cyqlone develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
Loading...
Searching...
No Matches
cyqlone::linalg Namespace Reference

Namespaces

namespace  multi

Single-batch operations

template<simdifiable Vx>
norms< simdified_value_t< Vx > >::result norms_all (Vx &&x)
 Compute the norms (max, 1-norm, and 2-norm) of a vector.
template<simdifiable Vx>
simdified_value_t< Vx > norm_inf (Vx &&x)
 Compute the infinity norm of a vector.
template<simdifiable Vx>
simdified_value_t< Vx > norm_1 (Vx &&x)
 Compute the 1-norm of a vector.
template<simdifiable Vx>
simdified_value_t< Vx > norm_2_squared (Vx &&x)
 Compute the squared 2-norm of a vector.
template<simdifiable Vx>
simdified_value_t< Vx > norm_2 (Vx &&x)
 Compute the 2-norm of a vector.
template<simdifiable Vx, simdifiable Vy>
simdified_value_t< Vx > dot (Vx &&x, Vy &&y)
 Compute the dot product of two vectors.
template<simdifiable Vx, simdifiable Vz, std::convertible_to< simdified_value_t< Vx > > T>
void scale (T alpha, Vx &&x, Vz &&z)
 Multiply a vector by a scalar z = αx.
template<simdifiable Vx, std::convertible_to< simdified_value_t< Vx > > T>
void scale (T alpha, Vx &&x)
 Multiply a vector by a scalar x = αx.
template<simdifiable Vx, simdifiable Vy, simdifiable Vz>
void hadamard (Vx &&x, Vy &&y, Vz &&z)
 Compute the Hadamard (elementwise) product of two vectors z = x ⊙ y.
template<simdifiable Vx, simdifiable Vy>
void hadamard (Vx &&x, Vy &&y)
 Compute the Hadamard (elementwise) product of two vectors x = x ⊙ y.
template<simdifiable Vx, simdifiable Vlo, simdifiable Vhi, simdifiable Vz>
void clamp (Vx &&x, Vlo &&lo, Vhi &&hi, Vz &&z)
 Elementwise clamping z = max(lo, min(x, hi)).
template<simdifiable Vx, simdifiable Vlo, simdifiable Vhi, simdifiable Vz>
void clamp_resid (Vx &&x, Vlo &&lo, Vhi &&hi, Vz &&z)
 Elementwise clamping residual z = x - max(lo, min(x, hi)).
template<simdifiable Vx, simdifiable Vy, simdifiable Vz, std::convertible_to< simdified_value_t< Vx > > Ta, std::convertible_to< simdified_value_t< Vx > > Tb>
void axpby (Ta alpha, Vx &&x, Tb beta, Vy &&y, Vz &&z)
 Add scaled vector z = αx + βy.
template<simdifiable Vx, simdifiable Vy, std::convertible_to< simdified_value_t< Vx > > Ta, std::convertible_to< simdified_value_t< Vx > > Tb>
void axpby (Ta alpha, Vx &&x, Tb beta, Vy &&y)
 Add scaled vector y = αx + βy.
template<auto Beta = 1, simdifiable Vy, simdifiable... Vx>
void axpy (Vy &&y, const std::array< simdified_value_t< Vy >, sizeof...(Vx)> &alphas, Vx &&...x)
 Add scaled vector y = ∑ᵢ αᵢxᵢ + βy.
template<simdifiable Vx, simdifiable Vy, simdifiable Vz, std::convertible_to< simdified_value_t< Vx > > Ta>
void axpy (Ta alpha, Vx &&x, Vy &&y, Vz &&z)
 Add scaled vector z = αx + y.
template<auto Beta = 1, simdifiable Vx, simdifiable Vy, std::convertible_to< simdified_value_t< Vx > > Ta>
void axpy (Ta alpha, Vx &&x, Vy &&y)
 Add scaled vector y = αx + βy (where β is a compile-time constant).
template<simdifiable VA, simdifiable VB, int Rotate = 0>
void negate (VA &&A, VB &&B, with_rotate_t< Rotate >={})
 Negate a matrix or vector B = -A.
template<simdifiable VA, int Rotate = 0>
void negate (VA &&A, with_rotate_t< Rotate >={})
 Negate a matrix or vector A = -A.
template<simdifiable VA, simdifiable VB, simdifiable VC, int Rotate = 0>
void sub (VA &&A, VB &&B, VC &&C, with_rotate_t< Rotate >={})
 Subtract two matrices or vectors C = A - B. Rotate affects B.
template<simdifiable VA, simdifiable VB, int Rotate = 0>
void sub (VA &&A, VB &&B, with_rotate_t< Rotate >={})
 Subtract two matrices or vectors A = A - B. Rotate affects B.
template<simdifiable VA, simdifiable VB, simdifiable VC, int Rotate = 0>
void add (VA &&A, VB &&B, VC &&C, with_rotate_t< Rotate >={})
 Add two matrices or vectors C = A + B. Rotate affects B.
template<simdifiable VA, simdifiable VB, int Rotate = 0>
void add (VA &&A, VB &&B, with_rotate_t< Rotate >={})
 Add two matrices or vectors A = A + B. Rotate affects B.
template<class F, simdifiable VA, simdifiable... VAs>
void for_each_elementwise (F &&fun, VA &&A, VAs &&...As)
 Apply a function to all elements of the given matrices or vectors.
template<class F, simdifiable VA, simdifiable... VAs>
void transform_elementwise (F &&fun, VA &&A, VAs &&...As)
 Apply a function to all elements of the given matrices or vectors, storing the result in the first argument.
template<class F, simdifiable VA, simdifiable VB, simdifiable... VAs>
void transform2_elementwise (F &&fun, VA &&A, VB &&B, VAs &&...As)
 Apply a function to all elements of the given matrices or vectors, storing the results in the first two arguments.
template<class F, simdifiable... VAs, simdifiable... VBs>
void transform_n_elementwise (F &&fun, std::tuple< VAs... > As, VBs &&...Bs)
 Apply a function to all elements of the given matrices or vectors, storing the results in the tuple of matrices given as the first argument.

Multi-batch operations

template<simdifiable_multi Vx>
norms< simdified_value_t< Vx > >::result norms_all (Vx &&x)
 Compute the norms (max, 1-norm, and 2-norm) of a vector.
template<simdifiable_multi Vx>
simdified_value_t< Vx > norm_inf (Vx &&x)
 Compute the infinity norm of a vector.
template<simdifiable_multi Vx>
simdified_value_t< Vx > norm_1 (Vx &&x)
 Compute the 1-norm of a vector.
template<simdifiable_multi Vx>
simdified_value_t< Vx > norm_2_squared (Vx &&x)
 Compute the squared 2-norm of a vector.
template<simdifiable_multi Vx>
simdified_value_t< Vx > norm_2 (Vx &&x)
 Compute the 2-norm of a vector.
template<simdifiable_multi Vx, simdifiable_multi Vy>
simdified_value_t< Vx > dot (Vx &&x, Vy &&y)
 Compute the dot product of two vectors.
template<simdifiable_multi Vx, simdifiable_multi Vz, std::convertible_to< simdified_value_t< Vx > > T>
void scale (T alpha, Vx &&x, Vz &&z)
 Multiply a vector by a scalar z = αx.
template<simdifiable_multi Vx, std::convertible_to< simdified_value_t< Vx > > T>
void scale (T alpha, Vx &&x)
 Multiply a vector by a scalar x = αx.
template<simdifiable_multi Vx, simdifiable_multi Vy, simdifiable_multi Vz>
void hadamard (Vx &&x, Vy &&y, Vz &&z)
 Compute the Hadamard (elementwise) product of two vectors z = x ⊙ y.
template<simdifiable_multi Vx, simdifiable_multi Vy>
void hadamard (Vx &&x, Vy &&y)
 Compute the Hadamard (elementwise) product of two vectors x = x ⊙ y.
template<simdifiable_multi Vx, simdifiable_multi Vlo, simdifiable_multi Vhi, simdifiable_multi Vz>
void clamp (Vx &&x, Vlo &&lo, Vhi &&hi, Vz &&z)
 Elementwise clamping z = max(lo, min(x, hi)).
template<simdifiable_multi Vx, simdifiable_multi Vlo, simdifiable_multi Vhi, simdifiable_multi Vz>
void clamp_resid (Vx &&x, Vlo &&lo, Vhi &&hi, Vz &&z)
 Elementwise clamping residual z = x - max(lo, min(x, hi)).
template<simdifiable_multi Vx, simdifiable_multi Vy, simdifiable_multi Vz, std::convertible_to< simdified_value_t< Vx > > Ta, std::convertible_to< simdified_value_t< Vx > > Tb>
void axpby (Ta alpha, Vx &&x, Tb beta, Vy &&y, Vz &&z)
 Add scaled vector z = αx + βy.
template<simdifiable_multi Vx, simdifiable_multi Vy, std::convertible_to< simdified_value_t< Vx > > Ta, std::convertible_to< simdified_value_t< Vx > > Tb>
void axpby (Ta alpha, Vx &&x, Tb beta, Vy &&y)
 Add scaled vector y = αx + βy.
template<auto Beta = 1, simdifiable_multi Vy, simdifiable_multi... Vx>
void axpy (Vy &&y, const std::array< simdified_value_t< Vy >, sizeof...(Vx)> &alphas, Vx &&...x)
 Add scaled vector y = ∑ᵢ αᵢxᵢ + βy.
template<simdifiable_multi Vx, simdifiable_multi Vy, simdifiable_multi Vz, std::convertible_to< simdified_value_t< Vx > > Ta>
void axpy (Ta alpha, Vx &&x, Vy &&y, Vz &&z)
 Add scaled vector z = αx + y.
template<auto Beta = 1, simdifiable_multi Vx, simdifiable_multi Vy, std::convertible_to< simdified_value_t< Vx > > Ta>
void axpy (Ta alpha, Vx &&x, Vy &&y)
 Add scaled vector y = αx + βy (where β is a compile-time constant).
template<simdifiable_multi VA, simdifiable_multi VB, int Rotate = 0>
void negate (VA &&A, VB &&B, with_rotate_t< Rotate > rot={})
 Negate a matrix or vector B = -A.
template<simdifiable_multi VA, int Rotate = 0>
void negate (VA &&A, with_rotate_t< Rotate > rot={})
 Negate a matrix or vector A = -A.
template<simdifiable_multi VA, simdifiable_multi VB, simdifiable_multi VC, int Rotate = 0>
void sub (VA &&A, VB &&B, VC &&C, with_rotate_t< Rotate > rot={})
 Subtract two matrices or vectors C = A - B. Rotate affects B.
template<simdifiable_multi VA, simdifiable_multi VB, int Rotate = 0>
void sub (VA &&A, VB &&B, with_rotate_t< Rotate > rot={})
 Subtract two matrices or vectors A = A - B. Rotate affects B.
template<simdifiable_multi VA, simdifiable_multi VB, simdifiable_multi VC, int Rotate = 0>
void add (VA &&A, VB &&B, VC &&C, with_rotate_t< Rotate > rot={})
 Add two matrices or vectors C = A + B. Rotate affects B.
template<simdifiable_multi VA, simdifiable_multi VB, int Rotate = 0>
void add (VA &&A, VB &&B, with_rotate_t< Rotate > rot={})
 Add two matrices or vectors A = A + B. Rotate affects B.
template<class F, simdifiable_multi VA, simdifiable_multi... VAs>
void for_each_elementwise (F &&fun, VA &&A, VAs &&...As)
 Apply a function to all elements of the given matrices or vectors.
template<class F, simdifiable_multi VA, simdifiable_multi... VAs>
void transform_elementwise (F &&fun, VA &&A, VAs &&...As)
 Apply a function to all elements of the given matrices or vectors, storing the result in the first argument.
template<class F, simdifiable_multi VA, simdifiable_multi VB, simdifiable_multi... VAs>
void transform2_elementwise (F &&fun, VA &&A, VB &&B, VAs &&...As)
 Apply a function to all elements of the given matrices or vectors, storing the results in the first two arguments.
template<class F, simdifiable_multi... VAs, simdifiable_multi... VBs>
void transform_n_elementwise (F &&fun, std::tuple< VAs... > As, VBs &&...Bs)
 Apply a function to all elements of the given matrices or vectors, storing the results in the tuple of matrices given as the first argument.
template<simdifiable_multi VA, simdifiable_multi VB, batmat::linalg::rotate_opt... Opts>
void copy (VA &&A, VB &&B, Opts... opts)
 Copy a matrix or vector B = A.
template<MatrixStructure S, simdifiable_multi VA, simdifiable_multi VB, batmat::linalg::rotate_opt... Opts>
void copy (Structured< VA, S > A, Structured< VB, S > B, Opts... opts)
 Copy a matrix or vector B = A.

Packing and unpacking

template<simdifiable VA, class VB>
void unpack (VA &&A, VB &&B)
 Copy a compact batch of matrices A to multiple scalar matrices B.
template<class VA, simdifiable VB>
void pack (VA &&A, VB &&B)
 Copy multiple scalar matrices A to a compact batch of matrices B.