dot-xx
A personal collection of small C++ modules
Loading...
Searching...
No Matches
dxx.math.linalg Module Reference

Linear algebra utilities for dxx::math. More...

Concepts

concept  dxx::math::vector
 We can treat any input range as a vector.
concept  dxx::math::mut_vector
 A vector for which the elements can be written to.
concept  dxx::math::vector_like
 Vector for which the element type is convertible to a target vector's type.
concept  dxx::math::mut_vector_like
 Similar to vector_like, but also satisfies mut_vector.

Classes

struct  dxx::math::Norm< Func, SqFunc >
 Defines a norm. Only norm field is required, all other fields can be assigned a nullptr More...

Typedefs

template<typename T>
using dxx::math::RealOf = detail::RealOf<T>::Type
 (Non-cv-qualified) Real type of the linalg type

Functions

template<mut_vector Out, vector_like< Out > U, vector_like< Out > V>
void dxx::math::cross (const U &u, const V &v, Out &out)
 Cross product of two 3D vectors (via out parameter)
template<mut_vector Out, vector_like< Out > U, vector_like< Out > V>
constexpr Out dxx::math::cross (const U &u, const V &v)
 Cross product of two 3D vectors (via return value)
template<mut_vector U, vector_like< U > V>
constexpr U dxx::math::cross (const U &u, const V &v)
 Cross product of two 3D vectors (via return value of default type)
template<vector U, vector_like< U > V>
constexpr RealOf< U > dxx::math::dot (const U &u, const V &v)
template<Norm t_norm = norms::euclidean, vector V>
constexpr RealOf< V > dxx::math::norm (const V &v)
 Calculates norm t_norm for vector v
template<Norm t_norm = norms::euclidean, vector V>
constexpr RealOf< V > dxx::math::sq_norm (const V &v)
 Calculates the square of the norm t_norm for vector v
template<Norm t_norm = norms::euclidean, vector V, vector_like< V > U>
constexpr RealOf< V > dxx::math::dist (const V &v, const U &u)
 Calculates the distance between vector v and u according to norm t_norm
template<Norm t_norm = norms::euclidean, vector V, vector_like< V > U>
constexpr RealOf< V > dxx::math::sq_dist (const V &v, const U &u)
 Calculates the square of the distance between vector v and u according to norm t_norm

Variables

constexpr Norm dxx::math::norms::euclidean
 Euclidean norm (2-norm)
constexpr Norm dxx::math::norms::p_one
 1-norm (sum of absolute values of elements)
constexpr Norm dxx::math::norms::infinity
 Infinity norm (max absolute value across elements)

Detailed Description

Linear algebra utilities for dxx::math.

Files

file  /build-llvm-libcpp/_deps/dot-xx-math-src/src/linalg/linalg.xx
 Linear algebra utilities for dxx::math.
file  /build-llvm-libcpp/_deps/dot-xx-math-src/src/linalg/cross.xx
 Cross product of 3D vectors.
file  /build-llvm-libcpp/_deps/dot-xx-math-src/src/linalg/dot.xx
 Dot product.
file  /build-llvm-libcpp/_deps/dot-xx-math-src/src/linalg/norm.xx
 Vector norms.
file  /build-llvm-libcpp/_deps/dot-xx-math-src/src/linalg/traits.xx
 Type traits and concepts for linear algebra utilities.