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

#include "mlir/Analysis/Presburger/QuasiPolynomial.h"

+ Inheritance diagram for mlir::presburger::QuasiPolynomial:

Public Member Functions

 QuasiPolynomial (unsigned numVars, ArrayRef< Fraction > coeffs={}, ArrayRef< std::vector< SmallVector< Fraction >>> aff={})
 
 QuasiPolynomial (unsigned numVars, const Fraction &constant)
 Define a quasipolynomial which is a single constant. More...
 
unsigned getNumInputs () const
 
const SmallVector< Fraction > & getCoefficients () const
 
const std::vector< std::vector< SmallVector< Fraction > > > & getAffine () const
 
QuasiPolynomial operator+ (const QuasiPolynomial &x) const
 
QuasiPolynomial operator- (const QuasiPolynomial &x) const
 
QuasiPolynomial operator* (const QuasiPolynomial &x) const
 
QuasiPolynomial operator/ (const Fraction &x) const
 
QuasiPolynomial simplify ()
 
QuasiPolynomial collectTerms ()
 
Fraction getConstantTerm ()
 
- Public Member Functions inherited from mlir::presburger::PresburgerSpace
PresburgerSpace getDomainSpace () const
 Get the domain/range space of this space. More...
 
PresburgerSpace getRangeSpace () const
 
PresburgerSpace getSpaceWithoutLocals () const
 Get the space without local variables. More...
 
unsigned getNumDomainVars () const
 
unsigned getNumRangeVars () const
 
unsigned getNumSetDimVars () const
 
unsigned getNumSymbolVars () const
 
unsigned getNumLocalVars () const
 
unsigned getNumDimVars () const
 
unsigned getNumDimAndSymbolVars () const
 
unsigned getNumVars () const
 
unsigned getNumVarKind (VarKind kind) const
 Get the number of vars of the specified kind. More...
 
unsigned getVarKindOffset (VarKind kind) const
 Return the index at which the specified kind of var starts. More...
 
unsigned getVarKindEnd (VarKind kind) const
 Return the index at Which the specified kind of var ends. More...
 
unsigned getVarKindOverlap (VarKind kind, unsigned varStart, unsigned varLimit) const
 Get the number of elements of the specified kind in the range [varStart, varLimit). More...
 
VarKind getVarKindAt (unsigned pos) const
 Return the VarKind of the var at the specified position. More...
 
unsigned insertVar (VarKind kind, unsigned pos, unsigned num=1)
 Insert num variables of the specified kind at position pos. More...
 
void removeVarRange (VarKind kind, unsigned varStart, unsigned varLimit)
 Removes variables of the specified kind in the column range [varStart, varLimit). More...
 
void convertVarKind (VarKind srcKind, unsigned srcPos, unsigned num, VarKind dstKind, unsigned dstPos)
 Converts variables of the specified kind in the column range [srcPos, srcPos + num) to variables of the specified kind at position dstPos. More...
 
void setVarSymbolSeparation (unsigned newSymbolCount)
 Changes the partition between dimensions and symbols. More...
 
void swapVar (VarKind kindA, VarKind kindB, unsigned posA, unsigned posB)
 Swaps the posA^th variable of kindA and posB^th variable of kindB. More...
 
bool isCompatible (const PresburgerSpace &other) const
 Returns true if both the spaces are compatible i.e. More...
 
bool isEqual (const PresburgerSpace &other) const
 Returns true if both the spaces are equal including local variables i.e. More...
 
Identifier getId (VarKind kind, unsigned pos) const
 Get the identifier of pos^th variable of the specified kind. More...
 
ArrayRef< IdentifiergetIds (VarKind kind) const
 
ArrayRef< IdentifiergetIds () const
 
void setId (VarKind kind, unsigned pos, Identifier id)
 Set the identifier of pos^th variable of the specified kind. More...
 
bool isUsingIds () const
 Returns if identifiers are being used. More...
 
void resetIds ()
 Reset the stored identifiers in the space. More...
 
void disableIds ()
 Disable identifiers being stored in space. More...
 
bool isAligned (const PresburgerSpace &other) const
 Check if the spaces are compatible, and the non-local variables having same identifiers are in the same positions. More...
 
bool isAligned (const PresburgerSpace &other, VarKind kind) const
 Same as above but only check the specified VarKind. More...
 
void mergeAndAlignSymbols (PresburgerSpace &other)
 Merge and align symbol variables of this and other with respect to identifiers. More...
 
void print (llvm::raw_ostream &os) const
 
void dump () const
 

Additional Inherited Members

- Static Public Member Functions inherited from mlir::presburger::PresburgerSpace
static PresburgerSpace getRelationSpace (unsigned numDomain=0, unsigned numRange=0, unsigned numSymbols=0, unsigned numLocals=0)
 
static PresburgerSpace getSetSpace (unsigned numDims=0, unsigned numSymbols=0, unsigned numLocals=0)
 
- Protected Member Functions inherited from mlir::presburger::PresburgerSpace
 PresburgerSpace (unsigned numDomain, unsigned numRange, unsigned numSymbols, unsigned numLocals)
 

Detailed Description

Definition at line 37 of file QuasiPolynomial.h.

Constructor & Destructor Documentation

◆ QuasiPolynomial() [1/2]

QuasiPolynomial::QuasiPolynomial ( unsigned  numVars,
ArrayRef< Fraction coeffs = {},
ArrayRef< std::vector< SmallVector< Fraction >>>  aff = {} 
)

Definition at line 16 of file QuasiPolynomial.cpp.

References getNumInputs().

Referenced by collectTerms(), operator*(), operator+(), and simplify().

◆ QuasiPolynomial() [2/2]

QuasiPolynomial::QuasiPolynomial ( unsigned  numVars,
const Fraction constant 
)

Define a quasipolynomial which is a single constant.

Definition at line 39 of file QuasiPolynomial.cpp.

Member Function Documentation

◆ collectTerms()

QuasiPolynomial QuasiPolynomial::collectTerms ( )

Definition at line 146 of file QuasiPolynomial.cpp.

References getNumInputs(), and QuasiPolynomial().

◆ getAffine()

const std::vector<std::vector<SmallVector<Fraction> > >& mlir::presburger::QuasiPolynomial::getAffine ( ) const
inline

Definition at line 52 of file QuasiPolynomial.h.

◆ getCoefficients()

const SmallVector<Fraction>& mlir::presburger::QuasiPolynomial::getCoefficients ( ) const
inline

Definition at line 50 of file QuasiPolynomial.h.

◆ getConstantTerm()

Fraction QuasiPolynomial::getConstantTerm ( )

Definition at line 167 of file QuasiPolynomial.cpp.

◆ getNumInputs()

unsigned mlir::presburger::QuasiPolynomial::getNumInputs ( ) const
inline

◆ operator*()

QuasiPolynomial QuasiPolynomial::operator* ( const QuasiPolynomial x) const

Definition at line 65 of file QuasiPolynomial.cpp.

References getNumInputs(), product(), and QuasiPolynomial().

◆ operator+()

QuasiPolynomial QuasiPolynomial::operator+ ( const QuasiPolynomial x) const

Definition at line 44 of file QuasiPolynomial.cpp.

References getNumInputs(), and QuasiPolynomial().

◆ operator-()

QuasiPolynomial QuasiPolynomial::operator- ( const QuasiPolynomial x) const

Definition at line 55 of file QuasiPolynomial.cpp.

References getNumInputs().

◆ operator/()

QuasiPolynomial QuasiPolynomial::operator/ ( const Fraction x) const

Definition at line 91 of file QuasiPolynomial.cpp.

◆ simplify()

QuasiPolynomial QuasiPolynomial::simplify ( )

Definition at line 102 of file QuasiPolynomial.cpp.

References getNumInputs(), and QuasiPolynomial().


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