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) {
112 void print(raw_ostream &os)
const;
117 void assertIsConsistent()
const;
166 "PWMAFunction cannot have local vars.");
196 std::optional<SmallVector<DynamicAPInt, 8>>
198 std::optional<SmallVector<DynamicAPInt, 8>>
223 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 ...
MutableArrayRef< T > 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...
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
MultiAffineFunction(const PresburgerSpace &space, const IntMatrix &output, const DivisionRepr &divs)
PresburgerSpace getOutputSpace() const
const PresburgerSpace & getSpace() const
Get the space of this function.
MultiAffineFunction(const PresburgerSpace &space, const IntMatrix &output)
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...
ArrayRef< DynamicAPInt > getOutputExpr(unsigned i) const
Get the i^th output expression.
SmallVector< DynamicAPInt, 8 > valueAt(ArrayRef< int64_t > point) const
unsigned getNumOutputs() const
SmallVector< DynamicAPInt, 8 > valueAt(ArrayRef< DynamicAPInt > point) const
unsigned getNumDomainVars() const
const IntMatrix & getOutputMatrix() const
Get a matrix with each row representing row^th output expression.
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)
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.
std::optional< SmallVector< DynamicAPInt, 8 > > valueAt(ArrayRef< DynamicAPInt > point) const
Return the output of the function at the given point.
PresburgerSet getDomain() const
Return the domain of this piece-wise MultiAffineFunction.
std::optional< SmallVector< DynamicAPInt, 8 > > valueAt(ArrayRef< int64_t > point) const
PresburgerSpace getDomainSpace() const
Get the domain/output space of the function.
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.
SmallVector< DynamicAPInt, 8 > getDynamicAPIntVec(ArrayRef< int64_t > range)
Check if the pos^th variable can be expressed as a floordiv of an affine function of other variables ...
OrderingKind
Enum representing a binary comparison operator: equal, not equal, less than, less than or equal,...
Include the generated interface declarations.
MultiAffineFunction output
bool isConsistent() const