GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | List of all members
gtsam::DiscreteValues Class Reference

#include <DiscreteValues.h>

Inheritance diagram for gtsam::DiscreteValues:
Inheritance graph
[legend]
Collaboration diagram for gtsam::DiscreteValues:
Collaboration graph
[legend]

Public Types

using Base = Assignment< Key >
 

Public Member Functions

Standard Constructors
 DiscreteValues ()=default
 
 DiscreteValues (const Base &a)
 
 DiscreteValues (std::initializer_list< std::pair< const Key, size_t >> init)
 
bool equals (const DiscreteValues &x, double tol=1e-9) const
 equals required by Testable for unit testing.
 

Standard Interface

std::pair< iterator, bool > insert (const value_type &value)
 
DiscreteValuesinsert (const DiscreteValues &values)
 
DiscreteValuesupdate (const DiscreteValues &values)
 
static std::vector< DiscreteValuesCartesianProduct (const DiscreteKeys &keys)
 Return a vector of DiscreteValues, one for each possible combination of values.
 

Wrapper support

using Names = std::map< Key, std::vector< std::string > >
 Translation table from values to strings.
 
std::string markdown (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const
 Output as a markdown table. More...
 
std::string html (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const
 Output as a html table. More...
 
static std::string Translate (const Names &names, Key key, size_t index)
 Translate an integer index value for given key to a string.
 

Detailed Description

A map from keys to values

Member Function Documentation

◆ html()

std::string gtsam::DiscreteValues::html ( const KeyFormatter keyFormatter = DefaultKeyFormatter,
const Names names = {} 
) const

Output as a html table.

Parameters
keyFormatterfunction that formats keys.
namestranslation table for values.
Returns
string html output.

◆ insert()

DiscreteValues& gtsam::DiscreteValues::insert ( const DiscreteValues values)

Insert all values from values. Throws an invalid_argument exception if any keys to be inserted are already used.

◆ markdown()

std::string gtsam::DiscreteValues::markdown ( const KeyFormatter keyFormatter = DefaultKeyFormatter,
const Names names = {} 
) const

Output as a markdown table.

Parameters
keyFormatterfunction that formats keys.
namestranslation table for values.
Returns
string markdown output.

◆ update()

DiscreteValues& gtsam::DiscreteValues::update ( const DiscreteValues values)

For all key/value pairs in values, replace 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.


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