Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
gtsam::Symbol Class Reference

#include <Symbol.h>

Public Member Functions

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

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). More...
 

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.

Definition at line 37 of file inference/Symbol.h.

Constructor & Destructor Documentation

◆ Symbol() [1/4]

gtsam::Symbol::Symbol ( )
inline

Default constructor

Definition at line 45 of file inference/Symbol.h.

◆ Symbol() [2/4]

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

Copy constructor

Definition at line 50 of file inference/Symbol.h.

◆ Symbol() [3/4]

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

Constructor

Definition at line 55 of file inference/Symbol.h.

◆ Symbol() [4/4]

gtsam::Symbol::Symbol ( Key  key)

Constructor that decodes an integer Key

Definition at line 35 of file Symbol.cpp.

Member Function Documentation

◆ chr()

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

Retrieve key character

Definition at line 75 of file inference/Symbol.h.

◆ ChrTest()

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.

Definition at line 66 of file Symbol.cpp.

◆ equals()

bool gtsam::Symbol::equals ( const Symbol expected,
double  tol = 0.0 
) const

Check equality.

Definition at line 54 of file Symbol.cpp.

◆ index()

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

Retrieve key index

Definition at line 80 of file inference/Symbol.h.

◆ key()

Key gtsam::Symbol::key ( ) const

return Key (integer) representation

Definition at line 40 of file Symbol.cpp.

◆ operator Key()

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

Cast to integer

Definition at line 66 of file inference/Symbol.h.

◆ operator std::string()

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

Create a string from the key

Definition at line 58 of file Symbol.cpp.

◆ operator!=() [1/2]

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

Comparison for use in maps

Definition at line 106 of file inference/Symbol.h.

◆ operator!=() [2/2]

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

Comparison for use in maps

Definition at line 111 of file inference/Symbol.h.

◆ operator<()

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

Comparison for use in maps

Definition at line 91 of file inference/Symbol.h.

◆ operator==() [1/2]

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

Comparison for use in maps

Definition at line 96 of file inference/Symbol.h.

◆ operator==() [2/2]

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

Comparison for use in maps

Definition at line 101 of file inference/Symbol.h.

◆ print()

void gtsam::Symbol::print ( const std::string &  s = "") const

Print.

Definition at line 50 of file Symbol.cpp.

◆ string()

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

Return string representation of the key.

Definition at line 88 of file inference/Symbol.h.

Friends And Related Function Documentation

◆ operator<<

GTSAM_EXPORT friend std::ostream& operator<< ( std::ostream &  os,
const Symbol symbol 
)
friend

Output stream operator that can be used with key_formatter (see Key.h).

Definition at line 73 of file Symbol.cpp.

Member Data Documentation

◆ c_

unsigned char gtsam::Symbol::c_
protected

Definition at line 39 of file inference/Symbol.h.

◆ j_

std::uint64_t gtsam::Symbol::j_
protected

Definition at line 40 of file inference/Symbol.h.


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


gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:18:08