32 for (
size_t i = 1;
i < row.size();
i++) os <<
" " << row[
i];
37 for (
size_t i = 0;
i < table.size();
i++) os << table[
i] << endl;
43 : key_(key), parents_(parents) {
48 const std::string& spec)
64 js.push_back(
key_.first);
72 const size_t nrStates =
table_->at(0).size();
73 for (
size_t j = 0;
j < nrStates;
j++) {
75 assert(
row.size() == nrStates);
76 cpt.push_back(
row[
j]);
90 for (
size_t i = 0;
i < row.size();
i++) sum += row[
i];
91 for (
size_t i = 0;
i < row.size();
i++) row[
i] /= sum;
121 os << (s.
spec_ ? *s.
spec_ :
"no spec") << endl;
125 os <<
"spec could not be parsed" << endl;
const gtsam::Symbol key('X', 0)
Signature(const DiscreteKey &key, const DiscreteKeys &parents, const Table &table)
const MATRIX::ConstRowXpr row(const MATRIX &A, size_t j)
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
signatures for conditional densities
Signature & operator,(const DiscreteKey &parent)
Parser for conditional distribution signatures.
const DiscreteKey & key() const
static void normalize(Signature::Row &row)
Signature & operator=(const std::string &spec)
DiscreteKeys discreteKeys() const
const DiscreteKeys & parents() const
static std::optional< Table > Parse(const std::string &str)
std::optional< std::string > spec_
const std::optional< Table > & table() const
Signature operator%(const DiscreteKey &key, const string &parent)
std::vector< double > Row
std::optional< Table > table_
std::vector< double > cpt() const
ofstream os("timeSchurFactors.csv")
GTSAM_EXPORT friend std::ostream & operator<<(std::ostream &os, const Signature &s)
std::pair< Key, size_t > DiscreteKey
Signature operator|(const DiscreteKey &key, const DiscreteKey &parent)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
KeyVector indices() const
DiscreteKeys is a set of keys that can be assembled using the & operator.