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

Method GetVertexOwner

Common/DataModel/vtkDistributedGraphHelper.cxx:45–73  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

43
44//------------------------------------------------------------------------------
45vtkIdType vtkDistributedGraphHelper::GetVertexOwner(vtkIdType v) const
46{
47 vtkIdType owner = v;
48 int numProcs = this->Graph->GetInformation()->Get(vtkDataObject::DATA_NUMBER_OF_PIECES());
49
50 if (numProcs > 1)
51 {
52 // An alternative to this obfuscated code is to provide
53 // an 'unsigned' equivalent to vtkIdType. Could then safely
54 // do a logical right-shift of bits, e.g.:
55 // owner = (vtkIdTypeUnsigned) v >> this->indexBits;
56 if (v & this->signBitMask)
57 {
58 owner ^= this->signBitMask; // remove sign bit
59 vtkIdType tmp = owner >> this->indexBits; // so can right-shift
60 owner = tmp | this->highBitShiftMask; // and append sign bit back
61 }
62 else
63 {
64 owner = v >> this->indexBits;
65 }
66 }
67 else // numProcs = 1
68 {
69 owner = 0;
70 }
71
72 return owner;
73}
74
75//------------------------------------------------------------------------------
76vtkIdType vtkDistributedGraphHelper::GetVertexIndex(vtkIdType v) const

Callers 14

SetGraphMethod · 0.80
NextMethod · 0.80
GetPointMethod · 0.80
GetOutEdgesMethod · 0.80
GetOutEdgeMethod · 0.80
GetOutDegreeMethod · 0.80
GetDegreeMethod · 0.80
GetInEdgesMethod · 0.80
GetInEdgeMethod · 0.80
GetInDegreeMethod · 0.80
GetAdjacentVerticesMethod · 0.80
ReorderOutVerticesMethod · 0.80

Calls 2

GetMethod · 0.45
GetInformationMethod · 0.45

Tested by

no test coverage detected