MCPcopy Create free account
hub / github.com/RenderKit/ospray / computeDivisor

Function computeDivisor

modules/mpi/tutorials/ospMPIDistribTutorialVolume.cpp:143–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool computeDivisor(int x, int &divisor)
144{
145 int upperBound = std::sqrt(x);
146 for (int i = 2; i <= upperBound; ++i) {
147 if (x % i == 0) {
148 divisor = i;
149 return true;
150 }
151 }
152 return false;
153}
154
155// Compute an X x Y x Z grid to have 'num' grid cells,
156// only gives a nice grid for numbers with even factors since

Callers 1

computeGridFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected