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

Method executeChanges

src/basis_factorization/CSRMatrix.cpp:602–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602void CSRMatrix::executeChanges()
603{
604 // Get the changes out of the way
605 for ( const auto &changedRow : _committedChanges )
606 {
607 unsigned row = changedRow.first;
608 for ( const auto &changedColumn : changedRow.second )
609 {
610 unsigned column = changedColumn._column;
611 unsigned index = findArrayIndexForEntry( row, column );
612
613 ASSERT( index < _nnz );
614
615 _A[index] = changedColumn._value;
616 }
617 }
618 _committedChanges.clear();
619
620 // Next, handle the deletions. Do a pass on the data structures, and shrink
621 // them as needed.
622 if ( !_committedDeletions.empty() )
623 {
624 List<unsigned> deletions;
625 for ( const auto &deletedEntry : _committedDeletions )
626 deletions.append( deletedEntry );
627 deleteElements( deletions );
628
629 _committedDeletions.clear();
630 }
631
632 // Finally, handle the insertions
633 if ( !_committedInsertions.empty() )
634 {
635 insertElements( _committedInsertions );
636 _committedInsertions.clear();
637 }
638}
639
640void CSRMatrix::countElements( unsigned *numRowElements, unsigned *numColumnElements )
641{

Callers 4

transposeIntoOtherMethod · 0.80
test_deletionsMethod · 0.80
test_changesMethod · 0.80

Calls 3

clearMethod · 0.45
emptyMethod · 0.45
appendMethod · 0.45

Tested by 3

test_deletionsMethod · 0.64
test_changesMethod · 0.64