MLIR  19.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< MPInt > dir)
 Add an equality dotProduct(dir, x - y) == 0. More...
 
Fraction computeWidth (ArrayRef< MPInt > dir)
 Compute max(dotProduct(dir, x - y)). More...
 
Fraction computeWidthAndDuals (ArrayRef< MPInt > dir, SmallVectorImpl< MPInt > &dual, MPInt &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 1648 of file Simplex.cpp.

Constructor & Destructor Documentation

◆ GBRSimplex()

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

Definition at line 1652 of file Simplex.cpp.

Member Function Documentation

◆ addEqualityForDirection()

void mlir::presburger::GBRSimplex::addEqualityForDirection ( ArrayRef< MPInt 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 1659 of file Simplex.cpp.

◆ computeWidth()

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

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

Definition at line 1666 of file Simplex.cpp.

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

◆ computeWidthAndDuals()

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

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

Definition at line 1675 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 1734 of file Simplex.cpp.


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