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

This class represents a multi-affine function with the domain as Z^d, where d is the number of domain variables of the function. More...

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

Public Member Functions

 MultiAffineFunction (const PresburgerSpace &space, const IntMatrix &output)
 
 MultiAffineFunction (const PresburgerSpace &space, const IntMatrix &output, const DivisionRepr &divs)
 
unsigned getNumDomainVars () const
 
unsigned getNumSymbolVars () const
 
unsigned getNumOutputs () const
 
unsigned getNumDivs () const
 
const PresburgerSpacegetSpace () const
 Get the space of this function. More...
 
PresburgerSpace getDomainSpace () const
 Get the domain/output space of the function. More...
 
PresburgerSpace getOutputSpace () const
 
const IntMatrixgetOutputMatrix () const
 Get a matrix with each row representing row^th output expression. More...
 
ArrayRef< DynamicAPInt > getOutputExpr (unsigned i) const
 Get the i^th output expression. More...
 
const DivisionReprgetDivs () const
 Get the divisions used in this function. More...
 
void removeOutputs (unsigned start, unsigned end)
 Remove the specified range of outputs. More...
 
void mergeDivs (MultiAffineFunction &other)
 Given a MAF other, merges division variables such that both functions have the union of the division vars that exist in the functions. More...
 
SmallVector< DynamicAPInt, 8 > valueAt (ArrayRef< DynamicAPInt > point) const
 
SmallVector< DynamicAPInt, 8 > valueAt (ArrayRef< int64_t > point) const
 
bool isEqual (const MultiAffineFunction &other) const
 Return whether the this and other are equal when the domain is restricted to domain. More...
 
bool isEqual (const MultiAffineFunction &other, const IntegerPolyhedron &domain) const
 
bool isEqual (const MultiAffineFunction &other, const PresburgerSet &domain) const
 
void subtract (const MultiAffineFunction &other)
 
PresburgerSet getLexSet (OrderingKind comp, const MultiAffineFunction &other) const
 Return the set of domain points where the output of this and other are ordered lexicographically according to the given ordering. More...
 
IntegerRelation getAsRelation () const
 Get this function as a relation. More...
 
void print (raw_ostream &os) const
 
void dump () const
 

Detailed Description

This class represents a multi-affine function with the domain as Z^d, where d is the number of domain variables of the function.

For example:

(x, y) -> (x + 2, 2*x - 3y + 5, 2*x + y).

The output expressions are represented as a matrix with one row for every output, one column for each var including division variables, and an extra column at the end for the constant term.

Checking equality of two such functions is supported, as well as finding the value of the function at a specified point.

Definition at line 41 of file PWMAFunction.h.

Constructor & Destructor Documentation

◆ MultiAffineFunction() [1/2]

mlir::presburger::MultiAffineFunction::MultiAffineFunction ( const PresburgerSpace space,
const IntMatrix output 
)
inline

Definition at line 43 of file PWMAFunction.h.

◆ MultiAffineFunction() [2/2]

mlir::presburger::MultiAffineFunction::MultiAffineFunction ( const PresburgerSpace space,
const IntMatrix output,
const DivisionRepr divs 
)
inline

Definition at line 49 of file PWMAFunction.h.

Member Function Documentation

◆ dump()

void MultiAffineFunction::dump ( ) const

Definition at line 68 of file PWMAFunction.cpp.

References print().

◆ getAsRelation()

IntegerRelation MultiAffineFunction::getAsRelation ( ) const

◆ getDivs()

const DivisionRepr& mlir::presburger::MultiAffineFunction::getDivs ( ) const
inline

Get the divisions used in this function.

Definition at line 75 of file PWMAFunction.h.

◆ getDomainSpace()

PresburgerSpace mlir::presburger::MultiAffineFunction::getDomainSpace ( ) const
inline

Get the domain/output space of the function.

The returned space is a set space.

Definition at line 64 of file PWMAFunction.h.

References mlir::presburger::PresburgerSpace::getDomainSpace().

Referenced by getLexSet(), and mlir::presburger::PWMAFunction::Piece::isConsistent().

◆ getLexSet()

PresburgerSet MultiAffineFunction::getLexSet ( OrderingKind  comp,
const MultiAffineFunction other 
) const

◆ getNumDivs()

unsigned mlir::presburger::MultiAffineFunction::getNumDivs ( ) const
inline

Definition at line 58 of file PWMAFunction.h.

References mlir::presburger::PresburgerSpace::getNumLocalVars().

Referenced by getLexSet(), and mergeDivs().

◆ getNumDomainVars()

unsigned mlir::presburger::MultiAffineFunction::getNumDomainVars ( ) const
inline

Definition at line 55 of file PWMAFunction.h.

References mlir::presburger::PresburgerSpace::getNumDomainVars().

Referenced by getAsRelation(), and valueAt().

◆ getNumOutputs()

unsigned mlir::presburger::MultiAffineFunction::getNumOutputs ( ) const
inline

◆ getNumSymbolVars()

unsigned mlir::presburger::MultiAffineFunction::getNumSymbolVars ( ) const
inline

Definition at line 56 of file PWMAFunction.h.

References mlir::presburger::PresburgerSpace::getNumSymbolVars().

Referenced by valueAt().

◆ getOutputExpr()

ArrayRef<DynamicAPInt> mlir::presburger::MultiAffineFunction::getOutputExpr ( unsigned  i) const
inline

Get the i^th output expression.

Definition at line 70 of file PWMAFunction.h.

References mlir::presburger::Matrix< T >::getRow().

Referenced by getAsRelation(), getLexSet(), and subtract().

◆ getOutputMatrix()

const IntMatrix& mlir::presburger::MultiAffineFunction::getOutputMatrix ( ) const
inline

Get a matrix with each row representing row^th output expression.

Definition at line 68 of file PWMAFunction.h.

◆ getOutputSpace()

PresburgerSpace mlir::presburger::MultiAffineFunction::getOutputSpace ( ) const
inline

Definition at line 65 of file PWMAFunction.h.

References mlir::presburger::PresburgerSpace::getRangeSpace().

◆ getSpace()

const PresburgerSpace& mlir::presburger::MultiAffineFunction::getSpace ( ) const
inline

Get the space of this function.

Definition at line 61 of file PWMAFunction.h.

Referenced by getLexSet().

◆ isEqual() [1/3]

bool MultiAffineFunction::isEqual ( const MultiAffineFunction other) const

Return whether the this and other are equal when the domain is restricted to domain.

This is the case if they lie in the same space, and their outputs are equal for every point in domain.

Definition at line 96 of file PWMAFunction.cpp.

References getAsRelation(), mlir::presburger::PresburgerSpace::isCompatible(), and mlir::presburger::IntegerRelation::isEqual().

◆ isEqual() [2/3]

bool MultiAffineFunction::isEqual ( const MultiAffineFunction other,
const IntegerPolyhedron domain 
) const

◆ isEqual() [3/3]

bool MultiAffineFunction::isEqual ( const MultiAffineFunction other,
const PresburgerSet domain 
) const

◆ mergeDivs()

void MultiAffineFunction::mergeDivs ( MultiAffineFunction other)

◆ print()

void MultiAffineFunction::print ( raw_ostream &  os) const

◆ removeOutputs()

void MultiAffineFunction::removeOutputs ( unsigned  start,
unsigned  end 
)

◆ subtract()

void MultiAffineFunction::subtract ( const MultiAffineFunction other)

◆ valueAt() [1/2]

SmallVector< DynamicAPInt, 8 > MultiAffineFunction::valueAt ( ArrayRef< DynamicAPInt >  point) const

◆ valueAt() [2/2]

SmallVector<DynamicAPInt, 8> mlir::presburger::MultiAffineFunction::valueAt ( ArrayRef< int64_t >  point) const
inline

Definition at line 86 of file PWMAFunction.h.

References mlir::presburger::getDynamicAPIntVec(), and valueAt().


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