gtsam  3.2.1
gtsam
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Value.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 
21 #include <memory>
22 #include <boost/serialization/assume_abstract.hpp>
23 #include <gtsam/base/Vector.h>
24 
25 namespace gtsam {
26 
81  class GTSAM_EXPORT Value {
82  public:
83 
85  virtual Value* clone_() const = 0;
86 
88  virtual void deallocate_() const = 0;
89 
91  virtual boost::shared_ptr<Value> clone() const = 0;
92 
94  virtual bool equals_(const Value& other, double tol = 1e-9) const = 0;
95 
97  virtual void print(const std::string& str = "") const = 0;
98 
104  virtual size_t dim() const = 0;
105 
112  virtual Value* retract_(const Vector& delta) const = 0;
113 
120  virtual Vector localCoordinates_(const Value& value) const = 0;
121 
123  virtual Value& operator=(const Value& rhs) = 0;
124 
126  virtual ~Value() {}
127 
128  private:
159  friend class boost::serialization::access;
160  template<class ARCHIVE>
161  void serialize(ARCHIVE & ar, const unsigned int version) {}
162 
163  };
164 
165 } /* namespace gtsam */
166 
167 BOOST_SERIALIZATION_ASSUME_ABSTRACT(gtsam::Value)
virtual ~Value()
Virutal destructor.
Definition: Value.h:126
typedef and functions to augment Eigen's VectorXd
This is the interface class for any value that may be used as a variable assignment in a factor graph...
Definition: Value.h:81
size_t dim(const Vector &v)
dimensionality == size
Definition: Vector.h:90
void print(const Matrix &A, const string &s, ostream &stream)
print a matrix
Definition: Matrix.cpp:183
Vector delta(size_t n, size_t i, double value)
Create basis vector of dimension n, with a constant in spot i.
Definition: Vector.cpp:53