ERC CISST - cisst software

vctFixedSizeVectorRecursiveEngines< _size >::VoViVi< _elementOperationType > Class Template Reference

#include <vctFixedSizeVectorRecursiveEngines.h>

List of all members.


Detailed Description

template<vct::size_type _size>
template<class _elementOperationType>
class vctFixedSizeVectorRecursiveEngines< _size >::VoViVi< _elementOperationType >

Implement operation of the form $v_o = op(v_{i1}, v_{i2})$ for fixed size vectors.

This class uses template specialization to perform binary vector operations of the form

\[ v_o = \mathrm{op}(v_{i1}, v_{i2}) \]

where $v_o$ is the output vector, and $v_{i1}, v_{i2}$ are input vectors, all of an equal fixed size, determined at compilation time, op stands for the a binary operation performed elementwise between $v_{i1}$ and $v_{i2}$, and whose result is stored elementwise into $v_o$.

The operation type operationType must have a static method with the signature

      static operationType Operate(const I1E & arg1, const I2E & arg2)
      

where OE, I1E, I2E are the types of vector elements in $v_o, v_{i1} v_{i2}$ respectively. These types do not need to be defined explicitly for vctFixedSizeVectorRecursiveEngines class, as they are inferred from the signature of the corresponding operator[] for each of the vector types. However, they may need to be defined for the class operationType.

For examples of binary operations, see vctBinaryOperations.h.

Usage example for vctFixedSizeVectorRecursiveEngines::VoViVi:

      enum {SIZE = 3};
      int input1[SIZE];
      float input2[SIZE];
      double output[SIZE];

      vctFixedSizeVectorRecursiveEngines<SIZE>::VoViVi<vctBinaryOperations<int,float,double>::Addition, SIZE>Unfold(output, input1, input2);
      
stores the sum of elements from input1 and input2 into output.

Parameters:
_elementOperationType The type of the binary operation.
See also:
vctFixedSizeVectorRecursiveEngines

Definition at line 128 of file vctFixedSizeVectorRecursiveEngines.h.

Public Types

Static Public Member Functions


Member Function Documentation

template<vct::size_type _size>
template<class _elementOperationType>
template<class _outputVectorType, class _inputVector1Type, class _inputVector2Type>
static void vctFixedSizeVectorRecursiveEngines< _size >::VoViVi< _elementOperationType >::Unfold ( _outputVectorType &  output,
const _inputVector1Type &  input1,
const _inputVector2Type &  input2 
) [inline, static]

Unfold the recursion. Performs the operation _elementOperationType elementwise on the last elements of the input/output vector(s) and call Unfold for the _size - 1 elements left (i.e. unfold the recursive calls).

Parameters:
output The output vector.
input1 The first input vector.
input2 The second input vector.

Definition at line 144 of file vctFixedSizeVectorRecursiveEngines.h.


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu