Public Types | Public Member Functions | Private Attributes | Friends | List of all members
gtsam::Signature Class Reference

#include <Signature.h>

Public Types

typedef std::vector< double > Row
 
typedef std::vector< RowTable
 

Public Member Functions

std::vector< double > cpt () const
 
DiscreteKeys discreteKeys () const
 
KeyVector indices () const
 
const DiscreteKeykey () const
 
Signatureoperator, (const DiscreteKey &parent)
 
Signatureoperator= (const std::string &spec)
 
Signatureoperator= (const Table &table)
 
const DiscreteKeysparents () const
 
 Signature (const DiscreteKey &key)
 
const boost::optional< Table > & table () const
 

Private Attributes

DiscreteKey key_
 
DiscreteKeys parents_
 
boost::optional< std::string > spec_
 
boost::optional< Tabletable_
 

Friends

GTSAM_EXPORT friend std::ostream & operator<< (std::ostream &os, const Signature &s)
 

Detailed Description

Signature for a discrete conditional density, used to construct conditionals.

The format is (Key % string) for nodes with no parents, and (Key | Key, Key = string) for nodes with parents.

The string specifies a conditional probability spec in the 00 01 10 11 order. For three-valued, it would be 00 01 02 10 11 12 20 21 22, etc...

For example, given the following keys

Key A("Asia"), S("Smoking"), T("Tuberculosis"), L("LungCancer"), B("Bronchitis"), E("Either"), X("XRay"), D("Dyspnoea");

These are all valid signatures (Asia network example):

A % "99/1" S % "50/50" T|A = "99/1 95/5" L|S = "99/1 90/10" B|S = "70/30 40/60" E|T,L = "F F F 1" X|E = "95/5 2/98" D|E,B = "9/1 2/8 3/7 1/9"

Definition at line 52 of file Signature.h.

Member Typedef Documentation

typedef std::vector<double> gtsam::Signature::Row

Data type for the CPT

Definition at line 57 of file Signature.h.

typedef std::vector<Row> gtsam::Signature::Table

Definition at line 58 of file Signature.h.

Constructor & Destructor Documentation

gtsam::Signature::Signature ( const DiscreteKey key)

Constructor from DiscreteKey

Definition at line 121 of file Signature.cpp.

Member Function Documentation

vector< double > gtsam::Signature::cpt ( ) const

Definition at line 139 of file Signature.cpp.

DiscreteKeys gtsam::Signature::discreteKeys ( ) const

All keys, with variable key first

Definition at line 125 of file Signature.cpp.

KeyVector gtsam::Signature::indices ( ) const

All key indices, with variable key first

Definition at line 132 of file Signature.cpp.

const DiscreteKey& gtsam::Signature::key ( ) const
inline

the variable key

Definition at line 80 of file Signature.h.

Signature & gtsam::Signature::operator, ( const DiscreteKey parent)

Add a parent

Definition at line 153 of file Signature.cpp.

Signature & gtsam::Signature::operator= ( const std::string &  spec)

Add the CPT spec - Fails in boost 1.40

Definition at line 166 of file Signature.cpp.

Signature & gtsam::Signature::operator= ( const Table table)

Add the CPT spec directly as a table

Definition at line 182 of file Signature.cpp.

const DiscreteKeys& gtsam::Signature::parents ( ) const
inline

the parent keys

Definition at line 85 of file Signature.h.

const boost::optional<Table>& gtsam::Signature::table ( ) const
inline

Definition at line 96 of file Signature.h.

Friends And Related Function Documentation

GTSAM_EXPORT friend std::ostream& operator<< ( std::ostream &  os,
const Signature s 
)
friend

provide streaming

Member Data Documentation

DiscreteKey gtsam::Signature::key_
private

the variable key

Definition at line 63 of file Signature.h.

DiscreteKeys gtsam::Signature::parents_
private

the parent keys

Definition at line 66 of file Signature.h.

boost::optional<std::string> gtsam::Signature::spec_
private

Definition at line 69 of file Signature.h.

boost::optional<Table> gtsam::Signature::table_
private

Definition at line 72 of file Signature.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:29