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

Function mat_to_sparse

dlib/test/cca.cpp:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36 template <typename T>
37 std::vector<std::map<unsigned long, T> > mat_to_sparse (
38 const matrix<T>& A
39 )
40 {
41 std::vector<std::map<unsigned long,T> > temp(A.nr());
42 for (long r = 0; r < A.nr(); ++r)
43 {
44 for (long c = 0; c < A.nc(); ++c)
45 {
46 temp[r][c] = A(r,c);
47 }
48 }
49 return temp;
50 }
51
52// ----------------------------------------------------------------------------------------
53

Callers 4

test_cca3Function · 0.85
test_cca2Function · 0.85
test_cca1Function · 0.85
test_svd_fastFunction · 0.85

Calls 3

AClass · 0.70
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected