TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
matrix_functions.hpp File Reference
#include "./accessors.hpp"
#include "./concepts.hpp"
#include "./declarations.hpp"
#include "./layout/policies.hpp"
#include "./layout_transforms.hpp"
#include "./macros.hpp"
#include "./mapped_functions.hpp"
#include "./mem/policies.hpp"
#include "./stdutil/array.hpp"
#include <algorithm>
#include <concepts>
#include <ranges>
#include <type_traits>

Detailed Description

Provides functions to create and manipulate matrices, i.e. arrays/view with 'M' algebra.

Definition in file matrix_functions.hpp.

Go to the source code of this file.

Functions

template<ArrayOfRank< 2 > M>
ArrayOfRank< 2 > auto nda::dagger (M const &m)
 Get the conjugate transpose of 2-dimensional array/view.
 
template<typename V >
requires (std::ranges::contiguous_range<V> or ArrayOfRank<V, 1>)
ArrayOfRank< 2 > auto nda::diag (V const &v)
 Get a new nda::matrix with the given values on the diagonal.
 
template<MemoryArrayOfRank< 2 > M>
ArrayOfRank< 1 > auto nda::diagonal (M &m)
 Get a view of the diagonal of a 2-dimensional array/view.
 
template<Scalar S, std::integral Int = long>
auto nda::eye (Int dim)
 Create an identity nda::matrix with ones on the diagonal.
 
template<ArrayOfRank< 2 > M>
auto nda::trace (M const &m)
 Get the trace of a 2-dimensional square array/view.
 
template<ArrayOfRank< 2 > A, ArrayOfRank< 2 > B>
requires (std::same_as<get_value_t<A>, get_value_t<B>>)
matrix< get_value_t< A > > nda::vstack (A const &a, B const &b)
 Stack two 2-dimensional arrays/views vertically.