MLIR  17.0.0git
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 Matrix &output)

MultiAffineFunction (const PresburgerSpace &space, const Matrix &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 MatrixgetOutputMatrix () const
Get a matrix with each row representing row^th output expression. More...

ArrayRef< MPIntgetOutputExpr (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< MPInt, 8 > valueAt (ArrayRef< MPInt > point) const

SmallVector< MPInt, 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.

## ◆ MultiAffineFunction() [1/2]

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

Definition at line 43 of file PWMAFunction.h.

## ◆ MultiAffineFunction() [2/2]

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

Definition at line 49 of file PWMAFunction.h.

## ◆ dump()

 void mlir::presburger::MultiAffineFunction::dump ( ) const

## ◆ getAsRelation()

 IntegerRelation MultiAffineFunction::getAsRelation ( ) const

## ◆ getDivs()

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

Get the divisions used in this function.

Definition at line 73 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.

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

## ◆ getLexSet()

 PresburgerSet MultiAffineFunction::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.

For example, if the given comparison is LT, then the returned set contains all points where the first output of this is lexicographically less than other.

Definition at line 176 of file PWMAFunction.cpp.

Referenced by tiebreakLex().

## ◆ getNumDivs()

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

Definition at line 58 of file PWMAFunction.h.

Referenced by getLexSet(), and mergeDivs().

## ◆ getNumDomainVars()

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

Definition at line 55 of file PWMAFunction.h.

Referenced by getAsRelation(), and valueAt().

## ◆ getNumOutputs()

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

Definition at line 57 of file PWMAFunction.h.

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

## ◆ getNumSymbolVars()

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

Definition at line 56 of file PWMAFunction.h.

Referenced by valueAt().

## ◆ getOutputExpr()

 ArrayRef 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::getRow().

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

## ◆ getOutputMatrix()

 const Matrix& 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.

## ◆ 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 83 of file PWMAFunction.cpp.

## ◆ isEqual() [2/3]

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

Definition at line 89 of file PWMAFunction.cpp.

## ◆ isEqual() [3/3]

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

Definition at line 102 of file PWMAFunction.cpp.

## ◆ mergeDivs()

 void MultiAffineFunction::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.

Definition at line 122 of file PWMAFunction.cpp.

Referenced by getLexSet(), and subtract().

## ◆ print()

 void MultiAffineFunction::print ( raw_ostream & os ) const

Definition at line 51 of file PWMAFunction.cpp.

## ◆ removeOutputs()

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

Remove the specified range of outputs.

Definition at line 112 of file PWMAFunction.cpp.

## ◆ subtract()

 void MultiAffineFunction::subtract ( const MultiAffineFunction & other )

Definition at line 374 of file PWMAFunction.cpp.

## ◆ valueAt() [1/2]

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

Definition at line 84 of file PWMAFunction.h.

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

## ◆ valueAt() [2/2]

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

Definition at line 60 of file PWMAFunction.cpp.

Referenced by valueAt().

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