13 #ifndef CD_LaPackUtils_H
14 #define CD_LaPackUtils_H
20 #include <CD_NamespaceHeader.H>
122 dgesv_(
int* N,
int* NRHS,
double* A,
int* LDA,
int* IPIV,
double* B,
int* LDB,
int* INFO);
137 linearIndex(
const int irow,
const int jcol,
const int M,
const int N);
155 std::vector<double>& a_linSigma,
156 std::vector<double>& a_linVtran,
157 const std::vector<double>& a_linA,
177 std::vector<float>& a_linSigma,
178 std::vector<float>& a_linVtran,
179 const std::vector<float>& a_linA,
192 const std::vector<double>& a_linA,
205 const std::vector<float>& a_linA,
222 const std::vector<std::vector<double>>& a_A,
223 const char& a_format);
236 const std::vector<std::vector<double>>& a_A);
246 linearizeRowMajorMatrix(std::vector<double>& a_linA,
int& a_M,
int& a_N,
const std::vector<std::vector<double>>& a_A);
261 const std::vector<double>& a_linA,
262 const char& a_format);
275 const std::vector<double>& a_linA);
288 const std::vector<double>& a_linA);
291 #include <CD_NamespaceFooter.H>
void dgesv_(int *N, int *NRHS, double *A, int *LDA, int *IPIV, double *B, int *LDB, int *INFO)
Interface to LaPack for computing solution to Ax=b.
void dgelss_(int *a_M, int *a_N, int *a_nRHS, double *a_A, int *a_LDA, double *a_B, int *a_LDB, double *a_S, double *a_rcond, int *a_RANK, double *a_WORK, int *a_LWORK, int *a_INFO)
This is an interface to LAPACK for solving least squares problems using singular-value decomposition.
void sgemm_(char *a_TRANSA, char *a_TRANSB, int *a_M, int *a_N, int *a_K, float *a_ALPHA, float *a_A, int *a_LDA, float *a_B, int *a_LDB, float *a_BETA, float *a_C, int *a_LDC)
Interface to LaPack for matrix multiplication.
void dgesdd_(char *a_JOBZ, int *a_M, int *a_N, double *a_A, int *a_LDA, double *a_S, double *a_U, int *a_LDU, double *a_VT, int *a_LDVT, double *a_WORK, int *a_LWORK, int *a_IWORK, int *a_INFO)
Interface to LaPack for computing the singular value decomposition of a matrix.
void sgesdd_(char *a_JOBZ, int *a_M, int *a_N, float *a_A, int *a_LDA, float *a_S, float *a_U, int *a_LDU, float *a_VT, int *a_LDVT, float *a_WORK, int *a_LWORK, int *a_IWORK, int *a_INFO)
Interface to LaPack for computing the singular value decomposition of a matrix.
void dgemm_(char *a_TRANSA, char *a_TRANSB, int *a_M, int *a_N, int *a_K, double *a_ALPHA, double *a_A, int *a_LDA, double *a_B, int *a_LDB, double *a_BETA, double *a_C, int *a_LDC)
Interface to LaPack for matrix multiplication.
Namespace containing various useful linear algebra routines using LaPACK.
Definition: CD_LaPackUtils.H:127
void deLinearizeColumnMajorMatrix(std::vector< std::vector< double >> &a_A, const int &a_M, const int &a_N, const std::vector< double > &a_linA)
Delinearize a linearized matrix from column major Fortran to column major form.
Definition: CD_LaPackUtils.cpp:417
void linearizeColumnMajorMatrix(std::vector< double > &a_linA, int &a_M, int &a_N, const std::vector< std::vector< double >> &a_A)
Linearize a matrix to column major Fortran form by column major format of the input matrix.
Definition: CD_LaPackUtils.cpp:359
void deLinearizeRowMajorMatrix(std::vector< std::vector< double >> &a_A, const int &a_M, const int &a_N, const std::vector< double > &a_linA)
Delinearize a linearized matrix from column major Fortran to row major form.
Definition: CD_LaPackUtils.cpp:438
bool computeSVD(std::vector< double > &a_linU, std::vector< double > &a_linSigma, std::vector< double > &a_linVtran, const std::vector< double > &a_linA, const int &a_M, const int &a_N)
Compute the singular value decomposition of a matrix.
Definition: CD_LaPackUtils.cpp:29
int linearIndex(const int irow, const int jcol, const int M, const int N)
Get the index in the linearized matrix of size MxN.
Definition: CD_LaPackUtils.cpp:23
void linearizeMatrix(std::vector< double > &a_linA, int &a_M, int &a_N, const std::vector< std::vector< double >> &a_A, const char &a_format)
Linearize a matrix to column major Fortran form by assuming row or major colum format of the input ma...
Definition: CD_LaPackUtils.cpp:399
bool computePseudoInverse(std::vector< double > &a_linAplus, const std::vector< double > &a_linA, const int &a_M, const int &a_N)
Compute the pseudoinverse of matrix through singular value decomposition.
Definition: CD_LaPackUtils.cpp:163
void linearizeRowMajorMatrix(std::vector< double > &a_linA, int &a_M, int &a_N, const std::vector< std::vector< double >> &a_A)
Linearize a matrix to column major Fortran form by row major format of the input matrix.
Definition: CD_LaPackUtils.cpp:379
void deLinearizeMatrix(std::vector< std::vector< double >> &a_A, const int &a_M, const int &a_N, const std::vector< double > &a_linA, const char &a_format)
Delinearize a linearized matrix from column major Fortran to row or major colum matrix format.
Definition: CD_LaPackUtils.cpp:459