MCPcopy Create free account
hub / github.com/davisking/dlib / test_vector

Method test_vector

dlib/test/blas_bindings/vector.cpp:49–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48 template <typename type>
49 void test_vector(
50 ) const
51 {
52 using namespace dlib;
53 using namespace dlib::blas_bindings;
54
55 dlib::vector<type,2> a2, b2, c2;
56 dlib::vector<type,3> a3, b3, c3;
57
58 matrix<type> mat2(2,2), mat3(3,3);
59 mat2 = 0;
60 mat3 = 0;
61
62 type var = 0;
63
64 // We want to make sure that the BLAS bindings are being called for the 2D and 3D vectors. That would
65 // be very slow.
66 counter_gemm() = 0;
67 counter_gemv() = 0;
68 counter_ger() = 0;
69 counter_dot() = 0;
70
71 var = trans(a2)*(a2);
72 var = dot(a2,a2);
73
74 a2 = mat2*b2;
75 var = trans(b2)*mat2*b2;
76
77 var = trans(a3)*(a3);
78 var = dot(a3,a3);
79
80 a3 = mat3*b3;
81 var = trans(b3)*mat3*b3;
82
83 mat3 = c3*trans(a3);
84 mat2 = c2*trans(a2);
85
86 DLIB_TEST(counter_gemm() == 0 && counter_gemv() == 0 && counter_ger() == 0 && counter_dot() == 0);
87
88 }
89
90 void perform_test (
91 )

Callers

nothing calls this directly

Calls 2

transFunction · 0.50
dotFunction · 0.50

Tested by

no test coverage detected