Lines Matching refs:Simplex
1 //===- Simplex.cpp - MLIR Simplex Class -----------------------------------===//
9 #include "mlir/Analysis/Presburger/Simplex.h"
33 using Direction = Simplex::Direction;
77 const Simplex::Unknown &SimplexBase::unknownFromIndex(int index) const {
82 const Simplex::Unknown &SimplexBase::unknownFromColumn(unsigned col) const {
87 const Simplex::Unknown &SimplexBase::unknownFromRow(unsigned row) const {
92 Simplex::Unknown &SimplexBase::unknownFromIndex(int index) {
97 Simplex::Unknown &SimplexBase::unknownFromColumn(unsigned col) {
102 Simplex::Unknown &SimplexBase::unknownFromRow(unsigned row) {
192 return direction == Direction::Up ? Direction::Down : Simplex::Direction::Up;
887 Simplex::findPivot(int row, Direction direction) const {
993 LogicalResult Simplex::restoreRow(Unknown &u) {
1031 std::optional<unsigned> Simplex::findPivotRow(std::optional<unsigned> skipRow,
1095 // entry, since in that case the Simplex will be erroneously marked as
1110 void Simplex::addInequality(ArrayRef<DynamicAPInt> coeffs) {
1184 void Simplex::undoLastConstraint() {
1231 // Simplex and LexSimplex handle this differently, so we call out to a
1345 MaybeOptimum<Fraction> Simplex::computeRowOptimum(Direction direction,
1364 MaybeOptimum<Fraction> Simplex::computeOptimum(Direction direction,
1375 MaybeOptimum<Fraction> Simplex::computeOptimum(Direction direction,
1399 bool Simplex::isBoundedAlongConstraint(unsigned constraintIndex) {
1409 bool Simplex::isMarkedRedundant(unsigned constraintIndex) const {
1419 void Simplex::markRowRedundant(Unknown &u) {
1429 void Simplex::detectRedundant(unsigned offset, unsigned count) {
1471 bool Simplex::isUnbounded() {
1499 Simplex Simplex::makeProduct(const Simplex &a, const Simplex &b) {
1502 Simplex result(numVar);
1571 std::optional<SmallVector<Fraction, 8>> Simplex::getRationalSample() const {
1627 Simplex::getSamplePointIfIntegral() const {
1632 // The value will always exist since the Simplex is non-empty.
1653 /// that contains a snapshot of the Simplex's state for each equality, just
1656 using Orientation = Simplex::Orientation;
1659 GBRSimplex(const Simplex &originalSimplex)
1660 : simplex(Simplex::makeProduct(originalSimplex, originalSimplex)),
1695 simplex.computeRowOptimum(Simplex::Direction::Up, row);
1765 Simplex simplex;
1828 void Simplex::reduceBasis(IntMatrix &basis, unsigned level) {
1997 std::optional<SmallVector<DynamicAPInt, 8>> Simplex::findIntegerSample() {
2108 Simplex::computeIntegerBounds(ArrayRef<DynamicAPInt> coeffs) {
2110 computeOptimum(Simplex::Direction::Down, coeffs).map(ceil));
2112 computeOptimum(Simplex::Direction::Up, coeffs).map(floor));
2116 bool Simplex::isFlatAlong(ArrayRef<DynamicAPInt> coeffs) {
2118 auto upOpt = computeOptimum(Simplex::Direction::Up, coeffs);
2119 auto downOpt = computeOptimum(Simplex::Direction::Down, coeffs);
2132 os << "Simplex marked empty!\n";
2173 bool Simplex::isRationalSubsetOf(const IntegerRelation &rel) {
2202 Simplex::IneqType Simplex::findIneqType(ArrayRef<DynamicAPInt> coeffs) {
2217 bool Simplex::isRedundantInequality(ArrayRef<DynamicAPInt> coeffs) {
2227 bool Simplex::isRedundantEquality(ArrayRef<DynamicAPInt> coeffs) {