@@ -1034,11 +1034,10 @@ class LinearProgramLoopBlock {
1034
1034
// / w: bounding offsets, independent of symbolic variables
1035
1035
// / u: bounding offsets, dependent on symbolic variables
1036
1036
auto instantiateOmniSimplex (const Graph &g, size_t d, bool satisfyDeps)
1037
- -> Optional<Simplex *> {
1038
- auto omniSimplex =
1039
- Simplex::create (allocator, numConstraints + numSlack,
1040
- numBounding + numActiveEdges + numPhiCoefs +
1041
- numOmegaCoefs + numSlack + numLambda);
1037
+ -> std::unique_ptr<Simplex> {
1038
+ auto omniSimplex = Simplex::create (
1039
+ numConstraints + numSlack, numBounding + numActiveEdges + numPhiCoefs +
1040
+ numOmegaCoefs + numSlack + numLambda);
1042
1041
auto C{omniSimplex->getConstraints ()};
1043
1042
C << 0 ;
1044
1043
// layout of omniSimplex:
@@ -1160,8 +1159,8 @@ class LinearProgramLoopBlock {
1160
1159
}
1161
1160
invariant (size_t (l), size_t (1 + numLambda));
1162
1161
invariant (size_t (c), size_t (numConstraints));
1163
- addIndependentSolutionConstraints (omniSimplex, g, d);
1164
- return omniSimplex-> initiateFeasible () ? nullptr : (Simplex *)omniSimplex ;
1162
+ addIndependentSolutionConstraints (omniSimplex. get () , g, d);
1163
+ return omniSimplex;
1165
1164
}
1166
1165
static void updateConstraints (MutPtrMatrix<int64_t > C,
1167
1166
const ScheduledNode &node,
@@ -1188,9 +1187,8 @@ class LinearProgramLoopBlock {
1188
1187
setSchedulesIndependent (g, depth);
1189
1188
return checkEmptySatEdges (g, depth);
1190
1189
}
1191
- auto p = allocator.scope ();
1192
1190
auto omniSimplex = instantiateOmniSimplex (g, depth, satisfyDeps);
1193
- if (! omniSimplex) return std::nullopt ;
1191
+ if (omniSimplex-> initiateFeasible () ) return std::nullopt ;
1194
1192
auto sol = omniSimplex->rLexMinStop (numLambda + numSlack);
1195
1193
assert (sol.size () ==
1196
1194
numBounding + numActiveEdges + numPhiCoefs + numOmegaCoefs);
@@ -1574,7 +1572,7 @@ class LinearProgramLoopBlock {
1574
1572
std::swap (g.nodeIds , nodeIds);
1575
1573
g.activeEdges = activeEdges; // undo such that g.getEdges(d) is correct
1576
1574
for (auto &&e : g.getEdges (d)) e.popSatLevel ();
1577
- g.activeEdges = oldEdges; // restore backup
1575
+ g.activeEdges = oldEdges; // restore backup
1578
1576
auto *oldNodeIter = oldSchedules.begin ();
1579
1577
for (auto &&n : g) n.getSchedule () = *(oldNodeIter++);
1580
1578
std::swap (carriedDeps, oldCarriedDeps);
0 commit comments