28 #ifndef CDPL_MATH_MINIMIZERVARIABLEARRAYTRAITS_HPP
29 #define CDPL_MATH_MINIMIZERVARIABLEARRAYTRAITS_HPP
96 for (
SizeType i = 0; i < size; i++) {
122 template <
typename T>
125 y.plusAssign(alpha * x);
153 template <
typename T>
174 template <
typename V>
194 template <
typename T>
211 template <
typename T>
218 const typename VectorType::ConstPointer vx = it->getData();
219 typename VectorType::SizeType dim = it->getSize();
221 for (
typename VectorType::SizeType i = 0; i < dim; i++) {
248 template <
typename T>
258 it2->plusAssign(tmp);
288 template <
typename T>
305 it1->minusAssign(*it2);
313 template <
typename V>
333 template <
typename T>
338 for (
typename ArrayType::const_iterator it1 = a1.begin(), it2 = a2.begin(), end1 = a1.end(); it1 != end1; ++it1, ++it2)
350 template <
typename T>
356 for (
typename ArrayType::const_iterator it = a.begin(), end = a.end(); it != end; ++it) {
357 const typename VectorType::ConstPointer vx = it->getData();
358 typename VectorType::SizeType dim = it->getSize();
360 for (
typename VectorType::SizeType i = 0; i < dim; i++) {
387 template <
typename T>
390 typename ArrayType::iterator it2 = y.begin();
393 for (
typename ArrayType::const_iterator it1 = x.begin(), end1 = x.end(); it1 != end1; ++it1, ++it2) {
397 it2->plusAssign(tmp);
407 for (
typename ArrayType::iterator it = a.begin(), end = a.end(); it != end; ++it)
427 template <
typename T>
430 for (
typename ArrayType::iterator it = a.begin(), end = a.end(); it != end; ++it)
441 typename ArrayType::const_iterator it2 = a2.begin();
443 for (
typename ArrayType::iterator it1 = a1.begin(), end1 = a1.end(); it1 != end1; ++it1, ++it2)
444 it1->minusAssign(*it2);
Definition of type traits.
Definition of class CDPL::Math::VectorArray.
Array data type for the ordered storage of vector objects.
Definition: VectorArray.hpp:49
StorageType::const_iterator ConstElementIterator
A constant random access iterator used to iterate over the elements of the array.
Definition: Array.hpp:125
ConstElementIterator getElementsEnd() const
Returns a constant iterator pointing to the end of the array.
Definition: Array.hpp:904
StorageType::iterator ElementIterator
A mutable random access iterator used to iterate over the elements of the array.
Definition: Array.hpp:137
ConstElementIterator getElementsBegin() const
Returns a constant iterator pointing to the beginning of the array.
Definition: Array.hpp:892
std::size_t SizeType
The type of objects stored by the array.
Definition: Array.hpp:110
constexpr unsigned int A
Generic type that covers any element except hydrogen.
Definition: AtomType.hpp:637
constexpr unsigned int V
Specifies Vanadium.
Definition: AtomType.hpp:177
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
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.
Definition: VectorExpression.hpp:883
CDPL_VIS_API void scale(TriangleMesh3D &mesh, double scale_x, double scale_y, double scale_z, std::size_t vtx_offs=0, std::size_t vtx_count=0)
The namespace of the Chemical Data Processing Library.
VectorArray< V > ArrayType
The vector-array type.
Definition: MinimizerVariableArrayTraits.hpp:179
static void sub(ArrayType &a1, const ArrayType &a2)
Subtracts a2 from a1 element-wise ( ).
Definition: MinimizerVariableArrayTraits.hpp:300
V::ValueType ValueType
The scalar value type stored in the array elements.
Definition: MinimizerVariableArrayTraits.hpp:183
static void clear(ArrayType &a)
Sets all vector elements in a to the default-constructed ValueType.
Definition: MinimizerVariableArrayTraits.hpp:266
static void multiply(ArrayType &a, const T &v)
Multiplies every element of a by the scalar v.
Definition: MinimizerVariableArrayTraits.hpp:289
static void assign(ArrayType &a1, const ArrayType &a2)
Copies the contents of a2 into a1.
Definition: MinimizerVariableArrayTraits.hpp:277
ArrayType::SizeType SizeType
The size type used by the vector array.
Definition: MinimizerVariableArrayTraits.hpp:185
static void axpy(const T &alpha, const ArrayType &x, ArrayType &y)
Performs the in-place BLAS-style axpy operation .
Definition: MinimizerVariableArrayTraits.hpp:249
V VectorType
The vector type of the array elements.
Definition: MinimizerVariableArrayTraits.hpp:181
static T norm2(const ArrayType &a)
Computes the Euclidean (L2) norm of a using a numerically stable scaling algorithm.
Definition: MinimizerVariableArrayTraits.hpp:212
static T dot(const ArrayType &a1, const ArrayType &a2)
Computes the inner product (dot product) of two vector arrays.
Definition: MinimizerVariableArrayTraits.hpp:195
static void assign(ArrayType &a1, const ArrayType &a2)
Copies the contents of a2 into a1.
Definition: MinimizerVariableArrayTraits.hpp:416
static void clear(ArrayType &a)
Sets all vector elements in a to the default-constructed ValueType.
Definition: MinimizerVariableArrayTraits.hpp:405
V VectorType
The vector type of the array elements.
Definition: MinimizerVariableArrayTraits.hpp:320
ArrayType::size_type SizeType
The size type used by the vector array.
Definition: MinimizerVariableArrayTraits.hpp:324
std::vector< V > ArrayType
The vector-array type.
Definition: MinimizerVariableArrayTraits.hpp:318
static T norm2(const ArrayType &a)
Computes the Euclidean (L2) norm of a using a numerically stable scaling algorithm.
Definition: MinimizerVariableArrayTraits.hpp:351
static void sub(ArrayType &a1, const ArrayType &a2)
Subtracts a2 from a1 element-wise ( ).
Definition: MinimizerVariableArrayTraits.hpp:439
static void axpy(const T &alpha, const ArrayType &x, ArrayType &y)
Performs the in-place BLAS-style axpy operation .
Definition: MinimizerVariableArrayTraits.hpp:388
V::ValueType ValueType
The scalar value type stored in the array elements.
Definition: MinimizerVariableArrayTraits.hpp:322
static T dot(const ArrayType &a1, const ArrayType &a2)
Computes the inner product (dot product) of two vector arrays.
Definition: MinimizerVariableArrayTraits.hpp:334
static void multiply(ArrayType &a, const T &v)
Multiplies every element of a by the scalar v.
Definition: MinimizerVariableArrayTraits.hpp:428
Traits template that adapts arbitrary variable-array types to the linear-algebra operations required ...
Definition: MinimizerVariableArrayTraits.hpp:55
static void axpy(const T &alpha, const ArrayType &x, ArrayType &y)
Performs the in-place BLAS-style axpy operation .
Definition: MinimizerVariableArrayTraits.hpp:123
static T dot(const ArrayType &a1, const ArrayType &a2)
Computes the inner product (dot product) of two variable arrays.
Definition: MinimizerVariableArrayTraits.hpp:72
static void multiply(ArrayType &a, const T &v)
Multiplies every element of a by the scalar v.
Definition: MinimizerVariableArrayTraits.hpp:154
static void sub(ArrayType &a1, const ArrayType &a2)
Subtracts a2 from a1 element-wise ( ).
Definition: MinimizerVariableArrayTraits.hpp:164
A::ValueType ValueType
The scalar value type stored in the array.
Definition: MinimizerVariableArrayTraits.hpp:60
static void assign(ArrayType &a1, const ArrayType &a2)
Copies the contents of a2 into a1.
Definition: MinimizerVariableArrayTraits.hpp:142
A ArrayType
The variable-array type.
Definition: MinimizerVariableArrayTraits.hpp:58
static void clear(ArrayType &a)
Sets all elements of a to the default-constructed ValueType.
Definition: MinimizerVariableArrayTraits.hpp:132
A::SizeType SizeType
The size type used by the array.
Definition: MinimizerVariableArrayTraits.hpp:62
static T norm2(const ArrayType &a)
Computes the Euclidean (L2) norm of a using a numerically stable scaling algorithm.
Definition: MinimizerVariableArrayTraits.hpp:84
static RealType abs(ConstReference t)
Returns the absolute value of t (std::abs for signed types, the identity for unsigned types).
Definition: TypeTraits.hpp:131
T RealType
The real-valued type (identical to ValueType for scalar traits).
Definition: TypeTraits.hpp:91
Primary traits template for scalar arithmetic value types.
Definition: TypeTraits.hpp:285