Lines Matching refs:poly

59 static void checkSample(bool hasSample, const IntegerPolyhedron &poly,  in checkSample()  argument
65 maybeSample = poly.findIntegerSample(); in checkSample()
66 maybeLexMin = poly.findIntegerLexMin(); in checkSample()
82 EXPECT_TRUE(poly.containsPoint(*maybeSample)); in checkSample()
86 EXPECT_TRUE(Simplex(poly).isUnbounded()); in checkSample()
89 EXPECT_TRUE(poly.containsPoint(*maybeLexMin)); in checkSample()
94 EXPECT_EQ(!hasSample, poly.isIntegerEmpty()); in checkSample()
482 IntegerPolyhedron poly = in TEST() local
484 poly.removeRedundantConstraints(); in TEST()
487 EXPECT_EQ(poly.getNumInequalities(), 0u); in TEST()
488 EXPECT_EQ(poly.getNumEqualities(), 1u); in TEST()
577 IntegerPolyhedron poly(PresburgerSpace::getSetSpace(2)); in TEST() local
578 poly.addBound(IntegerPolyhedron::UB, 0, 1); in TEST()
579 EXPECT_EQ(poly.atIneq(0, 0), -1); in TEST()
580 EXPECT_EQ(poly.atIneq(0, 1), 0); in TEST()
581 EXPECT_EQ(poly.atIneq(0, 2), 1); in TEST()
583 poly.addBound(IntegerPolyhedron::UB, {1, 2, 3}, 1); in TEST()
584 EXPECT_EQ(poly.atIneq(1, 0), -1); in TEST()
585 EXPECT_EQ(poly.atIneq(1, 1), -2); in TEST()
586 EXPECT_EQ(poly.atIneq(1, 2), -2); in TEST()
590 IntegerPolyhedron poly(PresburgerSpace::getSetSpace(2)); in TEST() local
591 poly.addBound(IntegerPolyhedron::LB, 0, 1); in TEST()
592 EXPECT_EQ(poly.atIneq(0, 0), 1); in TEST()
593 EXPECT_EQ(poly.atIneq(0, 1), 0); in TEST()
594 EXPECT_EQ(poly.atIneq(0, 2), -1); in TEST()
596 poly.addBound(IntegerPolyhedron::LB, {1, 2, 3}, 1); in TEST()
597 EXPECT_EQ(poly.atIneq(1, 0), 1); in TEST()
598 EXPECT_EQ(poly.atIneq(1, 1), 2); in TEST()
599 EXPECT_EQ(poly.atIneq(1, 2), 2); in TEST()
609 IntegerPolyhedron &poly, in checkDivisionRepresentation() argument
612 DivisionRepr divs = poly.getLocalReprs(); in checkDivisionRepresentation()
630 IntegerPolyhedron poly(PresburgerSpace::getSetSpace(1)); in TEST() local
632 poly.addLocalFloorDiv({1, 4}, 10); in TEST()
633 poly.addLocalFloorDiv({1, 0, 100}, 10); in TEST()
641 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
645 IntegerPolyhedron poly(PresburgerSpace::getSetSpace(4)); in TEST() local
647 poly.addInequality({1, 0, 3, 1, 2}); in TEST()
648 poly.addInequality({1, 2, -8, 1, 10}); in TEST()
649 poly.addEquality({1, 2, -4, 1, 10}); in TEST()
651 poly.addLocalFloorDiv({0, 0, 0, 0, 100}, 30); in TEST()
652 poly.addLocalFloorDiv({0, 0, 0, 0, 0, 206}, 101); in TEST()
659 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
663 IntegerPolyhedron poly(PresburgerSpace::getSetSpace(4)); in TEST() local
664 poly.addInequality({1, 0, 3, 1, 2}); in TEST()
665 poly.addInequality({1, 2, -8, 1, 10}); in TEST()
666 poly.addEquality({1, 2, -4, 1, 10}); in TEST()
668 poly.addLocalFloorDiv({0, -2, 7, 2, 10}, 3); in TEST()
669 poly.addLocalFloorDiv({3, 0, 9, 2, 2, 10}, 5); in TEST()
670 poly.addLocalFloorDiv({0, 1, -123, 2, 0, -4, 10}, 3); in TEST()
672 poly.addInequality({1, 2, -2, 1, -5, 0, 6, 100}); in TEST()
673 poly.addInequality({1, 2, -8, 1, 3, 7, 0, -9}); in TEST()
683 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
688 IntegerPolyhedron poly = parsePoly("(i) : (i mod 3 - 1 >= 0)"); in TEST() local
698 poly.removeRedundantConstraints(); in TEST()
704 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
708 IntegerPolyhedron poly = in TEST() local
711 poly.convertToLocal(VarKind::SetDim, 2, 3); in TEST()
717 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
723 IntegerPolyhedron poly = parsePoly("(i, j, q) : (-4*q + i + j == 0)"); in TEST() local
725 poly.convertToLocal(VarKind::SetDim, 2, 3); in TEST()
730 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
733 IntegerPolyhedron poly = parsePoly("(i, j, q) : (4*q - i - j == 0)"); in TEST() local
735 poly.convertToLocal(VarKind::SetDim, 2, 3); in TEST()
740 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
743 IntegerPolyhedron poly = parsePoly("(i, j, q) : (3*q + i + j - 2 == 0)"); in TEST() local
745 poly.convertToLocal(VarKind::SetDim, 2, 3); in TEST()
750 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
756 IntegerPolyhedron poly = in TEST() local
760 poly.convertToLocal(VarKind::SetDim, 2, 4); in TEST()
766 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
771 IntegerPolyhedron poly = in TEST() local
774 poly.convertToLocal(VarKind::SetDim, 1, 2); in TEST()
780 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
784 IntegerPolyhedron poly = in TEST() local
787 poly.convertToLocal(VarKind::SetDim, 1, 2); in TEST()
794 checkDivisionRepresentation(poly, divisions, denoms); in TEST()
799 IntegerPolyhedron poly(PresburgerSpace::getSetSpace(1, 0, 1)); in TEST() local
800 poly.addEquality({2, 1, -1}); in TEST()
801 poly.addEquality({0, 1, -2}); in TEST()
803 EXPECT_TRUE(poly.isEmpty()); in TEST()
1065 void expectRationalLexMin(const IntegerPolyhedron &poly, in expectRationalLexMin() argument
1067 auto lexMin = poly.findRationalLexMin(); in expectRationalLexMin()
1072 void expectNoRationalLexMin(OptimumKind kind, const IntegerPolyhedron &poly) { in expectNoRationalLexMin() argument
1075 EXPECT_EQ(poly.findRationalLexMin().getKind(), kind); in expectNoRationalLexMin()
1138 void expectIntegerLexMin(const IntegerPolyhedron &poly, ArrayRef<int64_t> min) { in expectIntegerLexMin() argument
1139 auto lexMin = poly.findIntegerLexMin(); in expectIntegerLexMin()
1144 void expectNoIntegerLexMin(OptimumKind kind, const IntegerPolyhedron &poly) { in expectNoIntegerLexMin() argument
1147 EXPECT_EQ(poly.findRationalLexMin().getKind(), kind); in expectNoIntegerLexMin()
1165 IntegerPolyhedron poly = parsePoly(polyStr); in expectSymbolicIntegerLexMin() local
1167 ASSERT_NE(poly.getNumDimVars(), 0u); in expectSymbolicIntegerLexMin()
1168 ASSERT_NE(poly.getNumSymbolVars(), 0u); in expectSymbolicIntegerLexMin()
1171 parsePWMAF(/*numInputs=*/poly.getNumSymbolVars(), in expectSymbolicIntegerLexMin()
1172 /*numOutputs=*/poly.getNumDimVars(), expectedLexminRepr, in expectSymbolicIntegerLexMin()
1173 /*numSymbols=*/poly.getNumSymbolVars()); in expectSymbolicIntegerLexMin()
1176 /*numDims=*/0, expectedUnboundedDomainRepr, poly.getNumSymbolVars()); in expectSymbolicIntegerLexMin()
1178 SymbolicLexMin result = poly.findSymbolicIntegerLexMin(); in expectSymbolicIntegerLexMin()
1388 expectComputedVolumeIsValidOverapprox(const IntegerPolyhedron &poly, in expectComputedVolumeIsValidOverapprox() argument
1391 expectComputedVolumeIsValidOverapprox(poly.computeVolume(), trueVolume, in expectComputedVolumeIsValidOverapprox()