Public Member Functions | Private Member Functions | Friends | List of all members
gtsam::Value Class Referenceabstract

#include <Value.h>

Inheritance diagram for gtsam::Value:
Inheritance graph
[legend]

Public Member Functions

template<typename ValueType >
const ValueType & cast () const
 
virtual boost::shared_ptr< Valueclone () const =0
 
virtual Valueclone_ () const =0
 
virtual void deallocate_ () const =0
 
virtual size_t dim () const =0
 
virtual bool equals_ (const Value &other, double tol=1e-9) const =0
 
virtual Vector localCoordinates_ (const Value &value) const =0
 
virtual Valueoperator= (const Value &)
 
virtual void print (const std::string &str="") const =0
 
virtual Valueretract_ (const Vector &delta) const =0
 
virtual ~Value ()
 

Private Member Functions

template<class ARCHIVE >
void serialize (ARCHIVE &, const unsigned int)
 

Friends

class boost::serialization::access
 

Detailed Description

This is the base class for any type to be stored in Values. Note: As of GTSAM 4.0, Value types should no longer derive from Value or DerivedValue. Use type traits instead. See https://bitbucket.org/gtborg/gtsam/wiki/Migrating%20from%20GTSAM%203.X%20to%20GTSAM%204.0#markdown-header-custom-value-types for current usage and migration details.

Definition at line 36 of file Value.h.

Constructor & Destructor Documentation

virtual gtsam::Value::~Value ( )
inlinevirtual

Virutal destructor

Definition at line 88 of file Value.h.

Member Function Documentation

template<typename ValueType >
const ValueType & gtsam::Value::cast ( ) const

Cast to known ValueType

Definition at line 205 of file GenericValue.h.

virtual boost::shared_ptr<Value> gtsam::Value::clone ( ) const
pure virtual

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

Implemented in gtsam::GenericValue< T >.

virtual Value* gtsam::Value::clone_ ( ) const
pure virtual

Clone this value in a special memory pool, must be deleted with Value::deallocate_, not with the 'delete' operator.

Implemented in gtsam::GenericValue< T >.

virtual void gtsam::Value::deallocate_ ( ) const
pure virtual

Deallocate a raw pointer of this value

Implemented in gtsam::GenericValue< T >.

virtual size_t gtsam::Value::dim ( ) const
pure virtual

Return the dimensionality of the tangent space of this value. This is the dimensionality of delta passed into retract() and of the vector returned by localCoordinates().

Returns
The dimensionality of the tangent space

Implemented in gtsam::GenericValue< T >.

virtual bool gtsam::Value::equals_ ( const Value other,
double  tol = 1e-9 
) const
pure virtual

Compare this Value with another for equality.

Implemented in gtsam::GenericValue< T >.

virtual Vector gtsam::Value::localCoordinates_ ( const Value value) const
pure virtual

Compute the coordinates in the tangent space of this value that retract() would map to value.

Parameters
valueThe value whose coordinates should be determined in the tangent space of the value on which this function is called.
Returns
The coordinates of value in the tangent space of this.

Implemented in gtsam::GenericValue< T >.

virtual Value& gtsam::Value::operator= ( const Value )
inlinevirtual

Assignment operator

Reimplemented in gtsam::GenericValue< T >.

Definition at line 78 of file Value.h.

virtual void gtsam::Value::print ( const std::string &  str = "") const
pure virtual

Print this value, for debugging and unit tests

Implemented in gtsam::GenericValue< T >.

virtual Value* gtsam::Value::retract_ ( const Vector delta) const
pure virtual

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.

Parameters
deltaThe delta vector in the tangent space of this value, by which to increment this value.

Implemented in gtsam::GenericValue< T >.

template<class ARCHIVE >
void gtsam::Value::serialize ( ARCHIVE &  ,
const unsigned  int 
)
inlineprivate

Definition at line 123 of file Value.h.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Empty serialization function.

There are two important things that users need to do to serialize derived objects in Values successfully: (Those derived objects are stored in Values as pointer to this abstract base class Value)

1. All DERIVED classes derived from Value must put the following line in their serialization function:
ar & boost::serialization::make_nvp("DERIVED", boost::serialization::base_object<Value>(*this));

or, alternatively

ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Value);

See: http://www.boost.org/doc/libs/release/libs/serialization/doc/serialization.html#runtimecasting

  1. The source module that includes archive class headers to serialize objects of derived classes (boost/archive/text_oarchive.h, for example) must export all derived classes, using either BOOST_CLASS_EXPORT or BOOST_CLASS_EXPORT_GUID macros:
    BOOST_CLASS_EXPORT(DERIVED_CLASS_1)
    BOOST_CLASS_EXPORT_GUID(DERIVED_CLASS_2, "DERIVED_CLASS_2_ID_STRING")
    See: http://www.boost.org/doc/libs/release/libs/serialization/doc/serialization.html#derivedpointers http://www.boost.org/doc/libs/release/libs/serialization/doc/serialization.html#export http://www.boost.org/doc/libs/release/libs/serialization/doc/serialization.html#instantiation\ http://www.boost.org/doc/libs/release/libs/serialization/doc/special.html#export http://www.boost.org/doc/libs/release/libs/serialization/doc/traits.html#export The last two links explain why these export lines have to be in the same source module that includes any of the archive class headers.

Definition at line 121 of file Value.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:37