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

◆ rawLeastSquares()

M2_bool rawLeastSquares ( MutableMatrix * A,
MutableMatrix * b,
MutableMatrix * x,
M2_bool assume_full_rank )

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

783{
784 try
785 {
786 const Ring *R = A->get_ring();
787 if (R != b->get_ring() || R != x->get_ring())
788 {
789 ERROR("expected matrices with same base ring");
790 return false;
791 }
792 if (A->n_rows() != b->n_rows())
793 {
794 ERROR("expected matrices with the same number of rows");
795 return false;
796 }
797 return A->least_squares(b, x, assume_full_rank);
798 } catch (const exc::engine_error& e)
799 {
800 ERROR(e.what());
801 return false;
802 }
803}
virtual size_t n_rows() const =0
virtual const Ring * get_ring() const =0
virtual bool least_squares(const MutableMatrix *b, MutableMatrix *x, bool assume_full_rank) const =0
xxx xxx xxx
Definition ring.hpp:102
const int ERROR
Definition m2-mem.cpp:55
volatile int x

References ERROR, MutableMatrix::get_ring(), MutableMatrix::least_squares(), MutableMatrix::n_rows(), and x.