#include <VectorArithmetic.h>
Mixin to provide vector space arithmetics to a container.
| T | The contained element value type |
| TDerived | The container which inherits this class |
| Incrementable | A 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.
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. | |