|
cisst-saw
|
Implement operation of the form \(s_o = op_{incr}(op(v_{i1}, v_{i2}))\) for fixed size vectors. More...
#include <vctFixedSizeVectorRecursiveEngines.h>
Public Types | |
| typedef vctFixedSizeVectorRecursiveEngines< _size-1 >::template SoViVi< _incrementalOperationType, _elementOperationType > | RecursiveStep |
| typedef _incrementalOperationType::OutputType | OutputType |
Static Public Member Functions | |
| template<class _input1VectorType, class _input2VectorType> | |
| static OutputType | Unfold (const _input1VectorType &input1Vector, const _input2VectorType &input2Vector) |
Implement operation of the form \(s_o = op_{incr}(op(v_{i1}, v_{i2}))\) 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_{i1}, v_{i2}))} \]
where \(v_{i1}\) and \(v_{i2}\) are the input vectors and \(s_o\) is the scalar output. The vectors have a fixed size, determined at compilation time, op stands for the unary operation performed elementwise on \(v_{i1}\) and \(v_{i2}\) 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(v1[1], v2[1]), op(v1[0], v2[0])), op(v1[2], v2[2]))\).
| _incrementalOperationType | The type of the incremental operation. |
| _elementOperationType | The type of the unary operation. |
| typedef _incrementalOperationType::OutputType SoViVi< _incrementalOperationType, _elementOperationType >::OutputType |
| typedef vctFixedSizeVectorRecursiveEngines<_size-1>::template SoViVi<_incrementalOperationType, _elementOperationType> SoViVi< _incrementalOperationType, _elementOperationType >::RecursiveStep |
|
inlinestatic |
Unfold the recursion. Performs the operation _elementOperationType elementwise on the last elements of the input vectors 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(input1Vector[_size], input2Vector[_size]).
| input1Vector | The first input vector (first operand for _elementOperationType). |
| input2Vector | The second input vector (second operand for _elementOperationType). |