MLIR  20.0.0git
Public Member Functions | List of all members
mlir::presburger::GBRSimplex Class Reference

Given a simplex for a polytope, construct a new simplex whose variables are identified with a pair of points (x, y) in the original polytope. More...

Public Member Functions

 GBRSimplex (const Simplex &originalSimplex)
 
void addEqualityForDirection (ArrayRef< DynamicAPInt > dir)
 Add an equality dotProduct(dir, x - y) == 0. More...
 
Fraction computeWidth (ArrayRef< DynamicAPInt > dir)
 Compute max(dotProduct(dir, x - y)). More...
 
Fraction computeWidthAndDuals (ArrayRef< DynamicAPInt > dir, SmallVectorImpl< DynamicAPInt > &dual, DynamicAPInt &dualDenom)
 Compute max(dotProduct(dir, x - y)) and save the dual variables for only the direction equalities to dual. More...
 
void removeLastEquality ()
 Remove the last equality that was added through addEqualityForDirection. More...
 

Detailed Description

Given a simplex for a polytope, construct a new simplex whose variables are identified with a pair of points (x, y) in the original polytope.

Supports some operations needed for generalized basis reduction. In what follows, dotProduct(x, y) = x_1 * y_1 + x_2 * y_2 + ... x_n * y_n where n is the dimension of the original polytope.

This supports adding equality constraints dotProduct(dir, x - y) == 0. It also supports rolling back this addition, by maintaining a snapshot stack that contains a snapshot of the Simplex's state for each equality, just before that equality was added.

Definition at line 1655 of file Simplex.cpp.

Constructor & Destructor Documentation

◆ GBRSimplex()

mlir::presburger::GBRSimplex::GBRSimplex ( const Simplex originalSimplex)
inline

Definition at line 1659 of file Simplex.cpp.

Member Function Documentation

◆ addEqualityForDirection()

void mlir::presburger::GBRSimplex::addEqualityForDirection ( ArrayRef< DynamicAPInt >  dir)
inline

Add an equality dotProduct(dir, x - y) == 0.

First pushes a snapshot for the current simplex state to the stack so that this can be rolled back later.

Definition at line 1666 of file Simplex.cpp.

◆ computeWidth()

Fraction mlir::presburger::GBRSimplex::computeWidth ( ArrayRef< DynamicAPInt >  dir)
inline

Compute max(dotProduct(dir, x - y)).

Definition at line 1673 of file Simplex.cpp.

References mlir::presburger::MaybeOptimum< T >::isBounded().

◆ computeWidthAndDuals()

Fraction mlir::presburger::GBRSimplex::computeWidthAndDuals ( ArrayRef< DynamicAPInt >  dir,
SmallVectorImpl< DynamicAPInt > &  dual,
DynamicAPInt &  dualDenom 
)
inline

Compute max(dotProduct(dir, x - y)) and save the dual variables for only the direction equalities to dual.

Definition at line 1682 of file Simplex.cpp.

References mlir::presburger::MaybeOptimum< T >::isBounded(), and mlir::presburger::Simplex::Up.

◆ removeLastEquality()

void mlir::presburger::GBRSimplex::removeLastEquality ( )
inline

Remove the last equality that was added through addEqualityForDirection.

We do this by rolling back to the snapshot at the top of the stack, which should be a snapshot taken just before the last equality was added.

Definition at line 1742 of file Simplex.cpp.


The documentation for this class was generated from the following file: