MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / testSolidSphere

Function testSolidSphere

src/ImathTest/testRandom.cpp:198–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196
197template <class Rand>
198void
199testSolidSphere ()
200{
201 const int N = 10;
202 const int M = 10000;
203 int v[N + 1];
204
205 for (int i = 0; i <= N; ++i)
206 v[i] = 0;
207
208 Rand rand (0);
209
210 for (int i = 0; i < M * N; ++i)
211 {
212 IMATH_INTERNAL_NAMESPACE::V3f p =
213 IMATH_INTERNAL_NAMESPACE::solidSphereRand<
214 IMATH_INTERNAL_NAMESPACE::V3f> (rand);
215 float l = p.length ();
216 v[IMATH_INTERNAL_NAMESPACE::floor (l * N)] += 1;
217
218 assert (l < 1.00001);
219 }
220
221 for (int i = 0; i < N; ++i)
222 assert (v[i] > 0);
223}
224
225template <class Rand>
226void

Callers

nothing calls this directly

Calls 1

floorFunction · 0.85

Tested by

no test coverage detected