MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / addEdge

Method addEdge

SRC/graph/graph/ArrayGraph.cpp:208–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206// graph. Returns $0$ if successful, a negative number if not.
207
208int
209ArrayGraph::addEdge(int vertexTag, int otherVertexTag)
210{
211 // get pointers to the vertices, if one does not exist return
212
213 Vertex *vertex1 = this->getVertexPtr(vertexTag);
214 Vertex *vertex2 = this->getVertexPtr(otherVertexTag);
215 if ((vertex1 == 0) || (vertex2 == 0))
216 return -1;
217
218 // add an edge to each vertex
219 int result;
220 if ((result = vertex1->addEdge(otherVertexTag)) == 0)
221 if ((result = vertex2->addEdge(vertexTag)) == 0)
222 numEdge++;
223
224 return result;
225}
226
227// VertexIter \&getVertices(void);}
228// A method which first invokes {\em reset()} on the graphs ArrayVertexIter

Callers

nothing calls this directly

Calls 1

getVertexPtrMethod · 0.95

Tested by

no test coverage detected