Chemical Data Processing Library C++ API - Version 1.4.0
Classes | Typedefs | Functions
CDPL::Math Namespace Reference

Contains classes and functions related to mathematics. More...

Classes

class  MatrixReference
 Lightweight matrix expression that proxies a reference to an underlying matrix container. More...
 
class  Vector
 Dynamically-sized dense vector with configurable underlying storage. More...
 
class  Matrix
 Dynamically-sized dense row-major matrix with configurable underlying storage. More...
 
class  RotationMatrix
 \( N \times N \) rotation matrix backed by a unit quaternion (or an axis-angle representation). More...
 
class  ScalingMatrix
 \( N \times N \) diagonal scaling matrix. More...
 
class  TranslationMatrix
 \( N \times N \) translation matrix in homogeneous coordinates. More...
 
class  BFGSMinimizer
 Fletcher's implementation of the BFGS method. More...
 
struct  CommonType
 Trait that resolves the common arithmetic type of T1 and T2 via std::common_type. More...
 
class  DirectAssignmentProxy
 Proxy that converts an assignment to a Math container into the corresponding direct-assignment call on the container (assign / plusAssign / minusAssign) bypassing alias detection. More...
 
class  Expression
 CRTP base class for all numeric expression types in the Math namespace (Barton-Nackman idiom). More...
 
class  VectorExpression
 CRTP base class for all vector expression types. More...
 
class  MatrixExpression
 CRTP base class for all matrix expression types. More...
 
class  QuaternionExpression
 CRTP base class for all quaternion expression types. More...
 
class  GridExpression
 CRTP base class for all grid expression types. More...
 
class  VectorContainer
 Refinement of Math::VectorExpression marking the derived type as a concrete (writable) vector container. More...
 
class  MatrixContainer
 Refinement of Math::MatrixExpression marking the derived type as a concrete (writable) matrix container. More...
 
class  QuaternionContainer
 Refinement of Math::QuaternionExpression marking the derived type as a concrete (writable) quaternion container. More...
 
class  GridContainer
 Refinement of Math::GridExpression marking the derived type as a concrete (writable) grid container. More...
 
struct  ScalarBinaryAssignmentFunctor
 Base class for binary in-place assignment functors of the form F::apply(T1, const T2&). More...
 
struct  ScalarAssignment
 Scalar plain-assignment functor: apply(t1, t2) performs t1 = t2. More...
 
struct  ScalarAdditionAssignment
 Scalar in-place addition functor: apply(t1, t2) performs t1 += t2. More...
 
struct  ScalarSubtractionAssignment
 Scalar in-place subtraction functor: apply(t1, t2) performs t1 -= t2. More...
 
struct  ScalarMultiplicationAssignment
 Scalar in-place multiplication functor: apply(t1, t2) performs t1 *= t2. More...
 
struct  ScalarDivisionAssignment
 Scalar in-place division functor: apply(t1, t2) performs t1 /= t2. More...
 
struct  ScalarUnaryFunctor
 Base class for unary scalar functors of the form F::apply(const T&) returning a T result. More...
 
struct  ScalarNegation
 Scalar negation functor: apply(v) returns -v. More...
 
struct  ScalarConjugation
 Scalar complex-conjugation functor: apply(v) returns \( \overline{v} \) (identity for real types). More...
 
struct  ScalarRealUnaryFunctor
 Base class for unary scalar functors that return the real part of T (Math::ScalarReal, Math::ScalarImaginary). More...
 
struct  ScalarReal
 Scalar real-part functor: apply(v) returns \( \mathrm{Re}(v) \) (identity for real types). More...
 
struct  ScalarImaginary
 Scalar imaginary-part functor: apply(v) returns \( \mathrm{Im}(v) \) (zero for real types). More...
 
struct  ScalarBinaryFunctor
 Base class for binary scalar functors of the form F::apply(const T1&, const T2&) returning a Math::CommonType result. More...
 
struct  ScalarAddition
 Scalar binary addition functor: apply(t1, t2) returns t1 + t2. More...
 
struct  ScalarSubtraction
 Scalar binary subtraction functor: apply(t1, t2) returns t1 - t2. More...
 
struct  ScalarMultiplication
 Scalar binary multiplication functor: apply(t1, t2) returns t1 * t2. More...
 
struct  ScalarDivision
 Scalar binary division functor: apply(t1, t2) returns t1 / t2. More...
 
struct  VectorScalarBinaryFunctor
 Base class for binary functors that take two vectors and return a scalar (Math::VectorInnerProduct, Math::VectorAngleCosine). More...
 
struct  VectorInnerProduct
 Vector inner-product functor: apply(e1, e2) returns \( \sum_i e_1(i) \cdot e_2(i) \). More...
 
struct  VectorAngleCosine
 Functor returning the cosine of the angle between two vectors (optionally clamped to [-1, 1]). More...
 
struct  VectorBooleanBinaryFunctor
 Base class for binary functors that take two vectors and return a boolean (Math::VectorEquality and similar). More...
 
struct  VectorEquality
 Vector equality functor: apply(e1, e2) tests element-wise equality of two vector expressions. More...
 
struct  Scalar3VectorBooleanTernaryFunctor
 Base class for ternary functors that take two vectors and a scalar tolerance and return a boolean (Math::VectorToleranceEquality). More...
 
struct  VectorToleranceEquality
 Vector tolerance-equality functor: apply(e1, e2, eps) tests element-wise equality within an absolute tolerance. More...
 
struct  VectorBinaryFunctor
 Base class for binary functors that take two vectors and return a vector (Math::VectorCrossProduct). More...
 
struct  VectorCrossProduct
 Vector cross-product functor: apply(e1, e2, i) returns the i-th component of the 3-vector cross product \( e_1 \times e_2 \). More...
 
struct  VectorScalarUnaryFunctor
 Base class for unary functors that take a vector and return a scalar (Math::VectorElementSum). More...
 
struct  VectorElementSum
 Functor returning the sum of all elements of a vector expression. More...
 
struct  VectorScalarRealUnaryFunctor
 Base class for unary functors that take a vector and return a real-valued scalar (Math::VectorNorm1, Math::VectorNorm2, Math::VectorNormInfinity). More...
 
struct  VectorNorm1
 Functor returning the L1 norm of a vector expression. More...
 
struct  VectorNorm2
 Functor returning the L2 (Euclidean) norm of a vector expression. More...
 
struct  VectorNormInfinity
 Functor returning the L∞ (maximum-magnitude) norm of a vector expression. More...
 
struct  VectorScalarIndexUnaryFunctor
 Base class for unary functors that take a vector and return a vector-element index (Math::VectorNormInfinityIndex). More...
 
struct  VectorNormInfinityIndex
 Functor returning the index of the vector element with the largest L∞ norm. More...
 
struct  MatrixBooleanBinaryFunctor
 Base class for binary functors that take two matrix expressions and return a bool result (Math::MatrixEquality). More...
 
struct  MatrixEquality
 Functor checking element-wise equality of two matrix expressions. More...
 
struct  Scalar3MatrixBooleanTernaryFunctor
 Base class for ternary functors that take two matrix expressions plus a tolerance scalar and return a bool result (Math::MatrixToleranceEquality). More...
 
struct  MatrixToleranceEquality
 Functor checking element-wise approximate equality of two matrix expressions within an absolute tolerance. More...
 
struct  MatrixScalarUnaryFunctor
 Base class for unary functors that take a matrix expression and return a scalar result (Math::MatrixElementSum, Math::MatrixTrace). More...
 
struct  MatrixElementSum
 Functor returning the sum of all elements of a matrix expression. More...
 
struct  MatrixTrace
 Functor returning the trace (sum of diagonal entries) of a matrix expression. More...
 
struct  MatrixScalarRealUnaryFunctor
 Base class for unary functors that take a matrix expression and return a real-valued scalar (Math::MatrixNorm1, Math::MatrixNormFrobenius, Math::MatrixNormInfinity). More...
 
struct  MatrixNorm1
 Functor returning the L1 (maximum absolute column sum) norm of a matrix expression. More...
 
struct  MatrixNormFrobenius
 Functor returning the Frobenius norm of a matrix expression. More...
 
struct  MatrixNormInfinity
 Functor returning the L∞ (maximum absolute row sum) norm of a matrix expression. More...
 
struct  VectorMatrixUnaryFunctor
 Base class for unary functors that produce a matrix element from a vector expression and (i, j) cell indices (Math::DiagonalMatrixFromVector, Math::CrossProductMatrixFromVector). More...
 
struct  DiagonalMatrixFromVector
 Functor producing the diagonal-matrix entry at (i, j) from a vector expression ( \( e(i) \) on the diagonal, 0 elsewhere). More...
 
struct  CrossProductMatrixFromVector
 Functor producing the cross-product (skew-symmetric) matrix entry at (i, j) for a 3-vector expression. More...
 
struct  MatrixVectorBinaryFunctor
 Base class for binary functors that take a matrix expression and a vector expression and return a vector-element scalar result (Math::MatrixVectorProduct, Math::VectorMatrixProduct). More...
 
struct  MatrixVectorProduct
 Functor returning element i of the matrix-vector product \( e_1 \cdot e_2 \). More...
 
struct  VectorMatrixProduct
 Functor returning element i of the vector-matrix product \( e_1 \cdot e_2 \). More...
 
struct  MatrixBinaryFunctor
 Base class for binary functors that take two matrix expressions and return a matrix-element scalar result (Math::MatrixProduct). More...
 
struct  MatrixProduct
 Functor returning entry (i, j) of the matrix product \( e_1 \cdot e_2 \). More...
 
struct  QuaternionBooleanBinaryFunctor
 Base class for binary functors that take two quaternion expressions and return a bool result (Math::QuaternionEquality). More...
 
struct  QuaternionEquality
 Functor checking component-wise equality of two quaternion expressions. More...
 
struct  Scalar3QuaternionBooleanTernaryFunctor
 Base class for ternary functors that take two quaternion expressions plus a tolerance scalar and return a bool result (Math::QuaternionToleranceEquality). More...
 
struct  QuaternionToleranceEquality
 Functor checking component-wise approximate equality of two quaternion expressions within an absolute tolerance. More...
 
struct  QuaternionScalarUnaryFunctor
 Base class for unary functors that take a quaternion expression and return a scalar result (Math::QuaternionElementSum). More...
 
struct  QuaternionElementSum
 Functor returning the sum of the four components of a quaternion expression. More...
 
struct  QuaternionScalarRealUnaryFunctor
 Base class for unary functors that take a quaternion expression and return a real-valued scalar (Math::QuaternionNorm, Math::QuaternionNorm2). More...
 
struct  QuaternionNorm
 Functor returning the (Euclidean) norm \( \|e\| \) of a quaternion expression. More...
 
struct  QuaternionNorm2
 Functor returning the squared norm \( \|e\|^2 \) of a quaternion expression. More...
 
struct  QuaternionUnaryFunctor
 Base class for per-component unary functors that take a quaternion expression and produce a quaternion result via applyC1 / applyC2 / applyC3 / applyC4 (Math::QuaternionUnreal, Math::QuaternionConjugate). More...
 
struct  QuaternionUnreal
 Per-component functor returning the unreal (pure-quaternion) part of a quaternion expression (zeros C1, keeps C2/C3/C4). More...
 
struct  QuaternionConjugate
 Per-component functor returning the quaternion conjugate (keeps C1, negates C2/C3/C4). More...
 
struct  Scalar1QuaternionBinaryFunctor
 Base class for per-component binary functors that take a scalar T (lhs) and a quaternion expression (Math::Scalar1QuaternionAddition, Math::Scalar1QuaternionSubtraction). More...
 
struct  Scalar1QuaternionAddition
 Per-component functor returning \( t + e \) (scalar t added to the real component of e). More...
 
struct  Scalar1QuaternionSubtraction
 Per-component functor returning \( t - e \) (scalar t with the quaternion e subtracted). More...
 
struct  Scalar2QuaternionBinaryFunctor
 Base class for per-component binary functors that take a quaternion expression (lhs) and a scalar T (Math::Scalar2QuaternionAddition, Math::Scalar2QuaternionSubtraction, Math::QuaternionInverse). More...
 
struct  Scalar2QuaternionAddition
 Per-component functor returning \( e + t \) (scalar t added to the real component of e). More...
 
struct  Scalar2QuaternionSubtraction
 Per-component functor returning \( e - t \) (scalar t subtracted from the real component of e). More...
 
struct  QuaternionInverse
 Per-component functor returning the multiplicative inverse \( \overline{e} / \|e\|^2 \) of a quaternion expression (n2 is the precomputed squared norm). More...
 
struct  QuaternionBinaryFunctor
 Base class for per-component binary functors that take two quaternion expressions and produce a quaternion result (Math::QuaternionProduct). More...
 
struct  QuaternionProduct
 Per-component functor returning the Hamilton product \( e_1 \cdot e_2 \) of two quaternion expressions. More...
 
struct  Scalar3QuaternionTernaryFunctor
 Base class for per-component ternary functors that take two quaternion expressions plus a scalar (Math::QuaternionDivision). More...
 
struct  QuaternionDivision
 Per-component functor returning the quaternion division \( e_1 \cdot e_2^{-1} \) (n2 is the precomputed squared norm of e_2). More...
 
struct  Scalar13QuaternionTernaryFunctor
 Base class for per-component ternary functors that take a scalar T1 (lhs), a quaternion expression, and a scalar T2 (Math::ScalarQuaternionDivision). More...
 
struct  ScalarQuaternionDivision
 Per-component functor returning the scalar/quaternion division \( t \cdot e^{-1} \) (n2 is the precomputed squared norm of e). More...
 
struct  QuaternionVectorBinaryFunctor
 Base class for binary functors that take a quaternion expression and a vector expression and return a vector-element scalar (Math::QuaternionVectorRotation). More...
 
struct  QuaternionVectorRotation
 Functor returning element i of the rotated 3-dimensional vector \( e_1 \cdot e_2 \cdot e_1^{-1} \) (quaternion rotation of \( e_2 \) by \( e_1 \)). More...
 
struct  GridBooleanBinaryFunctor
 Base class for binary functors that take two grid expressions and return a bool result (Math::GridEquality). More...
 
struct  GridEquality
 Functor checking cell-wise equality of two grid expressions. More...
 
struct  Scalar3GridBooleanTernaryFunctor
 Base class for ternary functors that take two grid expressions plus a tolerance scalar and return a bool result (Math::GridToleranceEquality). More...
 
struct  GridToleranceEquality
 Functor checking cell-wise approximate equality of two grid expressions within an absolute tolerance. More...
 
struct  GridScalarUnaryFunctor
 Base class for unary functors that take a grid expression and return a scalar result (Math::GridElementSum). More...
 
struct  GridElementSum
 Functor returning the sum of all cells of a grid expression. More...
 
class  GridReference
 Lightweight grid expression that proxies a reference to an underlying grid container. More...
 
class  Grid
 Dynamically-sized dense 3D grid ( \( d_1 \times d_2 \times d_3 \)) with configurable underlying storage. More...
 
class  ZeroGrid
 Constant grid expression whose cells are all zero. More...
 
class  ScalarGrid
 Constant grid expression in which every cell equals the same scalar value. More...
 
struct  GridTemporaryTraits< GridReference< G > >
 Math::GridTemporaryTraits specialization inheriting the temporary type of the underlying grid for a Math::GridReference view. More...
 
struct  GridTemporaryTraits< const GridReference< G > >
 Math::GridTemporaryTraits specialization inheriting the temporary type of the underlying grid for a const Math::GridReference view. More...
 
class  GridUnary
 Expression-template node applying a unary functor F element-wise to a grid expression E. More...
 
struct  GridUnaryTraits
 Traits selecting the expression-template node and its result type for the Math::GridUnary instantiation <E, F>. More...
 
class  GridBinary1
 Expression-template node combining two grid expressions E1 and E2 element-wise via the binary functor F. More...
 
struct  GridBinary1Traits
 Traits selecting the expression-template node and its result type for the Math::GridBinary1 instantiation Binary <E1, E2, F>. More...
 
class  Scalar1GridBinary
 Expression-template node combining a scalar E1 (lhs) and a grid expression E2 (rhs) element-wise via the binary functor F. More...
 
struct  Scalar1GridBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar1GridBinary instantiation <E1, E2, F>. More...
 
class  Scalar2GridBinary
 Expression-template node combining a grid expression E1 (lhs) and a scalar E2 (rhs) element-wise via the binary functor F. More...
 
struct  Scalar2GridBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar2GridBinary instantiation <E1, E2, F>. More...
 
class  KabschAlgorithm
 Implementation of the Kabsch algorithm [KABA]. More...
 
class  InitListMatrix
 Lightweight matrix container that wraps a nested std::initializer_list of T values. More...
 
class  SparseMatrix
 Sparse matrix that stores only non-default entries keyed by a packed (row, column) identifier. More...
 
class  BoundedVector
 Variable-size vector with a fixed upper capacity N stored in a stack-allocated array. More...
 
class  BoundedMatrix
 Variable-size matrix with fixed upper capacities M \( \times \) N stored in a stack-allocated array. More...
 
class  CMatrix
 Fixed-size dense matrix of dimensions M \( \times \) N backed by a 2D C-array (no dynamic allocation). More...
 
class  ZeroMatrix
 Constant matrix expression whose entries are all zero. More...
 
class  ScalarMatrix
 Constant matrix expression in which every entry equals the same scalar value. More...
 
class  IdentityMatrix
 Constant identity-matrix expression ( \( 1 \) on the diagonal, \( 0 \) elsewhere). More...
 
struct  VectorTemporaryTraits< MatrixReference< M > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying matrix for a Math::MatrixReference view. More...
 
struct  VectorTemporaryTraits< const MatrixReference< M > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying matrix for a const Math::MatrixReference view. More...
 
struct  MatrixTemporaryTraits< MatrixReference< M > >
 Math::MatrixTemporaryTraits specialization inheriting the temporary type of the underlying matrix for a Math::MatrixReference view. More...
 
struct  MatrixTemporaryTraits< const MatrixReference< M > >
 Math::MatrixTemporaryTraits specialization inheriting the temporary type of the underlying matrix for a const Math::MatrixReference view. More...
 
class  Range
 Half-open index range \( [start, stop) \) used for slicing vector and matrix expressions. More...
 
struct  Lower
 Tag selecting the lower-triangular view (entries strictly above the diagonal read as zero) for Math::TriangularAdapter. More...
 
struct  UnitLower
 Tag selecting the unit-lower-triangular view (zero above the diagonal, one on the diagonal) for Math::TriangularAdapter. More...
 
struct  Upper
 Tag selecting the upper-triangular view (entries strictly below the diagonal read as zero) for Math::TriangularAdapter. More...
 
struct  UnitUpper
 Tag selecting the unit-upper-triangular view (zero below the diagonal, one on the diagonal) for Math::TriangularAdapter. More...
 
class  TriangularAdapter
 Matrix expression that exposes only the triangular part of an underlying matrix M selected by the policy Tri (Math::Lower, Math::UnitLower, Math::Upper or Math::UnitUpper). More...
 
struct  VectorTemporaryTraits< TriangularAdapter< M, Tri > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a Math::TriangularAdapter view. More...
 
struct  VectorTemporaryTraits< const TriangularAdapter< M, Tri > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a const Math::TriangularAdapter view. More...
 
struct  MatrixTemporaryTraits< TriangularAdapter< M, Tri > >
 Math::MatrixTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a Math::TriangularAdapter view. More...
 
struct  MatrixTemporaryTraits< const TriangularAdapter< M, Tri > >
 Math::MatrixTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a const Math::TriangularAdapter view. More...
 
class  MatrixUnary
 Expression-template node applying a unary functor F element-wise to a matrix expression E. More...
 
struct  MatrixUnaryTraits
 Traits selecting the expression-template node and its result type for the Math::MatrixUnary instantiation <E, F>. More...
 
class  VectorMatrixUnary
 Expression-template node interpreting a vector expression E as a column matrix via the per-element functor F. More...
 
struct  VectorMatrixUnaryTraits
 Traits selecting the expression-template node and its result type for the Math::VectorMatrixUnary instantiation <E, F>. More...
 
class  MatrixBinary1
 Expression-template node combining two matrix expressions E1 and E2 element-wise via the binary functor F. More...
 
struct  MatrixBinary1Traits
 Traits selecting the expression-template node and its result type for the Math::MatrixBinary1 instantiation <E1, E2, F>. More...
 
class  MatrixBinary2
 Expression-template node combining two matrix expressions E1 and E2 via a binary functor F that is invoked with both expressions plus the (i, j) cell indices. More...
 
struct  MatrixBinary2Traits
 Traits selecting the expression-template node and its result type for the Math::MatrixBinary2 instantiation <E1, E2, F>. More...
 
class  VectorMatrixBinary
 Expression-template node interpreting a binary combination of two vector expressions as a matrix (e.g. outer product), via the per-cell functor F invoked with both expressions and the cell coordinates. More...
 
struct  VectorMatrixBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::VectorMatrixBinary instantiation <E1, E2, F>. More...
 
class  Matrix1VectorBinary
 Expression-template node interpreting a binary combination of a matrix expression E1 and a vector expression E2 as a vector (e.g. matrix-vector product), via the per-element functor F invoked with both expressions and the index. More...
 
struct  Matrix1VectorBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Matrix1VectorBinary instantiation <E1, E2, F>. More...
 
class  Matrix2VectorBinary
 Expression-template node interpreting a binary combination of a vector expression E1 and a matrix expression E2 as a vector (e.g. vector-matrix product), via the per-element functor F invoked with both expressions and the index. More...
 
struct  Matrix2VectorBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Matrix2VectorBinary instantiation <E1, E2, F>. More...
 
class  Scalar1MatrixBinary
 Expression-template node combining a scalar E1 (lhs) and a matrix expression E2 (rhs) element-wise via the binary functor F. More...
 
struct  Scalar1MatrixBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar1MatrixBinary instantiation <E1, E2, F>. More...
 
class  Scalar2MatrixBinary
 Expression-template node combining a matrix expression E1 (lhs) and a scalar E2 (rhs) element-wise via the binary functor F. More...
 
struct  Scalar2MatrixBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar2MatrixBinary instantiation <E1, E2, F>. More...
 
class  MatrixTranspose
 Mutable view adapter that exposes the transpose of a matrix M as a matrix expression ( \( (i, j) \to M(j, i) \)). More...
 
struct  VectorTemporaryTraits< MatrixTranspose< M > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a Math::MatrixTranspose view. More...
 
struct  VectorTemporaryTraits< const MatrixTranspose< M > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a const Math::MatrixTranspose view. More...
 
struct  MatrixTemporaryTraits< MatrixTranspose< M > >
 Math::MatrixTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a Math::MatrixTranspose view. More...
 
struct  MatrixTemporaryTraits< const MatrixTranspose< M > >
 Math::MatrixTemporaryTraits specialization inheriting the temporary type of the wrapped matrix for a const Math::MatrixTranspose view. More...
 
class  MatrixRow
 Vector-expression proxy that views a single row of an underlying matrix. More...
 
class  MatrixColumn
 Vector-expression proxy that views a single column of an underlying matrix. More...
 
class  MatrixRange
 Matrix-expression proxy that views a contiguous rectangular subrange of an underlying matrix. More...
 
class  MatrixSlice
 Matrix-expression proxy that views a strided rectangular slice of an underlying matrix. More...
 
struct  VectorTemporaryTraits< MatrixRow< M > >
 Vector-temporary trait specialization for Math::MatrixRow — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< const MatrixRow< M > >
 Vector-temporary trait specialization for const Math::MatrixRow — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< MatrixRow< M > >
 Matrix-temporary trait specialization for Math::MatrixRow — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< const MatrixRow< M > >
 Matrix-temporary trait specialization for const Math::MatrixRow — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< MatrixColumn< M > >
 Vector-temporary trait specialization for Math::MatrixColumn — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< const MatrixColumn< M > >
 Vector-temporary trait specialization for const Math::MatrixColumn — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< MatrixColumn< M > >
 Matrix-temporary trait specialization for Math::MatrixColumn — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< const MatrixColumn< M > >
 Matrix-temporary trait specialization for const Math::MatrixColumn — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< MatrixRange< M > >
 Vector-temporary trait specialization for Math::MatrixRange — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< const MatrixRange< M > >
 Vector-temporary trait specialization for const Math::MatrixRange — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< MatrixRange< M > >
 Matrix-temporary trait specialization for Math::MatrixRange — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< const MatrixRange< M > >
 Matrix-temporary trait specialization for const Math::MatrixRange — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< MatrixSlice< M > >
 Vector-temporary trait specialization for Math::MatrixSlice — inherits the temporary type from the wrapped matrix. More...
 
struct  VectorTemporaryTraits< const MatrixSlice< M > >
 Vector-temporary trait specialization for const Math::MatrixSlice — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< MatrixSlice< M > >
 Matrix-temporary trait specialization for Math::MatrixSlice — inherits the temporary type from the wrapped matrix. More...
 
struct  MatrixTemporaryTraits< const MatrixSlice< M > >
 Matrix-temporary trait specialization for const Math::MatrixSlice — inherits the temporary type from the wrapped matrix. More...
 
struct  MinimizerVariableArrayTraits
 Traits template that adapts arbitrary variable-array types to the linear-algebra operations required by minimizer implementations (dot, norm2, axpy, clear, assign, multiply, sub). More...
 
struct  MinimizerVariableArrayTraits< VectorArray< V > >
 Math::MinimizerVariableArrayTraits specialization for Math::VectorArray storage (a sequence of fixed-size vectors). More...
 
struct  MinimizerVariableArrayTraits< std::vector< V > >
 Math::MinimizerVariableArrayTraits specialization for std::vector storage of fixed-size vectors. More...
 
class  MLRModel
 Performs Multiple Linear Regression [WLIREG] on a set of data points \( (y_i, \vec{X}_i) \). More...
 
class  QuaternionReference
 Lightweight quaternion expression that proxies a reference to an underlying quaternion container. More...
 
class  Quaternion
 General 4-component quaternion \( q = c_1 + c_2 i + c_3 j + c_4 k \). More...
 
class  RealQuaternion
 Pure-real quaternion \( q = c_1 + 0i + 0j + 0k \) that stores only the real component. More...
 
struct  QuaternionTemporaryTraits< const QuaternionReference< Q > >
 Math::QuaternionTemporaryTraits specialization inheriting the temporary type of the underlying quaternion for a const Math::QuaternionReference view. More...
 
struct  QuaternionTemporaryTraits< QuaternionReference< Q > >
 Math::QuaternionTemporaryTraits specialization inheriting the temporary type of the underlying quaternion for a Math::QuaternionReference view. More...
 
class  QuaternionVectorAdapter
 View adapter that exposes a quaternion as a 4-element vector expression (indices map to the components C1, C2, C3, C4). More...
 
class  CVector
 Fixed-size vector of dimension N backed by a C-array (no dynamic allocation). More...
 
struct  VectorTemporaryTraits< QuaternionVectorAdapter< Q > >
 Math::VectorTemporaryTraits specialization selecting Math::CVector as the temporary type for a Math::QuaternionVectorAdapter view. More...
 
struct  VectorTemporaryTraits< const QuaternionVectorAdapter< Q > >
 Math::VectorTemporaryTraits specialization selecting Math::CVector as the temporary type for a const Math::QuaternionVectorAdapter view. More...
 
class  QuaternionUnary1
 Expression-template node applying a unary functor F that returns a quaternion result to a quaternion expression E. More...
 
struct  QuaternionUnary1Traits
 Traits selecting the expression-template node and its result type for the Math::QuaternionUnary1 instantiation <E, F>. More...
 
class  QuaternionUnary2
 Expression-template node applying a per-component functor F to a quaternion expression E, where F exposes four separate apply methods (applyC1 / applyC2 / applyC3 / applyC4) operating on the whole source expression. More...
 
struct  QuaternionUnary2Traits
 Traits selecting the expression-template node and its result type for the Math::QuaternionUnary2 instantiation <E, F>. More...
 
class  QuaternionBinary1
 Expression-template node combining two quaternion expressions E1 and E2 component-wise via the binary functor F. More...
 
struct  QuaternionBinary1Traits
 Traits selecting the expression-template node and its result type for the Math::QuaternionBinary1 instantiation <E1, E2, F>. More...
 
class  QuaternionBinary2
 Expression-template node combining two quaternion expressions E1 and E2 via the per-component functor F (which exposes four separate applyC1 / applyC2 / applyC3 / applyC4 methods operating on the whole source expressions). More...
 
struct  QuaternionBinary2Traits
 Traits selecting the expression-template node and its result type for the Math::QuaternionBinary2 instantiation <E1, E2, F>. More...
 
class  Scalar1QuaternionBinary1
 Expression-template node combining a scalar E1 (lhs) and a quaternion expression E2 (rhs) component-wise via the binary functor F. More...
 
struct  Scalar1QuaternionBinary1Traits
 Traits selecting the expression-template node and its result type for the Math::Scalar1QuaternionBinary1 instantiation <E1, E2, F>. More...
 
class  Scalar1QuaternionBinary2
 Expression-template node combining a scalar E1 (lhs) and a quaternion expression E2 (rhs) via the per-component functor F (which exposes applyC1 / applyC2 / applyC3 / applyC4 methods). More...
 
struct  Scalar1QuaternionBinary2Traits
 Traits selecting the expression-template node and its result type for the Math::Scalar1QuaternionBinary2 instantiation <E1, E2, F>. More...
 
class  Scalar2QuaternionBinary1
 Expression-template node combining a quaternion expression E1 (lhs) and a scalar E2 (rhs) component-wise via the binary functor F. More...
 
struct  Scalar2QuaternionBinary1Traits
 Traits selecting the expression-template node and its result type for the Math::Scalar2QuaternionBinary1 instantiation <E1, E2, F>. More...
 
class  Scalar2QuaternionBinary2
 Expression-template node combining a quaternion expression E1 (lhs) and a scalar E2 (rhs) via the per-component functor F (which exposes applyC1 / applyC2 / applyC3 / applyC4 methods). More...
 
struct  Scalar2QuaternionBinary2Traits
 Traits selecting the expression-template node and its result type for the Math::Scalar2QuaternionBinary2 instantiation <E1, E2, F>. More...
 
class  Scalar3QuaternionTernary
 Expression-template node combining two quaternion expressions E1 (lhs) and E2 (middle) with a scalar E3 (rhs) via the per-component ternary functor F. More...
 
struct  Scalar3QuaternionTernaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar3QuaternionTernary instantiation <E1, E2, E3, F>. More...
 
class  Scalar13QuaternionTernary
 Expression-template node combining a scalar E1 (lhs), a quaternion expression E2 (middle), and a scalar E3 (rhs) via the per-component ternary functor F. More...
 
struct  Scalar13QuaternionTernaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar13QuaternionTernary instantiation <E1, E2, E3, F>. More...
 
struct  GridCoordinatesMatrixTransformTraits
 Reusable transformation traits used by Math::RegularSpatialGrid when the coordinate transform is a 4x4 matrix. More...
 
struct  GridCoordinatesTransformTraits
 Primary traits template for grid-coordinate transformations of type T (left unspecialized; specialize for new transform types). More...
 
struct  GridCoordinatesTransformTraits< CMatrix< T, 4, 4 > >
 Math::GridCoordinatesTransformTraits specialization for the fixed-size Math::CMatrix 4x4 transformation type. More...
 
struct  GridCoordinatesTransformTraits< BoundedMatrix< T, 4, 4 > >
 Math::GridCoordinatesTransformTraits specialization for the bounded Math::BoundedMatrix 4x4 transformation type. More...
 
class  RegularSpatialGrid
 3D grid data structure combining a Math::Grid data store with a coordinate-system transformation that maps grid-cell indices to 3D world positions. More...
 
class  Slice
 Index slice ( \( start, stride, size \)) used for strided slicing of vector and matrix expressions. More...
 
class  SparseContainerElement
 Proxy that exposes a single (key, value) entry of a sparse container as a writable reference. More...
 
struct  TypeTraits< SparseContainerElement< C > >
 Math::TypeTraits specialization that delegates to the underlying value type of a Math::SparseContainerElement. More...
 
struct  ScalarAbsImpl
 Helper class template for retrieving the absolute value of scalar arithmetic types. More...
 
struct  ScalarAbsImpl< false >
 Specialization of Math::ScalarAbsImpl for unsigned types. More...
 
struct  ScalarTraits
 Common operations and type aliases for scalar arithmetic types. More...
 
struct  TypeTraits
 Primary traits template for scalar arithmetic value types. More...
 
struct  ComplexTraits
 Common operations and type aliases for complex arithmetic types. More...
 
struct  TypeTraits< std::complex< T > >
 Math::TypeTraits specialization for complex arithmetic value types. More...
 
struct  VectorTemporaryTraits
 Selects a concrete temporary vector type compatible with the vector expression V. More...
 
struct  MatrixTemporaryTraits
 Selects a concrete temporary matrix type compatible with the matrix expression M. More...
 
struct  QuaternionTemporaryTraits
 Selects a concrete temporary quaternion type compatible with the quaternion expression Q. More...
 
struct  GridTemporaryTraits
 Selects a concrete temporary grid type compatible with the grid expression G. More...
 
struct  IsScalar
 Type trait identifying T as a scalar arithmetic type (true for built-in arithmetic types). More...
 
struct  IsScalar< std::complex< T > >
 Math::IsScalar specialization that treats std::complex<T> as scalar when T is arithmetic. More...
 
class  VectorReference
 Lightweight vector expression that proxies a reference to an underlying vector container. More...
 
class  InitListVector
 Lightweight vector container that wraps a std::initializer_list for construction-style initialization. More...
 
class  SparseVector
 Sparse vector that stores only non-default entries in an associative key-to-value container. More...
 
class  ZeroVector
 Constant vector expression whose elements are all zero. More...
 
class  UnitVector
 Constant vector expression \( e_i \) that contains 1 at a single specified index and 0 elsewhere. More...
 
class  ScalarVector
 Constant vector expression in which every element equals the same scalar value. More...
 
struct  VectorTemporaryTraits< const VectorReference< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying vector for a const Math::VectorReference view. More...
 
struct  VectorTemporaryTraits< VectorReference< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying vector for a Math::VectorReference view. More...
 
class  HomogenousCoordsAdapter
 Vector expression that exposes a vector V as its homogeneous-coordinate extension by appending an implicit 1 at the end. More...
 
class  VectorQuaternionAdapter
 Quaternion expression that exposes a 4-element vector as a quaternion (component indices 0-3 map to C1-C4). More...
 
struct  QuaternionTemporaryTraits< VectorQuaternionAdapter< V > >
 Math::QuaternionTemporaryTraits specialization selecting Math::Quaternion as the temporary type for a Math::VectorQuaternionAdapter view. More...
 
struct  QuaternionTemporaryTraits< const VectorQuaternionAdapter< V > >
 Math::QuaternionTemporaryTraits specialization selecting Math::Quaternion as the temporary type for a const Math::VectorQuaternionAdapter view. More...
 
struct  VectorTemporaryTraits< HomogenousCoordsAdapter< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the wrapped vector for a Math::HomogenousCoordsAdapter view. More...
 
struct  VectorTemporaryTraits< const HomogenousCoordsAdapter< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the wrapped vector for a const Math::HomogenousCoordsAdapter view. More...
 
class  VectorArray
 Array data type for the ordered storage of vector objects. More...
 
class  VectorArrayAlignmentCalculator
 Convenience wrapper around Math::KabschAlgorithm that operates directly on Math::VectorArray inputs. More...
 
class  VectorUnary
 Expression-template node applying a unary functor F element-wise to a vector expression E. More...
 
struct  VectorUnaryTraits
 Traits selecting the expression-template node and its result type for the Math::VectorUnary instantiation <E, F>. More...
 
class  VectorBinary1
 Expression-template node combining two vector expressions E1 and E2 element-wise via the binary functor F. More...
 
struct  VectorBinary1Traits
 Traits selecting the expression-template node and its result type for the Math::VectorBinary1 instantiation <E1, E2, F>. More...
 
class  VectorBinary2
 Expression-template node combining two vector expressions E1 and E2 via a binary functor F invoked with both expressions plus the element index i. More...
 
struct  VectorBinary2Traits
 Traits selecting the expression-template node and its result type for the Math::VectorBinary2 instantiation <E1, E2, F>. More...
 
class  Scalar1VectorBinary
 Expression-template node combining a scalar E1 (lhs) and a vector expression E2 (rhs) element-wise via the binary functor F. More...
 
struct  Scalar1VectorBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar1VectorBinary instantiation <E1, E2, F>. More...
 
class  Scalar2VectorBinary
 Expression-template node combining a vector expression E1 (lhs) and a scalar E2 (rhs) element-wise via the binary functor F. More...
 
struct  Scalar2VectorBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::Scalar2VectorBinary instantiation <E1, E2, F>. More...
 
class  QuaternionVectorBinary
 Expression-template node combining a quaternion expression E1 and a vector expression E2 into a vector expression via the per-element functor F (used e.g. for quaternion-vector rotation). More...
 
struct  QuaternionVectorBinaryTraits
 Traits selecting the expression-template node and its result type for the Math::QuaternionVectorBinary instantiation <E1, E2, F>. More...
 
class  VectorElementAccessor
 Access functor used by Math::VectorIteratorTraits to read mutable vector elements via Util::IndexedElementIterator. More...
 
class  VectorElementAccessor< const E >
 Specialization of Math::VectorElementAccessor for const vector references (read-only iteration). More...
 
struct  VectorIteratorTraits
 Traits selecting the element accessor and Util::IndexedElementIterator specialization for mutable iteration over E. More...
 
struct  VectorIteratorTraits< const E >
 Specialization of Math::VectorIteratorTraits for read-only iteration over E. More...
 
class  VectorRange
 Vector-expression proxy that views a contiguous half-open subrange of an underlying vector. More...
 
class  VectorSlice
 Vector-expression proxy that views a strided slice of an underlying vector. More...
 
struct  VectorTemporaryTraits< VectorRange< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying vector for a Math::VectorRange view. More...
 
struct  VectorTemporaryTraits< const VectorRange< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying vector for a const Math::VectorRange view. More...
 
struct  VectorTemporaryTraits< VectorSlice< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying vector for a Math::VectorSlice view. More...
 
struct  VectorTemporaryTraits< const VectorSlice< V > >
 Math::VectorTemporaryTraits specialization inheriting the temporary type of the underlying vector for a const Math::VectorSlice view. More...
 

Typedefs

typedef ScalingMatrix< float > FScalingMatrix
 
typedef ScalingMatrix< double > DScalingMatrix
 
typedef ScalingMatrix< long > LScalingMatrix
 
typedef ScalingMatrix< unsigned long > ULScalingMatrix
 
typedef RotationMatrix< float > FRotationMatrix
 
typedef RotationMatrix< double > DRotationMatrix
 
typedef RotationMatrix< long > LRotationMatrix
 
typedef RotationMatrix< unsigned long > ULRotationMatrix
 
typedef TranslationMatrix< float > FTranslationMatrix
 
typedef TranslationMatrix< double > DTranslationMatrix
 
typedef TranslationMatrix< long > LTranslationMatrix
 
typedef TranslationMatrix< unsigned long > ULTranslationMatrix
 
typedef ZeroGrid< float > FZeroGrid
 Immutable grid where all elements have the value zero of type float. More...
 
typedef ZeroGrid< double > DZeroGrid
 Immutable grid where all elements have the value zero of type double. More...
 
typedef ScalarGrid< float > FScalarGrid
 Immutable grid where all elements have the same value of type float. More...
 
typedef ScalarGrid< double > DScalarGrid
 Immutable grid where all elements have the same value of type double. More...
 
typedef Grid< float > FGrid
 Unbounded dense grid storing floating point values of type float. More...
 
typedef Grid< double > DGrid
 Unbounded dense grid storing floating point values of type double. More...
 
typedef ZeroMatrix< float > FZeroMatrix
 Memory-efficient immutable matrix where all elements have the value zero of type float. More...
 
typedef ZeroMatrix< double > DZeroMatrix
 Memory-efficient immutable matrix where all elements have the value zero of type double. More...
 
typedef ZeroMatrix< long > LZeroMatrix
 Memory-efficient immutable matrix where all elements have the value zero of type long. More...
 
typedef ZeroMatrix< unsigned long > ULZeroMatrix
 Memory-efficient immutable matrix where all elements have the value zero of type unsigned long. More...
 
typedef ScalarMatrix< float > FScalarMatrix
 Memory-efficient immutable matrix where all elements have the same value of type float. More...
 
typedef ScalarMatrix< double > DScalarMatrix
 Memory-efficient immutable matrix where all elements have the same value of type double. More...
 
typedef ScalarMatrix< long > LScalarMatrix
 Memory-efficient immutable matrix where all elements have the same value of type long. More...
 
typedef ScalarMatrix< unsigned long > ULScalarMatrix
 Memory-efficient immutable matrix where all elements have the same value of type unsigned long. More...
 
typedef IdentityMatrix< float > FIdentityMatrix
 Memory-efficient immutable identity matrix with element values of type float. More...
 
typedef IdentityMatrix< double > DIdentityMatrix
 Memory-efficient immutable identity matrix with element values of type double. More...
 
typedef IdentityMatrix< long > LIdentityMatrix
 Memory-efficient immutable identity matrix with element values of type long. More...
 
typedef IdentityMatrix< unsigned long > ULIdentityMatrix
 Memory-efficient immutable identity matrix with element values of type unsigned long. More...
 
typedef Matrix< float > FMatrix
 Unbounded dense matrix holding floating point values of type float.. More...
 
typedef Matrix< double > DMatrix
 Unbounded dense matrix holding floating point values of type double.. More...
 
typedef Matrix< long > LMatrix
 Unbounded dense matrix holding signed integers of type long. More...
 
typedef Matrix< unsigned long > ULMatrix
 Unbounded dense matrix holding unsigned integers of type unsigned long. More...
 
typedef CMatrix< float, 2, 2 > Matrix2F
 Bounded 2x2 matrix holding floating point values of type float. More...
 
typedef CMatrix< float, 3, 3 > Matrix3F
 Bounded 3x3 matrix holding floating point values of type float. More...
 
typedef CMatrix< float, 4, 4 > Matrix4F
 Bounded 4x4 matrix holding floating point values of type float. More...
 
typedef CMatrix< double, 2, 2 > Matrix2D
 Bounded 2x2 matrix holding floating point values of type double. More...
 
typedef CMatrix< double, 3, 3 > Matrix3D
 Bounded 3x3 matrix holding floating point values of type double. More...
 
typedef CMatrix< double, 4, 4 > Matrix4D
 Bounded 4x4 matrix holding floating point values of type double. More...
 
typedef CMatrix< long, 2, 2 > Matrix2L
 Bounded 2x2 matrix holding signed integers of type long. More...
 
typedef CMatrix< long, 3, 3 > Matrix3L
 Bounded 3x3 matrix holding signed integers of type long. More...
 
typedef CMatrix< long, 4, 4 > Matrix4L
 Bounded 4x4 matrix holding signed integers of type long. More...
 
typedef CMatrix< unsigned long, 2, 2 > Matrix2UL
 Bounded 2x2 matrix holding unsigned integers of type unsigned long. More...
 
typedef CMatrix< unsigned long, 3, 3 > Matrix3UL
 Bounded 3x3 matrix holding unsigned integers of type unsigned long. More...
 
typedef CMatrix< unsigned long, 4, 4 > Matrix4UL
 Bounded 4x4 matrix holding unsigned integers of type unsigned long. More...
 
typedef SparseMatrix< float > SparseFMatrix
 Unbounded sparse matrix holding floating point values of type float.. More...
 
typedef SparseMatrix< double > SparseDMatrix
 Unbounded sparse matrix holding floating point values of type double.. More...
 
typedef SparseMatrix< long > SparseLMatrix
 Unbounded sparse matrix holding signed integers of type long. More...
 
typedef SparseMatrix< unsigned long > SparseULMatrix
 Unbounded sparse matrix holding unsigned integers of type unsigned long. More...
 
typedef Quaternion< float > FQuaternion
 General 4-component quaternion with component values of type float. More...
 
typedef Quaternion< double > DQuaternion
 General 4-component quaternion with component values of type double. More...
 
typedef Quaternion< long > LQuaternion
 General 4-component quaternion with component values of type long. More...
 
typedef Quaternion< unsigned long > ULQuaternion
 General 4-component quaternion with component values of type unsigned long. More...
 
typedef RealQuaternion< float > FRealQuaternion
 A memory-efficient pure-real quaternion with component values of type float. More...
 
typedef RealQuaternion< double > DRealQuaternion
 A memory-efficient pure-real quaternion with component values of type double. More...
 
typedef RealQuaternion< long > LRealQuaternion
 A memory-efficient pure-real quaternion with component values of type long. More...
 
typedef RealQuaternion< unsigned long > ULRealQuaternion
 A memory-efficient pure-real quaternion with component values of type unsigned long. More...
 
typedef RegularSpatialGrid< float > FRegularSpatialGrid
 Unbounded dense regular grid storing floating point values of type float. More...
 
typedef RegularSpatialGrid< double > DRegularSpatialGrid
 Unbounded dense regular grid storing floating point values of type double. More...
 
typedef ScalarVector< float > FScalarVector
 Memory-efficient immutable vector where all elements have the same value of type float. More...
 
typedef ScalarVector< double > DScalarVector
 Memory-efficient immutable vector where all elements have the same value of type double. More...
 
typedef ScalarVector< long > LScalarVector
 Memory-efficient immutable vector where all elements have the same value of type long. More...
 
typedef ScalarVector< unsigned long > ULScalarVector
 Memory-efficient immutable vector where all elements have the same value of type unsigned long. More...
 
typedef ZeroVector< float > FZeroVector
 Memory-efficient immutable vector where all elements have the value zero of type float. More...
 
typedef ZeroVector< double > DZeroVector
 Memory-efficient immutable vector where all elements have the value zero of type double. More...
 
typedef ZeroVector< long > LZeroVector
 Memory-efficient immutable vector where all elements have the value zero of type long. More...
 
typedef ZeroVector< unsigned long > ULZeroVector
 Memory-efficient immutable vector where all elements have the value zero of type unsigned long. More...
 
typedef UnitVector< float > FUnitVector
 Memory-efficient immutable unit vector with element values of type float. More...
 
typedef UnitVector< double > DUnitVector
 Memory-efficient immutable unit vector with element values of type double. More...
 
typedef UnitVector< long > LUnitVector
 Memory-efficient immutable unit vector with element values of type long. More...
 
typedef UnitVector< unsigned long > ULUnitVector
 Memory-efficient immutable unit vector with element values of type unsigned long. More...
 
typedef CVector< float, 2 > Vector2F
 Bounded 2 element vector holding floating point values of type float. More...
 
typedef CVector< float, 3 > Vector3F
 Bounded 3 element vector holding floating point values of type float. More...
 
typedef CVector< float, 4 > Vector4F
 Bounded 4 element vector holding floating point values of type float. More...
 
typedef CVector< double, 2 > Vector2D
 Bounded 2 element vector holding floating point values of type double. More...
 
typedef CVector< double, 3 > Vector3D
 Bounded 3 element vector holding floating point values of type double. More...
 
typedef CVector< double, 4 > Vector4D
 Bounded 4 element vector holding floating point values of type double. More...
 
typedef CVector< double, 7 > Vector7D
 Bounded 7 element vector holding floating point values of type double. More...
 
typedef CVector< long, 2 > Vector2L
 Bounded 2 element vector holding signed integers of type long. More...
 
typedef CVector< long, 3 > Vector3L
 Bounded 3 element vector holding signed integers of type long. More...
 
typedef CVector< long, 4 > Vector4L
 Bounded 4 element vector holding signed integers of type long. More...
 
typedef CVector< unsigned long, 2 > Vector2UL
 Bounded 2 element vector holding unsigned integers of type unsigned long. More...
 
typedef CVector< unsigned long, 3 > Vector3UL
 Bounded 3 element vector holding unsigned integers of type unsigned long. More...
 
typedef CVector< unsigned long, 4 > Vector4UL
 Bounded 4 element vector holding unsigned integers of type unsigned long. More...
 
typedef Vector< float > FVector
 Unbounded dense vector holding floating point values of type float. More...
 
typedef Vector< double > DVector
 Unbounded dense vector holding floating point values of type double. More...
 
typedef Vector< long > LVector
 Unbounded dense vector holding signed integers of type long. More...
 
typedef Vector< unsigned long > ULVector
 Unbounded dense vector holding unsigned integers of type unsigned long. More...
 
typedef SparseVector< float > SparseFVector
 Unbounded sparse vector holding floating point values of type float. More...
 
typedef SparseVector< double > SparseDVector
 Unbounded sparse vector holding floating point values of type double. More...
 
typedef SparseVector< long > SparseLVector
 Unbounded sparse vector holding signed integers of type long. More...
 
typedef SparseVector< unsigned long > SparseULVector
 Unbounded sparse vector holding unsigned integers of type unsigned long. More...
 
typedef VectorArray< Vector2FVector2FArray
 Array storing vectors of type Math::Vector2F. More...
 
typedef VectorArray< Vector3FVector3FArray
 Array storing vectors of type Math::Vector3F. More...
 
typedef VectorArray< Vector2DVector2DArray
 Array storing vectors of type Math::Vector2D. More...
 
typedef VectorArray< Vector3DVector3DArray
 Array storing vectors of type Math::Vector3D. More...
 
typedef VectorArray< Vector2LVector2LArray
 Array storing vectors of type Math::Vector2L. More...
 
typedef VectorArray< Vector3LVector3LArray
 Array storing vectors of type Math::Vector3L. More...
 
typedef VectorArray< Vector2ULVector2ULArray
 Array storing vectors of type Math::Vector2UL. More...
 
typedef VectorArray< Vector3ULVector3ULArray
 Array storing vectors of type Math::Vector3UL. More...
 

Functions

template<typename C >
DirectAssignmentProxy< const C > direct (const C &lvalue)
 Convenience factory creating a Math::DirectAssignmentProxy for a const lvalue. More...
 
template<typename C >
DirectAssignmentProxy< C > direct (C &lvalue)
 Convenience factory creating a Math::DirectAssignmentProxy for a mutable lvalue. More...
 
template<template< typename T1, typename T2 > class F, typename G , typename E >
void gridAssignGrid (G &g, const GridExpression< E > &e)
 Applies the element-wise functor F to every (grid cell, source cell) pair, i.e. F::apply(g(i,j,k), e()(i,j,k)). More...
 
template<template< typename T1, typename T2 > class F, typename G , typename T >
void gridAssignScalar (G &g, const T &t)
 Applies the element-wise functor F to every (grid cell, scalar) pair, i.e. F::apply(g(i,j,k), t). More...
 
template<typename G , typename E >
void gridSwap (G &g, GridExpression< E > &e)
 Swaps the cells of two equally sized grid expressions cell by cell. More...
 
template<typename E >
GridUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType operator- (const GridExpression< E > &e)
 Returns the element-wise negation of the grid expression e. More...
 
template<typename E >
const E & operator+ (const GridExpression< E > &e)
 Returns the grid expression e unchanged (unary +). More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarAddition< typename E1::ValueType, typename E2::ValueType > >::ResultType operator+ (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise sum of the grid expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarSubtraction< typename E1::ValueType, typename E2::ValueType > >::ResultType operator- (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise difference of the grid expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type operator* (const GridExpression< E > &e, const T &t)
 Returns the element-wise product of the grid expression e and the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1GridBinaryTraits< T, E, ScalarMultiplication< T, typename E::ValueType > >::ResultType >::type operator* (const T &t, const GridExpression< E > &e)
 Returns the element-wise product of the scalar t and the grid expression e. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type operator/ (const GridExpression< E > &e, const T &t)
 Returns the element-wise quotient of the grid expression e by the scalar t. More...
 
template<typename E1 , typename E2 >
GridEquality< E1, E2 >::ResultType operator== (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Tells whether the grid expressions e1 and e2 are element-wise equal. More...
 
template<typename E1 , typename E2 >
GridEquality< E1, E2 >::ResultType operator!= (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Tells whether the grid expressions e1 and e2 differ in at least one element. More...
 
template<typename E1 , typename E2 , typename T >
std::enable_if< std::is_arithmetic< T >::value, typename GridToleranceEquality< E1, E2, T >::ResultType >::type equals (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2, const T &eps)
 Tells whether the grid expressions e1 and e2 agree element-wise within the absolute tolerance eps. More...
 
template<typename E >
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj (const GridExpression< E > &e)
 Returns the element-wise complex conjugate of the grid expression e (identity for real-valued grids). More...
 
template<typename E >
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType herm (const GridExpression< E > &e)
 Returns the Hermitian conjugate of the grid expression e (alias of conj() for grids). More...
 
template<typename E >
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real (const GridExpression< E > &e)
 Returns the element-wise real part of the grid expression e. More...
 
template<typename E >
GridUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag (const GridExpression< E > &e)
 Returns the element-wise imaginary part of the grid expression e. More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise quotient of the grid expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise product of the grid expressions e1 and e2 (Hadamard product). More...
 
template<typename E >
GridElementSum< E >::ResultType sum (const GridExpression< E > &e)
 Returns the sum of all elements of the grid expression e. More...
 
template<typename C , typename T , typename E >
std::basic_ostream< C, T > & operator<< (std::basic_ostream< C, T > &os, const VectorExpression< E > &e)
 Writes a textual representation of the vector expression e to os. More...
 
template<typename C , typename T , typename E >
std::basic_ostream< C, T > & operator<< (std::basic_ostream< C, T > &os, const MatrixExpression< E > &e)
 Writes a textual representation of the matrix expression e to os: More...
 
template<typename C , typename T , typename E >
std::basic_ostream< C, T > & operator<< (std::basic_ostream< C, T > &os, const QuaternionExpression< E > &e)
 Writes a textual representation of the quaternion expression e to os. More...
 
template<typename C , typename T , typename E >
std::basic_ostream< C, T > & operator<< (std::basic_ostream< C, T > &os, const GridExpression< E > &e)
 Writes a textual representation of the grid expression e to os. More...
 
template<typename M1 , typename V , typename M2 >
bool jacobiDiagonalize (MatrixExpression< M1 > &a, VectorExpression< V > &d, MatrixExpression< M2 > &v, std::size_t max_iter=50)
 Computes all eigenvalues and eigenvectors of a real symmetric matrix an using Jacobi's algorithm [WJACO ]. More...
 
template<typename E1 , typename E2 >
bool solveLower (const MatrixExpression< E1 > &e1, VectorExpression< E2 > &e2)
 Solves \( L\,x = b \) in place by forward-substitution, where e1 is a lower-triangular matrix. More...
 
template<typename E1 , typename E2 >
bool solveUnitLower (const MatrixExpression< E1 > &e1, VectorExpression< E2 > &e2)
 Solves \( L\,x = b \) in place by forward-substitution, where e1 is a unit lower-triangular matrix (1 on the diagonal). More...
 
template<typename E1 , typename E2 >
bool solveLower (const MatrixExpression< E1 > &e1, MatrixExpression< E2 > &e2)
 Solves \( L\,X = B \) in place column-wise by forward-substitution, where e1 is a lower-triangular matrix. More...
 
template<typename E1 , typename E2 >
bool solveUnitLower (const MatrixExpression< E1 > &e1, MatrixExpression< E2 > &e2)
 Solves \( L\,X = B \) in place column-wise by forward-substitution, where e1 is a unit lower-triangular matrix. More...
 
template<typename E1 , typename E2 >
bool solveUpper (const MatrixExpression< E1 > &e1, VectorExpression< E2 > &e2)
 Solves \( U\,x = b \) in place by back-substitution, where e1 is an upper-triangular matrix. More...
 
template<typename E1 , typename E2 >
bool solveUnitUpper (const MatrixExpression< E1 > &e1, VectorExpression< E2 > &e2)
 Solves \( U\,x = b \) in place by back-substitution, where e1 is a unit upper-triangular matrix (1 on the diagonal). More...
 
template<typename E1 , typename E2 >
bool solveUpper (const MatrixExpression< E1 > &e1, MatrixExpression< E2 > &e2)
 Solves \( U\,X = B \) in place column-wise by back-substitution, where e1 is an upper-triangular matrix. More...
 
template<typename E1 , typename E2 >
bool solveUnitUpper (const MatrixExpression< E1 > &e1, MatrixExpression< E2 > &e2)
 Solves \( U\,X = B \) in place column-wise by back-substitution, where e1 is a unit upper-triangular matrix. More...
 
template<typename E >
E::SizeType luDecompose (MatrixExpression< E > &e)
 Computes an in-place LU decomposition of the matrix e without partial pivoting. More...
 
template<typename E , typename PV , typename T >
E::SizeType luDecompose (MatrixExpression< E > &e, PV &pv, T &num_row_swaps)
 Computes an in-place LU decomposition of the matrix e with partial (row) pivoting. More...
 
template<typename E , typename PV >
void swapRows (VectorExpression< E > &e, const PV &pv)
 Applies the permutation vector pv to the vector expression e by swapping element i with element pv[i]. More...
 
template<typename E , typename PV >
void swapRows (MatrixExpression< E > &e, const PV &pv)
 Applies the permutation vector pv to the rows of the matrix expression e by swapping row i with row pv[i]. More...
 
template<typename E1 , typename E2 >
bool luSubstitute (const MatrixExpression< E1 > &lu, VectorExpression< E2 > &b)
 Solves \( LU\,x = b \) for b in place, given the LU decomposition lu (without pivoting). More...
 
template<typename E1 , typename E2 , typename PV >
bool luSubstitute (const MatrixExpression< E1 > &lu, const PV &pv, VectorExpression< E2 > &b)
 Solves \( LU\,x = b \) for b in place, given the LU decomposition lu and pivot vector pv. More...
 
template<typename E1 , typename E2 >
bool luSubstitute (const MatrixExpression< E1 > &lu, MatrixExpression< E2 > &b)
 Solves \( LU\,X = B \) for the matrix b in place, given the LU decomposition lu (without pivoting). More...
 
template<typename E1 , typename E2 , typename PV >
bool luSubstitute (const MatrixExpression< E1 > &lu, const PV &pv, MatrixExpression< E2 > &b)
 Solves \( LU\,X = B \) for the matrix b in place, given the LU decomposition lu and pivot vector pv. More...
 
template<typename E >
E::ValueType det (const MatrixExpression< E > &e)
 Returns the determinant of the matrix expression e. More...
 
template<typename C >
C::ValueType det (const MatrixContainer< C > &c)
 Returns the determinant of the matrix container c (specialization avoiding an extra temporary copy when possible). More...
 
template<typename E , typename C >
bool invert (const MatrixExpression< E > &e, MatrixContainer< C > &c)
 Computes the inverse of the matrix expression e and stores it in c. More...
 
template<typename C >
bool invert (MatrixContainer< C > &c)
 Computes the inverse of the matrix container c in place. More...
 
template<typename Tri , typename E >
TriangularAdapter< E, Tri > triang (MatrixExpression< E > &e)
 Creates a Math::TriangularAdapter view of the matrix expression e using the triangular policy Tri. More...
 
template<typename Tri , typename E >
TriangularAdapter< const E, Tri > triang (const MatrixExpression< E > &e)
 Creates a constant Math::TriangularAdapter view of the matrix expression e using the triangular policy Tri. More...
 
template<template< typename T1, typename T2 > class F, typename M , typename E >
void matrixAssignMatrix (M &m, const MatrixExpression< E > &e)
 Applies the element-wise functor F to every (matrix element, source element) pair, i.e. F::apply(m(i,j), e()(i,j)). More...
 
template<template< typename T1, typename T2 > class F, typename M , typename T >
void matrixAssignScalar (M &m, const T &t)
 Applies the element-wise functor F to every (matrix element, scalar) pair, i.e. F::apply(m(i,j), t). More...
 
template<typename M , typename E >
void matrixSwap (M &m, MatrixExpression< E > &e)
 Swaps the elements of two equally sized matrix expressions element by element. More...
 
template<typename E >
MatrixUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType operator- (const MatrixExpression< E > &e)
 Returns the element-wise negation of the matrix expression e. More...
 
template<typename E >
const E & operator+ (const MatrixExpression< E > &e)
 Returns the matrix expression e unchanged (unary +). More...
 
template<typename E1 , typename E2 >
MatrixBinary1Traits< E1, E2, ScalarAddition< typename E1::ValueType, typename E2::ValueType > >::ResultType operator+ (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the element-wise sum of the matrix expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
MatrixBinary1Traits< E1, E2, ScalarSubtraction< typename E1::ValueType, typename E2::ValueType > >::ResultType operator- (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the element-wise difference of the matrix expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2MatrixBinaryTraits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type operator* (const MatrixExpression< E > &e, const T &t)
 Returns the element-wise product of the matrix expression e and the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1MatrixBinaryTraits< T, E, ScalarMultiplication< T, typename E::ValueType > >::ResultType >::type operator* (const T &t, const MatrixExpression< E > &e)
 Returns the element-wise product of the scalar t and the matrix expression e. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2MatrixBinaryTraits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type operator/ (const MatrixExpression< E > &e, const T &t)
 Returns the element-wise quotient of the matrix expression e by the scalar t. More...
 
template<typename E1 , typename E2 >
MatrixEquality< E1, E2 >::ResultType operator== (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Tells whether the matrix expressions e1 and e2 are element-wise equal. More...
 
template<typename E1 , typename E2 >
MatrixEquality< E1, E2 >::ResultType operator!= (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Tells whether the matrix expressions e1 and e2 differ in at least one element. More...
 
template<typename E1 , typename E2 , typename T >
std::enable_if< std::is_arithmetic< T >::value, typename MatrixToleranceEquality< E1, E2, T >::ResultType >::type equals (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2, const T &eps)
 Tells whether the matrix expressions e1 and e2 agree element-wise within the absolute tolerance eps. More...
 
template<typename E >
MatrixUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj (const MatrixExpression< E > &e)
 Returns the element-wise complex conjugate of the matrix expression e (identity for real-valued matrices). More...
 
template<typename E >
MatrixUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType herm (const MatrixExpression< E > &e)
 Returns the Hermitian conjugate (conjugate transpose) of the matrix expression e — currently aliased to conj() pending transpose support. More...
 
template<typename E >
MatrixUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real (const MatrixExpression< E > &e)
 Returns the element-wise real part of the matrix expression e. More...
 
template<typename E >
MatrixUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag (const MatrixExpression< E > &e)
 Returns the element-wise imaginary part of the matrix expression e. More...
 
template<typename E1 , typename E2 >
VectorMatrixBinaryTraits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType outerProd (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the outer product of the vector expressions e1 and e2 as a matrix expression \( e_1 \cdot e_2^T \). More...
 
template<typename E1 , typename E2 >
MatrixBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the element-wise quotient of the matrix expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
MatrixBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the element-wise product (Hadamard product) of the matrix expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
Matrix1VectorBinaryTraits< E1, E2, MatrixVectorProduct< E1, E2 > >::ResultType operator* (const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the matrix-vector product \( e_1 \cdot e_2 \) as a vector expression. More...
 
template<typename E1 , typename E2 >
Matrix1VectorBinaryTraits< E1, E2, MatrixVectorProduct< E1, E2 > >::ResultType prod (const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the matrix-vector product \( e_1 \cdot e_2 \) as a vector expression (named-function form of operator*). More...
 
template<typename C , typename E1 , typename E2 >
C & prod (const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2, VectorContainer< C > &c)
 Computes the matrix-vector product \( e_1 \cdot e_2 \) and stores it in c. More...
 
template<typename E1 , typename E2 >
Matrix2VectorBinaryTraits< E1, E2, VectorMatrixProduct< E1, E2 > >::ResultType operator* (const VectorExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the vector-matrix product \( e_1 \cdot e_2 \) as a vector expression. More...
 
template<typename E1 , typename E2 >
Matrix2VectorBinaryTraits< E1, E2, VectorMatrixProduct< E1, E2 > >::ResultType prod (const VectorExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the vector-matrix product \( e_1 \cdot e_2 \) as a vector expression (named-function form of operator*). More...
 
template<typename C , typename E1 , typename E2 >
C & prod (const VectorExpression< E1 > &e1, const MatrixExpression< E2 > &e2, VectorContainer< C > &c)
 Computes the vector-matrix product \( e_1 \cdot e_2 \) and stores it in c. More...
 
template<typename E1 , typename E2 >
MatrixBinary2Traits< E1, E2, MatrixProduct< E1, E2 > >::ResultType operator* (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the matrix-matrix product \( e_1 \cdot e_2 \) as a matrix expression. More...
 
template<typename E1 , typename E2 >
MatrixBinary2Traits< E1, E2, MatrixProduct< E1, E2 > >::ResultType prod (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2)
 Returns the matrix-matrix product \( e_1 \cdot e_2 \) as a matrix expression (named-function form of operator*). More...
 
template<typename C , typename E1 , typename E2 >
C & prod (const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2, MatrixContainer< C > &c)
 Computes the matrix-matrix product \( e_1 \cdot e_2 \) and stores it in c. More...
 
template<typename E >
MatrixTrace< E >::ResultType trace (const MatrixExpression< E > &e)
 Returns the trace (sum of diagonal elements) of the matrix expression e. More...
 
template<typename E >
MatrixNorm1< E >::ResultType norm1 (const MatrixExpression< E > &e)
 Returns the L1 (maximum absolute column sum) norm of the matrix expression e. More...
 
template<typename E >
MatrixNormFrobenius< E >::ResultType normFrob (const MatrixExpression< E > &e)
 Returns the Frobenius norm of the matrix expression e ( \( \sqrt{\sum_{i, j} |e(i, j)|^2} \)). More...
 
template<typename E >
MatrixNormInfinity< E >::ResultType normInf (const MatrixExpression< E > &e)
 Returns the L∞ (maximum absolute row sum) norm of the matrix expression e. More...
 
template<typename E >
VectorMatrixUnaryTraits< E, DiagonalMatrixFromVector< E > >::ResultType diag (const VectorExpression< E > &e)
 Returns a diagonal matrix whose diagonal entries are the components of the vector expression e. More...
 
template<typename E >
VectorMatrixUnaryTraits< E, CrossProductMatrixFromVector< E > >::ResultType cross (const VectorExpression< E > &e)
 Returns the cross-product (skew-symmetric) matrix corresponding to the 3-vector expression e (such that cross(e) * v == crossProd(e, v)). More...
 
template<typename E >
MatrixTranspose< E > trans (MatrixExpression< E > &e)
 Returns a mutable Math::MatrixTranspose view of the matrix expression e. More...
 
template<typename E >
MatrixTranspose< const E > trans (const MatrixExpression< E > &e)
 Returns a constant Math::MatrixTranspose view of the matrix expression e. More...
 
template<typename E >
MatrixElementSum< E >::ResultType sum (const MatrixExpression< E > &e)
 Returns the sum of all elements of the matrix expression e. More...
 
template<typename M >
MatrixRow< M > row (MatrixExpression< M > &e, typename MatrixRow< M >::SizeType i)
 Returns a mutable row proxy for row i of the matrix expression e. More...
 
template<typename M >
MatrixRow< const M > row (const MatrixExpression< M > &e, typename MatrixRow< const M >::SizeType i)
 Returns a const row proxy for row i of the matrix expression e. More...
 
template<typename M >
MatrixColumn< M > column (MatrixExpression< M > &e, typename MatrixColumn< M >::SizeType j)
 Returns a mutable column proxy for column j of the matrix expression e. More...
 
template<typename M >
MatrixColumn< const M > column (const MatrixExpression< M > &e, typename MatrixColumn< const M >::SizeType j)
 Returns a const column proxy for column j of the matrix expression e. More...
 
template<typename E >
MatrixRange< E > range (MatrixExpression< E > &e, const typename MatrixRange< E >::RangeType &r1, const typename MatrixRange< E >::RangeType &r2)
 Returns a mutable matrix range proxy viewing rows in r1 and columns in r2 of e. More...
 
template<typename E >
MatrixRange< const E > range (const MatrixExpression< E > &e, const typename MatrixRange< const E >::RangeType &r1, const typename MatrixRange< const E >::RangeType &r2)
 Returns a const matrix range proxy viewing rows in r1 and columns in r2 of e. More...
 
template<typename E >
MatrixRange< E > range (MatrixExpression< E > &e, typename MatrixRange< E >::RangeType::SizeType start1, typename MatrixRange< E >::RangeType::SizeType stop1, typename MatrixRange< E >::RangeType::SizeType start2, typename MatrixRange< E >::RangeType::SizeType stop2)
 Returns a mutable matrix range proxy viewing rows [start1, stop1) and columns [start2, stop2) of e. More...
 
template<typename E >
MatrixRange< const E > range (const MatrixExpression< E > &e, typename MatrixRange< const E >::RangeType::SizeType start1, typename MatrixRange< const E >::RangeType::SizeType stop1, typename MatrixRange< const E >::RangeType::SizeType start2, typename MatrixRange< const E >::RangeType::SizeType stop2)
 Returns a const matrix range proxy viewing rows [start1, stop1) and columns [start2, stop2) of e. More...
 
template<typename E >
MatrixSlice< E > slice (MatrixExpression< E > &e, const typename MatrixSlice< E >::SliceType &s1, const typename MatrixSlice< E >::SliceType &s2)
 Returns a mutable matrix slice proxy viewing the strided rectangular slice (s1, s2) of e. More...
 
template<typename E >
MatrixSlice< const E > slice (const MatrixExpression< E > &e, const typename MatrixSlice< const E >::SliceType &s1, const typename MatrixSlice< const E >::SliceType &s2)
 Returns a const matrix slice proxy viewing the strided rectangular slice (s1, s2) of e. More...
 
template<typename E >
MatrixSlice< E > slice (MatrixExpression< E > &e, typename MatrixSlice< E >::SliceType::SizeType start1, typename MatrixSlice< E >::SliceType::DifferenceType stride1, typename MatrixSlice< E >::SliceType::SizeType size1, typename MatrixSlice< E >::SliceType::SizeType start2, typename MatrixSlice< E >::SliceType::DifferenceType stride2, typename MatrixSlice< E >::SliceType::SizeType size2)
 Returns a mutable matrix slice proxy specified by row (start1, stride1, size1) and column (start2, stride2, size2). More...
 
template<typename E >
MatrixSlice< const E > slice (const MatrixExpression< E > &e, typename MatrixSlice< const E >::SliceType::SizeType start1, typename MatrixSlice< const E >::SliceType::DifferenceType stride1, typename MatrixSlice< const E >::SliceType::SizeType size1, typename MatrixSlice< const E >::SliceType::SizeType start2, typename MatrixSlice< const E >::SliceType::DifferenceType stride2, typename MatrixSlice< const E >::SliceType::SizeType size2)
 Returns a const matrix slice proxy specified by row (start1, stride1, size1) and column (start2, stride2, size2). More...
 
template<typename T >
std::enable_if< IsScalar< T >::value, RealQuaternion< T > >::type quat (const T &t)
 Constructs a Math::RealQuaternion from the scalar t (its real component). More...
 
template<typename T1 , typename T2 >
Quaternion< typename CommonType< T1, T2 >::Type > quat (const T1 &t1, const T2 &t2)
 Constructs a Math::Quaternion from two scalar components t1 and t2 (C1, C2) — remaining components are zero. More...
 
template<typename T1 , typename T2 , typename T3 >
Quaternion< typename CommonType< typename CommonType< T1, T2 >::Type, T3 >::Type > quat (const T1 &t1, const T2 &t2, const T3 &t3)
 Constructs a Math::Quaternion from three scalar components (C1, C2, C3) — C4 is zero. More...
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
Quaternion< typename CommonType< typename CommonType< typename CommonType< T1, T2 >::Type, T3 >::Type, T4 >::Type > quat (const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4)
 Constructs a Math::Quaternion from four scalar components (C1, C2, C3, C4). More...
 
template<typename E >
QuaternionVectorAdapter< E > vec (QuaternionExpression< E > &e)
 Creates a mutable Math::QuaternionVectorAdapter view of the quaternion expression e. More...
 
template<typename E >
QuaternionVectorAdapter< const E > vec (const QuaternionExpression< E > &e)
 Creates a constant Math::QuaternionVectorAdapter view of the quaternion expression e. More...
 
template<template< typename T1, typename T2 > class F, typename Q , typename E >
void quaternionAssignQuaternion (Q &q, const QuaternionExpression< E > &e)
 Applies the binary functor F componentwise between the destination quaternion q and the source quaternion expression e. More...
 
template<template< typename T1, typename T2 > class F, typename Q , typename T >
void quaternionAssignScalar (Q &q, const T &t)
 Applies the element-wise functor F to every (quaternion component, scalar) pair. More...
 
template<typename Q , typename E >
void quaternionSwap (Q &q, QuaternionExpression< E > &e)
 Swaps the components of two quaternion expressions component by component. More...
 
template<typename E >
QuaternionUnary1Traits< E, ScalarNegation< typename E::ValueType > >::ResultType operator- (const QuaternionExpression< E > &e)
 Returns the component-wise negation of the quaternion expression e. More...
 
template<typename E >
const E & operator+ (const QuaternionExpression< E > &e)
 Returns the quaternion expression e unchanged (unary +). More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarAddition< typename E1::ValueType, typename E2::ValueType > >::ResultType operator+ (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise sum of the quaternion expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary2Traits< E, T, Scalar2QuaternionAddition< E, T > >::ResultType >::type operator+ (const QuaternionExpression< E > &e, const T &t)
 Adds the scalar t to the real component (C1) of the quaternion expression e. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1QuaternionBinary2Traits< T, E, Scalar1QuaternionAddition< T, E > >::ResultType >::type operator+ (const T &t, const QuaternionExpression< E > &e)
 Adds the scalar t to the real component (C1) of the quaternion expression e (commutative form). More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarSubtraction< typename E1::ValueType, typename E2::ValueType > >::ResultType operator- (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise difference of the quaternion expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary2Traits< E, T, Scalar2QuaternionSubtraction< E, T > >::ResultType >::type operator- (const QuaternionExpression< E > &e, const T &t)
 Subtracts the scalar t from the real component (C1) of the quaternion expression e. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1QuaternionBinary2Traits< T, E, Scalar1QuaternionSubtraction< T, E > >::ResultType >::type operator- (const T &t, const QuaternionExpression< E > &e)
 Subtracts the quaternion expression e from the scalar t (forming \( t - e \) as a quaternion expression). More...
 
template<typename E1 , typename E2 >
QuaternionBinary2Traits< E1, E2, QuaternionProduct< E1, E2 > >::ResultType operator* (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the (Hamilton) product of the quaternion expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary1Traits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type operator* (const QuaternionExpression< E > &e, const T &t)
 Returns the component-wise product of the quaternion expression e and the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1QuaternionBinary1Traits< T, E, ScalarMultiplication< T, typename E::ValueType > >::ResultType >::type operator* (const T &t, const QuaternionExpression< E > &e)
 Returns the component-wise product of the scalar t and the quaternion expression e. More...
 
template<typename E1 , typename E2 >
Scalar3QuaternionTernaryTraits< E1, E2, typename QuaternionNorm2< E2 >::ResultType, QuaternionDivision< E1, E2, typename QuaternionNorm2< E2 >::ResultType > >::ResultType operator/ (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the quaternion division \( e_1 \cdot e_2^{-1} \) as an expression-template node. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary1Traits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type operator/ (const QuaternionExpression< E > &e, const T &t)
 Returns the component-wise quotient of the quaternion expression e by the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar13QuaternionTernaryTraits< T, E, typename QuaternionNorm2< E >::ResultType, ScalarQuaternionDivision< T, E, typename QuaternionNorm2< E >::ResultType > >::ResultType >::type operator/ (const T &t, const QuaternionExpression< E > &e)
 Returns the quaternion division of the scalar t by the quaternion expression e ( \( t \cdot e^{-1} \)). More...
 
template<typename E1 , typename E2 >
QuaternionEquality< E1, E2 >::ResultType operator== (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Tells whether the quaternion expressions e1 and e2 are component-wise equal. More...
 
template<typename E1 , typename E2 >
QuaternionEquality< E1, E2 >::ResultType operator!= (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Tells whether the quaternion expressions e1 and e2 differ in at least one component. More...
 
template<typename E1 , typename E2 , typename T >
std::enable_if< std::is_arithmetic< T >::value, typename QuaternionToleranceEquality< E1, E2, T >::ResultType >::type equals (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, const T &eps)
 Tells whether the quaternion expressions e1 and e2 agree component-wise within the absolute tolerance eps. More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise quotient of the quaternion expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise product (Hadamard product) of the quaternion expressions e1 and e2. More...
 
template<typename E >
E::ValueType real (const QuaternionExpression< E > &e)
 Returns the real component (C1) of the quaternion expression e. More...
 
template<typename E >
QuaternionUnary2Traits< E, QuaternionUnreal< E > >::ResultType unreal (const QuaternionExpression< E > &e)
 Returns the unreal (pure-quaternion) part of the quaternion expression e (with C1 zeroed out). More...
 
template<typename E >
QuaternionUnary2Traits< E, QuaternionConjugate< E > >::ResultType conj (const QuaternionExpression< E > &e)
 Returns the quaternion conjugate of the quaternion expression e (negates C2, C3, C4). More...
 
template<typename E >
Scalar2QuaternionBinary2Traits< E, typename QuaternionNorm2< E >::ResultType, QuaternionInverse< E, typename QuaternionNorm2< E >::ResultType > >::ResultType inv (const QuaternionExpression< E > &e)
 Returns the multiplicative inverse of the quaternion expression e ( \( \overline{e} / |e|^2 \)). More...
 
template<typename E >
QuaternionNorm< E >::ResultType norm (const QuaternionExpression< E > &e)
 Returns the norm (Euclidean length) of the quaternion expression e. More...
 
template<typename E >
QuaternionNorm2< E >::ResultType norm2 (const QuaternionExpression< E > &e)
 Returns the squared norm of the quaternion expression e. More...
 
template<typename E >
QuaternionElementSum< E >::ResultType sum (const QuaternionExpression< E > &e)
 Returns the sum of the four components of the quaternion expression e. More...
 
Range< std::size_t > range (std::size_t start, std::size_t stop)
 Convenience factory for Math::Range with std::size_t indices. More...
 
template<typename T , typename C , typename GD , typename XF , typename V >
interpolateTrilinear (const RegularSpatialGrid< T, C, GD, XF > &grid, const V &pos, bool local_pos)
 Returns the trilinearly-interpolated value of grid at pos. More...
 
Slice< std::size_t, std::ptrdiff_t > slice (std::size_t start, std::ptrdiff_t stride, std::size_t size)
 Convenience factory for Math::Slice with std::size_t indices and std::ptrdiff_t stride. More...
 
template<typename T >
factorial (unsigned int n)
 Computes the factorial \( n! \) of the non-negative integer n. More...
 
template<typename T >
pythag (const T &a, const T &b)
 Computes \( \sqrt{a^2 + b^2} \) without destructive underflow or overflow. More...
 
template<typename T1 , typename T2 >
T1 sign (const T1 &a, const T2 &b)
 Returns the magnitude of parameter a times the sign of parameter b. More...
 
template<typename T >
lnGamma (const T &z)
 Computes \( \ln[\Gamma(z)] \) for \( z > 0 \). More...
 
template<typename T >
gammaQ (const T &a, const T &x)
 Computes the incomplete gamma function \( Q(a, x) = 1 - P(a, x) \) (see [NRIC] for details). More...
 
template<typename T >
generalizedBell (const T &x, const T &a, const T &b, const T &c)
 Computes the generalized bell function \( Bell(x) = \frac{1}{1 + |\frac{x-c}{a}|^{2b}} \) at x. More...
 
template<typename M1 , typename V1 , typename M2 , typename V2 , typename V3 >
void svBackSubstitution (const M1 &u, const V1 &w, const M2 &v, const V2 &b, V3 &x)
 Solves \( A \cdot X = B \) for a vector \( X \) where \( A \) is given by its Singular Value Decomposition [WSVD]. More...
 
template<typename A , typename W , typename V >
bool svDecompose (MatrixExpression< A > &a, VectorExpression< W > &w, MatrixExpression< V > &v, std::size_t max_iter=0)
 Computes the Singular Value Decomposition [WSVD] \( A = UWV^T \) of a \( M \times N \)-dimensional matrix a. More...
 
template<typename U , typename W , typename V , typename B , typename X >
void svSubstitute (const MatrixExpression< U > &u, const VectorExpression< W > &w, const MatrixExpression< V > &v, const VectorExpression< B > &b, VectorExpression< X > &x)
 Solves \( A \cdot X = B \) for a vector \( X \) where \( A \) is given by its Singular Value Decomposition [WSVD]. More...
 
template<typename U , typename W , typename V , typename B , typename X >
void svSubstitute (const MatrixExpression< U > &u, const VectorExpression< W > &w, const MatrixExpression< V > &v, const MatrixExpression< B > &b, MatrixExpression< X > &x)
 Solves \( A \cdot X = B \) for a matrix \( X \) where \( A \) is given by its Singular Value Decomposition [WSVD]. More...
 
template<typename T1 , typename T2 >
CVector< typename CommonType< T1, T2 >::Type, 2 > vec (const T1 &t1, const T2 &t2)
 Constructs a Math::CVector of size 2 from the components t1 and t2. More...
 
template<typename T1 , typename T2 , typename T3 >
CVector< typename CommonType< typename CommonType< T1, T2 >::Type, T3 >::Type, 3 > vec (const T1 &t1, const T2 &t2, const T3 &t3)
 Constructs a Math::CVector of size 3 from the components t1, t2 and t3. More...
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
CVector< typename CommonType< typename CommonType< typename CommonType< T1, T2 >::Type, T3 >::Type, T4 >::Type, 4 > vec (const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4)
 Constructs a Math::CVector of size 4 from the components t1, t2, t3 and t4. More...
 
template<typename E >
VectorQuaternionAdapter< E > quat (VectorExpression< E > &e)
 Creates a mutable Math::VectorQuaternionAdapter view of the 4-element vector expression e. More...
 
template<typename E >
VectorQuaternionAdapter< const E > quat (const VectorExpression< E > &e)
 Creates a constant Math::VectorQuaternionAdapter view of the 4-element vector expression e. More...
 
template<typename E >
HomogenousCoordsAdapter< E > homog (VectorExpression< E > &e)
 Creates a mutable Math::HomogenousCoordsAdapter view of the vector expression e (extends e by an implicit 1). More...
 
template<typename E >
HomogenousCoordsAdapter< const E > homog (const VectorExpression< E > &e)
 Creates a constant Math::HomogenousCoordsAdapter view of the vector expression e. More...
 
template<typename T , std::size_t Dim, typename T1 >
void transform (VectorArray< CVector< T, Dim > > &va, const CMatrix< T1, Dim, Dim > &xform)
 Transforms each \( N \)-dimensional vector in the array with the \( N \)-dimensional square matrix xform. More...
 
template<typename T , std::size_t Dim, typename T1 >
void transform (VectorArray< CVector< T, Dim > > &va, const CMatrix< T1, Dim+1, Dim+1 > &xform)
 Transforms each \( N \)-dimensional vector in the array with the \( N+1 \)-dimensional square matrix xform. More...
 
template<typename T , std::size_t Dim, typename T1 >
bool calcCentroid (const VectorArray< CVector< T, Dim > > &va, CVector< T1, Dim > &ctr)
 Calculates the centroid of the array elements. More...
 
template<typename T , std::size_t Dim>
calcRMSD (const VectorArray< CVector< T, Dim > > &va1, const VectorArray< CVector< T, Dim > > &va2)
 Calculates the root-mean-square distance between the corresponding elements of va1 and va2. More...
 
template<typename T , std::size_t Dim, typename T1 >
calcRMSD (const VectorArray< CVector< T, Dim > > &va1, const VectorArray< CVector< T, Dim > > &va2, const CMatrix< T1, Dim+1, Dim+1 > &va1_xform)
 Calculates the root-mean-square distance between corresponding elements of va1 and va2 after applying the \( (N+1) \times (N+1) \) homogeneous transformation va1_xform to the elements of va1. More...
 
template<template< typename T1, typename T2 > class F, typename V , typename E >
void vectorAssignVector (V &v, const VectorExpression< E > &e)
 Applies the element-wise functor F to every (vector element, source element) pair, i.e. F::apply(v(i), e()(i)). More...
 
template<template< typename T1, typename T2 > class F, typename V , typename T >
void vectorAssignScalar (V &v, const T &t)
 Applies the element-wise functor F to every (vector element, scalar) pair, i.e. F::apply(v(i), t). More...
 
template<typename V , typename E >
void vectorSwap (V &v, VectorExpression< E > &e)
 Swaps the elements of two equally sized vector expressions element by element. More...
 
template<typename E >
VectorUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType operator- (const VectorExpression< E > &e)
 Returns the element-wise negation of the vector expression e. More...
 
template<typename E >
const E & operator+ (const VectorExpression< E > &e)
 Returns the vector expression e unchanged (unary +). More...
 
template<typename E1 , typename E2 >
VectorBinary1Traits< E1, E2, ScalarAddition< typename E1::ValueType, typename E2::ValueType > >::ResultType operator+ (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the element-wise sum of the vector expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
VectorBinary1Traits< E1, E2, ScalarSubtraction< typename E1::ValueType, typename E2::ValueType > >::ResultType operator- (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the element-wise difference of the vector expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2VectorBinaryTraits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type operator* (const VectorExpression< E > &e, const T &t)
 Returns the element-wise product of the vector expression e and the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1VectorBinaryTraits< T, E, ScalarMultiplication< T, typename E::ValueType > >::ResultType >::type operator* (const T &t, const VectorExpression< E > &e)
 Returns the element-wise product of the scalar t and the vector expression e. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2VectorBinaryTraits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type operator/ (const VectorExpression< E > &e, const T &t)
 Returns the element-wise quotient of the vector expression e by the scalar t. More...
 
template<typename E1 , typename E2 >
VectorEquality< E1, E2 >::ResultType operator== (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Tells whether the vector expressions e1 and e2 are element-wise equal. More...
 
template<typename E1 , typename E2 >
VectorEquality< E1, E2 >::ResultType operator!= (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Tells whether the vector expressions e1 and e2 differ in at least one element. More...
 
template<typename E1 , typename E2 , typename T >
std::enable_if< std::is_arithmetic< T >::value, typename VectorToleranceEquality< E1, E2, T >::ResultType >::type equals (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2, const T &eps)
 Tells whether the vector expressions e1 and e2 agree element-wise within the absolute tolerance eps. More...
 
template<typename E >
VectorUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj (const VectorExpression< E > &e)
 Returns the element-wise complex conjugate of the vector expression e (identity for real-valued vectors). More...
 
template<typename E >
VectorUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType herm (const VectorExpression< E > &e)
 Returns the Hermitian conjugate of the vector expression e (alias of conj() for vectors). More...
 
template<typename E >
VectorUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real (const VectorExpression< E > &e)
 Returns the element-wise real part of the vector expression e. More...
 
template<typename E >
VectorUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag (const VectorExpression< E > &e)
 Returns the element-wise imaginary part of the vector expression e. More...
 
template<typename E1 , typename E2 >
VectorBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the element-wise quotient of the vector expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
VectorBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the element-wise product (Hadamard product) of the vector expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
VectorBinary2Traits< E1, E2, VectorCrossProduct< E1, E2 > >::ResultType crossProd (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the 3-vector cross product \( e_1 \times e_2 \) as an expression-template node. More...
 
template<typename E1 , typename E2 >
VectorInnerProduct< E1, E2 >::ResultType innerProd (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Returns the inner (dot) product of the vector expressions e1 and e2. More...
 
template<typename E1 , typename E2 , typename T >
VectorAngleCosine< E1, E2, T >::ResultType angleCos (const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2, const T &sd, bool clamp=true)
 Returns the cosine of the angle between the vector expressions e1 and e2 (optionally clamped to [-1, 1]). More...
 
template<typename E >
VectorElementSum< E >::ResultType sum (const VectorExpression< E > &e)
 Returns the sum of all elements of the vector expression e. More...
 
template<typename E >
VectorNorm1< E >::ResultType norm1 (const VectorExpression< E > &e)
 Returns the L1 norm of the vector expression e ( \( \sum_i |e(i)| \)). More...
 
template<typename E >
VectorNorm2< E >::ResultType norm2 (const VectorExpression< E > &e)
 Returns the L2 (Euclidean) norm of the vector expression e ( \( \sqrt{\sum_i |e(i)|^2} \)). More...
 
template<typename E >
VectorNormInfinity< E >::ResultType normInf (const VectorExpression< E > &e)
 Returns the L∞ norm of the vector expression e ( \( \max_i |e(i)| \)). More...
 
template<typename E >
VectorNormInfinityIndex< E >::ResultType normInfIndex (const VectorExpression< E > &e)
 Returns the (first) index at which the vector expression e attains its L∞ norm. More...
 
template<typename E >
VectorNorm2< E >::ResultType length (const VectorExpression< E > &e)
 Returns the length (L2 norm) of the vector expression e (alias of norm2()). More...
 
template<typename E >
const E & trans (const VectorExpression< E > &e)
 Returns the transpose of the vector expression e (the identity for vectors — provided for matrix-API symmetry). More...
 
template<typename E >
E & trans (VectorExpression< E > &e)
 Returns the transpose of the mutable vector expression e (the identity for vectors — provided for matrix-API symmetry). More...
 
template<typename E1 , typename E2 >
QuaternionVectorBinaryTraits< E1, E2, QuaternionVectorRotation< E1, E2 > >::ResultType rotate (const QuaternionExpression< E1 > &e1, const VectorExpression< E2 > &e2)
 Rotates the vector expression e2 by the quaternion expression e1. More...
 
template<typename E >
VectorIteratorTraits< E >::IteratorType vectorBegin (VectorExpression< E > &e)
 Returns a mutable iterator pointing to the first element of the vector expression e. More...
 
template<typename E >
VectorIteratorTraits< E >::IteratorType vectorEnd (VectorExpression< E > &e)
 Returns a mutable iterator pointing one past the last element of the vector expression e. More...
 
template<typename E >
VectorIteratorTraits< const E >::IteratorType vectorBegin (const VectorExpression< E > &e)
 Returns a constant iterator pointing to the first element of the vector expression e. More...
 
template<typename E >
VectorIteratorTraits< const E >::IteratorType vectorEnd (const VectorExpression< E > &e)
 Returns a constant iterator pointing one past the last element of the vector expression e. More...
 
template<typename E >
VectorRange< E > range (VectorExpression< E > &e, const typename VectorRange< E >::RangeType &r)
 Creates a mutable Math::VectorRange view of the subrange r of the vector expression e. More...
 
template<typename E >
VectorRange< const E > range (const VectorExpression< E > &e, const typename VectorRange< const E >::RangeType &r)
 Creates a constant Math::VectorRange view of the subrange r of the vector expression e. More...
 
template<typename E >
VectorRange< E > range (VectorExpression< E > &e, typename VectorRange< E >::RangeType::SizeType start, typename VectorRange< E >::RangeType::SizeType stop)
 Creates a mutable Math::VectorRange view of the subrange [start, stop) of the vector expression e. More...
 
template<typename E >
VectorRange< const E > range (const VectorExpression< E > &e, typename VectorRange< const E >::RangeType::SizeType start, typename VectorRange< const E >::RangeType::SizeType stop)
 Creates a constant Math::VectorRange view of the subrange [start, stop) of the vector expression e. More...
 
template<typename E >
VectorSlice< E > slice (VectorExpression< E > &e, const typename VectorSlice< E >::SliceType &s)
 Creates a mutable Math::VectorSlice view of the slice s of the vector expression e. More...
 
template<typename E >
VectorSlice< const E > slice (const VectorExpression< E > &e, const typename VectorSlice< const E >::SliceType &s)
 Creates a constant Math::VectorSlice view of the slice s of the vector expression e. More...
 
template<typename E >
VectorSlice< E > slice (VectorExpression< E > &e, typename VectorSlice< E >::SliceType::SizeType start, typename VectorSlice< E >::SliceType::DifferenceType stride, typename VectorSlice< E >::SliceType::SizeType size)
 Creates a mutable Math::VectorSlice view of the slice (start, stride, size) of the vector expression e. More...
 
template<typename E >
VectorSlice< const E > slice (const VectorExpression< E > &e, typename VectorSlice< const E >::SliceType::SizeType start, typename VectorSlice< const E >::SliceType::DifferenceType stride, typename VectorSlice< const E >::SliceType::SizeType size)
 Creates a constant Math::VectorSlice view of the slice (start, stride, size) of the vector expression e. More...
 

Detailed Description

Contains classes and functions related to mathematics.

Typedef Documentation

◆ FScalingMatrix

◆ DScalingMatrix

◆ LScalingMatrix

◆ ULScalingMatrix

◆ FRotationMatrix

◆ DRotationMatrix

◆ LRotationMatrix

◆ ULRotationMatrix

◆ FTranslationMatrix

◆ DTranslationMatrix

◆ LTranslationMatrix

◆ ULTranslationMatrix

◆ FZeroGrid

Immutable grid where all elements have the value zero of type float.

◆ DZeroGrid

Immutable grid where all elements have the value zero of type double.

◆ FScalarGrid

Immutable grid where all elements have the same value of type float.

◆ DScalarGrid

Immutable grid where all elements have the same value of type double.

◆ FGrid

typedef Grid<float> CDPL::Math::FGrid

Unbounded dense grid storing floating point values of type float.

◆ DGrid

typedef Grid<double> CDPL::Math::DGrid

Unbounded dense grid storing floating point values of type double.

◆ FZeroMatrix

Memory-efficient immutable matrix where all elements have the value zero of type float.

◆ DZeroMatrix

Memory-efficient immutable matrix where all elements have the value zero of type double.

◆ LZeroMatrix

Memory-efficient immutable matrix where all elements have the value zero of type long.

◆ ULZeroMatrix

typedef ZeroMatrix<unsigned long> CDPL::Math::ULZeroMatrix

Memory-efficient immutable matrix where all elements have the value zero of type unsigned long.

◆ FScalarMatrix

Memory-efficient immutable matrix where all elements have the same value of type float.

◆ DScalarMatrix

Memory-efficient immutable matrix where all elements have the same value of type double.

◆ LScalarMatrix

Memory-efficient immutable matrix where all elements have the same value of type long.

◆ ULScalarMatrix

typedef ScalarMatrix<unsigned long> CDPL::Math::ULScalarMatrix

Memory-efficient immutable matrix where all elements have the same value of type unsigned long.

◆ FIdentityMatrix

Memory-efficient immutable identity matrix with element values of type float.

◆ DIdentityMatrix

Memory-efficient immutable identity matrix with element values of type double.

◆ LIdentityMatrix

Memory-efficient immutable identity matrix with element values of type long.

◆ ULIdentityMatrix

Memory-efficient immutable identity matrix with element values of type unsigned long.

◆ FMatrix

typedef Matrix<float> CDPL::Math::FMatrix

Unbounded dense matrix holding floating point values of type float..

◆ DMatrix

typedef Matrix<double> CDPL::Math::DMatrix

Unbounded dense matrix holding floating point values of type double..

◆ LMatrix

typedef Matrix<long> CDPL::Math::LMatrix

Unbounded dense matrix holding signed integers of type long.

◆ ULMatrix

typedef Matrix<unsigned long> CDPL::Math::ULMatrix

Unbounded dense matrix holding unsigned integers of type unsigned long.

◆ Matrix2F

typedef CMatrix<float, 2, 2> CDPL::Math::Matrix2F

Bounded 2x2 matrix holding floating point values of type float.

◆ Matrix3F

typedef CMatrix<float, 3, 3> CDPL::Math::Matrix3F

Bounded 3x3 matrix holding floating point values of type float.

◆ Matrix4F

typedef CMatrix<float, 4, 4> CDPL::Math::Matrix4F

Bounded 4x4 matrix holding floating point values of type float.

◆ Matrix2D

typedef CMatrix<double, 2, 2> CDPL::Math::Matrix2D

Bounded 2x2 matrix holding floating point values of type double.

◆ Matrix3D

typedef CMatrix<double, 3, 3> CDPL::Math::Matrix3D

Bounded 3x3 matrix holding floating point values of type double.

◆ Matrix4D

typedef CMatrix<double, 4, 4> CDPL::Math::Matrix4D

Bounded 4x4 matrix holding floating point values of type double.

◆ Matrix2L

typedef CMatrix<long, 2, 2> CDPL::Math::Matrix2L

Bounded 2x2 matrix holding signed integers of type long.

◆ Matrix3L

typedef CMatrix<long, 3, 3> CDPL::Math::Matrix3L

Bounded 3x3 matrix holding signed integers of type long.

◆ Matrix4L

typedef CMatrix<long, 4, 4> CDPL::Math::Matrix4L

Bounded 4x4 matrix holding signed integers of type long.

◆ Matrix2UL

typedef CMatrix<unsigned long, 2, 2> CDPL::Math::Matrix2UL

Bounded 2x2 matrix holding unsigned integers of type unsigned long.

◆ Matrix3UL

typedef CMatrix<unsigned long, 3, 3> CDPL::Math::Matrix3UL

Bounded 3x3 matrix holding unsigned integers of type unsigned long.

◆ Matrix4UL

typedef CMatrix<unsigned long, 4, 4> CDPL::Math::Matrix4UL

Bounded 4x4 matrix holding unsigned integers of type unsigned long.

◆ SparseFMatrix

Unbounded sparse matrix holding floating point values of type float..

◆ SparseDMatrix

Unbounded sparse matrix holding floating point values of type double..

◆ SparseLMatrix

Unbounded sparse matrix holding signed integers of type long.

◆ SparseULMatrix

typedef SparseMatrix<unsigned long> CDPL::Math::SparseULMatrix

Unbounded sparse matrix holding unsigned integers of type unsigned long.

◆ FQuaternion

General 4-component quaternion with component values of type float.

◆ DQuaternion

General 4-component quaternion with component values of type double.

◆ LQuaternion

General 4-component quaternion with component values of type long.

◆ ULQuaternion

typedef Quaternion<unsigned long> CDPL::Math::ULQuaternion

General 4-component quaternion with component values of type unsigned long.

◆ FRealQuaternion

A memory-efficient pure-real quaternion with component values of type float.

◆ DRealQuaternion

A memory-efficient pure-real quaternion with component values of type double.

◆ LRealQuaternion

A memory-efficient pure-real quaternion with component values of type long.

◆ ULRealQuaternion

A memory-efficient pure-real quaternion with component values of type unsigned long.

◆ FRegularSpatialGrid

Unbounded dense regular grid storing floating point values of type float.

◆ DRegularSpatialGrid

Unbounded dense regular grid storing floating point values of type double.

◆ FScalarVector

Memory-efficient immutable vector where all elements have the same value of type float.

◆ DScalarVector

Memory-efficient immutable vector where all elements have the same value of type double.

◆ LScalarVector

Memory-efficient immutable vector where all elements have the same value of type long.

◆ ULScalarVector

typedef ScalarVector<unsigned long> CDPL::Math::ULScalarVector

Memory-efficient immutable vector where all elements have the same value of type unsigned long.

◆ FZeroVector

Memory-efficient immutable vector where all elements have the value zero of type float.

◆ DZeroVector

Memory-efficient immutable vector where all elements have the value zero of type double.

◆ LZeroVector

Memory-efficient immutable vector where all elements have the value zero of type long.

◆ ULZeroVector

typedef ZeroVector<unsigned long> CDPL::Math::ULZeroVector

Memory-efficient immutable vector where all elements have the value zero of type unsigned long.

◆ FUnitVector

Memory-efficient immutable unit vector with element values of type float.

◆ DUnitVector

Memory-efficient immutable unit vector with element values of type double.

◆ LUnitVector

Memory-efficient immutable unit vector with element values of type long.

◆ ULUnitVector

typedef UnitVector<unsigned long> CDPL::Math::ULUnitVector

Memory-efficient immutable unit vector with element values of type unsigned long.

◆ Vector2F

typedef CVector<float, 2> CDPL::Math::Vector2F

Bounded 2 element vector holding floating point values of type float.

◆ Vector3F

typedef CVector<float, 3> CDPL::Math::Vector3F

Bounded 3 element vector holding floating point values of type float.

◆ Vector4F

typedef CVector<float, 4> CDPL::Math::Vector4F

Bounded 4 element vector holding floating point values of type float.

◆ Vector2D

typedef CVector<double, 2> CDPL::Math::Vector2D

Bounded 2 element vector holding floating point values of type double.

◆ Vector3D

typedef CVector<double, 3> CDPL::Math::Vector3D

Bounded 3 element vector holding floating point values of type double.

◆ Vector4D

typedef CVector<double, 4> CDPL::Math::Vector4D

Bounded 4 element vector holding floating point values of type double.

◆ Vector7D

typedef CVector<double, 7> CDPL::Math::Vector7D

Bounded 7 element vector holding floating point values of type double.

◆ Vector2L

typedef CVector<long, 2> CDPL::Math::Vector2L

Bounded 2 element vector holding signed integers of type long.

◆ Vector3L

typedef CVector<long, 3> CDPL::Math::Vector3L

Bounded 3 element vector holding signed integers of type long.

◆ Vector4L

typedef CVector<long, 4> CDPL::Math::Vector4L

Bounded 4 element vector holding signed integers of type long.

◆ Vector2UL

typedef CVector<unsigned long, 2> CDPL::Math::Vector2UL

Bounded 2 element vector holding unsigned integers of type unsigned long.

◆ Vector3UL

typedef CVector<unsigned long, 3> CDPL::Math::Vector3UL

Bounded 3 element vector holding unsigned integers of type unsigned long.

◆ Vector4UL

typedef CVector<unsigned long, 4> CDPL::Math::Vector4UL

Bounded 4 element vector holding unsigned integers of type unsigned long.

◆ FVector

typedef Vector<float> CDPL::Math::FVector

Unbounded dense vector holding floating point values of type float.

◆ DVector

typedef Vector<double> CDPL::Math::DVector

Unbounded dense vector holding floating point values of type double.

◆ LVector

typedef Vector<long> CDPL::Math::LVector

Unbounded dense vector holding signed integers of type long.

◆ ULVector

typedef Vector<unsigned long> CDPL::Math::ULVector

Unbounded dense vector holding unsigned integers of type unsigned long.

◆ SparseFVector

Unbounded sparse vector holding floating point values of type float.

◆ SparseDVector

Unbounded sparse vector holding floating point values of type double.

◆ SparseLVector

Unbounded sparse vector holding signed integers of type long.

◆ SparseULVector

typedef SparseVector<unsigned long> CDPL::Math::SparseULVector

Unbounded sparse vector holding unsigned integers of type unsigned long.

◆ Vector2FArray

Array storing vectors of type Math::Vector2F.

◆ Vector3FArray

Array storing vectors of type Math::Vector3F.

◆ Vector2DArray

Array storing vectors of type Math::Vector2D.

◆ Vector3DArray

Array storing vectors of type Math::Vector3D.

◆ Vector2LArray

Array storing vectors of type Math::Vector2L.

◆ Vector3LArray

Array storing vectors of type Math::Vector3L.

◆ Vector2ULArray

Array storing vectors of type Math::Vector2UL.

◆ Vector3ULArray

Array storing vectors of type Math::Vector3UL.

Function Documentation

◆ direct() [1/2]

template<typename C >
DirectAssignmentProxy<const C> CDPL::Math::direct ( const C &  lvalue)

Convenience factory creating a Math::DirectAssignmentProxy for a const lvalue.

Template Parameters
CThe container type.
Parameters
lvalueThe lvalue to wrap.
Returns
A Math::DirectAssignmentProxy bound to lvalue.

◆ direct() [2/2]

template<typename C >
DirectAssignmentProxy<C> CDPL::Math::direct ( C &  lvalue)

Convenience factory creating a Math::DirectAssignmentProxy for a mutable lvalue.

Template Parameters
CThe container type.
Parameters
lvalueThe lvalue to wrap.
Returns
A Math::DirectAssignmentProxy bound to lvalue.

◆ gridAssignGrid()

template<template< typename T1, typename T2 > class F, typename G , typename E >
void CDPL::Math::gridAssignGrid ( G &  g,
const GridExpression< E > &  e 
)

Applies the element-wise functor F to every (grid cell, source cell) pair, i.e. F::apply(g(i,j,k), e()(i,j,k)).

Template Parameters
FThe element-wise binary functor template.
GThe destination grid container type.
EThe source grid expression type.
Parameters
gThe destination grid.
eThe source grid expression.
Exceptions
Base::SizeErrorif the dimensions of g and e differ.

◆ gridAssignScalar()

template<template< typename T1, typename T2 > class F, typename G , typename T >
void CDPL::Math::gridAssignScalar ( G &  g,
const T &  t 
)

Applies the element-wise functor F to every (grid cell, scalar) pair, i.e. F::apply(g(i,j,k), t).

Template Parameters
FThe element-wise binary functor template.
GThe destination grid container type.
TThe scalar type.
Parameters
gThe destination grid.
tThe scalar value applied to every cell.

◆ gridSwap()

template<typename G , typename E >
void CDPL::Math::gridSwap ( G &  g,
GridExpression< E > &  e 
)

Swaps the cells of two equally sized grid expressions cell by cell.

Template Parameters
GThe first grid container type.
EThe second grid expression type.
Parameters
gThe first grid.
eThe second grid expression.
Exceptions
Base::SizeErrorif the dimensions of g and e differ.

◆ operator-() [1/10]

template<typename E >
GridUnaryTraits<E, ScalarNegation<typename E::ValueType> >::ResultType CDPL::Math::operator- ( const GridExpression< E > &  e)

Returns the element-wise negation of the grid expression e.

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
An expression-template node representing \( -e \).

◆ operator+() [1/10]

template<typename E >
const E& CDPL::Math::operator+ ( const GridExpression< E > &  e)

Returns the grid expression e unchanged (unary +).

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
A const reference to e.

◆ operator+() [2/10]

template<typename E1 , typename E2 >
GridBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator+ ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2 
)

Returns the element-wise sum of the grid expressions e1 and e2.

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
Parameters
e1The first grid expression.
e2The second grid expression.
Returns
An expression-template node representing \( e_1 + e_2 \).

◆ operator-() [2/10]

template<typename E1 , typename E2 >
GridBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator- ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2 
)

Returns the element-wise difference of the grid expressions e1 and e2.

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
Parameters
e1The first grid expression.
e2The second grid expression.
Returns
An expression-template node representing \( e_1 - e_2 \).

◆ operator*() [1/12]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2GridBinaryTraits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator* ( const GridExpression< E > &  e,
const T &  t 
)

Returns the element-wise product of the grid expression e and the scalar t.

Template Parameters
EThe grid expression type.
TThe scalar type.
Parameters
eThe grid expression.
tThe scalar multiplier.
Returns
An expression-template node representing \( e \cdot t \).

◆ operator*() [2/12]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar1GridBinaryTraits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type CDPL::Math::operator* ( const T &  t,
const GridExpression< E > &  e 
)

Returns the element-wise product of the scalar t and the grid expression e.

Template Parameters
TThe scalar type.
EThe grid expression type.
Parameters
tThe scalar multiplier.
eThe grid expression.
Returns
An expression-template node representing \( t \cdot e \).

◆ operator/() [1/6]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2GridBinaryTraits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator/ ( const GridExpression< E > &  e,
const T &  t 
)

Returns the element-wise quotient of the grid expression e by the scalar t.

Template Parameters
EThe grid expression type.
TThe scalar type.
Parameters
eThe grid expression.
tThe scalar divisor.
Returns
An expression-template node representing \( e / t \).

◆ operator==() [1/4]

template<typename E1 , typename E2 >
GridEquality<E1, E2>::ResultType CDPL::Math::operator== ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2 
)

Tells whether the grid expressions e1 and e2 are element-wise equal.

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
Parameters
e1The first grid expression.
e2The second grid expression.
Returns
true if both grids have equal sizes and equal elements, and false otherwise.

◆ operator!=() [1/4]

template<typename E1 , typename E2 >
GridEquality<E1, E2>::ResultType CDPL::Math::operator!= ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2 
)

Tells whether the grid expressions e1 and e2 differ in at least one element.

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
Parameters
e1The first grid expression.
e2The second grid expression.
Returns
true if the grids differ in size or in any element, and false otherwise.

◆ equals() [1/4]

template<typename E1 , typename E2 , typename T >
std::enable_if<std::is_arithmetic<T>::value, typename GridToleranceEquality<E1, E2, T>::ResultType>::type CDPL::Math::equals ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2,
const T &  eps 
)

Tells whether the grid expressions e1 and e2 agree element-wise within the absolute tolerance eps.

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
TThe numeric tolerance type.
Parameters
e1The first grid expression.
e2The second grid expression.
epsThe non-negative absolute tolerance.
Returns
true if all elements agree within eps, and false otherwise.

◆ conj() [1/4]

template<typename E >
GridUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType CDPL::Math::conj ( const GridExpression< E > &  e)

Returns the element-wise complex conjugate of the grid expression e (identity for real-valued grids).

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ herm() [1/3]

template<typename E >
GridUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType CDPL::Math::herm ( const GridExpression< E > &  e)

Returns the Hermitian conjugate of the grid expression e (alias of conj() for grids).

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ real() [1/4]

template<typename E >
GridUnaryTraits<E, ScalarReal<typename E::ValueType> >::ResultType CDPL::Math::real ( const GridExpression< E > &  e)

Returns the element-wise real part of the grid expression e.

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
An expression-template node representing the real part of e.

◆ imag() [1/3]

template<typename E >
GridUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ResultType CDPL::Math::imag ( const GridExpression< E > &  e)

Returns the element-wise imaginary part of the grid expression e.

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
An expression-template node representing the imaginary part of e.

◆ elemDiv() [1/4]

template<typename E1 , typename E2 >
GridBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemDiv ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2 
)

Returns the element-wise quotient of the grid expressions e1 and e2.

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
Parameters
e1The numerator grid expression.
e2The denominator grid expression.
Returns
An expression-template node representing the element-wise quotient \( e_1 / e_2 \).

◆ elemProd() [1/4]

template<typename E1 , typename E2 >
GridBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemProd ( const GridExpression< E1 > &  e1,
const GridExpression< E2 > &  e2 
)

Returns the element-wise product of the grid expressions e1 and e2 (Hadamard product).

Template Parameters
E1The first grid expression type.
E2The second grid expression type.
Parameters
e1The first grid expression.
e2The second grid expression.
Returns
An expression-template node representing the element-wise product \( e_1 \odot e_2 \).

◆ sum() [1/4]

template<typename E >
GridElementSum<E>::ResultType CDPL::Math::sum ( const GridExpression< E > &  e)

Returns the sum of all elements of the grid expression e.

Template Parameters
EThe grid expression type.
Parameters
eThe grid expression.
Returns
\( \sum_{i, j, k} e(i, j, k) \).

◆ operator<<() [1/4]

template<typename C , typename T , typename E >
std::basic_ostream<C, T>& CDPL::Math::operator<< ( std::basic_ostream< C, T > &  os,
const VectorExpression< E > &  e 
)

Writes a textual representation of the vector expression e to os.

Output format: size

Template Parameters
CThe stream character type.
TThe stream character traits.
EThe vector expression type.
Parameters
osThe output stream.
eThe vector expression to write.
Returns
A reference to os.

◆ operator<<() [2/4]

template<typename C , typename T , typename E >
std::basic_ostream<C, T>& CDPL::Math::operator<< ( std::basic_ostream< C, T > &  os,
const MatrixExpression< E > &  e 
)

Writes a textual representation of the matrix expression e to os:

Output format: rows,cols

where M = rows - 1 and N = cols - 1.

Empty matrices are written as [rows,cols]().

Template Parameters
CThe stream character type.
TThe stream character traits.
EThe matrix expression type.
Parameters
osThe output stream.
eThe matrix expression to write.
Returns
A reference to os.

◆ operator<<() [3/4]

template<typename C , typename T , typename E >
std::basic_ostream<C, T>& CDPL::Math::operator<< ( std::basic_ostream< C, T > &  os,
const QuaternionExpression< E > &  e 
)

Writes a textual representation of the quaternion expression e to os.

Output format: (c1,c2,c3,c4)

Template Parameters
CThe stream character type.
TThe stream character traits.
EThe quaternion expression type.
Parameters
osThe output stream.
eThe quaternion expression to write.
Returns
A reference to os.

◆ operator<<() [4/4]

template<typename C , typename T , typename E >
std::basic_ostream<C, T>& CDPL::Math::operator<< ( std::basic_ostream< C, T > &  os,
const GridExpression< E > &  e 
)

Writes a textual representation of the grid expression e to os.

Output format: d1,d2,d3

where each planeI is itself formatted as (row0,row1,...,rowD2) and each row as (e0,e1,...,eD3). Comma-separators are used at every level.

Empty grids are written as [d1,d2,d3]().

Template Parameters
CThe stream character type.
TThe stream character traits.
EThe grid expression type.
Parameters
osThe output stream.
eThe grid expression to write.
Returns
A reference to os.

◆ jacobiDiagonalize()

template<typename M1 , typename V , typename M2 >
bool CDPL::Math::jacobiDiagonalize ( MatrixExpression< M1 > &  a,
VectorExpression< V > &  d,
MatrixExpression< M2 > &  v,
std::size_t  max_iter = 50 
)

Computes all eigenvalues and eigenvectors of a real symmetric matrix an using Jacobi's algorithm [WJACO ].

On output, elements of a above the diagonal are destroyed. The vector d returns the eigenvalues of a. The columns of matrix v contain, on output, the normalized eigenvectors of a. For implementation details see [NRIC].

Parameters
aThe real symmetric matrix for which to compute eigenvalues and eigenvectors.
dThe output vector which will contain the eigenvalues of a.
vThe matrix whose columns will contain the normalized eigenvectors of a.
max_iterThe maximum number of iterations to perform.
Returns
true if a is a non-empty symmetric matrix and convergence has been reached in max_iter iterations, and false otherwise.
Precondition
a is symmetric and non-empty, i.e. a().getSize1() == a().getSize2() && a().getSize1() != 0, and furthermore d().getSize() >= a().getSize1().
Exceptions
Base::SizeErrorif preconditions are violated.

◆ solveLower() [1/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveLower ( const MatrixExpression< E1 > &  e1,
VectorExpression< E2 > &  e2 
)

Solves \( L\,x = b \) in place by forward-substitution, where e1 is a lower-triangular matrix.

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The vector expression type of the right-hand side.
Parameters
e1The lower-triangular coefficient matrix.
e2The right-hand side vector, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square, dimensions do not match, or a zero diagonal pivot is encountered.

◆ solveUnitLower() [1/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveUnitLower ( const MatrixExpression< E1 > &  e1,
VectorExpression< E2 > &  e2 
)

Solves \( L\,x = b \) in place by forward-substitution, where e1 is a unit lower-triangular matrix (1 on the diagonal).

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The vector expression type of the right-hand side.
Parameters
e1The unit lower-triangular coefficient matrix (diagonal entries are taken as 1).
e2The right-hand side vector, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square or dimensions do not match.

◆ solveLower() [2/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveLower ( const MatrixExpression< E1 > &  e1,
MatrixExpression< E2 > &  e2 
)

Solves \( L\,X = B \) in place column-wise by forward-substitution, where e1 is a lower-triangular matrix.

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The matrix expression type of the right-hand side.
Parameters
e1The lower-triangular coefficient matrix.
e2The right-hand side matrix, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square, dimensions do not match, or a zero diagonal pivot is encountered.

◆ solveUnitLower() [2/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveUnitLower ( const MatrixExpression< E1 > &  e1,
MatrixExpression< E2 > &  e2 
)

Solves \( L\,X = B \) in place column-wise by forward-substitution, where e1 is a unit lower-triangular matrix.

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The matrix expression type of the right-hand side.
Parameters
e1The unit lower-triangular coefficient matrix (diagonal entries are taken as 1).
e2The right-hand side matrix, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square or dimensions do not match.

◆ solveUpper() [1/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveUpper ( const MatrixExpression< E1 > &  e1,
VectorExpression< E2 > &  e2 
)

Solves \( U\,x = b \) in place by back-substitution, where e1 is an upper-triangular matrix.

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The vector expression type of the right-hand side.
Parameters
e1The upper-triangular coefficient matrix.
e2The right-hand side vector, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square, dimensions do not match, or a zero diagonal pivot is encountered.

◆ solveUnitUpper() [1/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveUnitUpper ( const MatrixExpression< E1 > &  e1,
VectorExpression< E2 > &  e2 
)

Solves \( U\,x = b \) in place by back-substitution, where e1 is a unit upper-triangular matrix (1 on the diagonal).

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The vector expression type of the right-hand side.
Parameters
e1The unit upper-triangular coefficient matrix (diagonal entries are taken as 1).
e2The right-hand side vector, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square or dimensions do not match.

◆ solveUpper() [2/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveUpper ( const MatrixExpression< E1 > &  e1,
MatrixExpression< E2 > &  e2 
)

Solves \( U\,X = B \) in place column-wise by back-substitution, where e1 is an upper-triangular matrix.

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The matrix expression type of the right-hand side.
Parameters
e1The upper-triangular coefficient matrix.
e2The right-hand side matrix, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square, dimensions do not match, or a zero diagonal pivot is encountered.

◆ solveUnitUpper() [2/2]

template<typename E1 , typename E2 >
bool CDPL::Math::solveUnitUpper ( const MatrixExpression< E1 > &  e1,
MatrixExpression< E2 > &  e2 
)

Solves \( U\,X = B \) in place column-wise by back-substitution, where e1 is a unit upper-triangular matrix.

Template Parameters
E1The matrix expression type of the coefficient matrix.
E2The matrix expression type of the right-hand side.
Parameters
e1The unit upper-triangular coefficient matrix (diagonal entries are taken as 1).
e2The right-hand side matrix, overwritten with the solution.
Returns
true if the substitution succeeded, and false if the system is not square or dimensions do not match.

◆ luDecompose() [1/2]

template<typename E >
E::SizeType CDPL::Math::luDecompose ( MatrixExpression< E > &  e)

Computes an in-place LU decomposition of the matrix e without partial pivoting.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix to decompose (modified in place).
Returns
The 1-based row index of the first singular pivot, or 0 if the matrix is non-singular.

◆ luDecompose() [2/2]

template<typename E , typename PV , typename T >
E::SizeType CDPL::Math::luDecompose ( MatrixExpression< E > &  e,
PV &  pv,
T &  num_row_swaps 
)

Computes an in-place LU decomposition of the matrix e with partial (row) pivoting.

Template Parameters
EThe matrix expression type.
PVThe permutation-vector type (must support indexed write access).
TAn arithmetic counter type.
Parameters
eThe matrix to decompose (modified in place).
pvThe output permutation vector recording the row pivots (pv[i] = pivot row index for step i).
num_row_swapsThe output count of executed row swaps.
Returns
The 1-based row index of the first singular pivot, or 0 if the matrix is non-singular.

◆ swapRows() [1/2]

template<typename E , typename PV >
void CDPL::Math::swapRows ( VectorExpression< E > &  e,
const PV &  pv 
)

Applies the permutation vector pv to the vector expression e by swapping element i with element pv[i].

Template Parameters
EThe vector expression type.
PVThe permutation-vector type.
Parameters
eThe vector to permute in place.
pvThe permutation vector.

◆ swapRows() [2/2]

template<typename E , typename PV >
void CDPL::Math::swapRows ( MatrixExpression< E > &  e,
const PV &  pv 
)

Applies the permutation vector pv to the rows of the matrix expression e by swapping row i with row pv[i].

Template Parameters
EThe matrix expression type.
PVThe permutation-vector type.
Parameters
eThe matrix to permute in place.
pvThe permutation vector.

◆ luSubstitute() [1/4]

template<typename E1 , typename E2 >
bool CDPL::Math::luSubstitute ( const MatrixExpression< E1 > &  lu,
VectorExpression< E2 > &  b 
)

Solves \( LU\,x = b \) for b in place, given the LU decomposition lu (without pivoting).

Template Parameters
E1The matrix expression type of lu.
E2The vector expression type of b.
Parameters
luThe LU decomposition.
bThe right-hand side vector, overwritten with the solution.
Returns
true if the back-substitution succeeded, and false if a zero pivot was encountered.

◆ luSubstitute() [2/4]

template<typename E1 , typename E2 , typename PV >
bool CDPL::Math::luSubstitute ( const MatrixExpression< E1 > &  lu,
const PV &  pv,
VectorExpression< E2 > &  b 
)

Solves \( LU\,x = b \) for b in place, given the LU decomposition lu and pivot vector pv.

Template Parameters
E1The matrix expression type of lu.
E2The vector expression type of b.
PVThe permutation-vector type.
Parameters
luThe LU decomposition (with pivoting).
pvThe permutation vector recorded during the LU decomposition.
bThe right-hand side vector, overwritten with the solution.
Returns
true if the back-substitution succeeded, and false if a zero pivot was encountered.

◆ luSubstitute() [3/4]

template<typename E1 , typename E2 >
bool CDPL::Math::luSubstitute ( const MatrixExpression< E1 > &  lu,
MatrixExpression< E2 > &  b 
)

Solves \( LU\,X = B \) for the matrix b in place, given the LU decomposition lu (without pivoting).

Template Parameters
E1The matrix expression type of lu.
E2The matrix expression type of b.
Parameters
luThe LU decomposition.
bThe right-hand side matrix, overwritten with the solution.
Returns
true if the back-substitution succeeded, and false if a zero pivot was encountered.

◆ luSubstitute() [4/4]

template<typename E1 , typename E2 , typename PV >
bool CDPL::Math::luSubstitute ( const MatrixExpression< E1 > &  lu,
const PV &  pv,
MatrixExpression< E2 > &  b 
)

Solves \( LU\,X = B \) for the matrix b in place, given the LU decomposition lu and pivot vector pv.

Template Parameters
E1The matrix expression type of lu.
E2The matrix expression type of b.
PVThe permutation-vector type.
Parameters
luThe LU decomposition (with pivoting).
pvThe permutation vector recorded during the LU decomposition.
bThe right-hand side matrix, overwritten with the solution.
Returns
true if the back-substitution succeeded, and false if a zero pivot was encountered.

◆ det() [1/2]

template<typename E >
E::ValueType CDPL::Math::det ( const MatrixExpression< E > &  e)

Returns the determinant of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
The determinant of e.

◆ det() [2/2]

template<typename C >
C::ValueType CDPL::Math::det ( const MatrixContainer< C > &  c)

Returns the determinant of the matrix container c (specialization avoiding an extra temporary copy when possible).

Template Parameters
CThe matrix container type.
Parameters
cThe matrix container.
Returns
The determinant of c.

◆ invert() [1/2]

template<typename E , typename C >
bool CDPL::Math::invert ( const MatrixExpression< E > &  e,
MatrixContainer< C > &  c 
)

Computes the inverse of the matrix expression e and stores it in c.

Template Parameters
EThe source matrix expression type.
CThe output matrix container type.
Parameters
eThe matrix expression to invert.
cThe output container receiving the inverse of e.
Returns
true if e is invertible and the inverse was computed, and false if e is singular.

◆ invert() [2/2]

template<typename C >
bool CDPL::Math::invert ( MatrixContainer< C > &  c)

Computes the inverse of the matrix container c in place.

Template Parameters
CThe matrix container type.
Parameters
cThe matrix container to invert in place.
Returns
true if c is invertible and the inverse was computed, and false if c is singular.

◆ triang() [1/2]

template<typename Tri , typename E >
TriangularAdapter<E, Tri> CDPL::Math::triang ( MatrixExpression< E > &  e)

Creates a Math::TriangularAdapter view of the matrix expression e using the triangular policy Tri.

Template Parameters
TriThe triangular-view selection policy (Math::Lower, Math::UnitLower, Math::Upper or Math::UnitUpper).
EThe matrix expression type.
Parameters
eThe matrix expression to wrap.
Returns
A mutable triangular view of e.

◆ triang() [2/2]

template<typename Tri , typename E >
TriangularAdapter<const E, Tri> CDPL::Math::triang ( const MatrixExpression< E > &  e)

Creates a constant Math::TriangularAdapter view of the matrix expression e using the triangular policy Tri.

Template Parameters
TriThe triangular-view selection policy (Math::Lower, Math::UnitLower, Math::Upper or Math::UnitUpper).
EThe matrix expression type.
Parameters
eThe matrix expression to wrap.
Returns
A constant triangular view of e.

◆ matrixAssignMatrix()

template<template< typename T1, typename T2 > class F, typename M , typename E >
void CDPL::Math::matrixAssignMatrix ( M &  m,
const MatrixExpression< E > &  e 
)

Applies the element-wise functor F to every (matrix element, source element) pair, i.e. F::apply(m(i,j), e()(i,j)).

Template Parameters
FThe element-wise binary functor template.
MThe destination matrix container type.
EThe source matrix expression type.
Parameters
mThe destination matrix.
eThe source matrix expression.
Exceptions
Base::SizeErrorif the dimensions of m and e differ.

◆ matrixAssignScalar()

template<template< typename T1, typename T2 > class F, typename M , typename T >
void CDPL::Math::matrixAssignScalar ( M &  m,
const T &  t 
)

Applies the element-wise functor F to every (matrix element, scalar) pair, i.e. F::apply(m(i,j), t).

Template Parameters
FThe element-wise binary functor template.
MThe destination matrix container type.
TThe scalar type.
Parameters
mThe destination matrix.
tThe scalar value applied to every element.

◆ matrixSwap()

template<typename M , typename E >
void CDPL::Math::matrixSwap ( M &  m,
MatrixExpression< E > &  e 
)

Swaps the elements of two equally sized matrix expressions element by element.

Template Parameters
MThe first matrix container type.
EThe second matrix expression type.
Parameters
mThe first matrix.
eThe second matrix expression.
Exceptions
Base::SizeErrorif the dimensions of m and e differ.

◆ operator-() [3/10]

template<typename E >
MatrixUnaryTraits<E, ScalarNegation<typename E::ValueType> >::ResultType CDPL::Math::operator- ( const MatrixExpression< E > &  e)

Returns the element-wise negation of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
An expression-template node representing \( -e \).

◆ operator+() [3/10]

template<typename E >
const E& CDPL::Math::operator+ ( const MatrixExpression< E > &  e)

Returns the matrix expression e unchanged (unary +).

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
A const reference to e.

◆ operator+() [4/10]

template<typename E1 , typename E2 >
MatrixBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator+ ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the element-wise sum of the matrix expressions e1 and e2.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
An expression-template node representing \( e_1 + e_2 \).

◆ operator-() [4/10]

template<typename E1 , typename E2 >
MatrixBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator- ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the element-wise difference of the matrix expressions e1 and e2.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
An expression-template node representing \( e_1 - e_2 \).

◆ operator*() [3/12]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2MatrixBinaryTraits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator* ( const MatrixExpression< E > &  e,
const T &  t 
)

Returns the element-wise product of the matrix expression e and the scalar t.

Template Parameters
EThe matrix expression type.
TThe scalar type.
Parameters
eThe matrix expression.
tThe scalar multiplier.
Returns
An expression-template node representing \( e \cdot t \).

◆ operator*() [4/12]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar1MatrixBinaryTraits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type CDPL::Math::operator* ( const T &  t,
const MatrixExpression< E > &  e 
)

Returns the element-wise product of the scalar t and the matrix expression e.

Template Parameters
TThe scalar type.
EThe matrix expression type.
Parameters
tThe scalar multiplier.
eThe matrix expression.
Returns
An expression-template node representing \( t \cdot e \).

◆ operator/() [2/6]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2MatrixBinaryTraits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator/ ( const MatrixExpression< E > &  e,
const T &  t 
)

Returns the element-wise quotient of the matrix expression e by the scalar t.

Template Parameters
EThe matrix expression type.
TThe scalar type.
Parameters
eThe matrix expression.
tThe scalar divisor.
Returns
An expression-template node representing \( e / t \).

◆ operator==() [2/4]

template<typename E1 , typename E2 >
MatrixEquality<E1, E2>::ResultType CDPL::Math::operator== ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Tells whether the matrix expressions e1 and e2 are element-wise equal.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
true if both matrices have equal dimensions and equal elements, and false otherwise.

◆ operator!=() [2/4]

template<typename E1 , typename E2 >
MatrixEquality<E1, E2>::ResultType CDPL::Math::operator!= ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Tells whether the matrix expressions e1 and e2 differ in at least one element.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
true if the matrices differ in dimension or in any element, and false otherwise.

◆ equals() [2/4]

template<typename E1 , typename E2 , typename T >
std::enable_if<std::is_arithmetic<T>::value, typename MatrixToleranceEquality<E1, E2, T>::ResultType>::type CDPL::Math::equals ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2,
const T &  eps 
)

Tells whether the matrix expressions e1 and e2 agree element-wise within the absolute tolerance eps.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
TThe numeric tolerance type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
epsThe non-negative absolute tolerance.
Returns
true if all elements agree within eps, and false otherwise.

◆ conj() [2/4]

template<typename E >
MatrixUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType CDPL::Math::conj ( const MatrixExpression< E > &  e)

Returns the element-wise complex conjugate of the matrix expression e (identity for real-valued matrices).

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ herm() [2/3]

template<typename E >
MatrixUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType CDPL::Math::herm ( const MatrixExpression< E > &  e)

Returns the Hermitian conjugate (conjugate transpose) of the matrix expression e — currently aliased to conj() pending transpose support.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ real() [2/4]

template<typename E >
MatrixUnaryTraits<E, ScalarReal<typename E::ValueType> >::ResultType CDPL::Math::real ( const MatrixExpression< E > &  e)

Returns the element-wise real part of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
An expression-template node representing the real part of e.

◆ imag() [2/3]

template<typename E >
MatrixUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ResultType CDPL::Math::imag ( const MatrixExpression< E > &  e)

Returns the element-wise imaginary part of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
An expression-template node representing the imaginary part of e.

◆ outerProd()

template<typename E1 , typename E2 >
VectorMatrixBinaryTraits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::outerProd ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the outer product of the vector expressions e1 and e2 as a matrix expression \( e_1 \cdot e_2^T \).

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
An expression-template node representing the outer product.

◆ elemDiv() [2/4]

template<typename E1 , typename E2 >
MatrixBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemDiv ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the element-wise quotient of the matrix expressions e1 and e2.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The numerator matrix expression.
e2The denominator matrix expression.
Returns
An expression-template node representing the element-wise quotient \( e_1 / e_2 \).

◆ elemProd() [2/4]

template<typename E1 , typename E2 >
MatrixBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemProd ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the element-wise product (Hadamard product) of the matrix expressions e1 and e2.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
An expression-template node representing the element-wise product \( e_1 \odot e_2 \).

◆ operator*() [5/12]

template<typename E1 , typename E2 >
Matrix1VectorBinaryTraits<E1, E2, MatrixVectorProduct<E1, E2> >::ResultType CDPL::Math::operator* ( const MatrixExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the matrix-vector product \( e_1 \cdot e_2 \) as a vector expression.

Template Parameters
E1The matrix expression type.
E2The vector expression type.
Parameters
e1The matrix expression.
e2The vector expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ prod() [1/6]

template<typename E1 , typename E2 >
Matrix1VectorBinaryTraits<E1, E2, MatrixVectorProduct<E1, E2> >::ResultType CDPL::Math::prod ( const MatrixExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the matrix-vector product \( e_1 \cdot e_2 \) as a vector expression (named-function form of operator*).

Template Parameters
E1The matrix expression type.
E2The vector expression type.
Parameters
e1The matrix expression.
e2The vector expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ prod() [2/6]

template<typename C , typename E1 , typename E2 >
C& CDPL::Math::prod ( const MatrixExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2,
VectorContainer< C > &  c 
)

Computes the matrix-vector product \( e_1 \cdot e_2 \) and stores it in c.

Template Parameters
CThe output vector container type.
E1The matrix expression type.
E2The input vector expression type.
Parameters
e1The matrix expression.
e2The input vector expression.
cThe output vector container receiving the result.
Returns
A reference to c.

◆ operator*() [6/12]

template<typename E1 , typename E2 >
Matrix2VectorBinaryTraits<E1, E2, VectorMatrixProduct<E1, E2> >::ResultType CDPL::Math::operator* ( const VectorExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the vector-matrix product \( e_1 \cdot e_2 \) as a vector expression.

Template Parameters
E1The vector expression type.
E2The matrix expression type.
Parameters
e1The vector expression.
e2The matrix expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ prod() [3/6]

template<typename E1 , typename E2 >
Matrix2VectorBinaryTraits<E1, E2, VectorMatrixProduct<E1, E2> >::ResultType CDPL::Math::prod ( const VectorExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the vector-matrix product \( e_1 \cdot e_2 \) as a vector expression (named-function form of operator*).

Template Parameters
E1The vector expression type.
E2The matrix expression type.
Parameters
e1The vector expression.
e2The matrix expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ prod() [4/6]

template<typename C , typename E1 , typename E2 >
C& CDPL::Math::prod ( const VectorExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2,
VectorContainer< C > &  c 
)

Computes the vector-matrix product \( e_1 \cdot e_2 \) and stores it in c.

Template Parameters
CThe output vector container type.
E1The input vector expression type.
E2The matrix expression type.
Parameters
e1The input vector expression.
e2The matrix expression.
cThe output vector container receiving the result.
Returns
A reference to c.

◆ operator*() [7/12]

template<typename E1 , typename E2 >
MatrixBinary2Traits<E1, E2, MatrixProduct<E1, E2> >::ResultType CDPL::Math::operator* ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the matrix-matrix product \( e_1 \cdot e_2 \) as a matrix expression.

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ prod() [5/6]

template<typename E1 , typename E2 >
MatrixBinary2Traits<E1, E2, MatrixProduct<E1, E2> >::ResultType CDPL::Math::prod ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2 
)

Returns the matrix-matrix product \( e_1 \cdot e_2 \) as a matrix expression (named-function form of operator*).

Template Parameters
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ prod() [6/6]

template<typename C , typename E1 , typename E2 >
C& CDPL::Math::prod ( const MatrixExpression< E1 > &  e1,
const MatrixExpression< E2 > &  e2,
MatrixContainer< C > &  c 
)

Computes the matrix-matrix product \( e_1 \cdot e_2 \) and stores it in c.

Template Parameters
CThe output matrix container type.
E1The first matrix expression type.
E2The second matrix expression type.
Parameters
e1The first matrix expression.
e2The second matrix expression.
cThe output matrix container receiving the result.
Returns
A reference to c.

◆ trace()

template<typename E >
MatrixTrace<E>::ResultType CDPL::Math::trace ( const MatrixExpression< E > &  e)

Returns the trace (sum of diagonal elements) of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
\( \sum_i e(i, i) \).

◆ norm1() [1/2]

template<typename E >
MatrixNorm1<E>::ResultType CDPL::Math::norm1 ( const MatrixExpression< E > &  e)

Returns the L1 (maximum absolute column sum) norm of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
The L1 norm of e.

◆ normFrob()

template<typename E >
MatrixNormFrobenius<E>::ResultType CDPL::Math::normFrob ( const MatrixExpression< E > &  e)

Returns the Frobenius norm of the matrix expression e ( \( \sqrt{\sum_{i, j} |e(i, j)|^2} \)).

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
The Frobenius norm of e.

◆ normInf() [1/2]

template<typename E >
MatrixNormInfinity<E>::ResultType CDPL::Math::normInf ( const MatrixExpression< E > &  e)

Returns the L∞ (maximum absolute row sum) norm of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
The L∞ norm of e.

◆ diag()

template<typename E >
VectorMatrixUnaryTraits<E, DiagonalMatrixFromVector<E> >::ResultType CDPL::Math::diag ( const VectorExpression< E > &  e)

Returns a diagonal matrix whose diagonal entries are the components of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
An expression-template node representing the diagonal matrix.

◆ cross()

template<typename E >
VectorMatrixUnaryTraits<E, CrossProductMatrixFromVector<E> >::ResultType CDPL::Math::cross ( const VectorExpression< E > &  e)

Returns the cross-product (skew-symmetric) matrix corresponding to the 3-vector expression e (such that cross(e) * v == crossProd(e, v)).

Template Parameters
EThe vector expression type.
Parameters
eThe 3-vector expression.
Returns
An expression-template node representing the skew-symmetric matrix.

◆ trans() [1/4]

template<typename E >
MatrixTranspose<E> CDPL::Math::trans ( MatrixExpression< E > &  e)

Returns a mutable Math::MatrixTranspose view of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression to transpose.
Returns
A mutable transpose view of e.

◆ trans() [2/4]

template<typename E >
MatrixTranspose<const E> CDPL::Math::trans ( const MatrixExpression< E > &  e)

Returns a constant Math::MatrixTranspose view of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression to transpose.
Returns
A constant transpose view of e.

◆ sum() [2/4]

template<typename E >
MatrixElementSum<E>::ResultType CDPL::Math::sum ( const MatrixExpression< E > &  e)

Returns the sum of all elements of the matrix expression e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
Returns
\( \sum_{i, j} e(i, j) \).

◆ row() [1/2]

template<typename M >
MatrixRow<M> CDPL::Math::row ( MatrixExpression< M > &  e,
typename MatrixRow< M >::SizeType  i 
)

Returns a mutable row proxy for row i of the matrix expression e.

Template Parameters
MThe matrix expression type.
Parameters
eThe matrix expression.
iThe zero-based row index.
Returns
A Math::MatrixRow proxy referring to row i of e.

◆ row() [2/2]

template<typename M >
MatrixRow<const M> CDPL::Math::row ( const MatrixExpression< M > &  e,
typename MatrixRow< const M >::SizeType  i 
)

Returns a const row proxy for row i of the matrix expression e.

Template Parameters
MThe matrix expression type.
Parameters
eThe matrix expression.
iThe zero-based row index.
Returns
A Math::MatrixRow proxy referring to row i of e.

◆ column() [1/2]

template<typename M >
MatrixColumn<M> CDPL::Math::column ( MatrixExpression< M > &  e,
typename MatrixColumn< M >::SizeType  j 
)

Returns a mutable column proxy for column j of the matrix expression e.

Template Parameters
MThe matrix expression type.
Parameters
eThe matrix expression.
jThe zero-based column index.
Returns
A Math::MatrixColumn proxy referring to column j of e.

◆ column() [2/2]

template<typename M >
MatrixColumn<const M> CDPL::Math::column ( const MatrixExpression< M > &  e,
typename MatrixColumn< const M >::SizeType  j 
)

Returns a const column proxy for column j of the matrix expression e.

Template Parameters
MThe matrix expression type.
Parameters
eThe matrix expression.
jThe zero-based column index.
Returns
A Math::MatrixColumn proxy referring to column j of e.

◆ range() [1/9]

template<typename E >
MatrixRange<E> CDPL::Math::range ( MatrixExpression< E > &  e,
const typename MatrixRange< E >::RangeType &  r1,
const typename MatrixRange< E >::RangeType &  r2 
)

Returns a mutable matrix range proxy viewing rows in r1 and columns in r2 of e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
r1The row index range.
r2The column index range.
Returns
A Math::MatrixRange proxy referring to the specified rectangular subrange of e.

◆ range() [2/9]

template<typename E >
MatrixRange<const E> CDPL::Math::range ( const MatrixExpression< E > &  e,
const typename MatrixRange< const E >::RangeType &  r1,
const typename MatrixRange< const E >::RangeType &  r2 
)

Returns a const matrix range proxy viewing rows in r1 and columns in r2 of e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
r1The row index range.
r2The column index range.
Returns
A Math::MatrixRange proxy referring to the specified rectangular subrange of e.

◆ range() [3/9]

template<typename E >
MatrixRange<E> CDPL::Math::range ( MatrixExpression< E > &  e,
typename MatrixRange< E >::RangeType::SizeType  start1,
typename MatrixRange< E >::RangeType::SizeType  stop1,
typename MatrixRange< E >::RangeType::SizeType  start2,
typename MatrixRange< E >::RangeType::SizeType  stop2 
)

Returns a mutable matrix range proxy viewing rows [start1, stop1) and columns [start2, stop2) of e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
start1The first row index (inclusive).
stop1The last row index (exclusive).
start2The first column index (inclusive).
stop2The last column index (exclusive).
Returns
A Math::MatrixRange proxy referring to the specified rectangular subrange of e.

◆ range() [4/9]

template<typename E >
MatrixRange<const E> CDPL::Math::range ( const MatrixExpression< E > &  e,
typename MatrixRange< const E >::RangeType::SizeType  start1,
typename MatrixRange< const E >::RangeType::SizeType  stop1,
typename MatrixRange< const E >::RangeType::SizeType  start2,
typename MatrixRange< const E >::RangeType::SizeType  stop2 
)

Returns a const matrix range proxy viewing rows [start1, stop1) and columns [start2, stop2) of e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
start1The first row index (inclusive).
stop1The last row index (exclusive).
start2The first column index (inclusive).
stop2The last column index (exclusive).
Returns
A Math::MatrixRange proxy referring to the specified rectangular subrange of e.

◆ slice() [1/9]

template<typename E >
MatrixSlice<E> CDPL::Math::slice ( MatrixExpression< E > &  e,
const typename MatrixSlice< E >::SliceType &  s1,
const typename MatrixSlice< E >::SliceType &  s2 
)

Returns a mutable matrix slice proxy viewing the strided rectangular slice (s1, s2) of e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
s1The row slice (start, stride, size).
s2The column slice (start, stride, size).
Returns
A Math::MatrixSlice proxy referring to the specified strided rectangular slice of e.

◆ slice() [2/9]

template<typename E >
MatrixSlice<const E> CDPL::Math::slice ( const MatrixExpression< E > &  e,
const typename MatrixSlice< const E >::SliceType &  s1,
const typename MatrixSlice< const E >::SliceType &  s2 
)

Returns a const matrix slice proxy viewing the strided rectangular slice (s1, s2) of e.

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
s1The row slice (start, stride, size).
s2The column slice (start, stride, size).
Returns
A Math::MatrixSlice proxy referring to the specified strided rectangular slice of e.

◆ slice() [3/9]

template<typename E >
MatrixSlice<E> CDPL::Math::slice ( MatrixExpression< E > &  e,
typename MatrixSlice< E >::SliceType::SizeType  start1,
typename MatrixSlice< E >::SliceType::DifferenceType  stride1,
typename MatrixSlice< E >::SliceType::SizeType  size1,
typename MatrixSlice< E >::SliceType::SizeType  start2,
typename MatrixSlice< E >::SliceType::DifferenceType  stride2,
typename MatrixSlice< E >::SliceType::SizeType  size2 
)

Returns a mutable matrix slice proxy specified by row (start1, stride1, size1) and column (start2, stride2, size2).

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
start1The start row index.
stride1The row stride.
size1The number of rows.
start2The start column index.
stride2The column stride.
size2The number of columns.
Returns
A Math::MatrixSlice proxy referring to the specified strided rectangular slice of e.

◆ slice() [4/9]

template<typename E >
MatrixSlice<const E> CDPL::Math::slice ( const MatrixExpression< E > &  e,
typename MatrixSlice< const E >::SliceType::SizeType  start1,
typename MatrixSlice< const E >::SliceType::DifferenceType  stride1,
typename MatrixSlice< const E >::SliceType::SizeType  size1,
typename MatrixSlice< const E >::SliceType::SizeType  start2,
typename MatrixSlice< const E >::SliceType::DifferenceType  stride2,
typename MatrixSlice< const E >::SliceType::SizeType  size2 
)

Returns a const matrix slice proxy specified by row (start1, stride1, size1) and column (start2, stride2, size2).

Template Parameters
EThe matrix expression type.
Parameters
eThe matrix expression.
start1The start row index.
stride1The row stride.
size1The number of rows.
start2The start column index.
stride2The column stride.
size2The number of columns.
Returns
A Math::MatrixSlice proxy referring to the specified strided rectangular slice of e.

◆ quat() [1/6]

template<typename T >
std::enable_if<IsScalar<T>::value, RealQuaternion<T> >::type CDPL::Math::quat ( const T &  t)

Constructs a Math::RealQuaternion from the scalar t (its real component).

Template Parameters
TThe scalar value type.
Parameters
tThe real component.
Returns
A real quaternion with C1 = t and zero imaginary components.

◆ quat() [2/6]

template<typename T1 , typename T2 >
Quaternion<typename CommonType<T1, T2>::Type> CDPL::Math::quat ( const T1 &  t1,
const T2 &  t2 
)

Constructs a Math::Quaternion from two scalar components t1 and t2 (C1, C2) — remaining components are zero.

Template Parameters
T1The type of the first component.
T2The type of the second component.
Parameters
t1The C1 component.
t2The C2 component.
Returns
A quaternion (t1, t2, 0, 0).

◆ quat() [3/6]

template<typename T1 , typename T2 , typename T3 >
Quaternion<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type> CDPL::Math::quat ( const T1 &  t1,
const T2 &  t2,
const T3 &  t3 
)

Constructs a Math::Quaternion from three scalar components (C1, C2, C3) — C4 is zero.

Template Parameters
T1The type of the C1 component.
T2The type of the C2 component.
T3The type of the C3 component.
Parameters
t1The C1 component.
t2The C2 component.
t3The C3 component.
Returns
A quaternion (t1, t2, t3, 0).

◆ quat() [4/6]

template<typename T1 , typename T2 , typename T3 , typename T4 >
Quaternion<typename CommonType<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type, T4>::Type> CDPL::Math::quat ( const T1 &  t1,
const T2 &  t2,
const T3 &  t3,
const T4 &  t4 
)

Constructs a Math::Quaternion from four scalar components (C1, C2, C3, C4).

Template Parameters
T1The type of the C1 component.
T2The type of the C2 component.
T3The type of the C3 component.
T4The type of the C4 component.
Parameters
t1The C1 component.
t2The C2 component.
t3The C3 component.
t4The C4 component.
Returns
A quaternion (t1, t2, t3, t4).

◆ vec() [1/5]

template<typename E >
QuaternionVectorAdapter<E> CDPL::Math::vec ( QuaternionExpression< E > &  e)

Creates a mutable Math::QuaternionVectorAdapter view of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression to wrap.
Returns
A mutable 4-element vector view of e.

◆ vec() [2/5]

template<typename E >
QuaternionVectorAdapter<const E> CDPL::Math::vec ( const QuaternionExpression< E > &  e)

Creates a constant Math::QuaternionVectorAdapter view of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression to wrap.
Returns
A constant 4-element vector view of e.

◆ quaternionAssignQuaternion()

template<template< typename T1, typename T2 > class F, typename Q , typename E >
void CDPL::Math::quaternionAssignQuaternion ( Q &  q,
const QuaternionExpression< E > &  e 
)

Applies the binary functor F componentwise between the destination quaternion q and the source quaternion expression e.

For each of the four quaternion components i in {C1, C2, C3, C4}, the call F::apply(q.getCi(), e().getCi()) is performed.

Template Parameters
FThe element-wise binary functor template (instantiated as F<Q::Reference, E::ValueType>).
QThe destination quaternion container type.
EThe source quaternion expression type.
Parameters
qThe destination quaternion.
eThe source quaternion expression.

◆ quaternionAssignScalar()

template<template< typename T1, typename T2 > class F, typename Q , typename T >
void CDPL::Math::quaternionAssignScalar ( Q &  q,
const T &  t 
)

Applies the element-wise functor F to every (quaternion component, scalar) pair.

Template Parameters
FThe element-wise binary functor template.
QThe destination quaternion container type.
TThe scalar type.
Parameters
qThe destination quaternion.
tThe scalar value applied to every component.

◆ quaternionSwap()

template<typename Q , typename E >
void CDPL::Math::quaternionSwap ( Q &  q,
QuaternionExpression< E > &  e 
)

Swaps the components of two quaternion expressions component by component.

Template Parameters
QThe first quaternion container type.
EThe second quaternion expression type.
Parameters
qThe first quaternion.
eThe second quaternion expression.

◆ operator-() [5/10]

template<typename E >
QuaternionUnary1Traits<E, ScalarNegation<typename E::ValueType> >::ResultType CDPL::Math::operator- ( const QuaternionExpression< E > &  e)

Returns the component-wise negation of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
An expression-template node representing \( -e \).

◆ operator+() [5/10]

template<typename E >
const E& CDPL::Math::operator+ ( const QuaternionExpression< E > &  e)

Returns the quaternion expression e unchanged (unary +).

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
A const reference to e.

◆ operator+() [6/10]

template<typename E1 , typename E2 >
QuaternionBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator+ ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Returns the component-wise sum of the quaternion expressions e1 and e2.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
Returns
An expression-template node representing \( e_1 + e_2 \).

◆ operator+() [7/10]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary2Traits<E, T, Scalar2QuaternionAddition<E, T> >::ResultType>::type CDPL::Math::operator+ ( const QuaternionExpression< E > &  e,
const T &  t 
)

Adds the scalar t to the real component (C1) of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
TThe scalar type.
Parameters
eThe quaternion expression.
tThe scalar summand.
Returns
An expression-template node representing \( e + t \).

◆ operator+() [8/10]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar1QuaternionBinary2Traits<T, E, Scalar1QuaternionAddition<T, E> >::ResultType>::type CDPL::Math::operator+ ( const T &  t,
const QuaternionExpression< E > &  e 
)

Adds the scalar t to the real component (C1) of the quaternion expression e (commutative form).

Template Parameters
TThe scalar type.
EThe quaternion expression type.
Parameters
tThe scalar summand.
eThe quaternion expression.
Returns
An expression-template node representing \( t + e \).

◆ operator-() [6/10]

template<typename E1 , typename E2 >
QuaternionBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator- ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Returns the component-wise difference of the quaternion expressions e1 and e2.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
Returns
An expression-template node representing \( e_1 - e_2 \).

◆ operator-() [7/10]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary2Traits<E, T, Scalar2QuaternionSubtraction<E, T> >::ResultType>::type CDPL::Math::operator- ( const QuaternionExpression< E > &  e,
const T &  t 
)

Subtracts the scalar t from the real component (C1) of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
TThe scalar type.
Parameters
eThe quaternion expression.
tThe scalar subtrahend.
Returns
An expression-template node representing \( e - t \).

◆ operator-() [8/10]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar1QuaternionBinary2Traits<T, E, Scalar1QuaternionSubtraction<T, E> >::ResultType>::type CDPL::Math::operator- ( const T &  t,
const QuaternionExpression< E > &  e 
)

Subtracts the quaternion expression e from the scalar t (forming \( t - e \) as a quaternion expression).

Template Parameters
TThe scalar type.
EThe quaternion expression type.
Parameters
tThe scalar minuend.
eThe quaternion expression to subtract.
Returns
An expression-template node representing \( t - e \).

◆ operator*() [8/12]

template<typename E1 , typename E2 >
QuaternionBinary2Traits<E1, E2, QuaternionProduct<E1, E2> >::ResultType CDPL::Math::operator* ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Returns the (Hamilton) product of the quaternion expressions e1 and e2.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
Returns
An expression-template node representing \( e_1 \cdot e_2 \).

◆ operator*() [9/12]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary1Traits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator* ( const QuaternionExpression< E > &  e,
const T &  t 
)

Returns the component-wise product of the quaternion expression e and the scalar t.

Template Parameters
EThe quaternion expression type.
TThe scalar type.
Parameters
eThe quaternion expression.
tThe scalar multiplier.
Returns
An expression-template node representing \( e \cdot t \).

◆ operator*() [10/12]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar1QuaternionBinary1Traits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type CDPL::Math::operator* ( const T &  t,
const QuaternionExpression< E > &  e 
)

Returns the component-wise product of the scalar t and the quaternion expression e.

Template Parameters
TThe scalar type.
EThe quaternion expression type.
Parameters
tThe scalar multiplier.
eThe quaternion expression.
Returns
An expression-template node representing \( t \cdot e \).

◆ operator/() [3/6]

template<typename E1 , typename E2 >
Scalar3QuaternionTernaryTraits<E1, E2, typename QuaternionNorm2<E2>::ResultType, QuaternionDivision<E1, E2, typename QuaternionNorm2<E2>::ResultType> >::ResultType CDPL::Math::operator/ ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Returns the quaternion division \( e_1 \cdot e_2^{-1} \) as an expression-template node.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The dividend quaternion expression.
e2The divisor quaternion expression.
Returns
An expression-template node representing \( e_1 / e_2 \).

◆ operator/() [4/6]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary1Traits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator/ ( const QuaternionExpression< E > &  e,
const T &  t 
)

Returns the component-wise quotient of the quaternion expression e by the scalar t.

Template Parameters
EThe quaternion expression type.
TThe scalar type.
Parameters
eThe quaternion expression.
tThe scalar divisor.
Returns
An expression-template node representing \( e / t \).

◆ operator/() [5/6]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar13QuaternionTernaryTraits<T, E, typename QuaternionNorm2<E>::ResultType, ScalarQuaternionDivision<T, E, typename QuaternionNorm2<E>::ResultType> >::ResultType>::type CDPL::Math::operator/ ( const T &  t,
const QuaternionExpression< E > &  e 
)

Returns the quaternion division of the scalar t by the quaternion expression e ( \( t \cdot e^{-1} \)).

Template Parameters
TThe scalar type.
EThe quaternion expression type.
Parameters
tThe scalar dividend.
eThe quaternion expression divisor.
Returns
An expression-template node representing \( t / e \).

◆ operator==() [3/4]

template<typename E1 , typename E2 >
QuaternionEquality<E1, E2>::ResultType CDPL::Math::operator== ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Tells whether the quaternion expressions e1 and e2 are component-wise equal.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
Returns
true if all four components agree, and false otherwise.

◆ operator!=() [3/4]

template<typename E1 , typename E2 >
QuaternionEquality<E1, E2>::ResultType CDPL::Math::operator!= ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Tells whether the quaternion expressions e1 and e2 differ in at least one component.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
Returns
true if at least one of the four components differs, and false otherwise.

◆ equals() [3/4]

template<typename E1 , typename E2 , typename T >
std::enable_if<std::is_arithmetic<T>::value, typename QuaternionToleranceEquality<E1, E2, T>::ResultType>::type CDPL::Math::equals ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2,
const T &  eps 
)

Tells whether the quaternion expressions e1 and e2 agree component-wise within the absolute tolerance eps.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
TThe numeric tolerance type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
epsThe non-negative absolute tolerance.
Returns
true if all four components agree within eps, and false otherwise.

◆ elemDiv() [3/4]

template<typename E1 , typename E2 >
QuaternionBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemDiv ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Returns the component-wise quotient of the quaternion expressions e1 and e2.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The numerator quaternion expression.
e2The denominator quaternion expression.
Returns
An expression-template node representing the component-wise quotient.

◆ elemProd() [3/4]

template<typename E1 , typename E2 >
QuaternionBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemProd ( const QuaternionExpression< E1 > &  e1,
const QuaternionExpression< E2 > &  e2 
)

Returns the component-wise product (Hadamard product) of the quaternion expressions e1 and e2.

Template Parameters
E1The first quaternion expression type.
E2The second quaternion expression type.
Parameters
e1The first quaternion expression.
e2The second quaternion expression.
Returns
An expression-template node representing the component-wise product.

◆ real() [3/4]

template<typename E >
E::ValueType CDPL::Math::real ( const QuaternionExpression< E > &  e)

Returns the real component (C1) of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
The real component \( \mathrm{Re}(e) \) as a scalar.

◆ unreal()

template<typename E >
QuaternionUnary2Traits<E, QuaternionUnreal<E> >::ResultType CDPL::Math::unreal ( const QuaternionExpression< E > &  e)

Returns the unreal (pure-quaternion) part of the quaternion expression e (with C1 zeroed out).

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
An expression-template node representing the unreal part of e.

◆ conj() [3/4]

template<typename E >
QuaternionUnary2Traits<E, QuaternionConjugate<E> >::ResultType CDPL::Math::conj ( const QuaternionExpression< E > &  e)

Returns the quaternion conjugate of the quaternion expression e (negates C2, C3, C4).

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ inv()

template<typename E >
Scalar2QuaternionBinary2Traits<E, typename QuaternionNorm2<E>::ResultType, QuaternionInverse<E, typename QuaternionNorm2<E>::ResultType> >::ResultType CDPL::Math::inv ( const QuaternionExpression< E > &  e)

Returns the multiplicative inverse of the quaternion expression e ( \( \overline{e} / |e|^2 \)).

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
An expression-template node representing \( e^{-1} \).

◆ norm()

template<typename E >
QuaternionNorm<E>::ResultType CDPL::Math::norm ( const QuaternionExpression< E > &  e)

Returns the norm (Euclidean length) of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
\( \|e\| = \sqrt{e \cdot \overline{e}} \).

◆ norm2() [1/2]

template<typename E >
QuaternionNorm2<E>::ResultType CDPL::Math::norm2 ( const QuaternionExpression< E > &  e)

Returns the squared norm of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
\( \|e\|^2 = e \cdot \overline{e} \).

◆ sum() [3/4]

template<typename E >
QuaternionElementSum<E>::ResultType CDPL::Math::sum ( const QuaternionExpression< E > &  e)

Returns the sum of the four components of the quaternion expression e.

Template Parameters
EThe quaternion expression type.
Parameters
eThe quaternion expression.
Returns
\( \sum_{i} C_i(e) \).

◆ range() [5/9]

Range<std::size_t> CDPL::Math::range ( std::size_t  start,
std::size_t  stop 
)
inline

Convenience factory for Math::Range with std::size_t indices.

Parameters
startThe lower (inclusive) bound.
stopThe upper (exclusive) bound.
Returns
The constructed Math::Range instance.

◆ interpolateTrilinear()

template<typename T , typename C , typename GD , typename XF , typename V >
T CDPL::Math::interpolateTrilinear ( const RegularSpatialGrid< T, C, GD, XF > &  grid,
const V &  pos,
bool  local_pos 
)

Returns the trilinearly-interpolated value of grid at pos.

Template Parameters
TThe grid cell value type.
CThe coordinate value type.
GDThe underlying grid data container type.
XFThe coordinate transformation type.
VThe position vector type (indexable via operator[] for 3 components).
Parameters
gridThe regular spatial grid.
posThe query position.
local_posIf true, pos is interpreted as local (cell-index space) coordinates; if false, pos is interpreted as world coordinates and converted via the inverse transform.
Returns
The trilinearly-interpolated cell value at pos (zero if grid is empty).

◆ slice() [5/9]

Slice<std::size_t, std::ptrdiff_t> CDPL::Math::slice ( std::size_t  start,
std::ptrdiff_t  stride,
std::size_t  size 
)
inline

Convenience factory for Math::Slice with std::size_t indices and std::ptrdiff_t stride.

Parameters
startThe starting global index.
strideThe signed step size between consecutive entries.
sizeThe number of entries.
Returns
The constructed Math::Slice instance.

◆ factorial()

template<typename T >
T CDPL::Math::factorial ( unsigned int  n)

Computes the factorial \( n! \) of the non-negative integer n.

Parameters
nThe non-negative integer for which to compute the factorial.
Returns
The computed factorial of n.

◆ pythag()

template<typename T >
T CDPL::Math::pythag ( const T &  a,
const T &  b 
)

Computes \( \sqrt{a^2 + b^2} \) without destructive underflow or overflow.

Parameters
aThe variable a.
bThe variable b.
Returns
The result of computing \( \sqrt{a^2 + b^2} \).

◆ sign()

template<typename T1 , typename T2 >
T1 CDPL::Math::sign ( const T1 &  a,
const T2 &  b 
)

Returns the magnitude of parameter a times the sign of parameter b.

Parameters
aThe parameter a.
bThe parameter b.
Returns
a times the sign of parameter b.

◆ lnGamma()

template<typename T >
T CDPL::Math::lnGamma ( const T &  z)

Computes \( \ln[\Gamma(z)] \) for \( z > 0 \).

Parameters
zThe argument to the gamma function.
Returns
The computed logarithm of the gamma function value for z.

◆ gammaQ()

template<typename T >
T CDPL::Math::gammaQ ( const T &  a,
const T &  x 
)

Computes the incomplete gamma function \( Q(a, x) = 1 - P(a, x) \) (see [NRIC] for details).

Parameters
aThe function argument a.
xThe function argument x.
Returns
The computed value of the incomplete gamma function.

◆ generalizedBell()

template<typename T >
T CDPL::Math::generalizedBell ( const T &  x,
const T &  a,
const T &  b,
const T &  c 
)

Computes the generalized bell function \( Bell(x) = \frac{1}{1 + |\frac{x-c}{a}|^{2b}} \) at x.

Parameters
xThe generalized bell function argument
aControls the width of the curve at \(f(x) = 0.5 \).
bControls the slope of the curve at \( x = c - a \) and \( x = c + a \).
cLocates the center of the curve.
Returns
The generalized bell function value at x.

◆ svBackSubstitution()

template<typename M1 , typename V1 , typename M2 , typename V2 , typename V3 >
void CDPL::Math::svBackSubstitution ( const M1 &  u,
const V1 &  w,
const M2 &  v,
const V2 &  b,
V3 &  x 
)

Solves \( A \cdot X = B \) for a vector \( X \) where \( A \) is given by its Singular Value Decomposition [WSVD].

The \( M \times N \)-dimensional matrix \( A \) is specified by its singular value decomposition \( A = UWV^T \), where \( U \) is given by the \( M \times N \)-dimensional matrix u, \( W \) by the \( N \)-dimensional vector w, and \( V \) is given by the \( N \times N \)-dimensional matrix v. The right-hand side vector \( B \) is given by the \( M \)-dimensional vector b, and x is the \( N \)-dimensional output solution vector \( X \). No input quantities are destroyed, so the routine may be called sequentially with different arguments b. For implementation details see [NRIC].

Parameters
uThe \( M \times N \)-dimensional matrix \( U \).
wThe \( N \)-dimensional vector \( W \) holding the singular values of \( A \).
vThe \( N \times N \)-dimensional matrix \( V \).
bThe \( M \)-dimensional right-hand side vector \( B \).
xThe \( N \)-dimensional output solution vector \( X \).
Precondition
w.size() == u.size2(), v.size1() == u.size2() && v.size2() == c.size2(), and b.size() == u.size1().
See also
svDecomposition()

◆ svDecompose()

template<typename A , typename W , typename V >
bool CDPL::Math::svDecompose ( MatrixExpression< A > &  a,
VectorExpression< W > &  w,
MatrixExpression< V > &  v,
std::size_t  max_iter = 0 
)

Computes the Singular Value Decomposition [WSVD] \( A = UWV^T \) of a \( M \times N \)-dimensional matrix a.

The matrix \( U \) replaces a on output. The diagonal matrix of singular values \( W \) is output as the \( N \)-dimensional vector w. The matrix \( V \) (not the transpose \( V^T \)) is output as the \( N \times N \)-dimensional matrix v. For implementation details see [NRIC].

Parameters
aThe decomposed \( M \times N \)-matrix \( A \) which will be replaced by \( U \) on output.
wThe \( N \)-dimensional output vector \( W \) holding the singular values.
vThe \( N \times N \)-dimensional output matrix \( V \).
max_iterThe maximum number of iterations to perform, or 0 if no limit.
Returns
true if convergence has been reached in max_iter iterations, and false otherwise.
Precondition
w().getSize() >= a().getSize2(), v().getSize1() >= a().getSize2() and v().getSize2() >= a().getSize2().
Exceptions
Base::SizeErrorif preconditions are violated.

◆ svSubstitute() [1/2]

template<typename U , typename W , typename V , typename B , typename X >
void CDPL::Math::svSubstitute ( const MatrixExpression< U > &  u,
const VectorExpression< W > &  w,
const MatrixExpression< V > &  v,
const VectorExpression< B > &  b,
VectorExpression< X > &  x 
)

Solves \( A \cdot X = B \) for a vector \( X \) where \( A \) is given by its Singular Value Decomposition [WSVD].

The \( M \times N \)-dimensional matrix \( A \) is specified by its singular value decomposition \( A = UWV^T \), where \( U \) is given by the \( M \times N \)-dimensional matrix u, \( W \) by the \( N \)-dimensional vector w, and \( V \) is provided by the \( N \times N \)-dimensional matrix v. The right-hand side vector \( B \) is given by the \( M \)-dimensional vector b, and x is the \( N \)-dimensional output solution vector \( X \). No input quantities are destroyed, so the routine may be called sequentially with different arguments b. For implementation details see [NRIC].

Parameters
uThe \( M \times N \)-dimensional matrix \( U \).
wThe \( N \)-dimensional vector \( W \) holding the singular values of \( A \).
vThe \( N \times N \)-dimensional matrix \( V \).
bThe \( M \)-dimensional right-hand side vector \( B \).
xThe \( N \)-dimensional output solution vector \( X \).
Precondition
w.getSize() == u.getSize2(), v.getSize1() == u.getSize2() && v.getSize2() == u.getSize2(), x.getSize() == u.getSize2()) and b.getSize() == u.getSize1().
See also
svDecomposition()

◆ svSubstitute() [2/2]

template<typename U , typename W , typename V , typename B , typename X >
void CDPL::Math::svSubstitute ( const MatrixExpression< U > &  u,
const VectorExpression< W > &  w,
const MatrixExpression< V > &  v,
const MatrixExpression< B > &  b,
MatrixExpression< X > &  x 
)

Solves \( A \cdot X = B \) for a matrix \( X \) where \( A \) is given by its Singular Value Decomposition [WSVD].

The \( M \times N \)-dimensional matrix \( A \) is specified by its singular value decomposition \( A = UWV^T \), where \( U \) is given by the \( M \times N \)-dimensional matrix u, \( W \) by the \( N \)-dimensional vector w, and \( V \) is provided by the \( N \times N \)-dimensional matrix v. The \( M \times P \)-dimensional right-hand side matrix \( B \) is given by b, and x is the \( N \times P \)-dimensional output solution matrix \( X \). No input quantities are destroyed, so the routine may be called sequentially with different arguments b. For implementation details see [NRIC].

Parameters
uThe \( M \times N \)-dimensional matrix \( U \).
wThe \( N \)-dimensional vector \( W \) holding the singular values of \( A \).
vThe \( N \times N \)-dimensional matrix \( V \).
bThe \( M \times P \)-dimensional right-hand side matrix \( B \).
xThe \( N \times P \)-dimensional output solution matrix \( X \).
Precondition
w().getSize() == u().getSize2(), v().getSize1() == u().getSize2() && v().getSize2() == u().getSize2(), x().getSize1() == u().getSize2() and b().getSize1() == u().getSize1() && b().getSize2() == x().getSize2().
Exceptions
Base::SizeErrorif preconditions are violated.
See also
svDecomposition()

◆ vec() [3/5]

template<typename T1 , typename T2 >
CVector<typename CommonType<T1, T2>::Type, 2> CDPL::Math::vec ( const T1 &  t1,
const T2 &  t2 
)

Constructs a Math::CVector of size 2 from the components t1 and t2.

Template Parameters
T1The type of the first component.
T2The type of the second component.
Parameters
t1The first component.
t2The second component.
Returns
A 2-element vector with components (t1, t2).

◆ vec() [4/5]

template<typename T1 , typename T2 , typename T3 >
CVector<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type, 3> CDPL::Math::vec ( const T1 &  t1,
const T2 &  t2,
const T3 &  t3 
)

Constructs a Math::CVector of size 3 from the components t1, t2 and t3.

Template Parameters
T1The type of the first component.
T2The type of the second component.
T3The type of the third component.
Parameters
t1The first component.
t2The second component.
t3The third component.
Returns
A 3-element vector with components (t1, t2, t3).

◆ vec() [5/5]

template<typename T1 , typename T2 , typename T3 , typename T4 >
CVector<typename CommonType<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type, T4>::Type, 4> CDPL::Math::vec ( const T1 &  t1,
const T2 &  t2,
const T3 &  t3,
const T4 &  t4 
)

Constructs a Math::CVector of size 4 from the components t1, t2, t3 and t4.

Template Parameters
T1The type of the first component.
T2The type of the second component.
T3The type of the third component.
T4The type of the fourth component.
Parameters
t1The first component.
t2The second component.
t3The third component.
t4The fourth component.
Returns
A 4-element vector with components (t1, t2, t3, t4).

◆ quat() [5/6]

template<typename E >
VectorQuaternionAdapter<E> CDPL::Math::quat ( VectorExpression< E > &  e)

Creates a mutable Math::VectorQuaternionAdapter view of the 4-element vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression to wrap.
Returns
A mutable quaternion view of e.

◆ quat() [6/6]

template<typename E >
VectorQuaternionAdapter<const E> CDPL::Math::quat ( const VectorExpression< E > &  e)

Creates a constant Math::VectorQuaternionAdapter view of the 4-element vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression to wrap.
Returns
A constant quaternion view of e.

◆ homog() [1/2]

template<typename E >
HomogenousCoordsAdapter<E> CDPL::Math::homog ( VectorExpression< E > &  e)

Creates a mutable Math::HomogenousCoordsAdapter view of the vector expression e (extends e by an implicit 1).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression to wrap.
Returns
A mutable homogeneous-coordinates view of e.

◆ homog() [2/2]

template<typename E >
HomogenousCoordsAdapter<const E> CDPL::Math::homog ( const VectorExpression< E > &  e)

Creates a constant Math::HomogenousCoordsAdapter view of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression to wrap.
Returns
A constant homogeneous-coordinates view of e.

◆ transform() [1/2]

template<typename T , std::size_t Dim, typename T1 >
void CDPL::Math::transform ( VectorArray< CVector< T, Dim > > &  va,
const CMatrix< T1, Dim, Dim > &  xform 
)

Transforms each \( N \)-dimensional vector in the array with the \( N \)-dimensional square matrix xform.

Template Parameters
TThe vector value type.
DimThe vector dimension.
T1The matrix value type.
Parameters
vaThe vectors to transform.
xformThe transformation matrix.

◆ transform() [2/2]

template<typename T , std::size_t Dim, typename T1 >
void CDPL::Math::transform ( VectorArray< CVector< T, Dim > > &  va,
const CMatrix< T1, Dim+1, Dim+1 > &  xform 
)

Transforms each \( N \)-dimensional vector in the array with the \( N+1 \)-dimensional square matrix xform.

Template Parameters
TThe vector value type.
DimThe vector dimension.
T1The matrix value type.
Parameters
vaThe vectors to transform.
xformThe transformation matrix.
Note
The missing vector element is taken to be 1.0.

◆ calcCentroid()

template<typename T , std::size_t Dim, typename T1 >
bool CDPL::Math::calcCentroid ( const VectorArray< CVector< T, Dim > > &  va,
CVector< T1, Dim > &  ctr 
)

Calculates the centroid of the array elements.

Template Parameters
TThe vector value type.
DimThe vector dimension.
T1The centroid value type.
Parameters
vaThe vectors for which to calculate the centroid.
ctrStores the calculated centroid.
Returns
true if the array is not empty, and false otherwise.

◆ calcRMSD() [1/2]

template<typename T , std::size_t Dim>
T CDPL::Math::calcRMSD ( const VectorArray< CVector< T, Dim > > &  va1,
const VectorArray< CVector< T, Dim > > &  va2 
)

Calculates the root-mean-square distance between the corresponding elements of va1 and va2.

If the two arrays have different sizes, only the first min(va1.size, va2.size) elements are considered.

Template Parameters
TThe vector value type.
DimThe vector dimension.
Parameters
va1The first vector array.
va2The second vector array.
Returns
The RMSD value, or 0 if either array is empty.

◆ calcRMSD() [2/2]

template<typename T , std::size_t Dim, typename T1 >
T CDPL::Math::calcRMSD ( const VectorArray< CVector< T, Dim > > &  va1,
const VectorArray< CVector< T, Dim > > &  va2,
const CMatrix< T1, Dim+1, Dim+1 > &  va1_xform 
)

Calculates the root-mean-square distance between corresponding elements of va1 and va2 after applying the \( (N+1) \times (N+1) \) homogeneous transformation va1_xform to the elements of va1.

If the two arrays have different sizes, only the first min(va1.size, va2.size) elements are considered.

Template Parameters
TThe vector value type.
DimThe vector dimension.
T1The transformation matrix value type.
Parameters
va1The first vector array (transformed via va1_xform on the fly).
va2The second vector array.
va1_xformThe transformation matrix applied to va1 (with implicit homogeneous coordinate 1).
Returns
The RMSD value, or 0 if either array is empty.

◆ vectorAssignVector()

template<template< typename T1, typename T2 > class F, typename V , typename E >
void CDPL::Math::vectorAssignVector ( V &  v,
const VectorExpression< E > &  e 
)

Applies the element-wise functor F to every (vector element, source element) pair, i.e. F::apply(v(i), e()(i)).

Template Parameters
FThe element-wise binary functor template (e.g. assignment, plus-assign).
VThe destination vector container type.
EThe source vector expression type.
Parameters
vThe destination vector.
eThe source vector expression.
Exceptions
Base::SizeErrorif the sizes of v and e differ.

◆ vectorAssignScalar()

template<template< typename T1, typename T2 > class F, typename V , typename T >
void CDPL::Math::vectorAssignScalar ( V &  v,
const T &  t 
)

Applies the element-wise functor F to every (vector element, scalar) pair, i.e. F::apply(v(i), t).

Template Parameters
FThe element-wise binary functor template (e.g. assignment, multiply-assign).
VThe destination vector container type.
TThe scalar type.
Parameters
vThe destination vector.
tThe scalar value applied to every element.

◆ vectorSwap()

template<typename V , typename E >
void CDPL::Math::vectorSwap ( V &  v,
VectorExpression< E > &  e 
)

Swaps the elements of two equally sized vector expressions element by element.

Template Parameters
VThe first vector container type.
EThe second vector expression type.
Parameters
vThe first vector.
eThe second vector expression.
Exceptions
Base::SizeErrorif the sizes of v and e differ.

◆ operator-() [9/10]

template<typename E >
VectorUnaryTraits<E, ScalarNegation<typename E::ValueType> >::ResultType CDPL::Math::operator- ( const VectorExpression< E > &  e)

Returns the element-wise negation of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
An expression-template node representing \( -e \).

◆ operator+() [9/10]

template<typename E >
const E& CDPL::Math::operator+ ( const VectorExpression< E > &  e)

Returns the vector expression e unchanged (unary +).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A const reference to e.

◆ operator+() [10/10]

template<typename E1 , typename E2 >
VectorBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator+ ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the element-wise sum of the vector expressions e1 and e2.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
An expression-template node representing \( e_1 + e_2 \).

◆ operator-() [10/10]

template<typename E1 , typename E2 >
VectorBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::operator- ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the element-wise difference of the vector expressions e1 and e2.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
An expression-template node representing \( e_1 - e_2 \).

◆ operator*() [11/12]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2VectorBinaryTraits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator* ( const VectorExpression< E > &  e,
const T &  t 
)

Returns the element-wise product of the vector expression e and the scalar t.

Template Parameters
EThe vector expression type.
TThe scalar type.
Parameters
eThe vector expression.
tThe scalar multiplier.
Returns
An expression-template node representing \( e \cdot t \).

◆ operator*() [12/12]

template<typename T , typename E >
std::enable_if<IsScalar<T>::value, typename Scalar1VectorBinaryTraits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type CDPL::Math::operator* ( const T &  t,
const VectorExpression< E > &  e 
)

Returns the element-wise product of the scalar t and the vector expression e.

Template Parameters
TThe scalar type.
EThe vector expression type.
Parameters
tThe scalar multiplier.
eThe vector expression.
Returns
An expression-template node representing \( t \cdot e \).

◆ operator/() [6/6]

template<typename E , typename T >
std::enable_if<IsScalar<T>::value, typename Scalar2VectorBinaryTraits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type CDPL::Math::operator/ ( const VectorExpression< E > &  e,
const T &  t 
)

Returns the element-wise quotient of the vector expression e by the scalar t.

Template Parameters
EThe vector expression type.
TThe scalar type.
Parameters
eThe vector expression.
tThe scalar divisor.
Returns
An expression-template node representing \( e / t \).

◆ operator==() [4/4]

template<typename E1 , typename E2 >
VectorEquality<E1, E2>::ResultType CDPL::Math::operator== ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Tells whether the vector expressions e1 and e2 are element-wise equal.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
true if both vectors have equal sizes and equal elements, and false otherwise.

◆ operator!=() [4/4]

template<typename E1 , typename E2 >
VectorEquality<E1, E2>::ResultType CDPL::Math::operator!= ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Tells whether the vector expressions e1 and e2 differ in at least one element.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
true if the vectors differ in size or in any element, and false otherwise.

◆ equals() [4/4]

template<typename E1 , typename E2 , typename T >
std::enable_if<std::is_arithmetic<T>::value, typename VectorToleranceEquality<E1, E2, T>::ResultType>::type CDPL::Math::equals ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2,
const T &  eps 
)

Tells whether the vector expressions e1 and e2 agree element-wise within the absolute tolerance eps.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
TThe numeric tolerance type.
Parameters
e1The first vector expression.
e2The second vector expression.
epsThe non-negative absolute tolerance.
Returns
true if all elements agree within eps, and false otherwise.

◆ conj() [4/4]

template<typename E >
VectorUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType CDPL::Math::conj ( const VectorExpression< E > &  e)

Returns the element-wise complex conjugate of the vector expression e (identity for real-valued vectors).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ herm() [3/3]

template<typename E >
VectorUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType CDPL::Math::herm ( const VectorExpression< E > &  e)

Returns the Hermitian conjugate of the vector expression e (alias of conj() for vectors).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
An expression-template node representing \( \overline{e} \).

◆ real() [4/4]

template<typename E >
VectorUnaryTraits<E, ScalarReal<typename E::ValueType> >::ResultType CDPL::Math::real ( const VectorExpression< E > &  e)

Returns the element-wise real part of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
An expression-template node representing the real part of e.

◆ imag() [3/3]

template<typename E >
VectorUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ResultType CDPL::Math::imag ( const VectorExpression< E > &  e)

Returns the element-wise imaginary part of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
An expression-template node representing the imaginary part of e.

◆ elemDiv() [4/4]

template<typename E1 , typename E2 >
VectorBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemDiv ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the element-wise quotient of the vector expressions e1 and e2.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The numerator vector expression.
e2The denominator vector expression.
Returns
An expression-template node representing the element-wise quotient \( e_1 / e_2 \).

◆ elemProd() [4/4]

template<typename E1 , typename E2 >
VectorBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType CDPL::Math::elemProd ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the element-wise product (Hadamard product) of the vector expressions e1 and e2.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
An expression-template node representing the element-wise product \( e_1 \odot e_2 \).

◆ crossProd()

template<typename E1 , typename E2 >
VectorBinary2Traits<E1, E2, VectorCrossProduct<E1, E2> >::ResultType CDPL::Math::crossProd ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the 3-vector cross product \( e_1 \times e_2 \) as an expression-template node.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first 3-vector expression.
e2The second 3-vector expression.
Returns
An expression-template node representing the cross product.

◆ innerProd()

template<typename E1 , typename E2 >
VectorInnerProduct<E1, E2>::ResultType CDPL::Math::innerProd ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Returns the inner (dot) product of the vector expressions e1 and e2.

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
Parameters
e1The first vector expression.
e2The second vector expression.
Returns
\( \sum_i e_1(i) \cdot e_2(i) \).

◆ angleCos()

template<typename E1 , typename E2 , typename T >
VectorAngleCosine<E1, E2, T>::ResultType CDPL::Math::angleCos ( const VectorExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2,
const T &  sd,
bool  clamp = true 
)

Returns the cosine of the angle between the vector expressions e1 and e2 (optionally clamped to [-1, 1]).

Template Parameters
E1The first vector expression type.
E2The second vector expression type.
TThe norm-product scalar type.
Parameters
e1The first vector expression.
e2The second vector expression.
sdThe precomputed product \( \|e_1\| \cdot \|e_2\| \) of the two vector magnitudes.
clampIf true (default), the result is clamped to the range [-1, 1].
Returns
The (optionally clamped) cosine of the angle.

◆ sum() [4/4]

template<typename E >
VectorElementSum<E>::ResultType CDPL::Math::sum ( const VectorExpression< E > &  e)

Returns the sum of all elements of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
\( \sum_i e(i) \).

◆ norm1() [2/2]

template<typename E >
VectorNorm1<E>::ResultType CDPL::Math::norm1 ( const VectorExpression< E > &  e)

Returns the L1 norm of the vector expression e ( \( \sum_i |e(i)| \)).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
The L1 norm.

◆ norm2() [2/2]

template<typename E >
VectorNorm2<E>::ResultType CDPL::Math::norm2 ( const VectorExpression< E > &  e)

Returns the L2 (Euclidean) norm of the vector expression e ( \( \sqrt{\sum_i |e(i)|^2} \)).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
The L2 norm.

◆ normInf() [2/2]

template<typename E >
VectorNormInfinity<E>::ResultType CDPL::Math::normInf ( const VectorExpression< E > &  e)

Returns the L∞ norm of the vector expression e ( \( \max_i |e(i)| \)).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
The L∞ norm.

◆ normInfIndex()

template<typename E >
VectorNormInfinityIndex<E>::ResultType CDPL::Math::normInfIndex ( const VectorExpression< E > &  e)

Returns the (first) index at which the vector expression e attains its L∞ norm.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
The zero-based index of the element with the maximum absolute value.

◆ length()

template<typename E >
VectorNorm2<E>::ResultType CDPL::Math::length ( const VectorExpression< E > &  e)

Returns the length (L2 norm) of the vector expression e (alias of norm2()).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
The vector length.

◆ trans() [3/4]

template<typename E >
const E& CDPL::Math::trans ( const VectorExpression< E > &  e)

Returns the transpose of the vector expression e (the identity for vectors — provided for matrix-API symmetry).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A const reference to e.

◆ trans() [4/4]

template<typename E >
E& CDPL::Math::trans ( VectorExpression< E > &  e)

Returns the transpose of the mutable vector expression e (the identity for vectors — provided for matrix-API symmetry).

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A reference to e.

◆ rotate()

template<typename E1 , typename E2 >
QuaternionVectorBinaryTraits<E1, E2, QuaternionVectorRotation<E1, E2> >::ResultType CDPL::Math::rotate ( const QuaternionExpression< E1 > &  e1,
const VectorExpression< E2 > &  e2 
)

Rotates the vector expression e2 by the quaternion expression e1.

Template Parameters
E1The quaternion expression type.
E2The vector expression type.
Parameters
e1The unit quaternion expression encoding the rotation.
e2The vector expression to rotate.
Returns
An expression-template node representing the rotated 3-vector \( e_1 \cdot e_2 \cdot e_1^{-1} \).

◆ vectorBegin() [1/2]

template<typename E >
VectorIteratorTraits<E>::IteratorType CDPL::Math::vectorBegin ( VectorExpression< E > &  e)

Returns a mutable iterator pointing to the first element of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A mutable iterator pointing to the first element.

◆ vectorEnd() [1/2]

template<typename E >
VectorIteratorTraits<E>::IteratorType CDPL::Math::vectorEnd ( VectorExpression< E > &  e)

Returns a mutable iterator pointing one past the last element of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A mutable iterator pointing one past the last element.

◆ vectorBegin() [2/2]

template<typename E >
VectorIteratorTraits<const E>::IteratorType CDPL::Math::vectorBegin ( const VectorExpression< E > &  e)

Returns a constant iterator pointing to the first element of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A constant iterator pointing to the first element.

◆ vectorEnd() [2/2]

template<typename E >
VectorIteratorTraits<const E>::IteratorType CDPL::Math::vectorEnd ( const VectorExpression< E > &  e)

Returns a constant iterator pointing one past the last element of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
Returns
A constant iterator pointing one past the last element.

◆ range() [6/9]

template<typename E >
VectorRange<E> CDPL::Math::range ( VectorExpression< E > &  e,
const typename VectorRange< E >::RangeType &  r 
)

Creates a mutable Math::VectorRange view of the subrange r of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
rThe index range to view.
Returns
A mutable range view of e.

◆ range() [7/9]

template<typename E >
VectorRange<const E> CDPL::Math::range ( const VectorExpression< E > &  e,
const typename VectorRange< const E >::RangeType &  r 
)

Creates a constant Math::VectorRange view of the subrange r of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
rThe index range to view.
Returns
A constant range view of e.

◆ range() [8/9]

template<typename E >
VectorRange<E> CDPL::Math::range ( VectorExpression< E > &  e,
typename VectorRange< E >::RangeType::SizeType  start,
typename VectorRange< E >::RangeType::SizeType  stop 
)

Creates a mutable Math::VectorRange view of the subrange [start, stop) of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
startThe (inclusive) start index of the range.
stopThe (exclusive) end index of the range.
Returns
A mutable range view of e.

◆ range() [9/9]

template<typename E >
VectorRange<const E> CDPL::Math::range ( const VectorExpression< E > &  e,
typename VectorRange< const E >::RangeType::SizeType  start,
typename VectorRange< const E >::RangeType::SizeType  stop 
)

Creates a constant Math::VectorRange view of the subrange [start, stop) of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
startThe (inclusive) start index of the range.
stopThe (exclusive) end index of the range.
Returns
A constant range view of e.

◆ slice() [6/9]

template<typename E >
VectorSlice<E> CDPL::Math::slice ( VectorExpression< E > &  e,
const typename VectorSlice< E >::SliceType &  s 
)

Creates a mutable Math::VectorSlice view of the slice s of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
sThe (start, stride, size) slice to view.
Returns
A mutable slice view of e.

◆ slice() [7/9]

template<typename E >
VectorSlice<const E> CDPL::Math::slice ( const VectorExpression< E > &  e,
const typename VectorSlice< const E >::SliceType &  s 
)

Creates a constant Math::VectorSlice view of the slice s of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
sThe (start, stride, size) slice to view.
Returns
A constant slice view of e.

◆ slice() [8/9]

template<typename E >
VectorSlice<E> CDPL::Math::slice ( VectorExpression< E > &  e,
typename VectorSlice< E >::SliceType::SizeType  start,
typename VectorSlice< E >::SliceType::DifferenceType  stride,
typename VectorSlice< E >::SliceType::SizeType  size 
)

Creates a mutable Math::VectorSlice view of the slice (start, stride, size) of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
startThe (inclusive) start index of the slice.
strideThe stride between successive slice elements.
sizeThe number of elements of the slice.
Returns
A mutable slice view of e.

◆ slice() [9/9]

template<typename E >
VectorSlice<const E> CDPL::Math::slice ( const VectorExpression< E > &  e,
typename VectorSlice< const E >::SliceType::SizeType  start,
typename VectorSlice< const E >::SliceType::DifferenceType  stride,
typename VectorSlice< const E >::SliceType::SizeType  size 
)

Creates a constant Math::VectorSlice view of the slice (start, stride, size) of the vector expression e.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
startThe (inclusive) start index of the slice.
strideThe stride between successive slice elements.
sizeThe number of elements of the slice.
Returns
A constant slice view of e.