10#ifndef TLAPACK_GETRF_LV0_HH
11#define TLAPACK_GETRF_LV0_HH
49template <TLAPACK_MATRIX matrix_t, TLAPACK_VECTOR piv_t>
57 const idx_t m = nrows(
A);
58 const idx_t n = ncols(
A);
59 const idx_t
end = min(m, n);
65 if (m <= 0 || n <= 0)
return 0;
67 for (idx_t j = 0; j <
end; j++) {
70 for (idx_t i = j + 1; i < m; i++) {
81 if ((idx_t)
piv[j] != j) {
82 for (idx_t i = 0; i < n; i++) {
84 A(j, i) =
A(
piv[j], i);
92 for (idx_t i = j + 1; i < m; i++) {
97 for (idx_t row = j + 1; row < m; row++) {
98 for (idx_t col = j + 1; col < n; col++) {
99 A(row, col) -=
A(row, j) *
A(j, col);
constexpr real_type< T > abs1(const T &x)
1-norm absolute value, |Re(x)| + |Im(x)|
Definition utils.hpp:133
int getrf_level0(matrix_t &A, piv_t &piv)
getrf computes an LU factorization of a general m-by-n matrix A using partial pivoting with row inter...
Definition getrf_level0.hpp:50
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
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