MCPcopy Create free account
hub / github.com/Kitware/VTK / GetDegree

Method GetDegree

Common/DataModel/vtkGraph.cxx:327–345  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

325
326//------------------------------------------------------------------------------
327vtkIdType vtkGraph::GetDegree(vtkIdType v)
328{
329 vtkIdType index = v;
330
331 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
332 {
333 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
334 if (myRank != helper->GetVertexOwner(v))
335 {
336 vtkErrorMacro("vtkGraph cannot determine the degree for a non-local vertex");
337 return 0;
338 }
339
340 index = helper->GetVertexIndex(v);
341 }
342
343 return static_cast<vtkIdType>(this->Internals->Adjacency[index].InEdges.size() +
344 this->Internals->Adjacency[index].OutEdges.size());
345}
346
347//------------------------------------------------------------------------------
348void vtkGraph::GetInEdges(vtkIdType v, vtkInEdgeIterator* it)

Callers 3

degreeFunction · 0.80
InitializeMethod · 0.80
RequestDataMethod · 0.80

Calls 5

GetVertexOwnerMethod · 0.80
GetMethod · 0.45
GetVertexIndexMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected