Public Types | Protected Attributes | Private Attributes | List of all members
gtsam::HybridFactor Class Reference

#include <HybridFactor.h>

Inheritance diagram for gtsam::HybridFactor:
Inheritance graph
[legend]

Public Types

typedef Factor Base
 Our base class. More...
 
typedef std::shared_ptr< HybridFactorshared_ptr
 shared_ptr to this class More...
 
typedef HybridFactor This
 This class. More...
 
- Public Types inherited from gtsam::Factor
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys. More...
 
typedef KeyVector::iterator iterator
 Iterator over keys. More...
 

Public Member Functions

Standard Constructors
 HybridFactor ()=default
 
 HybridFactor (const KeyVector &keys)
 Construct hybrid factor from continuous keys. More...
 
 HybridFactor (const DiscreteKeys &discreteKeys)
 Construct hybrid factor from discrete keys. More...
 
 HybridFactor (const KeyVector &continuousKeys, const DiscreteKeys &discreteKeys)
 Construct a new Hybrid Factor object. More...
 
Testable
virtual bool equals (const HybridFactor &lf, double tol=1e-9) const
 equals More...
 
void print (const std::string &s="HybridFactor\, const KeyFormatter &formatter=DefaultKeyFormatter) const override
 print More...
 
Standard Interface
bool isDiscrete () const
 True if this is a factor of discrete variables only. More...
 
bool isContinuous () const
 True if this is a factor of continuous variables only. More...
 
bool isHybrid () const
 True is this is a Discrete-Continuous factor. More...
 
size_t nrContinuous () const
 Return the number of continuous variables in this factor. More...
 
const DiscreteKeysdiscreteKeys () const
 Return the discrete keys for this factor. More...
 
const KeyVectorcontinuousKeys () const
 Return only the continuous keys for this factor. More...
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor. More...
 
bool empty () const
 Whether the factor is empty (involves zero variables). More...
 
Key front () const
 First key. More...
 
Key back () const
 Last key. More...
 
const_iterator find (Key key) const
 find More...
 
const KeyVectorkeys () const
 Access the factor's involved variable keys. More...
 
const_iterator begin () const
 
const_iterator end () const
 
virtual double error (const HybridValues &c) const
 
size_t size () const
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
bool equals (const This &other, double tol=1e-9) const
 check equality More...
 
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 

Protected Attributes

KeyVector continuousKeys_
 Record continuous keys for book-keeping. More...
 
DiscreteKeys discreteKeys_
 
- Protected Attributes inherited from gtsam::Factor
KeyVector keys_
 The keys involved in this factor. More...
 

Private Attributes

bool isContinuous_ = false
 
bool isDiscrete_ = false
 
bool isHybrid_ = false
 

Additional Inherited Members

- Protected Member Functions inherited from gtsam::Factor
 Factor ()
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 
- Static Protected Member Functions inherited from gtsam::Factor
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 

Detailed Description

Base class for truly hybrid probabilistic factors

Examples:

a mixture of Gaussian and discrete distributions over a set of variables.

Definition at line 52 of file HybridFactor.h.

Member Typedef Documentation

◆ Base

Our base class.

Definition at line 69 of file HybridFactor.h.

◆ shared_ptr

shared_ptr to this class

Definition at line 68 of file HybridFactor.h.

◆ This

This class.

Definition at line 66 of file HybridFactor.h.

Constructor & Destructor Documentation

◆ HybridFactor() [1/4]

gtsam::HybridFactor::HybridFactor ( )
default

Default constructor creates empty factor

◆ HybridFactor() [2/4]

gtsam::HybridFactor::HybridFactor ( const KeyVector keys)
explicit

Construct hybrid factor from continuous keys.

Parameters
keysVector of continuous keys.

Definition at line 52 of file HybridFactor.cpp.

◆ HybridFactor() [3/4]

gtsam::HybridFactor::HybridFactor ( const DiscreteKeys discreteKeys)
explicit

Construct hybrid factor from discrete keys.

Parameters
keysVector of discrete keys.

Definition at line 66 of file HybridFactor.cpp.

◆ HybridFactor() [4/4]

gtsam::HybridFactor::HybridFactor ( const KeyVector continuousKeys,
const DiscreteKeys discreteKeys 
)

Construct a new Hybrid Factor object.

Parameters
continuousKeysVector of keys for continuous variables.
discreteKeysVector of keys for discrete variables.

Definition at line 56 of file HybridFactor.cpp.

Member Function Documentation

◆ continuousKeys()

const KeyVector& gtsam::HybridFactor::continuousKeys ( ) const
inline

Return only the continuous keys for this factor.

Definition at line 132 of file HybridFactor.h.

◆ discreteKeys()

const DiscreteKeys& gtsam::HybridFactor::discreteKeys ( ) const
inline

Return the discrete keys for this factor.

Definition at line 129 of file HybridFactor.h.

◆ equals()

bool gtsam::HybridFactor::equals ( const HybridFactor lf,
double  tol = 1e-9 
) const
virtual

◆ isContinuous()

bool gtsam::HybridFactor::isContinuous ( ) const
inline

True if this is a factor of continuous variables only.

Definition at line 120 of file HybridFactor.h.

◆ isDiscrete()

bool gtsam::HybridFactor::isDiscrete ( ) const
inline

True if this is a factor of discrete variables only.

Definition at line 117 of file HybridFactor.h.

◆ isHybrid()

bool gtsam::HybridFactor::isHybrid ( ) const
inline

True is this is a Discrete-Continuous factor.

Definition at line 123 of file HybridFactor.h.

◆ nrContinuous()

size_t gtsam::HybridFactor::nrContinuous ( ) const
inline

Return the number of continuous variables in this factor.

Definition at line 126 of file HybridFactor.h.

◆ print()

void gtsam::HybridFactor::print ( const std::string &  s = "HybridFactor\n",
const KeyFormatter formatter = DefaultKeyFormatter 
) const
overridevirtual

print

Reimplemented from gtsam::Factor.

Reimplemented in gtsam::MixtureFactor.

Definition at line 82 of file HybridFactor.cpp.

Member Data Documentation

◆ continuousKeys_

KeyVector gtsam::HybridFactor::continuousKeys_
protected

Record continuous keys for book-keeping.

Definition at line 62 of file HybridFactor.h.

◆ discreteKeys_

DiscreteKeys gtsam::HybridFactor::discreteKeys_
protected

Definition at line 60 of file HybridFactor.h.

◆ isContinuous_

bool gtsam::HybridFactor::isContinuous_ = false
private

Definition at line 55 of file HybridFactor.h.

◆ isDiscrete_

bool gtsam::HybridFactor::isDiscrete_ = false
private

Definition at line 54 of file HybridFactor.h.

◆ isHybrid_

bool gtsam::HybridFactor::isHybrid_ = false
private

Definition at line 56 of file HybridFactor.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:20