MCPcopy Create free account
hub / github.com/PX4/eigen / fillMatrix

Function fillMatrix

bench/sparse_trisolver.cpp:40–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38typedef SparseMatrix<Scalar,RowMajorBit|UpperTriangular> EigenSparseTriMatrixRow;
39
40void fillMatrix(float density, int rows, int cols, EigenSparseTriMatrix& dst)
41{
42 dst.startFill(rows*cols*density);
43 for(int j = 0; j < cols; j++)
44 {
45 for(int i = 0; i < j; i++)
46 {
47 Scalar v = (internal::random<float>(0,1) < density) ? internal::random<Scalar>() : 0;
48 if (v!=0)
49 dst.fill(i,j) = v;
50 }
51 dst.fill(j,j) = internal::random<Scalar>();
52 }
53 dst.endFill();
54}
55
56int main(int argc, char *argv[])
57{

Callers 1

mainFunction · 0.70

Calls 1

fillMethod · 0.80

Tested by

no test coverage detected