21#include <gtsam/config.h>
24#if GTSAM_ENABLE_BOOST_SERIALIZATION
25#include <boost/serialization/nvp.hpp>
26#include <boost/serialization/assume_abstract.hpp>
39 class GTSAM_EXPORT Value {
43 Value(
const Value& other) =
default;
52 virtual std::shared_ptr<Value>
clone()
const = 0;
55 virtual bool equals_(
const Value& other,
double tol = 1e-9)
const = 0;
58 virtual void print(
const std::string& str =
"")
const = 0;
65 virtual size_t dim()
const = 0;
73 virtual Value*
retract_(
const Vector& delta)
const = 0;
90 template<
typename ValueType>
91 const ValueType& cast()
const;
127#if GTSAM_ENABLE_BOOST_SERIALIZATION
128 friend class boost::serialization::access;
129 template<
class ARCHIVE>
130 void serialize(ARCHIVE & ,
const unsigned int ) {
138#if GTSAM_ENABLE_BOOST_SERIALIZATION
typedef and functions to augment Eigen's VectorXd
Global functions in a separate testing namespace.
Definition chartTesting.h:28
This is the base class for any type to be stored in Values.
Definition Value.h:39
virtual size_t dim() const =0
Return the dimensionality of the tangent space of this value.
virtual std::shared_ptr< Value > clone() const =0
Clone this value (normal clone on the heap, delete with 'delete' operator).
virtual Value * retract_(const Vector &delta) const =0
Increment the value, by mapping from the vector delta in the tangent space of the current value back ...
virtual void deallocate_() const =0
Deallocate a raw pointer of this value.
virtual ~Value()
Virutal destructor.
Definition Value.h:94
virtual bool equals_(const Value &other, double tol=1e-9) const =0
Compare this Value with another for equality.
virtual Vector localCoordinates_(const Value &value) const =0
Compute the coordinates in the tangent space of this value that retract() would map to value.
virtual Value & operator=(const Value &)
Assignment operator.
Definition Value.h:84
virtual void print(const std::string &str="") const =0
Print this value, for debugging and unit tests.
virtual Value * clone_() const =0
Clone this value in a special memory pool, must be deleted with Value::deallocate_,...