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

◆ rawLinAlgSolveInvertible()

MutableMatrix * rawLinAlgSolveInvertible ( const MutableMatrix * A,
const MutableMatrix * B,
int * success )

Returns X s.t. AX = B. Assumptions: A is a square matrix, with the same number of rows as B. If a usage error occurs, NULL is returned and 'success' is set to 0. In all other cases, 'success' is set to 1. If A turns out to be not invertible, NULL is returned, otherwise the unique matrix X solving AX=B is returned.

Definition at line 922 of file mutable-matrix.cpp.

925{
926 try
927 {
928 *success = 1;
930 if (result != nullptr)
931 {
933 }
934 else
935 {
936 return nullptr;
937 }
938 } catch (const exc::engine_error& e)
939 {
940 *success = 0;
941 ERROR(e.what());
942 return nullptr;
943 }
944}
virtual MutableMatrix * solveInvertible(const MutableMatrix *B) const =0
Abstract base class for mutable matrices over an arbitrary engine Ring, the in-place counterpart of t...
Definition mat.hpp:79
MutableMatrix * internMutableMatrix(MutableMatrix *G)
Definition finalize.cpp:200
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)

References ERROR, internMutableMatrix(), result(), and MutableMatrix::solveInvertible().