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

◆ rawLinAlgSolve()

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

Returns X s.t. AX = B. Assumptions: A has the same number of rows as B. A doesn't have to be invertible or square. If a usage error occurs, NULL is returned and 'success' is set to 0. In all other cases, 'success' is set to 1. If AX=B has no solutions, then NULL is returned, otherwise a matrix X solving AX=B is returned.

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

901{
902 try
903 {
904 *success = 1;
906 if (result != nullptr)
907 {
909 }
910 else
911 {
912 return nullptr;
913 }
914 } catch (const exc::engine_error& e)
915 {
916 *success = 0;
917 ERROR(e.what());
918 return nullptr;
919 }
920}
virtual MutableMatrix * solveLinear(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::solveLinear().