58 : continuous_(cv), discrete_(dv){}
63 : continuous_(cv), discrete_(dv), nonlinear_(v){}
70 void print(
const std::string&
s =
"HybridValues",
72 std::cout <<
s <<
": \n";
73 continuous_.
print(
" Continuous",
75 discrete_.print(
" Discrete", keyFormatter);
105 return nonlinear_.
exists(j);
110 return existsVector(j) || existsDiscrete(j) || existsNonlinear(j);
138 continuous_.
insert(values);
152 nonlinear_.
insert(values);
182 continuous_.
update(values);
208 for (
const auto&
key : keys) {
226 std::stringstream
ss;
227 ss << this->continuous_.
html(keyFormatter);
228 ss << this->discrete_.
html(keyFormatter);
HybridValues & insert(const DiscreteValues &values)
HybridValues & insert(const VectorValues &values)
const gtsam::Symbol key('X', 0)
void insert(Key j, size_t value)
HybridValues & update(const DiscreteValues &values)
void insert_or_assign(Key j, const Vector &value)
insert_or_assign() , similar to Values.h
void insert_or_assign(Key j, size_t value)
insert_or_assign() , similar to Values.h
A non-templated config holding any types of Manifold-group elements.
void print(const std::string &str="VectorValues", const KeyFormatter &formatter=DefaultKeyFormatter) const
An assignment from labels to a discrete value index (size_t)
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Output as a html table.
iterator insert(const std::pair< Key, Vector > &key_value)
const VectorValues & continuous() const
Return the multi-dimensional vector values.
bool existsVector(Key j)
Check whether a variable with key j exists in VectorValues.
static const KeyFormatter DefaultKeyFormatter
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const
Output as a html table.
HybridValues & update(const VectorValues &values)
bool equals(const VectorValues &x, double tol=1e-9) const
bool exists(Key j)
Check whether a variable with key j exists.
void insert_or_assign(Key j, const Vector &value)
bool existsDiscrete(Key j)
Check whether a variable with key j exists in DiscreteValues.
Array< int, Dynamic, 1 > v
DiscreteValues & update(const DiscreteValues &values)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool equals(const DiscreteValues &x, double tol=1e-9) const
equals required by Testable for unit testing.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
HybridValues(const VectorValues &cv, const DiscreteValues &dv, const Values &v)
Construct from all values types.
static std::stringstream ss
HybridValues & update(const HybridValues &values)
HybridValues(const VectorValues &cv, const DiscreteValues &dv)
Construct from DiscreteValues and VectorValues.
specialized key for discrete variables
bool existsNonlinear(Key j)
Check whether a variable with key j exists in values.
HybridValues & insert(const Values &values)
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Output as a html table.
const DiscreteValues & discrete() const
Return the discrete values.
VectorValues continuousSubset(const KeyVector &keys) const
Extract continuous values with given keys.
void insert(Key j, const Vector &value)
bool equals(const HybridValues &other, double tol=1e-9) const
equals required by Testable for unit testing
void insert(Key j, const Value &val)
VectorValues & update(const VectorValues &values)
void print(const std::string &s="HybridValues", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print required by Testable for unit testing
std::pair< iterator, bool > insert(const value_type &value)
const Values & nonlinear() const
Return the nonlinear values.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
std::uint64_t Key
Integer nonlinear key type.
size_t & atDiscrete(Key j)
HybridValues & insert(const HybridValues &values)