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

Function runtest3

dlib/test/sammon.cpp:141–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139 }
140
141 void runtest3(int num_dims)
142 {
143 sammon_projection s;
144 std::vector<matrix<double, 0, 1> > projs;
145 matrix<double,3,1> m;
146 m = 1, 1, 1;
147 projs.push_back(m);
148
149 m = 1, 2, 1;
150 projs.push_back(m);
151
152 m = 1, 3, 1;
153 projs.push_back(m);
154
155 projs = s(projs,num_dims);
156
157 const double d1a = length(projs[0] - projs[1]);
158 const double d1b = length(projs[1] - projs[2]);
159 const double d2 = length(projs[0] - projs[2]);
160
161 DLIB_TEST(std::abs(d1a-d1b)/d1a < 1e-8);
162 DLIB_TEST(std::abs(d2/d1a-2) < 1e-8);
163 }
164
165 void runtest4(int num_dims)
166 {

Callers 1

perform_testMethod · 0.85

Calls 3

absFunction · 0.85
lengthFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected