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

Function test_eigenvalue2

dlib/test/matrix_eig.cpp:197–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195
196 template <int dims>
197 void test_eigenvalue2()
198 {
199 for (int seed = 0; seed < 10; ++seed)
200 {
201 print_spinner();
202 matrix<double> H = gaussian_randm(dims,dims,seed);
203 H = H*trans(H);
204
205 eigenvalue_decomposition<matrix<double> > eig(H);
206 matrix<double> HH = eig.get_pseudo_v()*diagm(eig.get_real_eigenvalues())*trans(eig.get_pseudo_v());
207 DLIB_TEST_MSG(max(abs(H - HH))<1e-12, "dims: " << dims << " error: " << max(abs(H - HH)));
208 }
209 }
210
211// ----------------------------------------------------------------------------------------
212

Callers

nothing calls this directly

Calls 6

print_spinnerFunction · 0.85
gaussian_randmFunction · 0.85
diagmFunction · 0.85
absFunction · 0.85
transFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected