Private Attributes | List of all members
gtsam::HybridValues Class Reference

#include <HybridValues.h>

Public Member Functions

Standard Constructors
 HybridValues ()=default
 Default constructor creates an empty HybridValues. More...
 
 HybridValues (const VectorValues &cv, const DiscreteValues &dv)
 Construct from DiscreteValues and VectorValues. More...
 
 HybridValues (const VectorValues &cv, const DiscreteValues &dv, const Values &v)
 Construct from all values types. More...
 
Testable
void print (const std::string &s="HybridValues", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 print required by Testable for unit testing More...
 
bool equals (const HybridValues &other, double tol=1e-9) const
 equals required by Testable for unit testing More...
 
Interface
const VectorValuescontinuous () const
 Return the multi-dimensional vector values. More...
 
const DiscreteValuesdiscrete () const
 Return the discrete values. More...
 
const Valuesnonlinear () const
 Return the nonlinear values. More...
 
bool existsVector (Key j)
 Check whether a variable with key j exists in VectorValues. More...
 
bool existsDiscrete (Key j)
 Check whether a variable with key j exists in DiscreteValues. More...
 
bool existsNonlinear (Key j)
 Check whether a variable with key j exists in values. More...
 
bool exists (Key j)
 Check whether a variable with key j exists. More...
 
HybridValues retract (const VectorValues &delta) const
 
void insert (Key j, const Vector &value)
 
void insert (Key j, size_t value)
 
void insert_or_assign (Key j, const Vector &value)
 insert_or_assign() , similar to Values.h More...
 
void insert_or_assign (Key j, size_t value)
 insert_or_assign() , similar to Values.h More...
 
HybridValuesinsert (const VectorValues &values)
 
HybridValuesinsert (const DiscreteValues &values)
 
HybridValuesinsert (const Values &values)
 
HybridValuesinsert (const HybridValues &values)
 
Vectorat (Key j)
 
size_tatDiscrete (Key j)
 
HybridValuesupdate (const VectorValues &values)
 
HybridValuesupdate (const DiscreteValues &values)
 
HybridValuesupdate (const HybridValues &values)
 
VectorValues continuousSubset (const KeyVector &keys) const
 Extract continuous values with given keys. More...
 
Wrapper support
std::string html (const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 Output as a html table. More...
 

Private Attributes

VectorValues continuous_
 
DiscreteValues discrete_
 
Values nonlinear_
 

Detailed Description

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.

Definition at line 37 of file HybridValues.h.

Constructor & Destructor Documentation

◆ HybridValues() [1/3]

gtsam::HybridValues::HybridValues ( )
default

Default constructor creates an empty HybridValues.

◆ HybridValues() [2/3]

HybridValues::HybridValues ( const VectorValues cv,
const DiscreteValues dv 
)

Construct from DiscreteValues and VectorValues.

Definition at line 27 of file HybridValues.cpp.

◆ HybridValues() [3/3]

HybridValues::HybridValues ( const VectorValues cv,
const DiscreteValues dv,
const Values v 
)

Construct from all values types.

Definition at line 31 of file HybridValues.cpp.

Member Function Documentation

◆ at()

Vector & HybridValues::at ( Key  j)

Read/write access to the vector value with key j, throws std::out_of_range if j does not exist.

Definition at line 129 of file HybridValues.cpp.

◆ atDiscrete()

size_t & HybridValues::atDiscrete ( Key  j)

Read/write access to the discrete value with key j, throws std::out_of_range if j does not exist.

Definition at line 132 of file HybridValues.cpp.

◆ continuous()

const VectorValues & HybridValues::continuous ( ) const

Return the multi-dimensional vector values.

Definition at line 54 of file HybridValues.cpp.

◆ continuousSubset()

VectorValues HybridValues::continuousSubset ( const KeyVector keys) const

Extract continuous values with given keys.

Definition at line 154 of file HybridValues.cpp.

◆ discrete()

const DiscreteValues & HybridValues::discrete ( ) const

Return the discrete values.

Definition at line 57 of file HybridValues.cpp.

◆ equals()

bool HybridValues::equals ( const HybridValues other,
double  tol = 1e-9 
) const

equals required by Testable for unit testing

Definition at line 48 of file HybridValues.cpp.

◆ exists()

bool HybridValues::exists ( Key  j)

Check whether a variable with key j exists.

Definition at line 74 of file HybridValues.cpp.

◆ existsDiscrete()

bool HybridValues::existsDiscrete ( Key  j)

Check whether a variable with key j exists in DiscreteValues.

Definition at line 66 of file HybridValues.cpp.

◆ existsNonlinear()

bool HybridValues::existsNonlinear ( Key  j)

Check whether a variable with key j exists in values.

Definition at line 71 of file HybridValues.cpp.

◆ existsVector()

bool HybridValues::existsVector ( Key  j)

Check whether a variable with key j exists in VectorValues.

Definition at line 63 of file HybridValues.cpp.

◆ html()

std::string HybridValues::html ( const KeyFormatter keyFormatter = DefaultKeyFormatter) const

Output as a html table.

Parameters
keyFormatterfunction that formats keys.
Returns
string html output.

Definition at line 163 of file HybridValues.cpp.

◆ insert() [1/6]

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.

Definition at line 109 of file HybridValues.cpp.

◆ insert() [2/6]

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.

Definition at line 121 of file HybridValues.cpp.

◆ insert() [3/6]

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.

Definition at line 115 of file HybridValues.cpp.

◆ insert() [4/6]

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.

Definition at line 103 of file HybridValues.cpp.

◆ insert() [5/6]

void 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.

Parameters
valueThe vector to be inserted.
jThe index with which the value will be associated.

Definition at line 85 of file HybridValues.cpp.

◆ insert() [6/6]

void 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.

Parameters
valueThe vector to be inserted.
jThe index with which the value will be associated.

Definition at line 90 of file HybridValues.cpp.

◆ insert_or_assign() [1/2]

void HybridValues::insert_or_assign ( Key  j,
const Vector value 
)

insert_or_assign() , similar to Values.h

Definition at line 93 of file HybridValues.cpp.

◆ insert_or_assign() [2/2]

void HybridValues::insert_or_assign ( Key  j,
size_t  value 
)

insert_or_assign() , similar to Values.h

Definition at line 98 of file HybridValues.cpp.

◆ nonlinear()

const Values & HybridValues::nonlinear ( ) const

Return the nonlinear values.

Definition at line 60 of file HybridValues.cpp.

◆ print()

void HybridValues::print ( const std::string &  s = "HybridValues",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const

print required by Testable for unit testing

Definition at line 36 of file HybridValues.cpp.

◆ retract()

HybridValues HybridValues::retract ( const VectorValues delta) const

Add a delta config to current config and returns a new config

Definition at line 79 of file HybridValues.cpp.

◆ update() [1/3]

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.

Definition at line 141 of file HybridValues.cpp.

◆ update() [2/3]

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.

Definition at line 147 of file HybridValues.cpp.

◆ update() [3/3]

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.

Definition at line 135 of file HybridValues.cpp.

Member Data Documentation

◆ continuous_

VectorValues gtsam::HybridValues::continuous_
private

Definition at line 40 of file HybridValues.h.

◆ discrete_

DiscreteValues gtsam::HybridValues::discrete_
private

Definition at line 43 of file HybridValues.h.

◆ nonlinear_

Values gtsam::HybridValues::nonlinear_
private

Definition at line 46 of file HybridValues.h.


The documentation for this class was generated from the following files:


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:23:54