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

◆ solveLinear()

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

Implements MutableMatrix.

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

115{
116 const T* B1 = B->coerce_const<T>();
117 if (B1 == 0) throw exc::engine_error("expected matrices of the same type");
118 if (B->get_ring() != get_ring())
119 throw exc::engine_error("expected same ring");
120 if (B->n_rows() != n_rows())
121 throw exc::engine_error("expected matrices with same number of rows");
124 if (retval) return solns;
125 delete solns;
126 return NULL;
127}
virtual size_t n_rows() 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 solveLinear(const Mat &A, const Mat &B, Mat &X)
solve AX=B, return true if the system has a solution.

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