$search

Jacobian< T > Class Template Reference

Jacobian<T> constructs a tangent vector class out of the given basetype. More...

#include <jacobian.hpp>

List of all members.

Public Types

typedef Traits< T >::derivType derivType
typedef T exprType
typedef Traits< T >::valueType valueType

Public Member Functions

derivTypederiv (int i)
 returns the derivative towards the ith variable.
derivType deriv (int i) const
 returns the derivative towards the ith variable.
JacobianBitset getDerivs () const
 stores a bitset containing to target
bool hasDeriv (int i) const
 indicates whether ith derivative is zero or not.
bool hasDerivs () const
 indicates whether all derivatives are zero.
 Jacobian (const valueType &arg)
 Construct an RVFrame object with size==0 and declared constant.
 Jacobian (const Jacobian< T > &arg)
 Copy constructor,.
 Jacobian (int _size=0)
 Construct an Jacobian<T> object,.
int nrOfDeriv () const
 returns the number of variables to which the derivative is taken.
Jacobian< T > & operator= (const T &expr)
 assigns the argument to the current object
Jacobian< T > & operator= (const Jacobian< T > &expr)
 assigns the argument to the current object
template<class A >
Jacobian< T > & operator= (const Expr< A > &e)
 evaluates an template expression and stores the result.
void resize (int _size)
void setDeriv (int i, bool s=true)
 specify whether all derivatives are zero or not.
valueType value () const
 returns the value of this entity
valueTypevalue ()
 returns the value of this entity
 ~Jacobian ()
 When memory was allocated (i.e. der!=0), deallocate.

Private Attributes

std::vector< derivTypeder
JacobianBitset hasderiv
int size
valueType val

Detailed Description

template<typename T>
class Jacobian< T >

Jacobian<T> constructs a tangent vector class out of the given basetype.

This class contains a value for type T and n values for derivatives of type T.

Definition at line 105 of file experimental/jacobian.hpp.


Member Typedef Documentation

template<typename T>
typedef Traits<T>::derivType Jacobian< T >::derivType

GeomTriats classes are used to derive the type of the derivatives of instances of type T.

Definition at line 114 of file experimental/jacobian.hpp.

template<typename T>
typedef T Jacobian< T >::exprType

Definition at line 108 of file experimental/jacobian.hpp.

template<typename T>
typedef Traits<T>::valueType Jacobian< T >::valueType

Definition at line 109 of file experimental/jacobian.hpp.


Constructor & Destructor Documentation

template<typename T>
Jacobian< T >::Jacobian ( int  _size = 0  )  [inline, explicit]

Construct an Jacobian<T> object,.

When size==0, it will be declared constant, otherwise it is variable.

Warning:
allocates on the heap when _size not equal to 0 !

Definition at line 127 of file experimental/jacobian.hpp.

template<typename T>
Jacobian< T >::Jacobian ( const Jacobian< T > &  arg  )  [inline]

Copy constructor,.

Warning:
allocates on the heap when arg is not constant !

Definition at line 149 of file experimental/jacobian.hpp.

template<typename T>
Jacobian< T >::Jacobian ( const valueType arg  )  [inline]

Construct an RVFrame object with size==0 and declared constant.

arg gives the value given in its argument. All derivatives are zero and isconstant is set to true. Does NOT allocate on the heap.

Definition at line 164 of file experimental/jacobian.hpp.

template<typename T>
Jacobian< T >::~Jacobian (  )  [inline]

When memory was allocated (i.e. der!=0), deallocate.

Definition at line 170 of file experimental/jacobian.hpp.


Member Function Documentation

template<typename T>
derivType& Jacobian< T >::deriv ( int  i  )  [inline]

returns the derivative towards the ith variable.

  • This method will be used with non-const declarations of Jacobian<T>. It that case deriv(i) can be an lvalue.
  • Will clear the isconstant flag for this variable, also when only the value is used !

For example, for Jacobian<double>:

	   deriv(1) = 5.0;
	   

Definition at line 199 of file experimental/jacobian.hpp.

template<typename T>
derivType Jacobian< T >::deriv ( int  i  )  const [inline]

returns the derivative towards the ith variable.

  • This method will be used with a const Jacobian<T>& declaration. It is impossible to use deriv(i) as an lvalue.
  • isConstant(i) should be false.

Definition at line 180 of file experimental/jacobian.hpp.

template<typename T>
JacobianBitset Jacobian< T >::getDerivs (  )  const [inline]

stores a bitset containing to target

target[i] is true if ith variable has a derivative.

Definition at line 254 of file experimental/jacobian.hpp.

template<typename T>
bool Jacobian< T >::hasDeriv ( int  i  )  const [inline]

indicates whether ith derivative is zero or not.

Definition at line 237 of file experimental/jacobian.hpp.

template<typename T>
bool Jacobian< T >::hasDerivs (  )  const [inline]

indicates whether all derivatives are zero.

Definition at line 244 of file experimental/jacobian.hpp.

template<typename T>
int Jacobian< T >::nrOfDeriv (  )  const [inline]

returns the number of variables to which the derivative is taken.

Definition at line 229 of file experimental/jacobian.hpp.

template<typename T>
Jacobian<T>& Jacobian< T >::operator= ( const T &  expr  )  [inline]

assigns the argument to the current object

Assigns the argument to the stored value and makes all derivatives zero. isConstant() is true after this assignment.

Definition at line 323 of file experimental/jacobian.hpp.

template<typename T>
Jacobian<T>& Jacobian< T >::operator= ( const Jacobian< T > &  expr  )  [inline]

assigns the argument to the current object

Does NOT do any allocation.

Warning:
the current object and the argument should have the same number of derivatives

Definition at line 304 of file experimental/jacobian.hpp.

template<typename T>
template<class A >
Jacobian<T>& Jacobian< T >::operator= ( const Expr< A > &  e  )  [inline]

evaluates an template expression and stores the result.

This method calls the value() method the template expression and for each variable, it calls deriv(i) of the template expression.

Warning:
You can do only A=A*B if the underlying datatype supports this. For now all implemented instantiations of Jacobian support this. (double, Frame and variants, FrameVel and variants).

Definition at line 280 of file experimental/jacobian.hpp.

template<typename T>
void Jacobian< T >::resize ( int  _size  )  [inline]

Definition at line 135 of file experimental/jacobian.hpp.

template<typename T>
void Jacobian< T >::setDeriv ( int  i,
bool  s = true 
) [inline]

specify whether all derivatives are zero or not.

Warning:
This method does not change the amount of variables to which the derivative is taken.
It is not valid to call this on a class with nrOfDeriv()==0.

Definition at line 264 of file experimental/jacobian.hpp.

template<typename T>
valueType Jacobian< T >::value (  )  const [inline]

returns the value of this entity

This method will be used with a const Jacobian<T>& declaration. It is impossible to use value() as an lvalue.

Definition at line 221 of file experimental/jacobian.hpp.

template<typename T>
valueType& Jacobian< T >::value (  )  [inline]

returns the value of this entity

This method will be used with non-const declarations of Jacobian<T>. It that case value() can be an lvalue.

Definition at line 211 of file experimental/jacobian.hpp.


Member Data Documentation

template<typename T>
std::vector<derivType> Jacobian< T >::der [private]

Definition at line 117 of file experimental/jacobian.hpp.

template<typename T>
JacobianBitset Jacobian< T >::hasderiv [private]

Definition at line 119 of file experimental/jacobian.hpp.

template<typename T>
int Jacobian< T >::size [private]

Definition at line 118 of file experimental/jacobian.hpp.

template<typename T>
valueType Jacobian< T >::val [private]

Definition at line 116 of file experimental/jacobian.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


orocos_kdl
Author(s): Ruben Smits, Erwin Aertbelien, Orocos Developers
autogenerated on Fri Mar 1 16:20:10 2013