A type to specify the implementation of a unary operation. More...
#include <jacobianexpr.hpp>
A type to specify the implementation of a unary operation.
An implementation of a unary operation constructs a template specialization. You can see this as a compile-time lookup table that finds the correct operation depending on the operator and the type of its argument.
A is the type of the value of the argument. (The type of the derivative of the argument is determined by the GeomTraits classes).
The marker class OpID is a type that is created to specify a binary operator. For example, the unary - operator corresponds to OpNegate. This is done because the operators themself cannot serve as template parameters. There can only be one specification type for each operator. E.g. defining OpMinus also created with the unary - operator for other another type A will lead to compile-time errors. This type can be created with an empty class declaration.
Specializations should define the following :
a type derivType defining the type of the derivative of the result of this unary operator.
template <> class UnaryOp<OpNegate,double> { public: typedef double valueType; typedef double derivType; static valueType value(double F) { return -F; } static derivType deriv(double a ,double da) { return -da; } };
Definition at line 123 of file jacobianexpr.hpp.