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

Function test_stuff

dlib/test/matrix4.cpp:165–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 }
164
165 void test_stuff()
166 {
167 print_spinner();
168
169 {
170 matrix<double> m(3,3), lr(3,3), ud(3,3);
171
172 m = 1,2,3,
173 4,5,6,
174 7,8,9;
175
176
177 lr = 3,2,1,
178 6,5,4,
179 9,8,7;
180
181 ud = 7,8,9,
182 4,5,6,
183 1,2,3;
184
185 DLIB_TEST(lr == fliplr(m));
186 DLIB_TEST(ud == flipud(m));
187 }
188 {
189 matrix<double> m(3,2), lr(3,2), ud(3,2);
190
191 m = 1,2,
192 3,4,
193 5,6;
194
195 lr = 2,1,
196 4,3,
197 6,5;
198
199 ud = 5,6,
200 3,4,
201 1,2;
202
203 DLIB_TEST(lr == fliplr(m));
204 DLIB_TEST(ud == flipud(m));
205 }
206
207 {
208 matrix<int> a, b;
209
210 a = matrix_cast<int>(round(10*randm(3,3)));
211 b = a;
212
213 b *= b;
214 DLIB_TEST(b == a*a);
215 }
216
217 {
218 matrix<double> m(2,3), m2(2,3);
219
220 m = 1,2,3,
221 4,5,6;
222

Callers 2

perform_testMethod · 0.85
perform_testMethod · 0.85

Calls 15

print_spinnerFunction · 0.85
fliplrFunction · 0.85
flipudFunction · 0.85
roundFunction · 0.85
diagmFunction · 0.85
pinvFunction · 0.85
tmpFunction · 0.85
pointwise_multiplyFunction · 0.85
upperboundFunction · 0.85
lowerboundFunction · 0.85
orthogonalizeFunction · 0.85
pointwise_powFunction · 0.85

Tested by

no test coverage detected