![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
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...
#include <MinimizerVariableArrayTraits.hpp>
Inheritance diagram for CDPL::Math::MinimizerVariableArrayTraits< A >:Public Types | |
| typedef A | ArrayType |
| The variable-array type. More... | |
| typedef A::ValueType | ValueType |
| The scalar value type stored in the array. More... | |
| typedef A::SizeType | SizeType |
| The size type used by the array. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static T | dot (const ArrayType &a1, const ArrayType &a2) |
| Computes the inner product (dot product) of two variable arrays. More... | |
| template<typename T > | |
| static T | norm2 (const ArrayType &a) |
| Computes the Euclidean (L2) norm of a using a numerically stable scaling algorithm. More... | |
| template<typename T > | |
| static void | axpy (const T &alpha, const ArrayType &x, ArrayType &y) |
| Performs the in-place BLAS-style axpy operation \( y \leftarrow y + \alpha\, x \). More... | |
| static void | clear (ArrayType &a) |
| Sets all elements of a to the default-constructed ValueType. More... | |
| static void | assign (ArrayType &a1, const ArrayType &a2) |
| Copies the contents of a2 into a1. More... | |
| template<typename T > | |
| static void | multiply (ArrayType &a, const T &v) |
| Multiplies every element of a by the scalar v. More... | |
| static void | sub (ArrayType &a1, const ArrayType &a2) |
| Subtracts a2 from a1 element-wise ( \( a_1 \leftarrow a_1 - a_2 \)). More... | |
Traits template that adapts arbitrary variable-array types to the linear-algebra operations required by minimizer implementations (dot, norm2, axpy, clear, assign, multiply, sub).
The primary template assumes A behaves like a Math::Vector (provides getSize, clear, assign, plusAssign/ minusAssign,innerProd and arithmetic operators). Specializations adapt other array-of-vector storage types.
| A | The variable array type. |
| typedef A CDPL::Math::MinimizerVariableArrayTraits< A >::ArrayType |
The variable-array type.
| typedef A::ValueType CDPL::Math::MinimizerVariableArrayTraits< A >::ValueType |
The scalar value type stored in the array.
| typedef A::SizeType CDPL::Math::MinimizerVariableArrayTraits< A >::SizeType |
The size type used by the array.
|
inlinestatic |
Computes the inner product (dot product) of two variable arrays.
| T | The scalar result type. |
| a1 | The first variable array. |
| a2 | The second variable array. |
|
inlinestatic |
Computes the Euclidean (L2) norm of a using a numerically stable scaling algorithm.
| T | The scalar result type. |
| a | The variable array. |
|
inlinestatic |
Performs the in-place BLAS-style axpy operation \( y \leftarrow y + \alpha\, x \).
| T | The scalar type of alpha. |
| alpha | The scalar multiplier. |
| x | The variable array x. |
| y | The variable array y (updated in place). |
|
inlinestatic |
Sets all elements of a to the default-constructed ValueType.
| a | The variable array to clear. |
|
inlinestatic |
Copies the contents of a2 into a1.
| a1 | The destination variable array. |
| a2 | The source variable array. |
|
inlinestatic |
Multiplies every element of a by the scalar v.
| T | The scalar type of v. |
| a | The variable array to scale (updated in place). |
| v | The scalar multiplier. |
|
inlinestatic |
Subtracts a2 from a1 element-wise ( \( a_1 \leftarrow a_1 - a_2 \)).
| a1 | The destination variable array (updated in place). |
| a2 | The variable array to subtract. |