10#ifndef TLAPACK_GETRI_HH
11#define TLAPACK_GETRI_HH
46template <
class T, TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR piv_t>
51 if (opts.variant == GetriVariant::UXLI)
52 return getri_uxli_worksize<T>(A, opts);
73 using idx_t = size_type<matrix_t>;
76 const idx_t n = ncols(A);
80 if (opts.variant == GetriVariant::UXLI)
86 if (info != 0)
return info;
89 for (idx_t j = n; j-- > 0;) {
91 auto vect1 = tlapack::col(A, j);
92 auto vect2 = tlapack::col(A, piv[j]);
121template <TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR piv_t>
124 using idx_t = size_type<matrix_t>;
127 const idx_t n = ncols(A);
131 if (opts.variant == GetriVariant::UXLI)
137 if (info != 0)
return info;
140 for (idx_t j = n; j-- > 0;) {
142 auto vect1 = tlapack::col(A, j);
143 auto vect2 = tlapack::col(A, piv[j]);
#define TLAPACK_SMATRIX
Macro for tlapack::concepts::SliceableMatrix compatible with C++17.
Definition concepts.hpp:899
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
GetriVariant
Variants of the algorithm to compute the inverse of a matrix.
Definition getri.hpp:21
@ UILI
Method D from doi:10.1137/1.9780898718027.
@ UXLI
Method C from doi:10.1137/1.9780898718027.
int getri_uxli(matrix_t &A)
getri computes inverse of a general n-by-n matrix A by solving for X in the following equation
Definition getri_uxli.hpp:115
void swap(vectorX_t &x, vectorY_t &y)
Swap vectors, .
Definition swap.hpp:31
int getri_uili(matrix_t &A)
getri_uili calculates the inverse of a general n-by-n matrix A
Definition getri_uili.hpp:39
int getri_uxli_work(matrix_t &A, work_t &work)
getri computes inverse of a general n-by-n matrix A by solving for X in the following equation Work...
Definition getri_uxli.hpp:46
int getri_work(matrix_t &A, const piv_t &piv, work_t &work, const GetriOpts &opts={})
getri computes inverse of a general n-by-n matrix A Workspace is provided as an argument.
Definition getri.hpp:68
int getri(matrix_t &A, const piv_t &piv, const GetriOpts &opts={})
getri computes inverse of a general n-by-n matrix A
Definition getri.hpp:122
constexpr WorkInfo getri_worksize(const matrix_t &A, const piv_t &piv, const GetriOpts &opts={})
Worspace query of getri()
Definition getri.hpp:47
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113
Options struct for getri()
Definition getri.hpp:27
Output information in the workspace query.
Definition workspace.hpp:16