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 <gtsam/config.h> // Configuration from CMake
22 
23 #include <gtsam/base/Vector.h>
24 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
25 #include <boost/serialization/nvp.hpp>
26 #include <boost/serialization/assume_abstract.hpp>
27 #endif
28 #include <memory>
29 
30 namespace gtsam {
31 
39  class GTSAM_EXPORT Value {
40  public:
41 
43  virtual Value* clone_() const = 0;
44 
46  virtual void deallocate_() const = 0;
47 
49  virtual std::shared_ptr<Value> clone() const = 0;
50 
52  virtual bool equals_(const Value& other, double tol = 1e-9) const = 0;
53 
55  virtual void print(const std::string& str = "") const = 0;
56 
62  virtual size_t dim() const = 0;
63 
70  virtual Value* retract_(const Vector& delta) const = 0;
71 
78  virtual Vector localCoordinates_(const Value& value) const = 0;
79 
81  virtual Value& operator=(const Value& /*rhs*/) {
82  //needs a empty definition so recursion in implicit derived assignment operators work
83  return *this;
84  }
85 
87  template<typename ValueType>
88  const ValueType& cast() const;
89 
91  virtual ~Value() {}
92 
93  private:
124 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
125  friend class boost::serialization::access;
126  template<class ARCHIVE>
127  void serialize(ARCHIVE & /*ar*/, const unsigned int /*version*/) {
128  }
129 #endif
130 
131  };
132 
133 } /* namespace gtsam */
134 
135 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
136 BOOST_SERIALIZATION_ASSUME_ABSTRACT(gtsam::Value)
137 #endif
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
std::string serialize(const T &input)
serializes to a string
Eigen::VectorXd Vector
Definition: Vector.h:38
Definition: pytypes.h:1403
EIGEN_DEVICE_FUNC NewType cast(const OldType &x)
virtual Value & operator=(const Value &)
Definition: Value.h:81
Array< double, 1, 3 > e(1./3., 0.5, 2.)
traits
Definition: chartTesting.h:28
typedef and functions to augment Eigen&#39;s VectorXd
const G double tol
Definition: Group.h:86
virtual ~Value()
Definition: Value.h:91


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:40:43