HybridValues.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 
22 #include <gtsam/inference/Key.h>
24 #include <gtsam/nonlinear/Values.h>
25 
26 #include <map>
27 #include <string>
28 #include <vector>
29 
30 namespace gtsam {
31 
37 class GTSAM_EXPORT HybridValues {
38  private:
41 
44 
47 
48  public:
51 
53  HybridValues() = default;
54 
56  HybridValues(const VectorValues& cv, const DiscreteValues& dv);
57 
59  HybridValues(const VectorValues& cv, const DiscreteValues& dv,
60  const Values& v);
61 
65 
67  void print(const std::string& s = "HybridValues",
68  const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
69 
71  bool equals(const HybridValues& other, double tol = 1e-9) const;
72 
76 
78  const VectorValues& continuous() const;
79 
81  const DiscreteValues& discrete() const;
82 
84  const Values& nonlinear() const;
85 
87  bool existsVector(Key j);
88 
90  bool existsDiscrete(Key j);
91 
93  bool existsNonlinear(Key j);
94 
96  bool exists(Key j);
97 
99  HybridValues retract(const VectorValues& delta) const;
100 
105  void insert(Key j, const Vector& value);
106 
111  void insert(Key j, size_t value);
112 
114  void insert_or_assign(Key j, const Vector& value);
115 
117  void insert_or_assign(Key j, size_t value);
118 
122 
126 
129  HybridValues& insert(const Values& values);
130 
134 
139  Vector& at(Key j);
140 
145  size_t& atDiscrete(Key j);
146 
152 
158 
164 
166  VectorValues continuousSubset(const KeyVector& keys) const;
167 
171 
178  std::string html(
179  const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
180 
182 };
183 
184 // traits
185 template <>
186 struct traits<HybridValues> : public Testable<HybridValues> {};
187 
188 } // namespace gtsam
relicense.update
def update(text)
Definition: relicense.py:46
gtsam::HybridValues
Definition: HybridValues.h:37
s
RealScalar s
Definition: level1_cplx_impl.h:126
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
keys
const KeyVector keys
Definition: testRegularImplicitSchurFactor.cpp:40
gtsam::utils.numerical_derivative.retract
def retract(a, np.ndarray xi)
Definition: numerical_derivative.py:44
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:245
gtsam::Vector
Eigen::VectorXd Vector
Definition: Vector.h:39
gtsam::KeyVector
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:92
gtsam::DefaultKeyFormatter
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition: Key.cpp:30
Key.h
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:156
gtsam.examples.PlanarManipulatorExample.delta
def delta(g0, g1)
Definition: PlanarManipulatorExample.py:45
gtsam::VectorValues
Definition: VectorValues.h:74
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
gtsam::KeyFormatter
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
gtsam::HybridValues::nonlinear_
Values nonlinear_
Definition: HybridValues.h:46
VectorValues.h
Factor Graph Values.
gtsam::equals
Definition: Testable.h:112
gtsam::HybridValues::continuous_
VectorValues continuous_
Definition: HybridValues.h:40
gtsam
traits
Definition: SFMdata.h:40
gtsam::Testable
Definition: Testable.h:152
DiscreteValues.h
gtsam::traits
Definition: Group.h:36
gtsam::DiscreteValues
Definition: DiscreteValues.h:34
gtsam::Values
Definition: Values.h:65
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
gtsam::tol
const G double tol
Definition: Group.h:79
gtsam::html
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
Definition: DiscreteValues.cpp:135
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:97
insert
A insert(1, 2)=0
test_callbacks.value
value
Definition: test_callbacks.py:160
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
gtsam::HybridValues::discrete_
DiscreteValues discrete_
Definition: HybridValues.h:43
Values.h
A non-templated config holding any types of Manifold-group elements.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:40