34 bool parallel =
false;
35 for (
size_t p = 0; p < planes.size(); ++p) {
52 planes.push_back(plane);
100 const vector<Plane>& dtPlanes) {
101 CHECK(thinPlanes.size() == dtPlanes.size());
103 for (
size_t thin = 0; thin < thinPlanes.size(); ++thin) {
104 bool parallel =
false;
105 for (
size_t dt = 0; dt < dtPlanes.size(); ++dt) {
106 if (thinPlanes[thin].isParallel(dtPlanes[dt])) {
115 for (
size_t dt = 0; dt < dtPlanes.size(); ++dt) {
116 const Plane& plane = dtPlanes[dt];
132 CHECK(dtPlanes.size() == 6 || found);
146 const vector<mpz_class>& rhs,
148 size_t onFacet = numeric_limits<size_t>::max();
149 mpq_class leastEntry;
152 for (
size_t i = 0; i < lat.
getYDim(); ++i) {
153 if (i == facetPushOut)
159 if (onFacet == numeric_limits<size_t>::max() ||
160 leastEntry > lat.
getYMatrix()(n, facetPushOut)) {
161 leastEntry = lat.
getYMatrix()(n, facetPushOut);
171 size_t onFacet = numeric_limits<size_t>::max();
172 mpq_class leastEntry;
175 for (
size_t i = 1; i < lat.
getYDim(); ++i)
179 if (onFacet == numeric_limits<size_t>::max() ||
190 void computeRhs(vector<mpz_class>& rhs,
const vector<Neighbor> points) {
192 const GrobLat& lat = points[0].getGrobLat();
194 for (
size_t var = 0; var < lat.
getYDim(); ++var) {
195 rhs[var] = points[0].getY(var);
196 for (
size_t p = 1; p < points.size(); ++p)
197 if (rhs[var] < points[p].getY(var))
198 rhs[var] = points[p].getY(var);
207 const GrobLat& lat = points[0].getGrobLat();
213 for (
size_t i = 0; i < lat.
getYDim(); ++i)
224 for (
size_t var = 0; var < lat.
getHDim(); ++var)
232 for (
size_t var = 0; var < lat.
getHDim(); ++var)
245 SliceFacade facade(params, initialIdeal, recorder);
247 auto_ptr<BigIdeal> rhsesOwner = recorder.
releaseIdeal();
254 vector<Neighbor> points;
255 for (
size_t i = 0; i < mlfbs.size(); ++i) {
256 Mlfb& mlfb = mlfbs[i];
261 for (
size_t var = 0; var < initialIdeal.
getVarCount(); ++var)
262 if (initialIdeal[gen][var] > rhses[i][var])
264 points.push_back(
Neighbor(lat, gen));
268 mlfb.
reset(i, points);
274 transpose(nullSpaceBasis, nullSpaceBasis);
277 for (
size_t m = 0; m < mlfbs.size(); ++m) {
278 Mlfb& mlfb = mlfbs[m];
285 mpq_class minInitial = 0;
288 if (minInitial > initial) {
289 minInitial = initial;
298 for (
size_t r = 0; r < nullSpaceBasis.
getRowCount(); ++r)
299 for (
size_t c = 0; c < nullSpaceBasis.
getColCount(); ++c)
306 for (
size_t facetPushIn = 0; facetPushIn < lat.
getYDim(); ++facetPushIn) {
307 mpq_class secondLargest;
308 size_t facetPushOut = numeric_limits<size_t>::max();
310 for (
size_t neigh = 0; neigh < lat.
getYDim(); ++neigh) {
315 if (neigh == facetPushIn) {
316 if (entry != mlfb.
getRhs()[facetPushIn])
317 goto skipBecauseNotGeneric;
319 if (entry == secondLargest &&
320 facetPushOut != numeric_limits<size_t>::max())
321 goto skipBecauseNotGeneric;
323 if (entry > secondLargest ||
324 facetPushOut == numeric_limits<size_t>::max()) {
325 secondLargest = entry;
326 facetPushOut = neigh;
365 ASSERT(facetPushIn == 0 || secondLargest >= 0);
367 vector<mpz_class> rhs(mlfb.
getRhs());
369 rhs[facetPushIn] = secondLargest;
371 if (facetPushIn == 0) {
374 for (
size_t i = 0; i < lat.
getYDim(); ++i)
378 if (facetPushOut > 0) {
381 if (newNeighbor == numeric_limits<size_t>::max())
382 goto skipBecauseNotGeneric;
383 rhs[facetPushOut] = lat.
getYMatrix()(newNeighbor, facetPushOut);
386 if (facetPushOut == 0) {
389 if (newNeighbor == numeric_limits<size_t>::max())
390 goto skipBecauseNotGeneric;
391 for (
size_t i = 0; i < lat.
getYDim(); ++i)
398 for (
size_t mi = 0; mi < mlfbs.size(); ++mi) {
399 if (mlfbs[mi].getRhs() == rhs) {
400 mlfb.
edges[facetPushIn] = &(mlfbs[mi]);
405 goto skipBecauseNotGeneric;
409 skipBecauseNotGeneric:
417 for (pushIn = 0;; ++pushIn) {
449 const Mlfb& leftFlat = *(flatSeq.front().mlfb);
453 for (
size_t j = 0; j < 4; ++j) {
454 if (j != 0 && j != sumFacet) {
461 size_t subSeqCount = 1;
462 for (
size_t i = 1; i < flatSeq.size() - 1; ++i) {
463 const Mlfb& prev = *(flatSeq[i - 1].mlfb);
464 const Mlfb& flat = *(flatSeq[i].mlfb);
472 const vector<Mlfb>& mlfbs,
473 const Plane& plane) {
475 const Mlfb* leftFlat = 0;
476 for (
size_t m = 0; m < mlfbs.size(); ++m) {
477 if (!plane.
isFlat(mlfbs[m]))
480 if (!plane.
isFlat(*toLeft)) {
481 CHECK(leftFlat == 0 || leftFlat == toLeft);
482 leftFlat = &(mlfbs[m]);
496 ASSERT(seq.empty() || seq.back().mlfb != pos.
mlfb);
499 for (
size_t facet = 1; facet < 4; ++facet) {
513 vector<Mlfb>& mlfbs) {
515 for (
size_t gen1 = 0; gen1 < neighborCount; ++gen1) {
516 for (
size_t gen2 = gen1 + 1; gen2 < neighborCount; ++gen2) {
534 planes.push_back(
Plane(a, b, sum, mlfbs, lat));
535 Plane& plane = planes.back();
543 mpq_class& value = prod(gen, 0);
556 for (
size_t p = 0; p < planes.size(); ++p) {
557 Plane& plane = planes[p];
558 for (
size_t i = 0; i < mlfbs.size(); ++i)
568 const vector<Mlfb>& mlfbs,
const GrobLat& lat):
569 _a(a), _b(b), _sum(sum) {
572 for (
size_t m = 0; m < mlfbs.size(); ++m)
573 if (mlfbs[m].hasPoint(a) && mlfbs[m].hasPoint(sum))
577 for (
size_t m = 0; m < mlfbs.size(); ++m)
578 if (mlfbs[m].hasPoint(b) && mlfbs[m].hasPoint(sum))
582 vector<Neighbor> points;
586 points.push_back(sum);
587 vector<mpz_class> rhs;
592 bool boundary =
true;
593 bool interior =
true;
594 for (
size_t i = 0; i < rhs.size(); ++i) {
595 if (neighbor.
getY(i) == rhs[i])
597 else if (neighbor.
getY(i) > rhs[i]) {
612 vector<bool> ok(mlfbs.size());
613 bool sawFlat =
false;
614 for (
size_t i =0 ; i < mlfbs.size(); ++i) {
615 ok[i] = (mlfbs[i].index == 0);
624 for (
size_t i = 0; i < mlfbs.size(); ++i) {
626 size_t to = mlfbs[i].getEdge(0)->getOffset();
637 for (
size_t i = 0; i < mlfbs.size(); ++i) {
644 for (
size_t m = 0; m < mlfbs.size(); ++m) {
651 const vector<Mlfb>& mlfbs) {
654 for (
size_t p1 = 0; p1 < planes.size(); ++p1) {
655 for (
size_t p2 = 0; p2 < p1; ++p2) {
663 for (
size_t m = 0; m < mlfbs.size(); ++m) {
665 bool liesInSomePlane =
false;
666 for (
size_t p = 0; p < planes.size(); ++p) {
667 if (planes[p].isFlat(mlfbs[m])) {
668 liesInSomePlane =
true;
672 CHECK(liesInSomePlane);
679 bool multipleIntervals =
false;
680 bool anyFlat =
false;
681 bool flatWith4Pivots =
false;
682 for (
size_t p = 0; p < planes.size(); ++p) {
683 if (planes[p].flatIntervalCount > 1)
684 multipleIntervals =
true;
685 if (planes[p].hasFlat()) {
687 if (planes[p].pivots.size() == 4)
688 flatWith4Pivots =
true;
691 if (multipleIntervals) {
694 CHECK(planes.size() == 1);
697 if (planes.size() == 6) {
699 CHECK(planes.size() == 6);
700 for (
size_t p = 0; p < planes.size(); ++p) {
701 CHECK(planes[p].pivots.size() == 4);
704 CHECK(mlfbs.size() == 6);
710 CHECK(planes.size() < 6);
715 for (
size_t i = 0; i < mlfbs.size(); ++i) {
717 CHECK(mlfbs[i].index == -1 || mlfbs[i].index == 1);
718 }
else if (plane.
isFlat(mlfbs[i])) {
719 CHECK(mlfbs[i].index == 0);
728 for (
size_t push = 0; push < 4; ++push) {
739 for (
size_t i = 0; i < a.size(); ++i)
740 for (
size_t j = 0; j < b.size(); ++j)
741 if (a[i].mlfb == b[j].mlfb)
747 const vector<Mlfb>& mlfbs,
749 const vector<SeqPos>& flatSeq) {
751 for (
size_t m = 0; m < mlfbs.size(); ++m)
753 pivots.push_back(&(mlfbs[m]));
754 if (pivots.size() != 4 || flatSeq.empty())
759 size_t sumFacet = flatSeq.front().mlfb->getMinInitialFacet();
760 pivots.push_back(flatSeq.front().mlfb->getEdge(0));
761 pivots.push_back(flatSeq.front().mlfb->getEdge(sumFacet));
763 sumFacet = flatSeq.back().mlfb->getMinInitialFacet();
764 for (
size_t i = 0; i < 4; ++i)
765 if (i != 0 && i != sumFacet)
766 pivots.push_back(flatSeq.back().mlfb->getEdge(i));
770 vector<vector<SeqPos> >& right,
771 const vector<Mlfb>& mlfbs,
772 const Plane& plane) {
773 vector<vector<SeqPos> > seqs;
775 for (
size_t m = 0; m < mlfbs.size(); ++m) {
778 const Mlfb& p = mlfbs[m];
779 for (
size_t i = 0; i < 4; ++i) {
784 bool doneBefore =
false;
785 for (
size_t s = 0; s < seqs.size(); ++s) {
786 if (*(seqs[s][seqs[s].size() - 1].mlfb) == p &&
787 *(seqs[s][seqs[s].size() - 2].mlfb) == e) {
796 for (prevFacet = 0; prevFacet < 4; ++prevFacet)
797 if (*(e.
getEdge(prevFacet)) == p)
803 for (nextFacet = 0; nextFacet < 4; ++nextFacet) {
804 if (nextFacet != prevFacet &&
810 seqs.resize(seqs.size() + 1);
811 vector<SeqPos>& seq = seqs.back();
820 CHECK(!seqs.empty());
821 ASSERT(!seqs.front().empty());
824 stack<const Mlfb*> pending;
828 vector<bool> leftSeen(mlfbs.size());
829 pending.push(seqs.front().front().mlfb);
830 while (!pending.empty()) {
831 const Mlfb& m = *pending.top();
836 for (
size_t s = 0; s < seqs.size(); ++s) {
837 if (*(seqs[s].front().mlfb) == m)
838 pending.push(seqs[s].back().mlfb);
839 if (*(seqs[s].back().mlfb) == m)
840 pending.push(seqs[s].front().mlfb);
846 for (m = 0; m < mlfbs.size(); ++m)
849 CHECK(m < mlfbs.size());
853 vector<bool> rightSeen(mlfbs.size());
854 pending.push(&(mlfbs[m]));
855 while (!pending.empty()) {
856 const Mlfb& pm = *pending.top();
861 for (
size_t s = 0; s < seqs.size(); ++s) {
862 if (*(seqs[s].front().mlfb) == pm)
863 pending.push(seqs[s].back().mlfb);
864 if (*(seqs[s].back().mlfb) == pm)
865 pending.push(seqs[s].front().mlfb);
871 for (
size_t s = 0; s < seqs.size(); ++s) {
872 const size_t offset = seqs[s].front().mlfb->
getOffset();
873 if (leftSeen[offset]) {
874 CHECK(!rightSeen[offset]);
875 left.push_back(seqs[s]);
876 }
else if (rightSeen[offset])
877 right.push_back(seqs[s]);
883 const Plane& plane) {
889 for (
size_t facet = 0; facet < 4; ++facet) {
890 if (facet == flatFacet)
892 seqs.resize(seqs.size() + 1);
893 vector<SeqPos>& seq = seqs.back();
895 SeqPos pos(&pivot, facet, flatFacet);
905 const vector<SeqPos>& seq,
906 const Plane& plane) {
907 CHECK(seq.size() >= 3);
910 CHECK(seq.front().mlfb != seq.back().mlfb);
912 for (
size_t m = 1; m < seq.size() - 1 ; ++m) {
913 const Mlfb* prev = seq[m - 1].mlfb;
914 const Mlfb* current = seq[m].mlfb;
915 const Mlfb* next = seq[m + 1].mlfb;
916 const SeqPos& pos = seq[m];
938 const vector<vector<SeqPos> >& side,
940 const vector<Mlfb>& mlfbs) {
941 CHECK(side.size() == 2 || side.size() == 3);
943 vector<bool> seenOnSide(mlfbs.size());
944 for (
size_t s = 0; s < side.size(); ++s){
946 checkSeq(seenOnSide, side[s], plane);
949 pivotOnSide[side[s].front().mlfb->getOffset()] =
true;
950 pivotOnSide[side[s].back().mlfb->getOffset()] =
true;
959 size_t sidePivots = 0;
960 for (
size_t m = 0; m < mlfbs.size(); ++m)
963 CHECK(sidePivots == 2 || sidePivots == 3 || sidePivots == 4);
967 const vector<vector<SeqPos> >& right,
969 const vector<Mlfb>& mlfbs) {
970 vector<bool> isLeftPivot(mlfbs.size());
971 checkSide(isLeftPivot, left, plane, mlfbs);
973 vector<bool> isRightPivot(mlfbs.size());
974 checkSide(isRightPivot, right, plane, mlfbs);
977 for (
size_t m = 0; m < mlfbs.size(); ++m) {
979 CHECK((isLeftPivot[m] + isRightPivot[m]) == 1);
981 CHECK((isLeftPivot[m] + isRightPivot[m]) == 0);
986 const vector<Mlfb>& mlfbs) {
988 vector<bool> seen(mlfbs.size());
989 stack<const Mlfb*> pending;
993 for (m = 0; m < mlfbs.size(); ++m)
1000 pending.push(&(mlfbs[m]));
1001 while (!pending.empty()) {
1002 const Mlfb& mlfb = *(pending.top());
1007 for (
size_t i = 0; i < 4; ++i)
1008 pending.push(mlfb.
getEdge(i));
1012 for (m = 0; m < mlfbs.size(); ++m)
1018 const vector<Mlfb>& mlfbs) {
1020 for (
size_t m = 0; m < mlfbs.size(); ++m) {
1021 const Mlfb& mlfb = mlfbs[m];
1023 for (
size_t i = 0; i < 4; ++i)
1029 for (
size_t m = 0; m < mlfbs.size(); ++m) {
1030 const Mlfb& mlfb = mlfbs[m];
1033 if (!plane.
isFlat(mlfb)) {
1034 for (
size_t i = 0; i < 4; ++i) {
1044 const vector<Mlfb>& mlfbs) {
1047 CHECK(aSideCount == 1 || aSideCount == 2);
1048 CHECK(bSideCount == 1 || bSideCount == 2);
1050 for (
size_t m = 0; m < aSideCount; ++m) {
1054 for (
size_t m = 0; m < bSideCount; ++m) {
1064 for (
size_t m = 0; m < mlfbs.size(); ++m) {
1065 const Mlfb& mlfb = mlfbs[m];
1066 set<size_t> adjParas;
1067 set<size_t> adjNodes;
1068 for (
size_t i = 0; i < 4; ++i) {
1074 const size_t outDegree = adjNodes.size();
1076 CHECK(outDegree == 4);
1078 CHECK(outDegree == 4 - adjParas.size());
1082 for (
size_t m = 0; m < mlfbs.size(); ++m) {
1083 const Mlfb& mlfb = mlfbs[m];
1084 for (
size_t i = 0; i < 4; ++i) {
1094 const vector<Mlfb>& mlfbs,
1095 const vector<SeqPos>& flatSeq) {
1096 CHECK(pivotSeqs.size() == 3);
1097 CHECK(pivotSeqs[0].size() >= 2);
1098 const Mlfb* pivot1 = pivotSeqs[0].front().mlfb;
1099 const Mlfb* pivot2 = pivotSeqs[0].back().mlfb;
1105 bool foundPlace =
false;
1107 for (
size_t i = 0; i < 3; ++i) {
1108 CHECK(pivotSeqs[i].size() >= 2);
1110 CHECK((pivotSeqs[i].front().mlfb == pivot1 &&
1111 pivotSeqs[i].back().mlfb == pivot2) ||
1112 (pivotSeqs[i].front().mlfb == pivot2 &&
1113 pivotSeqs[i].back().mlfb == pivot1));
1115 for (
size_t j = 1; j < pivotSeqs[i].size() - 1; ++j) {
1116 const Mlfb* prev = pivotSeqs[i][j - 1].mlfb;
1117 const Mlfb* current = pivotSeqs[i][j].mlfb;
1118 const Mlfb* next = pivotSeqs[i][j + 1].mlfb;
1124 const SeqPos& pos = pivotSeqs[i][j];
1143 vector<bool> seen(mlfbs.size());
1144 for (
size_t i = 0; i < 3; ++i) {
1145 for (
size_t j = 1; j < pivotSeqs[i].size() - 1; ++j) {
1146 CHECK(!seen[pivotSeqs[i][j].mlfb->getOffset()]);
1147 seen[pivotSeqs[i][j].mlfb->getOffset()] =
true;
1158 const vector<Neighbor>& nonSums = lat.
getNonSums();
1159 CHECK(nonSums.size() == 3 || nonSums.size() == 4);
1160 if (nonSums.size() == 3) {
1162 for (
size_t ns = 0; ns < 3; ++ns)
1163 for (
size_t var = 0; var < 3; ++var)
1164 mat(ns, var) = nonSums[ns].getH(var);
1166 CHECK(det == 1 || det == -1);
1169 for (
size_t ns = 0; ns < 4; ++ns)
1170 for (
size_t var = 0; var < 3; ++var)
1171 mat(ns, var) = nonSums[ns].getY(var);
1182 const Plane& plane) {
1183 if (flatSeq.empty())
1185 size_t sumf = flatSeq.front().mlfb->getMinInitialFacet();
1189 for (
size_t j = 0; j < 4; ++j) {
1190 if (j != 0 && j != sumf) {
1197 for (
size_t j = 0; j < 4; ++j) {
1198 if (j != 0 && j != sumf && j != af) {
1204 for (
size_t i = 0; i < flatSeq.size(); ++i) {
1205 const Mlfb& flat = *(flatSeq[i].mlfb);
1214 if (i < flatSeq.size() - 1) {
1217 const Mlfb& next = *(flatSeq[i + 1].mlfb);
1242 const Mlfb& prev = *(flatSeq[i - 1].mlfb);
1260 const vector<Mlfb>& mlfbs,
1261 const vector<const Mlfb*>& pivots,
1262 const Plane& plane) {
1263 const Tri& tri = plane.
tri;
1269 for (
size_t i = 0; i < mlfbs.size(); ++i) {
1270 if (plane.
isFlat(mlfbs[i])) {
1271 CHECK(!mlfbs[i].hasPoint(a) ||
1272 !mlfbs[i].hasPoint(b) ||
1273 !mlfbs[i].hasPoint(sum));
1278 const Mlfb* mlfbA = 0;
1279 for (
size_t i = 0; i < mlfbs.size(); ++i) {
1280 if (!plane.
isFlat(mlfbs[i]) &&
1281 mlfbs[i].hasPoint(a) &&
1282 mlfbs[i].hasPoint(sum)) {
1284 mlfbA = &(mlfbs[i]);
1290 const Mlfb* mlfbB = 0;
1291 for (
size_t i = 0; i < mlfbs.size(); ++i) {
1292 if (!plane.
isFlat(mlfbs[i]) &&
1293 mlfbs[i].hasPoint(b) &&
1294 mlfbs[i].hasPoint(sum)) {
1296 mlfbB = &(mlfbs[i]);
1306 CHECK((mlfbA == pivots[0] && mlfbB == pivots[1]) ||
1307 (mlfbA == pivots[1] && mlfbB == pivots[0]));
1312 case 0:
return "sw";
1313 case 1:
return "se";
1314 case 2:
return "ne";
1315 case 3:
return "nw";
1323 for (
size_t m = 0; m < mlfbs.size(); ++m)
1324 sum += mlfbs[m].index;
1331 ASSERT(nextFacet != previousFacet);
1333 ASSERT(previousFacet < 4);
1337 for (
size_t f = 0; f < 4; ++f)
1338 if (f != previousFacet && f != nextFacet)
1340 for (
size_t f = 0; f < 4; ++f)
1341 if (f != previousFacet && f != nextFacet && f !=
fixFacet1)
1346 for (
size_t i = 0; ; ++i) {
1359 for (to = 0; to < 4; ++to) {
1403 _lat(&lat), _row(lat.getNeighborCount() + 1) {
1407 _lat(&lat), _row(row) {
1448 map<size_t, size_t>::const_iterator it =
typeCounts.find(type);
1474 const size_t type =
getType(mlfb);
1475 return type == 1 || type == 3;
1481 for (
size_t i = 0; i < 4; ++i)
1488 const size_t type =
getType(mlfb);
1525 name <<
'n' << (
getRow() + 1);
1550 for (
size_t j = 0; j < i; ++j) {
1558 for (
size_t i = 0; i <
_isSumRow.size(); ++i)
void checkFlatSeq(const vector< SeqPos > &flatSeq, const GrobLat &lat, const Plane &plane)
void checkGraphOnPlane(const Plane &plane, const vector< Mlfb > &mlfbs)
void checkPlanes(const vector< TriPlane > &thinPlanes, const vector< Plane > &dtPlanes)
void checkMlfbs(const vector< Mlfb > &mlfbs, const GrobLat &lat)
const char * getEdgePos(size_t index)
bool disjointSeqs(const vector< SeqPos > &a, const vector< SeqPos > &b)
void computePivotSeqs(vector< vector< SeqPos > > &seqs, const Mlfb &pivot, const Plane &plane)
Starting at pivot (which must be a pivot), follow the three non-flat sequences starting at pivot.
SeqPos prevInSeq(SeqPos pos)
void checkSeqs(const vector< vector< SeqPos > > &left, const vector< vector< SeqPos > > &right, const Plane &plane, const vector< Mlfb > &mlfbs)
void checkSeq(vector< bool > &seenOnSide, const vector< SeqPos > &seq, const Plane &plane)
void computeSeqs(vector< vector< SeqPos > > &left, vector< vector< SeqPos > > &right, const vector< Mlfb > &mlfbs, const Plane &plane)
size_t pivotToFlatFacet(const Mlfb &pivot, const Plane &plane)
Returns the facet to push in of pivot to get to a flat.
size_t pushOutFacetZero(const vector< mpz_class > &rhs, const GrobLat &lat)
char getPlaceCode(NeighborPlace place)
void computeMlfbs(vector< Mlfb > &mlfbs, const GrobLat &lat)
void computePivots(vector< const Mlfb * > &pivots, const vector< Mlfb > &mlfbs, const Plane &plane, const vector< SeqPos > &flatSeq)
Put all pivots into pivots.
void checkGraph(const vector< Mlfb > &mlfbs)
void checkMiddle(const Plane &plane, const vector< Mlfb > &mlfbs)
mpq_class getIndexSum(const vector< Mlfb > &mlfbs)
void checkDoubleTriangle(const Plane &plane, const vector< Mlfb > &mlfbs)
void computePlanes(vector< Plane > &planes, const GrobLat &lat, vector< Mlfb > &mlfbs)
void checkDoubleTrianglePlanes(const vector< Plane > &planes, const GrobLat &lat, const vector< Mlfb > &mlfbs)
void checkSide(vector< bool > &pivotOnSide, const vector< vector< SeqPos > > &side, const Plane &plane, const vector< Mlfb > &mlfbs)
void computeFlatSeq(vector< SeqPos > &seq, const vector< Mlfb > &mlfbs, const Plane &plane)
void check0Graph(const vector< Mlfb > &mlfbs)
SeqPos nextInSeq(SeqPos pos)
size_t pushOutFacetPositive(size_t facetPushOut, const vector< mpz_class > &rhs, const GrobLat &lat)
void getThinPlanes(vector< TriPlane > &planes, const GrobLat &lat)
void checkNonSums(const GrobLat &lat)
void computeRhs(vector< mpz_class > &rhs, const vector< Neighbor > points)
void checkPlane(const Plane &plane, const vector< Mlfb > &mlfbs)
void checkPlaneTri(const GrobLat &lat, const vector< Mlfb > &mlfbs, const vector< const Mlfb * > &pivots, const Plane &plane)
void checkPivotSeqs(vector< vector< SeqPos > > &pivotSeqs, const Plane &plane, const vector< Mlfb > &mlfbs, const vector< SeqPos > &flatSeq)
Perform checks where pivotSeqs are the 3 non-flat sequences on one side.
size_t computeFlatIntervalCount(const vector< SeqPos > &flatSeq)
bool solve(Matrix &sol, const Matrix &lhs, const Matrix &rhs)
Sets sol to some matrix such that lhs*sol=rhs and returns true if such a matrix exists.
mpq_class getParallelogramAreaSq(const Matrix &mat)
Returns the square of the area of the parallelogram whose vertices are the 4 rows of mat.
void product(Matrix &prod, const Matrix &a, const Matrix &b)
Sets prod to a * b.
bool isParallelogram(const Matrix &mat)
Returns true if the rows of mat are the (4) vertices of a parallelogram.
void nullSpace(Matrix &basis, const Matrix &matParam)
Sets the columns of basis to a basis of the null space of mat.
mpq_class determinant(const Matrix &mat)
Returns the determinant of mat.
void copyRow(Matrix &target, size_t targetRow, const Matrix &source, size_t sourceRow)
Copies row sourceRow from source to row targetRow of target.
bool hasSameRowSpace(const Matrix &a, const Matrix &b)
Returns true if a and b have the same row space.
void transpose(Matrix &trans, const Matrix &mat)
Sets trans to the transpose of mat.
size_t getVarCount() const
size_t getGeneratorCount() const
BigTermRecorder records all the terms it consumes into an ideal.
auto_ptr< BigIdeal > releaseIdeal()
A lattice with associated Grobner basis/neighbors.
Neighbor getNeighbor(size_t row) const
const mpq_class & getZero() const
const vector< Neighbor > & getNonSums() const
const Matrix & getYMatrix() const
GrobLat(const Matrix &matrix, const SatBinomIdeal &ideal)
Neighbor getSum(Neighbor a, Neighbor b) const
size_t getNeighborCount() const
const Matrix & getHMatrix() const
void getInitialIdeal(BigIdeal &ideal) const
bool isSum(Neighbor n) const
vector< Neighbor > _nonSums
bool isPointFreeBody(Neighbor a, Neighbor b) const
Returns true if the smallest body containing zero, a and b has no neighbor in its interior.
const Matrix & getMatrix() const
size_t getColCount() const
size_t getRowCount() const
const vector< mpz_class > & getRhs() const
Neighbor getPoint(size_t offset) const
vector< Neighbor > _points
vector< size_t > edgeHitsFacet
const Mlfb * getEdge(size_t indexParam) const
bool hasPoint(Neighbor n) const
void reset(size_t offset, const vector< Neighbor > &points)
size_t getPointCount() const
bool isParallelogram() const
size_t getMinInitialFacet() const
size_t getHitsFacet(size_t indexParam) const
const mpq_class & getH(size_t i) const
const mpq_class & getY(size_t i) const
bool isFlat(const Mlfb &mlfb) const
vector< NeighborPlace > neighborPlace
bool isPivot(const Mlfb &mlfb) const
bool is22(const Mlfb &mlfb) const
NeighborPlace getPlace(Neighbor neighbor) const
map< size_t, size_t > typeCounts
vector< const Mlfb * > pivots
size_t getTypeCount(size_t type) const
bool isSidePivot(const Mlfb &mlfb) const
size_t getMaxType() const
bool inPlane(Neighbor neighbor) const
size_t getType(const Mlfb &mlfb) const
Represents a saturated binomial ideal.
void getMatrix(Matrix &matrix) const
A facade for operations on monomial ideals using the Slice Algorithm.
void computeIrreducibleDecomposition(bool encode)
Compute the unique irredundant set of irreducible ideals whose intersection equals ideal.
bool closeToPlane(Neighbor a)
bool isParallel(const TriPlane &plane) const
vector< const Mlfb * > _bSideMlfbs
const vector< const Mlfb * > & getBSideMlfbs() const
Tri(Neighbor a, Neighbor b, Neighbor sum, const vector< Mlfb > &mlfbs, const GrobLat &lat)
vector< Neighbor > _interior
const vector< const Mlfb * > & getASideMlfbs() const
vector< Neighbor > _boundary
vector< const Mlfb * > _aSideMlfbs
void swap(hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht1, hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht2)
SeqPos getReverse() const
bool operator<(const SeqPos &pos) const
size_t getForwardFacet() const
size_t getBackFacet() const