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

Method AttachToGraph

Common/DataModel/vtkDistributedGraphHelper.cxx:147–168  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

145
146//------------------------------------------------------------------------------
147void vtkDistributedGraphHelper::AttachToGraph(vtkGraph* graph)
148{
149 this->Graph = graph;
150
151 // Some factors and masks to help speed up encoding/decoding {owner,index}
152 int numProcs = this->Graph->GetInformation()->Get(vtkDataObject::DATA_NUMBER_OF_PIECES());
153 int tmp = numProcs - 1;
154 // The following is integer arith equiv of ceil(log2(numProcs)):
155 int numProcBits = 0;
156 while (tmp != 0)
157 {
158 tmp >>= 1;
159 numProcBits++;
160 }
161 if (numProcs == 1)
162 numProcBits = 1;
163
164 this->signBitMask = VTK_ID_MIN;
165 this->highBitShiftMask = static_cast<vtkIdType>(1) << numProcBits;
166 this->procBits = numProcBits + 1;
167 this->indexBits = (sizeof(vtkIdType) * CHAR_BIT) - (numProcBits + 1);
168}
169
170//------------------------------------------------------------------------------
171void vtkDistributedGraphHelper::SetVertexPedigreeIdDistribution(

Callers 1

Calls 2

GetMethod · 0.45
GetInformationMethod · 0.45

Tested by

no test coverage detected