MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / initialize

Method initialize

src/basis_factorization/CSRMatrix.cpp:52–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void CSRMatrix::initialize( const double *M, unsigned m, unsigned n )
53{
54 initializeToEmpty( m, n );
55
56 // Now go over M, populate the arrays and find nnz
57 _nnz = 0;
58 _IA[0] = 0;
59 for ( unsigned i = 0; i < _m; ++i )
60 {
61 _IA[i + 1] = _IA[i];
62 for ( unsigned j = 0; j < _n; ++j )
63 {
64 // Ignore zero entries
65 if ( FloatUtils::isZero( M[i * _n + j] ) )
66 continue;
67
68 if ( _nnz >= _estimatedNnz )
69 increaseCapacity();
70
71 _A[_nnz] = M[i * _n + j];
72 ++_IA[i + 1];
73 _JA[_nnz] = j;
74
75 ++_nnz;
76 }
77 }
78}
79
80void CSRMatrix::initializeToEmpty( unsigned m, unsigned n )
81{

Callers 15

getColumnOfBasisMethod · 0.45
test_sanityMethod · 0.45
test_store_restoreMethod · 0.45
test_add_last_rowMethod · 0.45
test_add_last_columnMethod · 0.45
test_get_rowMethod · 0.45
test_to_denseMethod · 0.45
test_get_columnMethod · 0.45
test_deletionsMethod · 0.45
test_changesMethod · 0.45

Calls

no outgoing calls

Tested by 15

getColumnOfBasisMethod · 0.36
test_sanityMethod · 0.36
test_store_restoreMethod · 0.36
test_add_last_rowMethod · 0.36
test_add_last_columnMethod · 0.36
test_get_rowMethod · 0.36
test_to_denseMethod · 0.36
test_get_columnMethod · 0.36
test_deletionsMethod · 0.36
test_changesMethod · 0.36
test_count_elementsMethod · 0.36