================ @@ -241,6 +245,32 @@ class IntMatrix : public Matrix<MPInt> /// Returns the GCD of the columns of the specified row. MPInt normalizeRow(unsigned row); + // Return the integer inverse of the matrix, leaving the calling object + // unmodified. + std::optional<IntMatrix> integerInverse(); +}; + +// An inherited class for rational matrices, with no new data attributes. +// This class is for functionality that only applies to matrices of fractions. +class FracMatrix : public Matrix<Fraction> { +public: + FracMatrix(unsigned rows, unsigned columns, unsigned reservedRows = 0, + unsigned reservedColumns = 0) + : Matrix<Fraction>(rows, columns, reservedRows, reservedColumns){}; + + FracMatrix(Matrix<Fraction> m) + : Matrix<Fraction>(m.getNumRows(), m.getNumColumns(), + m.getNumReservedRows(), m.getNumReservedColumns()) { + for (unsigned i = 0; i < m.getNumRows(); i++) + for (unsigned j = 0; j < m.getNumColumns(); j++) + at(i, j) = m(i, j); ---------------- Superty wrote:
`: Matrix<Fraction(m)`? https://github.com/llvm/llvm-project/pull/67382 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits