gtsam 4.1.1
gtsam
gtsam::GenericValue< T > Class Template Reference

Detailed Description

template<class T>
class gtsam::GenericValue< T >

Wraps any type T so it can play as a Value.

+ Inheritance diagram for gtsam::GenericValue< T >:

Public Member Functions

 GenericValue (const T &value)
 Construct from value.
 
const T & value () const
 Return a constant value.
 
T & value ()
 Return the value.
 
 ~GenericValue () override
 Destructor.
 
bool equals_ (const Value &p, double tol=1e-9) const override
 equals implementing generic Value interface More...
 
bool equals (const GenericValue &other, double tol=1e-9) const
 non virtual equals function, uses traits
 
void print (const std::string &str) const override
 Virtual print function, uses traits. More...
 
Valueclone_ () const override
 Create a duplicate object returned as a pointer to the generic Value interface. More...
 
void deallocate_ () const override
 Destroy and deallocate this object, only if it was originally allocated using clone_(). More...
 
boost::shared_ptr< Valueclone () const override
 Clone this value (normal clone on the heap, delete with 'delete' operator) More...
 
Valueretract_ (const Vector &delta) const override
 Generic Value interface version of retract. More...
 
Vector localCoordinates_ (const Value &value2) const override
 Generic Value interface version of localCoordinates. More...
 
GenericValue retract (const Vector &delta) const
 Non-virtual version of retract.
 
Vector localCoordinates (const GenericValue &value2) const
 Non-virtual version of localCoordinates.
 
size_t dim () const override
 Return run-time dimensionality. More...
 
Valueoperator= (const Value &rhs) override
 Assignment operator. More...
 
- Public Member Functions inherited from gtsam::Value
virtual Valueclone_ () const =0
 Clone this value in a special memory pool, must be deleted with Value::deallocate_, not with the 'delete' operator. More...
 
virtual void deallocate_ () const =0
 Deallocate a raw pointer of this value. More...
 
virtual boost::shared_ptr< Valueclone () const =0
 Clone this value (normal clone on the heap, delete with 'delete' operator) More...
 
virtual bool equals_ (const Value &other, double tol=1e-9) const =0
 Compare this Value with another for equality. More...
 
virtual void print (const std::string &str="") const =0
 Print this value, for debugging and unit tests. More...
 
virtual size_t dim () const =0
 Return the dimensionality of the tangent space of this value. More...
 
virtual Valueretract_ (const Vector &delta) const =0
 Increment the value, by mapping from the vector delta in the tangent space of the current value back to the manifold to produce a new, incremented value. More...
 
virtual Vector localCoordinates_ (const Value &value) const =0
 Compute the coordinates in the tangent space of this value that retract() would map to value. More...
 
virtual Valueoperator= (const Value &)
 Assignment operator. More...
 
template<typename ValueType >
const ValueType & cast () const
 Cast to known ValueType.
 
virtual ~Value ()
 Virutal destructor.
 

Public Types

typedef T type
 

Protected Member Functions

GenericValue< T > & operator= (const GenericValue< T > &rhs)
 Assignment operator, protected because only the Value or DERIVED assignment operators should be used.
 

Protected Attributes

value_
 The wrapped value.
 

Friends

class boost::serialization::access
 Serialization function.
 

Member Function Documentation

◆ clone()

template<class T >
boost::shared_ptr< Value > gtsam::GenericValue< T >::clone ( ) const
inlineoverridevirtual

Clone this value (normal clone on the heap, delete with 'delete' operator)

Implements gtsam::Value.

◆ clone_()

template<class T >
Value * gtsam::GenericValue< T >::clone_ ( ) const
inlineoverridevirtual

Create a duplicate object returned as a pointer to the generic Value interface.

Implements gtsam::Value.

◆ deallocate_()

template<class T >
void gtsam::GenericValue< T >::deallocate_ ( ) const
inlineoverridevirtual

Destroy and deallocate this object, only if it was originally allocated using clone_().

Implements gtsam::Value.

◆ dim()

template<class T >
size_t gtsam::GenericValue< T >::dim ( ) const
inlineoverridevirtual

Return run-time dimensionality.

Implements gtsam::Value.

◆ equals_()

template<class T >
bool gtsam::GenericValue< T >::equals_ ( const Value p,
double  tol = 1e-9 
) const
inlineoverridevirtual

equals implementing generic Value interface

Implements gtsam::Value.

◆ localCoordinates_()

template<class T >
Vector gtsam::GenericValue< T >::localCoordinates_ ( const Value value2) const
inlineoverridevirtual

Generic Value interface version of localCoordinates.

Implements gtsam::Value.

◆ operator=()

template<class T >
Value & gtsam::GenericValue< T >::operator= ( const Value rhs)
inlineoverridevirtual

Assignment operator.

Reimplemented from gtsam::Value.

◆ print()

template<class T >
void gtsam::GenericValue< T >::print ( const std::string &  str) const
inlineoverridevirtual

Virtual print function, uses traits.

Implements gtsam::Value.

◆ retract_()

template<class T >
Value * gtsam::GenericValue< T >::retract_ ( const Vector &  delta) const
inlineoverridevirtual

Generic Value interface version of retract.

Implements gtsam::Value.


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