BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_gels.hpp File Reference

Least-squares or minimum-norm solution of a full-rank system (LAPACK ?gels). More...

#include <algorithm>
#include <complex>
#include "assert.hpp"
#include "cl_Vector.hpp"
#include "cl_Matrix.hpp"
#include "lapacktools.hpp"
Include dependency graph for fn_gels.hpp:

Go to the source code of this file.

Namespaces

namespace  belfem
 USER GUIDES:
namespace  belfem::lapack

Functions

void belfem::lapack::sgels_ (char *trans, int_t *m, int_t *n, int_t *nrhs, float *a, int_t *lda, float *b, int_t *ldb, float *work, int_t *lwork, int_t *info, fortran_charlen_t lt)
void belfem::lapack::dgels_ (char *trans, int_t *m, int_t *n, int_t *nrhs, double *a, int_t *lda, double *b, int_t *ldb, double *work, int_t *lwork, int_t *info, fortran_charlen_t lt)
void belfem::lapack::cgels_ (char *trans, int_t *m, int_t *n, int_t *nrhs, cplx_float_t *a, int_t *lda, cplx_float_t *b, int_t *ldb, cplx_float_t *work, int_t *lwork, int_t *info, fortran_charlen_t lt)
void belfem::lapack::zgels_ (char *trans, int_t *m, int_t *n, int_t *nrhs, cplx_double_t *a, int_t *lda, cplx_double_t *b, int_t *ldb, cplx_double_t *work, int_t *lwork, int_t *info, fortran_charlen_t lt)
template<typename T>
void belfem::lapack::gels (const char *trans, const int_t *m, const int_t *n, const int_t *nrhs, T *a, const int_t *lda, T *b, const int_t *ldb, T *work, const int_t *lwork, int_t *info)
template<>
void belfem::lapack::gels (const char *trans, const int_t *m, const int_t *n, const int_t *nrhs, float *a, const int_t *lda, float *b, const int_t *ldb, float *work, const int_t *lwork, int_t *info)
template<>
void belfem::lapack::gels (const char *trans, const int_t *m, const int_t *n, const int_t *nrhs, double *a, const int_t *lda, double *b, const int_t *ldb, double *work, const int_t *lwork, int_t *info)
template<>
void belfem::lapack::gels (const char *trans, const int_t *m, const int_t *n, const int_t *nrhs, std::complex< float > *a, const int_t *lda, std::complex< float > *b, const int_t *ldb, std::complex< float > *work, const int_t *lwork, int_t *info)
template<>
void belfem::lapack::gels (const char *trans, const int_t *m, const int_t *n, const int_t *nrhs, std::complex< double > *a, const int_t *lda, std::complex< double > *b, const int_t *ldb, std::complex< double > *work, const int_t *lwork, int_t *info)
template<typename T>
int_t belfem::gels (Matrix< T > &A, Vector< T > &B, Vector< T > &Work, const bool AbortOnError=true)
 solve the least squares problem min || A * x - b || via LAPACK ?gels ( QR or LQ factorization, A must have full rank )
template<typename T>
int_t belfem::gels (Matrix< T > &A, Matrix< T > &B, Vector< T > &Work, const bool AbortOnError=true)
 solve min || A * X - B || for multiple right hand sides, see the single right hand side version above

Detailed Description

Least-squares or minimum-norm solution of a full-rank system (LAPACK ?gels).

Thin wrapper over the Fortran routine: BELFEM containers are passed straight through after their leading dimensions are worked out. Arguments are not copied – see each parameter for what is overwritten in place.