MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / testRandomEngineNormal

Function testRandomEngineNormal

test/random.cpp:332–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330
331template<typename T>
332void testRandomEngineNormal(randomEngineType type) {
333 SUPPORTED_TYPE_CHECK(T);
334 dtype ty = (dtype)dtype_traits<T>::af_type;
335
336 int elem = 16 * 1024 * 1024;
337 randomEngine r(type, 0);
338 array A = randn(elem, ty, r);
339 T m = mean<T>(A);
340 T s = stdev<T>(A, AF_VARIANCE_POPULATION);
341 ASSERT_NEAR(m, 0, 1e-1);
342 ASSERT_NEAR(s, 1, 1e-1);
343}
344
345TYPED_TEST(RandomEngine, philoxRandomEngineUniform) {
346 testRandomEngineUniform<TypeParam>(AF_RANDOM_ENGINE_PHILOX_4X32_10);

Callers

nothing calls this directly

Calls 1

randnFunction · 0.85

Tested by

no test coverage detected