cisst-saw
|
Define binary operations between objects as classes. More...
#include <vctBinaryOperations.h>
Classes | |
class | Addition |
Returns the sum of the two InputType object. More... | |
class | And |
Logical And operator between input1 and input2. More... | |
class | Bound |
Test if the first argument is bound by the second argument. More... | |
class | ClipIn |
Return the -input2 in input1 is lesser than -input2, input2 if input 1 is greater than input2 and input1 otherwise. The operator doesn't test if input2 is negative. More... | |
class | Division |
Returns the ratio of the two InputType object. More... | |
class | DotProduct |
Dot product. More... | |
class | Equal |
Test for equality between input1 and input2. More... | |
class | FirstOperand |
Return the first operand of (input1, input2), i.e., input1. More... | |
class | Greater |
Test if input1 is greater than input2. More... | |
class | GreaterOrEqual |
Test if input1 is greater than or equal to input2. More... | |
class | Lesser |
Test if input1 is lesser than input2. More... | |
class | LesserOrEqual |
Test if input1 is lesser than or equal to input2. More... | |
class | Maximum |
Return the greater of (input1, input2). More... | |
class | Minimum |
Return the lesser of (input1, input2). More... | |
class | Multiplication |
Returns the product of the two InputType object. More... | |
class | NotEqual |
Test for non equality between input1 and input2. More... | |
class | Or |
Logical Or operator between input1 and input2. More... | |
class | SecondOperand |
Return the second operand of (input1, input2), i.e., input2. More... | |
class | Subtraction |
Returns the difference of the two InputType object. More... | |
Public Types | |
typedef _outputType | OutputType |
typedef _input1Type | Input1Type |
typedef _input2Type | Input2Type |
Define binary operations between objects as classes.
Class vctBinaryOperations is an envelope that wraps binary operations between objects as classes. BinaryOperations defines internal classes such as Addition, Subtraction, 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 Input1Type & input1, const Input2Type & input2)
Where OutputType, Input1Type, Input2Type are the types of the result and the two operands.
By abstracting very simple operations as inline functions, we can plug the BinaryOperations 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 .
outputType | the type of the result |
input1Type | the type of the first (left-side) operand |
input2Type | the type of the second (right-side) operand) |
typedef _input1Type vctBinaryOperations< _outputType, _input1Type, _input2Type >::Input1Type |
typedef _input2Type vctBinaryOperations< _outputType, _input1Type, _input2Type >::Input2Type |
typedef _outputType vctBinaryOperations< _outputType, _input1Type, _input2Type >::OutputType |