13#ifndef CD_LaPackUtils_H
14#define CD_LaPackUtils_H
20#include <CD_NamespaceHeader.H>
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.
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25
Namespace containing various useful linear algebra routines using LaPACK.
Definition CD_LaPackUtils.H:127
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
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
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
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
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
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
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
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 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