12#ifndef TLAPACK_LACPY_HH
13#define TLAPACK_LACPY_HH
45 const idx_t m = nrows(
A);
46 const idx_t n = ncols(
A);
50 uplo != Uplo::General);
52 if (
uplo == Uplo::Upper) {
54 for (idx_t j = 0; j < n; ++j) {
55 const idx_t
M = min(m, j + 1);
56 for (idx_t i = 0; i <
M; ++i)
57 B(i, j) = (
TB)
A(i, j);
60 else if (
uplo == Uplo::Lower) {
62 const idx_t
N = min(m, n);
63 for (idx_t j = 0; j <
N; ++j)
64 for (idx_t i = j; i < m; ++i)
65 B(i, j) = (
TB)
A(i, j);
69 for (idx_t j = 0; j < n; ++j)
70 for (idx_t i = 0; i < m; ++i)
71 B(i, j) = (
TB)
A(i, j);
#define TLAPACK_UPLO
Macro for tlapack::concepts::Uplo compatible with C++17.
Definition concepts.hpp:942
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
void lacpy(uplo_t uplo, const matrixA_t &A, matrixB_t &B)
Copies a matrix from A to B.
Definition lacpy.hpp:38
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
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