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

Function runtest

dlib/test/sammon.cpp:70–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70 void runtest()
71 {
72 sammon_projection s;
73 std::vector<matrix<double, 0, 1> > projs = s(make_test_data3(),2);
74 running_stats<double> rs1, rs2;
75
76 rs1.add(length(projs[0] - projs[1]));
77 rs1.add(length(projs[0] - projs[2]));
78 rs1.add(length(projs[0] - projs[3]));
79
80 rs2.add(length(projs[1] - projs[2]));
81 rs2.add(length(projs[2] - projs[3]));
82 rs2.add(length(projs[3] - projs[1]));
83
84 DLIB_TEST(rs1.stddev()/rs1.mean() < 1e-4);
85 DLIB_TEST(rs2.stddev()/rs2.mean() < 1e-4);
86
87
88
89 projs = s(make_test_data4(),2);
90 rs1.clear();
91 rs2.clear();
92
93 rs1.add(length(projs[0] - projs[1]));
94 rs1.add(length(projs[0] - projs[2]));
95 rs1.add(length(projs[0] - projs[3]));
96
97 rs2.add(length(projs[1] - projs[2]));
98 rs2.add(length(projs[2] - projs[3]));
99 rs2.add(length(projs[3] - projs[1]));
100
101 DLIB_TEST(rs1.stddev()/rs1.mean() < 1e-4);
102 DLIB_TEST(rs2.stddev()/rs2.mean() < 1e-4);
103
104 projs = s(make_test_data3d(),2);
105 rs1.clear();
106 rs2.clear();
107
108 rs1.add(length(projs[0] - projs[1]));
109 rs1.add(length(projs[0] - projs[2]));
110 rs1.add(length(projs[0] - projs[3]));
111
112 rs2.add(length(projs[1] - projs[2]));
113 rs2.add(length(projs[2] - projs[3]));
114 rs2.add(length(projs[3] - projs[1]));
115
116 DLIB_TEST(rs1.stddev()/rs1.mean() < 1e-4);
117 DLIB_TEST(rs2.stddev()/rs2.mean() < 1e-4);
118 }
119
120 void runtest2()
121 {

Callers 1

perform_testMethod · 0.85

Calls 8

make_test_data3Function · 0.85
make_test_data4Function · 0.85
make_test_data3dFunction · 0.85
lengthFunction · 0.50
addMethod · 0.45
stddevMethod · 0.45
meanMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected