#include "mlir/Analysis/Presburger/Matrix.h"
#include "mlir/Analysis/Presburger/Fraction.h"
#include "mlir/Analysis/Presburger/Utils.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <utility>
usingnamespacemlir;
usingnamespacepresburger;
template <typename T>
Matrix<T>::Matrix(unsigned rows, unsigned columns, unsigned reservedRows,
unsigned reservedColumns)
: … { … }
template <typename T>
bool Matrix<T>::operator==(const Matrix<T> &m) const { … }
template <typename T>
Matrix<T> Matrix<T>::identity(unsigned dimension) { … }
template <typename T>
unsigned Matrix<T>::getNumReservedRows() const { … }
template <typename T>
void Matrix<T>::reserveRows(unsigned rows) { … }
template <typename T>
unsigned Matrix<T>::appendExtraRow() { … }
template <typename T>
unsigned Matrix<T>::appendExtraRow(ArrayRef<T> elems) { … }
template <typename T>
Matrix<T> Matrix<T>::transpose() const { … }
template <typename T>
void Matrix<T>::resizeHorizontally(unsigned newNColumns) { … }
template <typename T>
void Matrix<T>::resize(unsigned newNRows, unsigned newNColumns) { … }
template <typename T>
void Matrix<T>::resizeVertically(unsigned newNRows) { … }
template <typename T>
void Matrix<T>::swapRows(unsigned row, unsigned otherRow) { … }
template <typename T>
void Matrix<T>::swapColumns(unsigned column, unsigned otherColumn) { … }
template <typename T>
MutableArrayRef<T> Matrix<T>::getRow(unsigned row) { … }
template <typename T>
ArrayRef<T> Matrix<T>::getRow(unsigned row) const { … }
template <typename T>
void Matrix<T>::setRow(unsigned row, ArrayRef<T> elems) { … }
template <typename T>
void Matrix<T>::insertColumn(unsigned pos) { … }
template <typename T>
void Matrix<T>::insertColumns(unsigned pos, unsigned count) { … }
template <typename T>
void Matrix<T>::removeColumn(unsigned pos) { … }
template <typename T>
void Matrix<T>::removeColumns(unsigned pos, unsigned count) { … }
template <typename T>
void Matrix<T>::insertRow(unsigned pos) { … }
template <typename T>
void Matrix<T>::insertRows(unsigned pos, unsigned count) { … }
template <typename T>
void Matrix<T>::removeRow(unsigned pos) { … }
template <typename T>
void Matrix<T>::removeRows(unsigned pos, unsigned count) { … }
template <typename T>
void Matrix<T>::copyRow(unsigned sourceRow, unsigned targetRow) { … }
template <typename T>
void Matrix<T>::fillRow(unsigned row, const T &value) { … }
template <typename T>
void Matrix<T>::moveColumns(unsigned srcPos, unsigned num, unsigned dstPos) { … }
template <typename T>
void Matrix<T>::addToRow(unsigned sourceRow, unsigned targetRow,
const T &scale) { … }
template <typename T>
void Matrix<T>::addToRow(unsigned row, ArrayRef<T> rowVec, const T &scale) { … }
template <typename T>
void Matrix<T>::scaleRow(unsigned row, const T &scale) { … }
template <typename T>
void Matrix<T>::addToColumn(unsigned sourceColumn, unsigned targetColumn,
const T &scale) { … }
template <typename T>
void Matrix<T>::negateColumn(unsigned column) { … }
template <typename T>
void Matrix<T>::negateRow(unsigned row) { … }
template <typename T>
void Matrix<T>::negateMatrix() { … }
template <typename T>
SmallVector<T, 8> Matrix<T>::preMultiplyWithRow(ArrayRef<T> rowVec) const { … }
template <typename T>
SmallVector<T, 8> Matrix<T>::postMultiplyWithColumn(ArrayRef<T> colVec) const { … }
static void modEntryColumnOperation(Matrix<DynamicAPInt> &m, unsigned row,
unsigned sourceCol, unsigned targetCol,
Matrix<DynamicAPInt> &otherMatrix) { … }
template <typename T>
Matrix<T> Matrix<T>::getSubMatrix(unsigned fromRow, unsigned toRow,
unsigned fromColumn,
unsigned toColumn) const { … }
template <typename T>
void Matrix<T>::print(raw_ostream &os) const { … }
template <typename T>
std::pair<Matrix<T>, Matrix<T>>
Matrix<T>::splitByBitset(ArrayRef<int> indicator) { … }
template <typename T>
void Matrix<T>::dump() const { … }
template <typename T>
bool Matrix<T>::hasConsistentState() const { … }
namespace mlir {
namespace presburger {
template class Matrix<DynamicAPInt>;
template class Matrix<Fraction>;
}
}
IntMatrix IntMatrix::identity(unsigned dimension) { … }
std::pair<IntMatrix, IntMatrix> IntMatrix::computeHermiteNormalForm() const { … }
DynamicAPInt IntMatrix::normalizeRow(unsigned row, unsigned cols) { … }
DynamicAPInt IntMatrix::normalizeRow(unsigned row) { … }
DynamicAPInt IntMatrix::determinant(IntMatrix *inverse) const { … }
FracMatrix FracMatrix::identity(unsigned dimension) { … }
FracMatrix::FracMatrix(IntMatrix m)
: … { … }
Fraction FracMatrix::determinant(FracMatrix *inverse) const { … }
FracMatrix FracMatrix::gramSchmidt() const { … }
void FracMatrix::LLL(Fraction delta) { … }
IntMatrix FracMatrix::normalizeRows() const { … }