cisst-saw
Loading...
Searching...
No Matches
vctUnaryOperations< _outputElementType, _inputElementType > Class Template Reference

Define unary operations on an object as classes. More...

#include <vctUnaryOperations.h>

Classes

class  Identity
 Returns the input as an OutputType object. More...
class  AbsValue
 Returns the absolute value of the input as an OutputType object. More...
class  Floor
 Returns the floor of the input, that is, the largest integer less-than or equal to the input, as an OutputType object. More...
class  Ceil
 Returns the ceiling of the input, that is, the smallest integer greater-than or equal to the input, as an OutputType object. More...
class  Square
 Returns the square of the input as an OutputType object. More...
class  Negation
 Returns the negative of the input as an OutputType object. More...
class  IsPositive
class  IsNonNegative
class  IsNonPositive
class  IsNegative
class  IsNonzero
class  IsFinite
class  IsNaN

Public Types

typedef _outputElementType OutputElementType
typedef _inputElementType InputElementType

Detailed Description

template<class _outputElementType, class _inputElementType = _outputElementType>
class vctUnaryOperations< _outputElementType, _inputElementType >

Define unary operations on an object as classes.

Class vctUnaryOperations is an envelope that wraps unary operations on an object as classes. vctUnaryOperations defines internal classes such as Identity, AbsValue, etc., and each of the internal classes has one static function named Operate(), which wraps the corresponding operation. The signature of a typical Operate() is

 static inline OutputType Operate(const InputType & input)

Where OutputType, InputType, are the types of the result and the operand.

By abstracting very simple operations as inline functions, we can plug the vctUnaryOperations internal classes into templated vector operation engines. See an example of such engine in vctFixedSizeVectorRecursiveEngines.h , and an example of plugging an operation into the engine in vctFixedSizeVectorOperations.h .

Parameters
inputElementTypethe type of the first (left-side) operand
outputElementTypethe type of the result
See also
Identity AbsValue Square Negation

Member Typedef Documentation

◆ InputElementType

template<class _outputElementType, class _inputElementType = _outputElementType>
typedef _inputElementType vctUnaryOperations< _outputElementType, _inputElementType >::InputElementType

◆ OutputElementType

template<class _outputElementType, class _inputElementType = _outputElementType>
typedef _outputElementType vctUnaryOperations< _outputElementType, _inputElementType >::OutputElementType

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