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

Function rand_sp_banded

dlib/test/matrix.cpp:94–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93 template <typename type>
94 const matrix<type> rand_sp_banded(long n, long bw)
95 {
96 matrix<type> m = 10 * identity_matrix<type>(n);
97 for (long row = 0; row < m.nr(); ++row)
98 {
99 for (long col = row; col < min(m.nc(), row + bw); ++col)
100 {
101 type r = rnd.get_random_double();
102 m(row,col) += r;
103 m(col,row) += r;
104 }
105 }
106
107 return m;
108 }
109
110 void matrix_test (
111 )

Callers

nothing calls this directly

Calls 4

get_random_doubleMethod · 0.80
minFunction · 0.50
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected