EleFits  5.0.0
A modern C++ API on top of CFITSIO
List of all members
VectorArithmeticMixin< T, TDerived, Incrementable > Struct Template Reference

#include <VectorArithmetic.h>

Detailed Description

template<typename T, typename TDerived, bool Incrementable = std::is_integral<T>::value>
struct Euclid::Fits::VectorArithmeticMixin< T, TDerived, Incrementable >

Mixin to provide vector space arithmetics to a container.

Template Parameters
TThe contained element value type
TDerivedThe container which inherits this class
IncrementableA flag to activate increment and decrement operators

In addition to vector space arithmetic operators, this mixin provides generate() and apply() to apply a function to each element.

Satisfies VectorArithmetic requirements
Implements vector space arithmetic operators (uppercase letters are for vectors, lowercase letters are for scalars):
  • Vector-additive: V += U, W = V + U, V += U, W = V - U;
  • Scalar-additive: V += a, V = U + a, V = a + U, V -= a, V = U + a, V = a - U;
  • Scalar-multiplicative: V *= a, V = U * a, V = a * U, V /= a, V = U / a;
  • Incrementation if enabled (for integral value types by default): V++, ++V, V–, –V.

Public Member Functions

Data modifiers
TDerived & operator+= (const TDerived &rhs)
 V += U and W = V + U.
 
TDerived & operator+= (const T &rhs)
 V += a, V = U + a, V = a + U.
 
TDerived & operator-= (const TDerived &rhs)
 V -= U and W = V - U.
 
TDerived & operator-= (const T &rhs)
 V -= a, V = U - a, V = a - U.
 
TDerived & operator*= (const T &rhs)
 V *= a, V = U * a, V = a * U.
 
TDerived & operator/= (const T &rhs)
 V /= a, V = U / a.
 
template<typename TFunc , typename... TContainers>
TDerived & generate (TFunc &&func, const TContainers &... args)
 Generate values from a function with optional input containers. More...
 
template<typename TFunc , typename... TContainers>
TDerived & apply (TFunc &&func, const TContainers &... args)
 Apply a function with optional input containers. More...
 
Operations
TDerived operator+ () const
 Copy.
 
TDerived operator- () const
 Compute the opposite.
 

The documentation for this struct was generated from the following file: