KDL::UnaryOp< OpID, A > Class Template Reference

A type to specify the implementation of a unary operation. More...

`#include <jacobianexpr.hpp>`

class KDL::UnaryOp< OpID, A >

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
**valueType**defining the type of the value of the result of this unary operator.

a type **derivType** defining the type of the derivative of the result of this unary operator.

- a method valueType value(const A& arg) or valueType value(A arg) Sometimes it is much more efficient to pass a type by value instead of by reference. This is the case for double.
- a method derivType deriv(const A& arg, const B& darg). or equivalent argument types.
**B**corresponds the type of the derivative of arg. (in general: mTraits<A>::derivType, you can fill in the specific type in these classes ) For exampletemplate <> 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.

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

orocos_kdl

Author(s): Ruben Smits, Erwin Aertbelien, Orocos Developers

autogenerated on Sat Dec 28 2013 17:17:26

Author(s): Ruben Smits, Erwin Aertbelien, Orocos Developers

autogenerated on Sat Dec 28 2013 17:17:26