Macaulay2 Engine
Loading...
Searching...
No Matches

◆ solveInvertible()

template<typename T>
MutableMatrix * MutableMat< T >::solveInvertible ( const MutableMatrix * B) const
virtual

Implements MutableMatrix.

Definition at line 130 of file mutablemat-imp.hpp.

131{
132 const T* B1 = B->coerce_const<T>();
133 if (B1 == 0) throw exc::engine_error("expected matrices of the same type");
134 if (B->get_ring() != get_ring())
135 throw exc::engine_error("expected same ring");
136 if (n_rows() != n_cols()) throw exc::engine_error("expected a square matrix");
137 if (B->n_rows() != n_rows())
138 throw exc::engine_error("expected matrices with same number of rows");
141 if (retval) return solns;
142 delete solns;
143 return NULL;
144}
virtual size_t n_rows() const
virtual size_t n_cols() const
virtual const Ring * get_ring() const
MutableMat * makeZeroMatrix(size_t nrows, size_t ncols) const
const MatT * coerce_const() const
Definition mat.hpp:159
bool solveInvertible(const Mat &A, const Mat &B, Mat &X)
solve AX=B, where A is a square (invertible) matrix.

References MutableMatrix::coerce_const(), get_ring(), MutableMatrix::get_ring(), makeZeroMatrix(), mat, MutableMat(), MutableMatrix::MutableMatrix(), n_cols(), n_rows(), MutableMatrix::n_rows(), MatrixOps::solveInvertible(), and T.