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

Function TEST

test/diagonal.cpp:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145TEST(Diagonal, ExtractGFOR) {
146 dim4 dims = dim4(100, 100, 3);
147 array A = round(100 * randu(dims));
148 array B = constant(0, 100, 1, 3);
149
150 gfor(seq ii, 3) { B(span, span, ii) = diag(A(span, span, ii)); }
151
152 for (int ii = 0; ii < 3; ii++) {
153 array c_ii = diag(A(span, span, ii));
154 array b_ii = B(span, span, ii);
155 ASSERT_EQ(max<double>(abs(c_ii - b_ii)) < 1E-5, true);
156 }
157}

Callers

nothing calls this directly

Calls 6

roundFunction · 0.85
randuFunction · 0.85
constantFunction · 0.85
diagFunction · 0.85
absFunction · 0.70
dim4Class · 0.50

Tested by

no test coverage detected