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

Method initializeToEmpty

src/basis_factorization/CSRMatrix.cpp:80–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void CSRMatrix::initializeToEmpty( unsigned m, unsigned n )
81{
82 _m = m;
83 _n = n;
84
85 unsigned estimatedNumRowEntries = std::max( 2U, _n / ROW_DENSITY_ESTIMATE );
86 _estimatedNnz = estimatedNumRowEntries * _m;
87
88 freeMemoryIfNeeded();
89
90 _A = new double[_estimatedNnz];
91 if ( !_A )
92 throw BasisFactorizationError( BasisFactorizationError::ALLOCATION_FAILED, "CSRMatrix::A" );
93
94 _IA = new unsigned[_m + 1];
95 if ( !_IA )
96 throw BasisFactorizationError( BasisFactorizationError::ALLOCATION_FAILED,
97 "CSRMatrix::IA" );
98
99 _JA = new unsigned[_estimatedNnz];
100 if ( !_JA )
101 throw BasisFactorizationError( BasisFactorizationError::ALLOCATION_FAILED,
102 "CSRMatrix::JA" );
103
104 std::fill_n( _IA, _m + 1, 0.0 );
105 _nnz = 0;
106}
107
108void CSRMatrix::increaseCapacity()
109{

Callers 4

transposeIntoOtherMethod · 0.45
certifyInfeasibilityMethod · 0.45
ContradictionMethod · 0.45

Calls 1

Tested by

no test coverage detected