TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
Various mathematical functions that can be applied to arrays and views.
Mathematical functions are (mostly) implemented as lazy expressions. That means they do not return the result right away but the following proxy object instead:
This lazy function call expression satisfies the nda::Array concept and can therefore be used to assign to or construct nda::basic_array and nda::basic_array_view objects. Another way to evaluate lazy expressions is with nda::make_regular:
Output:
Classes | |
struct | nda::expr_call< F, As > |
A lazy function call expression on arrays/views. More... | |
struct | nda::mapped< F > |
Functor that is returned by the nda::map function. More... | |
Functions | |
template<ArrayOrScalar A> | |
auto | nda::abs (A &&a) |
Function abs for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> | |
auto | nda::abs2 (A &&a) |
Function abs2 for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::acos (A &&a) |
Function acos for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::asin (A &&a) |
Function asin for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::atan (A &&a) |
Function atan for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> | |
decltype(auto) | nda::conj (A &&a) |
Function conj for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types with a complex value type). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::cos (A &&a) |
Function cos for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::cosh (A &&a) |
Function cosh for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOfRank< 2 > M> | |
ArrayOfRank< 2 > auto | nda::dagger (M const &m) |
Get the conjugate transpose of 2-dimensional array/view. | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::exp (A &&a) |
Function exp for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> | |
auto | nda::floor (A &&a) |
Function floor for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOfRank< 2 > A> | |
double | nda::frobenius_norm (A const &a) |
Calculate the Frobenius norm of a 2-dimensional array. | |
template<ArrayOrScalar A> | |
auto | nda::imag (A &&a) |
Function imag for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> | |
auto | nda::isnan (A &&a) |
Function isnan for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::log (A &&a) |
Function log for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<class F > | |
mapped< F > | nda::map (F f) |
Create a lazy function call expression on arrays/views. | |
template<ArrayOrScalar A> | |
auto | nda::pow (A &&a, double p) |
Function pow for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> | |
auto | nda::real (A &&a) |
Function real for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::sin (A &&a) |
Function sin for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::sinh (A &&a) |
Function sinh for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::sqrt (A &&a) |
Function sqrt for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::tan (A &&a) |
Function tan for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOrScalar A> requires (get_algebra<A> != 'M') | |
auto | nda::tanh (A &&a) |
Function tanh for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types). | |
template<ArrayOfRank< 2 > M> | |
auto | nda::trace (M const &m) |
Get the trace of a 2-dimensional square array/view. | |
auto nda::abs | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function abs for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::abs
applied to the object (nda::Scalar). Definition at line 96 of file mapped_functions.hxx.
auto nda::abs2 | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function abs2 for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type.. |
a | nda::ArrayOrScalar object. |
nda::detail::abs2
applied to the object (nda::Scalar). Definition at line 149 of file mapped_functions.hxx.
auto nda::acos | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function acos for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::acos
applied to the object (nda::Scalar). Definition at line 269 of file mapped_functions.hxx.
auto nda::asin | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function asin for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::asin
applied to the object (nda::Scalar). Definition at line 283 of file mapped_functions.hxx.
auto nda::atan | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function atan for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::atan
applied to the object (nda::Scalar). Definition at line 297 of file mapped_functions.hxx.
decltype(auto) nda::conj | ( | A && | a | ) |
#include <nda/mapped_functions.hpp>
Function conj for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types with a complex value type).
A | nda::ArrayOrScalar type.. |
a | nda::ArrayOrScalar object. |
Definition at line 105 of file mapped_functions.hpp.
auto nda::cos | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function cos for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::cos
applied to the object (nda::Scalar). Definition at line 185 of file mapped_functions.hxx.
auto nda::cosh | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function cosh for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::cosh
applied to the object (nda::Scalar). Definition at line 227 of file mapped_functions.hxx.
ArrayOfRank< 2 > auto nda::dagger | ( | M const & | m | ) |
#include <nda/matrix_functions.hpp>
Get the conjugate transpose of 2-dimensional array/view.
It first calls nda::transpose and then the lazy nda::conj function in case the array/view is complex valued.
M | nda::ArrayOfRank<2> type. |
m | 2-dimensional array/view. |
Definition at line 91 of file matrix_functions.hpp.
auto nda::exp | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function exp for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::exp
applied to the object (nda::Scalar). Definition at line 171 of file mapped_functions.hxx.
auto nda::floor | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function floor for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::floor
applied to the object (nda::Scalar). Definition at line 124 of file mapped_functions.hxx.
double nda::frobenius_norm | ( | A const & | a | ) |
#include <nda/algorithms.hpp>
Calculate the Frobenius norm of a 2-dimensional array.
A | nda::ArrayOfRank<2> type. |
a | Array object. |
Definition at line 172 of file algorithms.hpp.
auto nda::imag | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function imag for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::imag
applied to the object (nda::Scalar). Definition at line 110 of file mapped_functions.hxx.
auto nda::isnan | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function isnan for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type.. |
a | nda::ArrayOrScalar object. |
nda::detail::isnan
applied to the object (nda::Scalar). Definition at line 160 of file mapped_functions.hxx.
auto nda::log | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function log for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::log
applied to the object (nda::Scalar). Definition at line 311 of file mapped_functions.hxx.
mapped< F > nda::map | ( | F | f | ) |
#include <nda/map.hpp>
Create a lazy function call expression on arrays/views.
The callable should take the array/view elements as arguments.
F | Callable type. |
f | Callable object. |
auto nda::pow | ( | A && | a, |
double | p ) |
#include <nda/mapped_functions.hpp>
Function pow for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type.. |
a | nda::ArrayOrScalar object. |
p | Exponent value. |
std::pow
applied to the object (nda::Scalar). Definition at line 88 of file mapped_functions.hpp.
auto nda::real | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function real for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type.. |
a | nda::ArrayOrScalar object. |
nda::detail::real
applied to the object (nda::Scalar). Definition at line 138 of file mapped_functions.hxx.
auto nda::sin | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function sin for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::sin
applied to the object (nda::Scalar). Definition at line 199 of file mapped_functions.hxx.
auto nda::sinh | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function sinh for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::sinh
applied to the object (nda::Scalar). Definition at line 241 of file mapped_functions.hxx.
auto nda::sqrt | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function sqrt for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::sqrt
applied to the object (nda::Scalar). Definition at line 325 of file mapped_functions.hxx.
auto nda::tan | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function tan for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::tan
applied to the object (nda::Scalar). Definition at line 213 of file mapped_functions.hxx.
auto nda::tanh | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Function tanh for non-matrix nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
A | nda::ArrayOrScalar type. |
a | nda::ArrayOrScalar object. |
std::tanh
applied to the object (nda::Scalar). Definition at line 255 of file mapped_functions.hxx.
auto nda::trace | ( | M const & | m | ) |
#include <nda/matrix_functions.hpp>
Get the trace of a 2-dimensional square array/view.
M | nda::ArrayOfRank<2> type. |
m | 2-dimensional array/view. |
Definition at line 70 of file matrix_functions.hpp.