22#ifndef BELFEM_FN_GESV_HPP
23#define BELFEM_FN_GESV_HPP
91 template<
typename T >
103 "gesv not implemented for selected data type" );
120 const_cast< int_t *
> ( n ),
121 const_cast< int_t *
> ( nrhs ),
123 const_cast< int_t *
> ( lda ),
126 const_cast< int_t *
> ( ldb ),
144 const_cast< int_t *
> ( n ),
145 const_cast< int_t *
> ( nrhs ),
147 const_cast< int_t *
> ( lda ),
150 const_cast< int_t *
> ( ldb ),
160 std::complex< float > * a,
163 std::complex< float > * b,
168 const_cast< int_t *
> ( n ),
169 const_cast< int_t *
> ( nrhs ),
171 const_cast< int_t *
> ( lda ),
174 const_cast< int_t *
> ( ldb ),
184 std::complex< double > * a,
187 std::complex< double > * b,
192 const_cast< int_t *
> ( n ),
193 const_cast< int_t *
> ( nrhs ),
195 const_cast< int_t *
> ( lda ),
198 const_cast< int_t *
> ( ldb ) ,
220 template<
typename T >
223 const bool AbortOnError =
true )
226 "Matrix A must be square ( is %lu x %lu )",
227 (
long unsigned int ) A.
n_rows(),
228 (
long unsigned int ) A.
n_cols() );
231 "Length of right hand side does not match ( %lu vs %lu )",
232 (
long unsigned int ) B.length(),
233 (
long unsigned int ) A.
n_rows() );
236 "Pivot vector is too short ( %lu, need %lu )",
237 (
long unsigned int ) Pivot.
length(),
238 (
long unsigned int ) A.
n_rows() );
262 "LAPACK gesv has thrown an error: %i", (
int ) info );
281 template<
typename T >
286 "Matrix A must be square ( is %lu x %lu )",
287 (
long unsigned int ) A.
n_rows(),
288 (
long unsigned int ) A.
n_cols() );
291 "Number of rows of right hand side does not match ( %lu vs %lu )",
292 (
long unsigned int ) B.n_rows(),
293 (
long unsigned int ) A.
n_rows() );
296 "Pivot vector is too short ( %lu, need %lu )",
297 (
long unsigned int ) Pivot.
length(),
298 (
long unsigned int ) A.
n_rows() );
322 "LAPACK gesv 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
Column vector.
Definition cl_BZ_Vector.hpp:41
T * data()
expose the underlying raw pointer ( writable version )
Definition cl_AR_Vector.hpp:182
size_t length() const
get the length of the vector
Definition cl_AR_Vector.hpp:257
Definition fn_gees.hpp:33
void dgesv_(int_t *n, int_t *nrhs, double *a, int_t *lda, int_t *ipiv, double *b, int_t *ldb, int_t *info)
constexpr bool dependent_false
Definition lapacktools.hpp:49
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 sgesv_(int_t *n, int_t *nrhs, float *a, int_t *lda, int_t *ipiv, float *b, int_t *ldb, int_t *info)
void cgesv_(int_t *n, int_t *nrhs, cplx_float_t *a, int_t *lda, int_t *ipiv, cplx_float_t *b, int_t *ldb, int_t *info)
void gesv(const int_t *n, const int_t *nrhs, T *a, const int_t *lda, int_t *ipiv, T *b, const int_t *ldb, int_t *info)
Definition fn_gesv.hpp:93
double cplx_double_t
Definition lapacktools.hpp:91
void zgesv_(int_t *n, int_t *nrhs, cplx_double_t *a, int_t *lda, int_t *ipiv, cplx_double_t *b, int_t *ldb, int_t *info)
USER GUIDES:
Definition cl_Capacitor.cpp:16
int_t gesv(Matrix< T > &A, Vector< T > &B, Vector< int_t > &Pivot, const bool AbortOnError=true)
solve the square linear system A * x = b via LAPACK ?gesv ( LU factorization with partial pivoting )
Definition fn_gesv.hpp:222
int32_t int_t
Definition typedefs.hpp:51