25namespace nda::linalg {
48 static_assert(nda::mem::have_host_compatible_addr_space<
decltype(ipiv)>);
49 EXPECTS(m >= ipiv.size());
51 for (
int i = 0; i < ipiv.size(); ++i)
std::swap(sigma(i), sigma(ipiv(i) - 1));
73 template <Scalar T,
typename LP = F_layout>
75 static_assert(nda::mem::have_host_compatible_addr_space<
decltype(sigma)>);
78 for (
int i = 0; i < m; ++i) (column_permutations ? P(sigma(i), i) : P(i, sigma(i))) = T{1};
97 template <Scalar T,
typename LP = F_layout>
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides the generic class for arrays.
void swap(nda::basic_array_view< V1, R1, LP1, A1, AP1, OP1 > &a, nda::basic_array_view< V2, R2, LP2, A2, AP2, OP2 > &b)=delete
std::swap is deleted for nda::basic_array_view.
Provides basic functions to create and manipulate arrays and views.
static basic_array zeros(std::array< Int, Rank > const &shape)
Check if a given type is a vector, i.e. an nda::ArrayOfRank<1>.
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
Provides a custom runtime error class and macros to assert conditions and throw exceptions.
auto arange(long first, long last, long step=1)
Make a 1-dimensional integer array and initialize it with values of a given nda::range.
basic_array< ValueType, 1, C_layout, 'V', ContainerPolicy > vector
Alias template of an nda::basic_array with rank 1 and a 'V' algebra.
auto get_permutation_matrix(Vector auto const &sigma, bool column_permutations=false)
Get the permutation matrix from a permutation vector .
auto get_permutation_vector(Vector auto const &ipiv, int m)
Get the permutation vector from the pivot indices returned by nda::lapack::getrf or other LAPACK rou...
Provides definitions of various layout policies.
Macros used in the nda library.
Provides type traits for the nda library.