30 # include <itpp/config.h> 32 # include <itpp/config_msvc.h> 35 #if defined(HAVE_LAPACK) 36 # include <itpp/base/algebra/lapack.h> 45 #if defined(HAVE_LAPACK) 47 bool inv(
const mat &X, mat &Y)
51 int m = X.rows(), info, lwork;
58 dgetrf_(&m, &m, Y._data(), &m, p._data(), &info);
62 dgetri_(&m, Y._data(), &m, p._data(), work._data(), &lwork, &info);
66 bool inv(
const cmat &X, cmat &Y)
70 int m = X.rows(), info, lwork;
77 zgetrf_(&m, &m, Y._data(), &m, p._data(), &info);
81 zgetri_(&m, Y._data(), &m, p._data(), work._data(), &lwork, &info);
87 bool inv(
const mat &X, mat &Y)
89 it_error(
"LAPACK library is needed to use inv() function");
93 bool inv(
const cmat &X, cmat &Y)
95 it_error(
"LAPACK library is needed to use inv() function");
Definitions of matrix inversion routines.
#define it_assert_debug(t, s)
Abort if t is not true and NDEBUG is not defined.
bool inv(const mat &X, mat &Y)
Inverse of real square matrix.Calculate the inverse of the real matrix .
#define it_error(s)
Abort unconditionally.