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

Method select

src/engine/BlandsRule.cpp:21–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include "MarabouError.h"
20
21bool BlandsRule::select( ITableau &tableau,
22 const List<unsigned> &candidates,
23 const Set<unsigned> &excluded )
24{
25 List<unsigned> remainingCandidates = candidates;
26
27 List<unsigned>::iterator it = remainingCandidates.begin();
28 while ( it != remainingCandidates.end() )
29 {
30 if ( excluded.exists( *it ) )
31 it = remainingCandidates.erase( it );
32 else
33 ++it;
34 }
35
36 if ( remainingCandidates.empty() )
37 return false;
38
39 it = remainingCandidates.begin();
40 unsigned minIndex = *it;
41 unsigned minVariable = tableau.nonBasicIndexToVariable( minIndex );
42
43 ++it;
44 unsigned variable;
45 while ( it != remainingCandidates.end() )
46 {
47 variable = tableau.nonBasicIndexToVariable( *it );
48 if ( variable < minVariable )
49 {
50 minIndex = *it;
51 minVariable = variable;
52 }
53
54 ++it;
55 }
56
57 tableau.setEnteringVariableIndex( minIndex );
58 return true;
59}
60
61//
62// Local Variables:

Callers 1

performSimplexStepMethod · 0.45

Calls 7

beginMethod · 0.45
endMethod · 0.45
existsMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected