28 #ifndef _nmrLSSolver_h
29 #define _nmrLSSolver_h
98 CISSTNETLIB_INTEGER
M;
99 CISSTNETLIB_INTEGER
N;
135 nmrLSSolver(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, CISSTNETLIB_INTEGER nrhs,
bool storageOrder) {
161 inline void Allocate(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, CISSTNETLIB_INTEGER nrhs,
bool storageOrder) {
162 const CISSTNETLIB_INTEGER one = 1;
167 Lda = std::max(one,
M);
168 Ldb = std::max(one, std::max(
M,
N));
169 CISSTNETLIB_INTEGER MN = std::min(
M,
N);
170 Lwork = std::max (one, MN + std::max (MN,
NRHS));
192 template <
class _matrixOwnerType>
196 cmnThrow(std::runtime_error(
"nmrLSSolver Solve: Storage order used for Allocate was different"));
199 cmnThrow(std::runtime_error(
"nmrLSSolver Solve: Storage order used for Allocate was different"));
205 if (A.IsColMajor()) {
206 if ((
M != static_cast<CISSTNETLIB_INTEGER>(A.rows())) || (
N !=
static_cast<CISSTNETLIB_INTEGER
>(A.cols()))) {
207 cmnThrow(std::runtime_error(
"nmrLSSolver Solve: Size used for Allocate was different"));
210 if (B.IsColMajor()) {
211 if ((
M != static_cast<CISSTNETLIB_INTEGER>(B.rows())) || (
NRHS !=
static_cast<CISSTNETLIB_INTEGER
>(B.cols()))) {
212 cmnThrow(std::runtime_error(
"nmrLSSolver Solve: Size used for Allocate was different"));
217 if (! A.IsCompact()) {
218 cmnThrow(std::runtime_error(
"nmrLSSolver Solve: Requires a compact matrix"));
220 if (! B.IsCompact()) {
221 cmnThrow(std::runtime_error(
"nmrLSSolver Solve: Requires a compact matrix"));
225 #if defined(CISSTNETLIB_VERSION_MAJOR)
226 #if (CISSTNETLIB_VERSION_MAJOR >= 3)
232 #else // no major version
237 #endif // CISSTNETLIB_VERSION
244 #endif // _nmrLSSolver_h
Declaration of vctDynamicMatrix.
void Allocate(vctDynamicMatrix< double > &A, vctDynamicMatrix< double > &B)
Definition: nmrLSSolver.h:181
nmrLSSolver(vctDynamicMatrix< double > &A, vctDynamicMatrix< double > &B)
Definition: nmrLSSolver.h:146
Definition: vctDynamicMatrixBase.h:42
void Solve(vctDynamicMatrixBase< _matrixOwnerType, double > &A, vctDynamicMatrixBase< _matrixOwnerType, double > &B)
Definition: nmrLSSolver.h:193
CISSTNETLIB_INTEGER M
Definition: nmrLSSolver.h:98
CISSTNETLIB_INTEGER N
Definition: nmrLSSolver.h:99
nmrLSSolver(void)
Definition: nmrLSSolver.h:114
CISSTNETLIB_INTEGER Lwork
Definition: nmrLSSolver.h:103
CISSTNETLIB_INTEGER Ldb
Definition: nmrLSSolver.h:102
pointer Pointer(size_type rowIndex, size_type colIndex)
Definition: vctDynamicMatrixBase.h:143
nmrLSSolver(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, CISSTNETLIB_INTEGER nrhs, bool storageOrder)
Definition: nmrLSSolver.h:135
bool StorageOrder
Definition: nmrLSSolver.h:107
size_type rows() const
Definition: vctDynamicConstMatrixBase.h:238
size_type cols() const
Definition: vctDynamicConstMatrixBase.h:243
void Allocate(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, CISSTNETLIB_INTEGER nrhs, bool storageOrder)
Definition: nmrLSSolver.h:161
bool IsRowMajor(void) const
Definition: vctDynamicConstMatrixBase.h:635
void SetSize(size_type rows, size_type cols, bool storageOrder)
Definition: vctDynamicMatrix.h:364
CISSTNETLIB_INTEGER NRHS
Definition: nmrLSSolver.h:100
#define cmnThrow(a)
Definition: MinimalCmn.h:4
char Trans
Definition: nmrLSSolver.h:104
const bool VCT_COL_MAJOR
Definition: vctForwardDeclarations.h:46
Definition: nmrLSSolver.h:92
CISSTNETLIB_INTEGER Lda
Definition: nmrLSSolver.h:101
CISSTNETLIB_INTEGER Info
Definition: nmrLSSolver.h:106
vctDynamicMatrix< double > Work
Definition: nmrLSSolver.h:105