XC Open source finite element analysis program
Public Member Functions | Protected Member Functions | Friends | List of all members

Array de grafos. More...

#include <ArrayGraph.h>

Inheritance diagram for XC::ArrayGraph:
XC::Graph XC::MovableObject XC::DistributedBase

Public Member Functions

 ArrayGraph (int arraySize)
 
virtual bool addVertex (const Vertex &vertexPtr)
 Method to add a vertex to the graph. If the adjacency list of the vertex is not empty the graph will first check to see all vertices in the the the vertices adjacency list exist in the graph before the vertex is added. It then checks if it neeeds a new_ array and if so creates one, i.e. if the {arraySize} $=$ {numVertex} it creates a new_ array, whose size is double the original and copies the pointers to the vertices, before invoking {delete()} on the old array. It now tries to add the vertex in the array at location {vertexTag}. If this fails it adds at the first empty location it comes to. Returns a 0 if successfull addition, a $-1$ otherwise and a message to std::cerr explaining the problem.
 
virtual int addEdge (int vertexTag, int otherVertexTag)
 Adds an edge to the graph. Previously we check that its vertices are already defined in the graph, otherwise it returns -1 (error condition) More...
 
virtual VertexgetVertexPtr (int vertexTag)
 A method which returns a pointer to the vertex whose tag is given by vertexTag. The method first looks at location {vertexTag} for the vertex, otherwise it must search through the array until it finds the vertex it is looking for. If no such vertex exists in the graph $0$ is returned.
 
virtual const VertexgetVertexPtr (int vertexTag) const
 A method which returns a pointer to the vertex whose tag is given by vertexTag. The method first looks at location {vertexTag} for the vertex, otherwise it must search through the array until it finds the vertex it is looking for. If no such vertex exists in the graph $0$ is returned.
 
virtual VertexItergetVertices (void)
 Returns an iterator to the vertices of the graph.
 
int getNumVertex (void) const
 Returns the number of vertices del grafo.
 
int getNumEdge (void) const
 Returns the número de aristas del grafo.
 
virtual void Print (std::ostream &s) const
 
- Public Member Functions inherited from XC::Graph
 Graph (void)
 Constructor.
 
 Graph (int numVertices)
 Constructor.
 
 Graph (const Graph &other)
 Copy constructor.
 
Graphoperator= (const Graph &other)
 Assignment operator.
 
virtual bool addVertex (const Vertex &vertexPtr, bool checkAdjacency=true)
 Appends a vertex to the graph. If the adjacency list of the vertex is not empty, we check before that all the vertices of the list are already on the graph.
 
virtual int getFreeTag (void)
 Returns the siguiente identificador (tag) libre.
 
virtual bool removeVertex (int tag, bool removeEdgeFlag=true)
 Removes from the graph the vertex identified by the tag being passed as parameter.
 
const VertexBuscaRef (int ref) const
 
void getBand (int &, int &) const
 Returns the extremos del ancho de banda.
 
int getVertexDiffMaxima (void) const
 Returns the maximum (positive) of the difference between vertices indexes.
 
int getVertexDiffExtrema (void) const
 Returns the extreme (positive or negative) of the difference between vertices indexes.
 
virtual int merge (Graph &other)
 Mezcla los dos grafos.
 
virtual void Print (std::ostream &os, int flag=0)
 Imprime.
 
int sendSelf (CommParameters &)
 Sends object through the channel being passed as parameter.
 
int recvSelf (const CommParameters &)
 Receives object through the channel being passed as parameter.
 
- Public Member Functions inherited from XC::MovableObject
 MovableObject (int classTag, int dbTag)
 Constructor.
 
 MovableObject (int classTag)
 Constructor.
 
 MovableObject (const MovableObject &otro)
 Copy constructor.
 
MovableObjectoperator= (const MovableObject &otro)
 Operacdor asignación.
 
int getClassTag (void) const
 Returns the tag de la clase.
 
int getDbTag (void) const
 Returns the tag para la database.
 
int getDbTag (CommParameters &)
 Returns the tag para la database.
 
void setDbTag (int dbTag)
 Asigna el tag para la database.
 
void setDbTag (CommParameters &)
 Asigna, sólo si es preciso, el tag para la database.
 
virtual int setParameter (const std::vector< std::string > &argv, Parameter &param)
 
virtual int updateParameter (int parameterID, Information &info)
 
virtual int activateParameter (int parameterID)
 
virtual int setVariable (const std::string &variable, Information &)
 Returns the identificador de la variable cuyo nombre being passed as parameter.
 
virtual int getVariable (const std::string &variable, Information &)
 
- Public Member Functions inherited from XC::DistributedBase
 DistributedBase (void)
 Constructor.
 
virtual DbTagDatagetDbTagData (void) const
 Returns a vector to store class dbTags.
 
const int & getDbTagDataPos (const int &i) const
 Returns the data at the i-th position.
 
void setDbTagDataPos (const int &i, const int &v)
 Sets the data at the i-th position.
 
void inicComm (const int &dataSize) const
 Initializes communication.
 

Protected Member Functions

int getArraySize (void) const
 
 ArrayGraph (const ArrayGraph &)
 
ArrayGraphoperator= (const ArrayGraph &)
 
- Protected Member Functions inherited from XC::Graph
void inic (const size_t &)
 
void copia (const Graph &other)
 
int sendData (CommParameters &)
 Send object members through the channel being passed as parameter.
 
int recvData (const CommParameters &)
 Receives object members through the channel being passed as parameter.
 

Friends

class ArrayVertexIter
 
std::ostream & operator<< (std::ostream &s, const ArrayGraph &M)
 

Additional Inherited Members

- Protected Attributes inherited from XC::Graph
ArrayOfTaggedObjects myVertices
 
VertexIter theVertexIter
 
int numEdge
 
int nextFreeTag
 

Detailed Description

Array de grafos.

Member Function Documentation

int XC::ArrayGraph::addEdge ( int  vertexTag,
int  otherVertexTag 
)
virtual

Adds an edge to the graph. Previously we check that its vertices are already defined in the graph, otherwise it returns -1 (error condition)

Parameters
vertexTagend of the edge.
otherVertexTagthe other end of the edge.

Reimplemented from XC::Graph.


The documentation for this class was generated from the following files: