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

Function computeDivisor

modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp:146–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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