Loading...
Searching...
No Matches
Value.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/config.h> // Configuration from CMake
#include <gtsam/base/Vector.h>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/assume_abstract.hpp>
#include <memory>
namespace gtsam {
class GTSAM_EXPORT Value {
public:
virtual Value* clone_() const = 0;
virtual void deallocate_() const = 0;
virtual boost::shared_ptr<Value> clone() const = 0;
virtual bool equals_(const Value& other, double tol = 1e-9) const = 0;
virtual void print(const std::string& str = "") const = 0;
virtual size_t dim() const = 0;
virtual Value* retract_(const Vector& delta) const = 0;
virtual Vector localCoordinates_(const Value& value) const = 0;
virtual Value& operator=(const Value& /*rhs*/) {
//needs a empty definition so recursion in implicit derived assignment operators work
return *this;
}
template<typename ValueType>
const ValueType& cast() const;
virtual ~Value() {}
private:
friend class boost::serialization::access;
template<class ARCHIVE>
void serialize(ARCHIVE & /*ar*/, const unsigned int /*version*/) {
}
};
} /* namespace gtsam */
BOOST_SERIALIZATION_ASSUME_ABSTRACT(gtsam::Value)
Vector.h
typedef and functions to augment Eigen's VectorXd
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::Value
This is the base class for any type to be stored in Values.
Definition Value.h:37
gtsam::Value::dim
virtual size_t dim() const =0
Return the dimensionality of the tangent space of this value.
gtsam::Value::retract_
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 ...
gtsam::Value::deallocate_
virtual void deallocate_() const =0
Deallocate a raw pointer of this value.
gtsam::Value::~Value
virtual ~Value()
Virutal destructor.
Definition Value.h:89
gtsam::Value::equals_
virtual bool equals_(const Value &other, double tol=1e-9) const =0
Compare this Value with another for equality.
gtsam::Value::localCoordinates_
virtual Vector localCoordinates_(const Value &value) const =0
Compute the coordinates in the tangent space of this value that retract() would map to value.
gtsam::Value::operator=
virtual Value & operator=(const Value &)
Assignment operator.
Definition Value.h:79
gtsam::Value::print
virtual void print(const std::string &str="") const =0
Print this value, for debugging and unit tests.
gtsam::Value::clone_
virtual Value * clone_() const =0
Clone this value in a special memory pool, must be deleted with Value::deallocate_,...
gtsam::Value::clone
virtual boost::shared_ptr< Value > clone() const =0
Clone this value (normal clone on the heap, delete with 'delete' operator).