10#ifndef TLAPACK_GETRF_RECURSIVE_HH
11#define TLAPACK_GETRF_RECURSIVE_HH
55template <TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR piv_t>
67 const idx_t m = nrows(
A);
68 const idx_t n = ncols(
A);
69 const idx_t
k = min(m, n);
75 if (m <= 0 || n <= 0)
return 0;
103 A(
piv[0], 0) =
A(0, 0);
109 auto l = slice(
A,
range(1, m), 0);
118 auto A0 = tlapack::cols(
A,
range(0, m));
119 auto A1 = tlapack::cols(
A,
range(m, n));
125 for (idx_t j = 0; j <
k; j++) {
126 if ((idx_t)
piv[j] != j) {
127 auto vect1 = tlapack::row(
A1, j);
154 for (idx_t j = 0; j <
k0; j++) {
155 if ((idx_t)
piv0[j] != j) {
156 auto vect1 = tlapack::row(
A1, j);
183 for (idx_t j = 0; j <
k -
k0; j++) {
184 if ((idx_t)
piv1[j] != j) {
193 for (idx_t i = 0; i <
k -
k0; i++) {
constexpr internal::LowerTriangle LOWER_TRIANGLE
Lower Triangle access.
Definition types.hpp:188
constexpr internal::UnitDiagonal UNIT_DIAG
The main diagonal is assumed to consist of 1's.
Definition types.hpp:222
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:260
constexpr internal::LeftSide LEFT_SIDE
left side
Definition types.hpp:294
void rscl(const alpha_t &alpha, vector_t &x)
Scale vector by the reciprocal of a constant, .
Definition rscl.hpp:22
void swap(vectorX_t &x, vectorY_t &y)
Swap vectors, .
Definition swap.hpp:31
size_type< vector_t > iamax(const vector_t &x, const IamaxOpts< abs_f > &opts)
Return .
Definition iamax.hpp:234
void gemm(Op transA, Op transB, const alpha_t &alpha, const matrixA_t &A, const matrixB_t &B, const beta_t &beta, matrixC_t &C)
General matrix-matrix multiply:
Definition gemm.hpp:61
void trsm(Side side, Uplo uplo, Op trans, Diag diag, const alpha_t &alpha, const matrixA_t &A, matrixB_t &B)
Solve the triangular matrix-vector equation.
Definition trsm.hpp:76
int getrf_recursive(matrix_t &A, piv_t &piv)
getrf_recursive computes an LU factorization of a general m-by-n matrix A using partial pivoting with...
Definition getrf_recursive.hpp:56
#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
Options for iamax.
Definition iamax.hpp:37