10#ifndef TLAPACK_INFNORM_TR_COLMAJOR_HH
11#define TLAPACK_INFNORM_TR_COLMAJOR_HH
72 const idx_t m = nrows(
A);
73 const idx_t n = ncols(
A);
76 if (m == 0 || n == 0)
return real_t(0);
84 for (idx_t i = 0; i < n; ++i)
87 if (
uplo == Uplo::Upper) {
88 if (
diag == Diag::NonUnit) {
89 for (idx_t i = 0; i < m; ++i)
92 for (idx_t j = 0; j < n; ++j)
93 for (idx_t i = 0; i <= min(j, m - 1); ++i)
97 for (idx_t i = 0; i < m; ++i)
100 for (idx_t j = 1; j < n; ++j) {
101 for (idx_t i = 0; i < min(j, m); ++i)
102 w[i] += abs(
A(i, j));
107 if (
diag == Diag::NonUnit) {
108 for (idx_t i = 0; i < m; ++i)
111 for (idx_t j = 0; j < n; ++j)
112 for (idx_t i = j; i < m; ++i)
113 w[i] += abs(
A(i, j));
116 for (idx_t i = 0; i < min(m, n); ++i)
118 for (idx_t i = n; i < m; ++i)
121 for (idx_t j = 1; j < n; ++j) {
122 for (idx_t i = j + 1; i < m; ++i)
123 w[i] += abs(
A(i, j));
128 for (idx_t i = 0; i < m; ++i) {
161template <TLAPACK_UPLO uplo_t, TLAPACK_DIAG diag_t, TLAPACK_MATRIX matrix_t>
173 const idx_t m = nrows(
A);
174 const idx_t n = ncols(
A);
177 if (m == 0 || n == 0)
return real_t(0);
181 std::vector<T>
work_;
constexpr bool isnan(const T &x) noexcept
Extends std::isnan() to complex numbers.
Definition utils.hpp:125
#define TLAPACK_DIAG
Macro for tlapack::concepts::Diag compatible with C++17.
Definition concepts.hpp:945
#define TLAPACK_UPLO
Macro for tlapack::concepts::Uplo compatible with C++17.
Definition concepts.hpp:942
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
constexpr auto diag(T &A, int diagIdx=0) noexcept
Get the Diagonal of an Eigen Matrix.
Definition eigen.hpp:576
auto infnorm_triangular_colmajor(uplo_t uplo, diag_t diag, const matrix_t &A)
Calculates the infinity norm of a column-major triangular matrix.
Definition infnorm_triangular_colmajor.hpp:162
auto infnorm_triangular_colmajor_work(uplo_t uplo, diag_t diag, const matrix_t &A, work_t &work)
Calculates the infinity norm of a column-major triangular matrix. Workspace is provided as an argum...
Definition infnorm_triangular_colmajor.hpp:57
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
constexpr WorkInfo infnorm_triangular_colmajor_worksize(uplo_t uplo, diag_t diag, const matrix_t &A)
Worspace query of infnorm_triangular_colmajor()
Definition infnorm_triangular_colmajor.hpp:38
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
Output information in the workspace query.
Definition workspace.hpp:16