GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
gtsam::Symbol Class Reference

#include <Symbol.h>

Public Member Functions

 Symbol ()
 
 Symbol (const Symbol &key)
 
 Symbol (unsigned char c, std::uint64_t j)
 
 Symbol (Key key)
 
Key key () const
 
 operator Key () const
 
void print (const std::string &s="") const
 Print.
 
bool equals (const Symbol &expected, double tol=0.0) const
 Check equality.
 
unsigned char chr () const
 
std::uint64_t index () const
 
 operator std::string () const
 
std::string string () const
 Return string representation of the key.
 
bool operator< (const Symbol &comp) const
 
bool operator== (const Symbol &comp) const
 
bool operator== (Key comp) const
 
bool operator!= (const Symbol &comp) const
 
bool operator!= (Key comp) const
 

Static Public Member Functions

static std::function< bool(Key)> ChrTest (unsigned char c)
 

Protected Attributes

unsigned char c_
 
std::uint64_t j_
 

Friends

GTSAM_EXPORT friend std::ostream & operator<< (std::ostream &, const Symbol &)
 Output stream operator that can be used with key_formatter (see Key.h).
 

Detailed Description

Character and index key used to refer to variables. Will simply cast to a Key, i.e., a large integer. Keys are used to retrieve values from Values, specify what variables factors depend on, etc.

Constructor & Destructor Documentation

◆ Symbol() [1/4]

gtsam::Symbol::Symbol ( )
inline

Default constructor

◆ Symbol() [2/4]

gtsam::Symbol::Symbol ( const Symbol key)
inline

Copy constructor

◆ Symbol() [3/4]

gtsam::Symbol::Symbol ( unsigned char  c,
std::uint64_t  j 
)
inline

Constructor

◆ Symbol() [4/4]

gtsam::Symbol::Symbol ( Key  key)

Constructor that decodes an integer Key

Member Function Documentation

◆ chr()

unsigned char gtsam::Symbol::chr ( ) const
inline

Retrieve key character

◆ ChrTest()

static std::function<bool(Key)> gtsam::Symbol::ChrTest ( unsigned char  c)
static

Return a filter function that returns true when evaluated on a Key whose character (when converted to a Symbol) matches c. Use this with the Values::filter() function to retrieve all key-value pairs with the requested character.

◆ index()

std::uint64_t gtsam::Symbol::index ( ) const
inline

Retrieve key index

◆ key()

Key gtsam::Symbol::key ( ) const

return Key (integer) representation

◆ operator Key()

gtsam::Symbol::operator Key ( ) const
inline

Cast to integer

◆ operator std::string()

gtsam::Symbol::operator std::string ( ) const

Create a string from the key

◆ operator!=() [1/2]

bool gtsam::Symbol::operator!= ( const Symbol comp) const
inline

Comparison for use in maps

◆ operator!=() [2/2]

bool gtsam::Symbol::operator!= ( Key  comp) const
inline

Comparison for use in maps

◆ operator<()

bool gtsam::Symbol::operator< ( const Symbol comp) const
inline

Comparison for use in maps

◆ operator==() [1/2]

bool gtsam::Symbol::operator== ( const Symbol comp) const
inline

Comparison for use in maps

◆ operator==() [2/2]

bool gtsam::Symbol::operator== ( Key  comp) const
inline

Comparison for use in maps


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