|
MLIR
22.0.0git
|
#include "mlir/Analysis/Presburger/Matrix.h"
Inheritance diagram for mlir::presburger::FracMatrix:Public Member Functions | |
| FracMatrix (unsigned rows, unsigned columns, unsigned reservedRows=0, unsigned reservedColumns=0) | |
| FracMatrix (Matrix< Fraction > m) | |
| FracMatrix (IntMatrix m) | |
| Fraction | determinant (FracMatrix *inverse=nullptr) const |
| FracMatrix | gramSchmidt () const |
| void | LLL (const Fraction &delta) |
| IntMatrix | normalizeRows () const |
Public Member Functions inherited from mlir::presburger::Matrix< Fraction > | |
| Matrix ()=delete | |
| Matrix (unsigned rows, unsigned columns, unsigned reservedRows=0, unsigned reservedColumns=0) | |
| Construct a matrix with the specified number of rows and columns. More... | |
| Fraction & | at (unsigned row, unsigned column) |
| Access the element at the specified row and column. More... | |
| Fraction | at (unsigned row, unsigned column) const |
| Fraction & | operator() (unsigned row, unsigned column) |
| Fraction | operator() (unsigned row, unsigned column) const |
| bool | operator== (const Matrix< Fraction > &m) const |
We cannot use the default implementation of operator== as it compares fields like reservedColumns etc., which are not part of the data. More... | |
| void | swapColumns (unsigned column, unsigned otherColumn) |
| Swap the given columns. More... | |
| void | swapRows (unsigned row, unsigned otherRow) |
| Swap the given rows. More... | |
| unsigned | getNumRows () const |
| unsigned | getNumColumns () const |
| unsigned | getNumReservedRows () const |
| Return the maximum number of rows/columns that can be added without incurring a reallocation. More... | |
| unsigned | getNumReservedColumns () const |
| void | reserveRows (unsigned rows) |
| Reserve enough space to resize to the specified number of rows without reallocations. More... | |
| MutableArrayRef< Fraction > | getRow (unsigned row) |
| Get a [Mutable]ArrayRef corresponding to the specified row. More... | |
| ArrayRef< Fraction > | getRow (unsigned row) const |
| void | setRow (unsigned row, ArrayRef< Fraction > elems) |
Set the specified row to elems. More... | |
| void | insertColumns (unsigned pos, unsigned count) |
| Insert columns having positions pos, pos + 1, ... More... | |
| void | insertColumn (unsigned pos) |
| void | insertRows (unsigned pos, unsigned count) |
| Insert rows having positions pos, pos + 1, ... More... | |
| void | insertRow (unsigned pos) |
| void | removeColumns (unsigned pos, unsigned count) |
| Remove the columns having positions pos, pos + 1, ... More... | |
| void | removeColumn (unsigned pos) |
| void | removeRows (unsigned pos, unsigned count) |
| Remove the rows having positions pos, pos + 1, ... More... | |
| void | removeRow (unsigned pos) |
| void | copyRow (unsigned sourceRow, unsigned targetRow) |
| void | fillRow (unsigned row, const Fraction &value) |
| void | fillRow (unsigned row, int64_t value) |
| void | addToRow (unsigned sourceRow, unsigned targetRow, const Fraction &scale) |
Add scale multiples of the source row to the target row. More... | |
| void | addToRow (unsigned sourceRow, unsigned targetRow, int64_t scale) |
| void | addToRow (unsigned row, ArrayRef< Fraction > rowVec, const Fraction &scale) |
Add scale multiples of the rowVec row to the specified row. More... | |
| void | scaleRow (unsigned row, const Fraction &scale) |
Multiply the specified row by a factor of scale. More... | |
| void | addToColumn (unsigned sourceColumn, unsigned targetColumn, const Fraction &scale) |
Add scale multiples of the source column to the target column. More... | |
| void | addToColumn (unsigned sourceColumn, unsigned targetColumn, int64_t scale) |
| void | negateColumn (unsigned column) |
| Negate the specified column. More... | |
| void | negateRow (unsigned row) |
| Negate the specified row. More... | |
| void | negateMatrix () |
| Negate the entire matrix. More... | |
| SmallVector< Fraction, 8 > | preMultiplyWithRow (ArrayRef< Fraction > rowVec) const |
| The given vector is interpreted as a row vector v. More... | |
| SmallVector< Fraction, 8 > | postMultiplyWithColumn (ArrayRef< Fraction > colVec) const |
| The given vector is interpreted as a column vector v. More... | |
| void | resize (unsigned newNRows, unsigned newNColumns) |
| Resize the matrix to the specified dimensions. More... | |
| void | resizeHorizontally (unsigned newNColumns) |
| void | resizeVertically (unsigned newNRows) |
| unsigned | appendExtraRow () |
| Add an extra row at the bottom of the matrix and return its position. More... | |
| unsigned | appendExtraRow (ArrayRef< Fraction > elems) |
| Same as above, but copy the given elements into the row. More... | |
| Matrix< Fraction > | transpose () const |
| Matrix< Fraction > | getSubMatrix (unsigned fromRow, unsigned toRow, unsigned fromColumn, unsigned toColumn) const |
| std::pair< Matrix< Fraction >, Matrix< Fraction > > | splitByBitset (ArrayRef< int > indicator) |
| Split the rows of a matrix into two matrices according to which bits are 1 and which are 0 in a given bitset. More... | |
| void | print (raw_ostream &os) const |
| Print the matrix. More... | |
| void | dump () const |
| bool | hasConsistentState () const |
| Return whether the Matrix is in a consistent state with all its invariants satisfied. More... | |
| void | moveColumns (unsigned srcPos, unsigned num, unsigned dstPos) |
| Move the columns in the source range [srcPos, srcPos + num) to the specified destination [dstPos, dstPos + num), while moving the columns adjacent to the source range to the left/right of the shifted columns. More... | |
Static Public Member Functions | |
| static FracMatrix | identity (unsigned dimension) |
| Return the identity matrix of the specified dimension. More... | |
Static Public Member Functions inherited from mlir::presburger::Matrix< Fraction > | |
| static Matrix | identity (unsigned dimension) |
| Return the identity matrix of the specified dimension. More... | |
Additional Inherited Members | |
Protected Attributes inherited from mlir::presburger::Matrix< Fraction > | |
| unsigned | nRows |
| The current number of rows, columns, and reserved columns. More... | |
| unsigned | nColumns |
| unsigned | nReservedColumns |
| SmallVector< Fraction, 16 > | data |
| Stores the data. More... | |
|
inline |
|
explicit |
Definition at line 584 of file Matrix.cpp.
References mlir::presburger::Matrix< T >::at(), mlir::presburger::Matrix< Fraction >::at(), mlir::presburger::Matrix< T >::getNumColumns(), and mlir::presburger::Matrix< T >::getNumRows().
| Fraction FracMatrix::determinant | ( | FracMatrix * | inverse = nullptr | ) | const |
Definition at line 591 of file Matrix.cpp.
References mlir::presburger::Matrix< T >::addToRow(), mlir::presburger::Matrix< T >::at(), identity(), mlir::presburger::Matrix< Fraction >::nColumns, mlir::presburger::Matrix< Fraction >::nRows, and mlir::presburger::Matrix< T >::swapRows().
Referenced by mlir::presburger::detail::computeUnimodularConeGeneratingFunction(), mlir::presburger::IntMatrix::determinant(), and mlir::presburger::detail::solveParametricEquations().
| FracMatrix FracMatrix::gramSchmidt | ( | ) | const |
Definition at line 676 of file Matrix.cpp.
References mlir::presburger::Matrix< T >::addToRow(), mlir::presburger::dotProduct(), mlir::presburger::Matrix< Fraction >::getNumRows(), and mlir::presburger::Matrix< T >::getRow().
|
static |
Return the identity matrix of the specified dimension.
Definition at line 580 of file Matrix.cpp.
References mlir::presburger::Matrix< T >::identity().
Referenced by determinant().
| void FracMatrix::LLL | ( | const Fraction & | delta | ) |
Definition at line 724 of file Matrix.cpp.
| IntMatrix FracMatrix::normalizeRows | ( | ) | const |
Definition at line 764 of file Matrix.cpp.
References mlir::presburger::Matrix< Fraction >::at(), mlir::presburger::Matrix< Fraction >::getNumColumns(), and mlir::presburger::Matrix< Fraction >::getNumRows().