22#ifndef BELFEM_FN_GETRI_HPP
23#define BELFEM_FN_GETRI_HPP
90 template<
typename T >
101 "getri not implemented for selected data type" );
118 const_cast< int_t *
>( lda ),
121 const_cast< int_t *
>( lwork ),
139 const_cast< int_t *
>( lda ),
142 const_cast< int_t *
>( lwork ),
151 std::complex< float > * a,
154 std::complex< float > * work,
160 const_cast< int_t *
>( lda ),
163 const_cast< int_t *
>( lwork ),
172 std::complex< double > * a,
175 std::complex< double > * work,
181 const_cast< int_t *
>( lda ),
184 const_cast< int_t *
>( lwork ),
205 template<
typename T >
210 "Matrix A must be square ( is %lu x %lu )",
211 (
long unsigned int ) A.
n_rows(),
212 (
long unsigned int ) A.
n_cols() );
215 "Pivot vector is too short ( %lu, need %lu )",
216 (
long unsigned int ) Pivot.
length(),
217 (
long unsigned int ) A.
n_rows() );
223 int_t lwork = std::max< int_t >( 1, n );
225 if (
static_cast< int_t >( Work.
length() ) < lwork )
235 "LAPACK getri workspace query has thrown an error: %i", (
int ) info );
237 if ( info != 0 )
return info ;
252 "LAPACK getri has thrown an error: %i", (
int ) info );
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Dense column-major matrix.
Definition cl_BZ_Matrix.hpp:28
size_t n_rows() const
Definition cl_AR_Matrix.hpp:205
size_t n_cols() const
Definition cl_AR_Matrix.hpp:213
T * data()
Definition cl_AR_Matrix.hpp:135
T * data()
expose the underlying raw pointer ( writable version )
Definition cl_AR_Vector.hpp:182
void set_size(const size_t aNumRows)
change the size of the vector
Definition cl_AR_Vector.hpp:237
size_t length() const
get the length of the vector
Definition cl_AR_Vector.hpp:257
Definition fn_gees.hpp:33
void sgetri_(int_t *n, float *a, int_t *lda, int_t *ipiv, float *work, int_t *lwork, int_t *info)
void zgetri_(int_t *n, cplx_double_t *a, int_t *lda, int_t *ipiv, cplx_double_t *work, int_t *lwork, int_t *info)
constexpr bool dependent_false
Definition lapacktools.hpp:49
void getri(const int_t *n, T *a, const int_t *lda, int_t *ipiv, T *work, const int_t *lwork, int_t *info)
Definition fn_getri.hpp:92
float cplx_float_t
Definition lapacktools.hpp:90
int_t leading_dimension(const Vector< T > &A)
logical length of a vector operand, as passed to LAPACK as LDB; vector storage is contiguous under bo...
Definition lapacktools.hpp:143
void cgetri_(int_t *n, cplx_float_t *a, int_t *lda, int_t *ipiv, cplx_float_t *work, int_t *lwork, int_t *info)
void dgetri_(int_t *n, double *a, int_t *lda, int_t *ipiv, double *work, int_t *lwork, int_t *info)
int_t work_size(const float &aValue)
lapack reports the optimal work size in the first entry of the work array, which stays real valued fo...
Definition lapacktools.hpp:191
double cplx_double_t
Definition lapacktools.hpp:91
USER GUIDES:
Definition cl_Capacitor.cpp:16
int_t getri(Matrix< T > &A, Vector< int_t > &Pivot, Vector< T > &Work, const bool AbortOnError=true)
invert a square matrix in place via LAPACK ?getri, using the LU factorization computed by getrf()
Definition fn_getri.hpp:207
int32_t int_t
Definition typedefs.hpp:51