|
gtsam
|
HybridValues represents a collection of DiscreteValues and VectorValues.
It is typically used to store the variables of a HybridGaussianFactorGraph. Optimizing a HybridGaussianBayesNet returns this class.
Public Member Functions | |
Standard Constructors | |
| HybridValues ()=default | |
| Default constructor creates an empty HybridValues. | |
| HybridValues (const VectorValues &cv, const DiscreteValues &dv) | |
| Construct from DiscreteValues and VectorValues. | |
| HybridValues (const VectorValues &cv, const DiscreteValues &dv, const Values &v) | |
| Construct from all values types. | |
| HybridValues (const DiscreteValues &dv, const Values &v) | |
| Construct from DiscreteValues and Values. | |
Testable | |
| void | print (const std::string &s="HybridValues", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
| print required by Testable for unit testing | |
| bool | equals (const HybridValues &other, double tol=1e-9) const |
| equals required by Testable for unit testing | |
Interface | |
| const VectorValues & | continuous () const |
| Return the multi-dimensional vector values. | |
| const DiscreteValues & | discrete () const |
| Return the discrete values. | |
| const Values & | nonlinear () const |
| Return the nonlinear values. | |
| bool | existsVector (Key j) |
Check whether a variable with key j exists in VectorValues. | |
| bool | existsDiscrete (Key j) |
Check whether a variable with key j exists in DiscreteValues. | |
| bool | existsNonlinear (Key j) |
Check whether a variable with key j exists in values. | |
| bool | exists (Key j) |
Check whether a variable with key j exists. | |
| HybridValues | retract (const VectorValues &delta) const |
| Add a delta config to current config and returns a new config. | |
| HybridValues & | insert (Key j, const Vector &value) |
Insert a vector value with key j. | |
| HybridValues & | insert (Key j, size_t value) |
Insert a discrete value with key j. | |
| template<typename T> | |
| HybridValues & | insertNonlinear (Key j, const T &value) |
Insert a nonlinear value with key j. | |
| 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 | |
| HybridValues & | insert (const VectorValues &values) |
Insert all continuous values from values. | |
| HybridValues & | insert (const DiscreteValues &values) |
Insert all discrete values from values. | |
| HybridValues & | insert (const Values &values) |
Insert all values from values. | |
| HybridValues & | insert (const HybridValues &values) |
Insert all values from values. | |
| Vector & | at (Key j) |
Read/write access to the vector value with key j, throws std::out_of_range if j does not exist. | |
| size_t & | atDiscrete (Key j) |
Read/write access to the discrete value with key j, throws std::out_of_range if j does not exist. | |
| HybridValues & | update (const VectorValues &values) |
For all key/value pairs in values, replace continuous values with corresponding keys in this object with those in values. | |
| HybridValues & | update (const DiscreteValues &values) |
For all key/value pairs in values, replace discrete values with corresponding keys in this object with those in values. | |
| HybridValues & | update (const Values &values) |
For all key/value pairs in values, replace nonlinear values with corresponding keys in this object with those in values. | |
| HybridValues & | update (const HybridValues &values) |
For all key/value pairs in values, replace all values with corresponding keys in this object with those in values. | |
| VectorValues | continuousSubset (const KeyVector &keys) const |
| Extract continuous values with given keys. | |
Wrapper support | |
| std::string | html (const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
| Output as a html table. | |
| std::string HybridValues::html | ( | const KeyFormatter & | keyFormatter = DefaultKeyFormatter | ) | const |
Output as a html table.
| keyFormatter | function that formats keys. |
| HybridValues & HybridValues::insert | ( | const DiscreteValues & | values | ) |
Insert all discrete values from values.
Throws an invalid_argument exception if any keys to be inserted are already used.
| HybridValues & HybridValues::insert | ( | const HybridValues & | values | ) |
Insert all values from values.
Throws an invalid_argument exception if any keys to be inserted are already used.
| HybridValues & HybridValues::insert | ( | const Values & | values | ) |
Insert all values from values.
Throws an invalid_argument exception if any keys to be inserted are already used.
| HybridValues & HybridValues::insert | ( | const VectorValues & | values | ) |
Insert all continuous values from values.
Throws an invalid_argument exception if any keys to be inserted are already used.
| HybridValues & HybridValues::insert | ( | Key | j, |
| const Vector & | value ) |
Insert a vector value with key j.
Throws an invalid_argument exception if the key j is already used.
| value | The vector to be inserted. |
| j | The index with which the value will be associated. |
| HybridValues & HybridValues::insert | ( | Key | j, |
| size_t | value ) |
Insert a discrete value with key j.
Replaces the existing value if the key j is already used.
| value | The vector to be inserted. |
| j | The index with which the value will be associated. |
|
inline |
Insert a nonlinear value with key j.
Throws an invalid_argument exception if the key j is already used.
| T | The type of value to insert. |
| j | The index with which the value will be associated. |
| value | The value to be inserted. |
| HybridValues HybridValues::retract | ( | const VectorValues & | delta | ) | const |
Add a delta config to current config and returns a new config.
| delta | The delta to be added. |
| HybridValues & HybridValues::update | ( | const DiscreteValues & | values | ) |
For all key/value pairs in values, replace discrete values with corresponding keys in this object with those in values.
Throws std::out_of_range if any keys in values are not present in this object.
| HybridValues & HybridValues::update | ( | const HybridValues & | values | ) |
For all key/value pairs in values, replace all values with corresponding keys in this object with those in values.
Throws std::out_of_range if any keys in values are not present in this object.
| HybridValues & HybridValues::update | ( | const Values & | values | ) |
For all key/value pairs in values, replace nonlinear values with corresponding keys in this object with those in values.
Throws std::out_of_range if any keys in values are not present in this object.
| HybridValues & HybridValues::update | ( | const VectorValues & | values | ) |
For all key/value pairs in values, replace continuous values with corresponding keys in this object with those in values.
Throws std::out_of_range if any keys in values are not present in this object.