cisst-saw
|
Define unary operations on an object as classes. More...
#include <vctUnaryOperations.h>
Classes | |
class | AbsValue |
Returns the absolute value of 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 | 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 | Identity |
Returns the input as an OutputType object. More... | |
class | IsFinite |
class | IsNaN |
class | IsNegative |
class | IsNonNegative |
class | IsNonPositive |
class | IsNonzero |
class | IsPositive |
class | Negation |
Returns the negative of the input as an OutputType object. More... | |
class | Square |
Returns the square of the input as an OutputType object. More... | |
Public Types | |
typedef _outputElementType | OutputElementType |
typedef _inputElementType | 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 .
inputElementType | the type of the first (left-side) operand |
outputElementType | the type of the result |
typedef _inputElementType vctUnaryOperations< _outputElementType, _inputElementType >::InputElementType |
typedef _outputElementType vctUnaryOperations< _outputElementType, _inputElementType >::OutputElementType |