16 #ifndef MLIR_ANALYSIS_PRESBURGER_PWMAFUNCTION_H
17 #define MLIR_ANALYSIS_PRESBURGER_PWMAFUNCTION_H
24 namespace presburger {
44 : space(space), output(output),
45 divs(space.getNumVars() - space.getNumRangeVars()) {
51 : space(space), output(output), divs(divs) {
110 void print(raw_ostream &os)
const;
115 void assertIsConsistent()
const;
164 "PWMAFunction cannot have local vars.");
219 void print(raw_ostream &os)
const;
Class storing division representation of local variables of a constraint system.
An IntegerPolyhedron represents the set of points from a PresburgerSpace that satisfy a list of affin...
An IntegerRelation represents the set of points from a PresburgerSpace that satisfy a list of affine ...
This is a class to represent a resizable matrix.
MutableArrayRef< MPInt > getRow(unsigned row)
Get a [Mutable]ArrayRef corresponding to the specified row.
This class represents a multi-affine function with the domain as Z^d, where d is the number of domain...
MultiAffineFunction(const PresburgerSpace &space, const Matrix &output, const DivisionRepr &divs)
const Matrix & getOutputMatrix() const
Get a matrix with each row representing row^th output expression.
void subtract(const MultiAffineFunction &other)
void removeOutputs(unsigned start, unsigned end)
Remove the specified range of outputs.
void print(raw_ostream &os) const
unsigned getNumDivs() const
PresburgerSpace getOutputSpace() const
ArrayRef< MPInt > getOutputExpr(unsigned i) const
Get the i^th output expression.
const PresburgerSpace & getSpace() const
Get the space of this function.
PresburgerSpace getDomainSpace() const
Get the domain/output space of the function.
PresburgerSet getLexSet(OrderingKind comp, const MultiAffineFunction &other) const
Return the set of domain points where the output of this and other are ordered lexicographically acco...
SmallVector< MPInt, 8 > valueAt(ArrayRef< MPInt > point) const
MultiAffineFunction(const PresburgerSpace &space, const Matrix &output)
unsigned getNumOutputs() const
unsigned getNumDomainVars() const
SmallVector< MPInt, 8 > valueAt(ArrayRef< int64_t > point) const
void mergeDivs(MultiAffineFunction &other)
Given a MAF other, merges division variables such that both functions have the union of the division ...
unsigned getNumSymbolVars() const
const DivisionRepr & getDivs() const
Get the divisions used in this function.
IntegerRelation getAsRelation() const
Get this function as a relation.
bool isEqual(const MultiAffineFunction &other) const
Return whether the this and other are equal when the domain is restricted to domain.
This class represents a piece-wise MultiAffineFunction.
const PresburgerSpace & getSpace() const
void addPiece(const Piece &piece)
unsigned getNumDomainVars() const
void print(raw_ostream &os) const
PWMAFunction unionLexMax(const PWMAFunction &func)
std::optional< SmallVector< MPInt, 8 > > valueAt(ArrayRef< MPInt > point) const
Return the output of the function at the given point.
unsigned getNumPieces() const
void removeOutputs(unsigned start, unsigned end)
Remove the specified range of outputs.
unsigned getNumOutputs() const
unsigned getNumVarKind(VarKind kind) const
PWMAFunction unionLexMin(const PWMAFunction &func)
Return a function defined on the union of the domains of this and func, such that when only one of th...
PWMAFunction(const PresburgerSpace &space)
ArrayRef< Piece > getAllPieces() const
Return all the pieces of this piece-wise function.
PresburgerSet getDomain() const
Return the domain of this piece-wise MultiAffineFunction.
PresburgerSpace getDomainSpace() const
Get the domain/output space of the function.
std::optional< SmallVector< MPInt, 8 > > valueAt(ArrayRef< int64_t > point) const
PresburgerSpace getOutputSpace() const
unsigned getNumSymbolVars() const
bool isEqual(const PWMAFunction &other) const
Return whether this and other are equal as PWMAFunctions, i.e.
const PresburgerSpace & getSpace() const
PresburgerSpace is the space of all possible values of a tuple of integer valued variables/variables.
unsigned getNumRangeVars() const
PresburgerSpace getRangeSpace() const
unsigned getNumSymbolVars() const
unsigned getNumVarKind(VarKind kind) const
Get the number of vars of the specified kind.
PresburgerSpace getDomainSpace() const
Get the domain/range space of this space.
unsigned getNumLocalVars() const
unsigned getNumDomainVars() const
bool isCompatible(const PresburgerSpace &other) const
Returns true if both the spaces are compatible i.e.
OrderingKind
Enum representing a binary comparison operator: equal, not equal, less than, less than or equal,...
SmallVector< MPInt, 8 > getMPIntVec(ArrayRef< int64_t > range)
Check if the pos^th variable can be expressed as a floordiv of an affine function of other variables ...
Include the generated interface declarations.
MultiAffineFunction output
bool isConsistent() const