|
13 | 13 | #include "Math/NormalForm.hpp"
|
14 | 14 | #include "Math/Simplex.hpp"
|
15 | 15 | #include "Utilities/Allocators.hpp"
|
| 16 | +#include "Utilities/Invariant.hpp" |
16 | 17 | #include "Utilities/Optional.hpp"
|
17 | 18 | #include "Utilities/Valid.hpp"
|
18 | 19 | #include <algorithm>
|
@@ -848,7 +849,7 @@ class LinearProgramLoopBlock {
|
848 | 849 | -> Optional<Simplex *> {
|
849 | 850 | auto omniSimplex =
|
850 | 851 | Simplex::create(allocator, numConstraints + numSlack,
|
851 |
| - 1 + numBounding + numActiveEdges + numPhiCoefs + |
| 852 | + numBounding + numActiveEdges + numPhiCoefs + |
852 | 853 | numOmegaCoefs + numSlack + numLambda);
|
853 | 854 | auto C{omniSimplex->getConstraints()};
|
854 | 855 | C << 0;
|
@@ -976,6 +977,7 @@ class LinearProgramLoopBlock {
|
976 | 977 | }
|
977 | 978 | }
|
978 | 979 | }
|
| 980 | + invariant(size_t(c), size_t(numConstraints)); |
979 | 981 | addIndependentSolutionConstraints(omniSimplex, g, d);
|
980 | 982 | return omniSimplex->initiateFeasible() ? nullptr : (Simplex *)omniSimplex;
|
981 | 983 | }
|
@@ -1126,7 +1128,7 @@ class LinearProgramLoopBlock {
|
1126 | 1128 | C(i++, ++s) = -1; // for >=
|
1127 | 1129 | }
|
1128 | 1130 | }
|
1129 |
| - assert(omniSimplex->getNumCons() == i); |
| 1131 | + invariant(size_t(omniSimplex->getNumCons()), i); |
1130 | 1132 | assert(!allZero(omniSimplex->getConstraints()(last, _)));
|
1131 | 1133 | }
|
1132 | 1134 | [[nodiscard]] static auto nonZeroMask(const AbstractVector auto &x)
|
|
0 commit comments