|
cisst-saw
|
Implement operation of the form \(s_o = op_{incr}(op(v_i, s_i))\) for fixed size vectors. More...
#include <vctFixedSizeVectorRecursiveEngines.h>
Public Types | |
| typedef vctFixedSizeVectorRecursiveEngines< _size-1 >::template SoViSi< _incrementalOperationType, _elementOperationType > | RecursiveStep |
| typedef _incrementalOperationType::OutputType | OutputType |
Static Public Member Functions | |
| template<class _inputVectorType, class _inputScalarType> | |
| static OutputType | Unfold (const _inputVectorType &inputVector, const _inputScalarType &inputScalar) |
Implement operation of the form \(s_o = op_{incr}(op(v_i, s_i))\) for fixed size vectors.
This class uses template specialization to perform incremental binary vector operations of the form
\[s_o = \mathrm{op_{incr}(\mathrm{op}(v_i, s_i))} \]
where \(v_i\) and \(s_i\) are the input vector and scalar and \(s_o\) is the scalar output. The vector has a fixed size, determined at compilation time, op stands for the unary operation performed elementwise on \(v_i\) and \(s_i\) and whose result are used incrementally as input for \(op_{incr}\). For a vector of size 3, the result is \(s_o = op_{incr}(op_{incr}(op(v[1], s), op(v[0], s)), op(v, s))\).
| _incrementalOperationType | The type of the incremental operation. |
| _elementOperationType | The type of the unary operation. |
| typedef _incrementalOperationType::OutputType SoViSi< _incrementalOperationType, _elementOperationType >::OutputType |
| typedef vctFixedSizeVectorRecursiveEngines<_size-1>::template SoViSi<_incrementalOperationType, _elementOperationType> SoViSi< _incrementalOperationType, _elementOperationType >::RecursiveStep |
|
inlinestatic |
Unfold the recursion. Performs the operation _elementOperationType elementwise on the last elements of the input vector and the input scalar and call Unfold for the _size - 1 elements left (i.e. unfold the recursive calls). The incremental operation is applied to the result of the recursive Unfold call and the result of _elementOperationType(inputVector[_size], inputScalar[_size]).
| inputVector | The input vector (first operand for _elementOperationType). |
| inputScalar | The input scalar (second operand for _elementOperationType). |