20 #ifndef __LS_SOLVER_H__
21 #define __LS_SOLVER_H__
66 virtual int solve(
double* result,
double* b) = 0;
110 QRSolver(std::size_t numRow, std::size_t numCol,
double *A,
double limitR=1e-3) {
114 isDecomposed =
false;
141 virtual int solve(
double* result,
double* b);
146 std::vector<int> m_vJPVT;
147 std::vector<double> m_vTAU;
151 #endif // __LS_SOLVER_H__
std::size_t m_iNumRow
The number of rows in matrix A.
Definition: ls_solver.h:69
An abstract class for the family of solvers for the least squares problem.
Definition: ls_solver.h:45
double * m_vb
The vector b (the right-hand-side)
Definition: ls_solver.h:72
std::size_t m_iNumCol
The number of columns in matrix A.
Definition: ls_solver.h:70
QRSolver(std::size_t numRow, std::size_t numCol, double *A, double limitR=1e-3)
Constructor.
Definition: ls_solver.h:110
virtual int solve(double *result, double *b)=0
Solves the least squares problem Ax = b.
A class which solves the least squares problem by the QR decomposition method.
Definition: ls_solver.h:97
virtual int solve(double *result, double *b)
returns 0 if success and result will be non-empty returns k<0 if the kth argument is illegal...
Definition: ls_solver.cpp:33
double * m_vA
The matrix A.
Definition: ls_solver.h:71
virtual ~LSSolver()
Destructor.
Definition: ls_solver.h:54