MCPcopy Create free account
hub / github.com/Derious/cuMPC / test_array

Function test_array

dependence/eigen-3.4.0/test/half_float.cpp:302–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void test_array()
303{
304 typedef Array<half,1,Dynamic> ArrayXh;
305 Index size = internal::random<Index>(1,10);
306 Index i = internal::random<Index>(0,size-1);
307 ArrayXh a1 = ArrayXh::Random(size), a2 = ArrayXh::Random(size);
308 VERIFY_IS_APPROX( a1+a1, half(2)*a1 );
309 VERIFY( (a1.abs() >= half(0)).all() );
310 VERIFY_IS_APPROX( (a1*a1).sqrt(), a1.abs() );
311
312 VERIFY( ((a1.min)(a2) <= (a1.max)(a2)).all() );
313 a1(i) = half(-10.);
314 VERIFY_IS_EQUAL( a1.minCoeff(), half(-10.) );
315 a1(i) = half(10.);
316 VERIFY_IS_EQUAL( a1.maxCoeff(), half(10.) );
317
318 std::stringstream ss;
319 ss << a1;
320}
321
322void test_product()
323{

Callers 1

EIGEN_DECLARE_TESTFunction · 0.70

Calls 6

absMethod · 0.80
halfClass · 0.70
allMethod · 0.45
sqrtMethod · 0.45
minCoeffMethod · 0.45
maxCoeffMethod · 0.45

Tested by

no test coverage detected