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

Function computeDivisor

modules/mpi/tutorials/ospMPIDistributedExamples.cpp:152–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152bool computeDivisor(int x, int &divisor)
153{
154 int upperBound = std::sqrt(x);
155 for (int i = 2; i <= upperBound; ++i) {
156 if (x % i == 0) {
157 divisor = i;
158 return true;
159 }
160 }
161 return false;
162}
163
164// Compute an X x Y x Z grid to have 'num' grid cells,
165// 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