Signature.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 #include <string>
21 #include <vector>
22 #include <boost/optional.hpp>
24 
25 namespace gtsam {
26 
52  class GTSAM_EXPORT Signature {
53 
54  public:
55 
57  typedef std::vector<double> Row;
58  typedef std::vector<Row> Table;
59 
60  private:
61 
64 
67 
68  // the given CPT specification string
69  boost::optional<std::string> spec_;
70 
71  // the CPT as parsed, if successful
72  boost::optional<Table> table_;
73 
74  public:
75 
77  Signature(const DiscreteKey& key);
78 
80  const DiscreteKey& key() const {
81  return key_;
82  }
83 
85  const DiscreteKeys& parents() const {
86  return parents_;
87  }
88 
90  DiscreteKeys discreteKeys() const;
91 
93  KeyVector indices() const;
94 
95  // the CPT as parsed, if successful
96  const boost::optional<Table>& table() const {
97  return table_;
98  }
99 
100  // the CPT as a vector of doubles, with key's values most rapidly changing
101  std::vector<double> cpt() const;
102 
104  Signature& operator,(const DiscreteKey& parent);
105 
107  Signature& operator=(const std::string& spec);
108 
110  Signature& operator=(const Table& table);
111 
113  GTSAM_EXPORT friend std::ostream& operator <<(std::ostream &os, const Signature &s);
114  };
115 
120  GTSAM_EXPORT Signature operator|(const DiscreteKey& key, const DiscreteKey& parent);
121 
127  GTSAM_EXPORT Signature operator%(const DiscreteKey& key, const std::string& parent);
128 
133  GTSAM_EXPORT Signature operator%(const DiscreteKey& key, const Signature::Table& parent);
134 
135 }
const boost::optional< Table > & table() const
Definition: Signature.h:96
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
Definition: testGroup.cpp:109
DiscreteKey key_
Definition: Signature.h:63
boost::optional< std::string > spec_
Definition: Signature.h:69
boost::optional< Table > table_
Definition: Signature.h:72
Signature operator|(const DiscreteKey &key, const DiscreteKey &parent)
Definition: Signature.cpp:208
DiscreteKeys parents_
Definition: Signature.h:66
std::vector< Row > Table
Definition: Signature.h:58
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
std::pair< Key, size_t > DiscreteKey
Definition: DiscreteKey.h:34
RealScalar s
const DiscreteKeys & parents() const
Definition: Signature.h:85
Signature operator%(const DiscreteKey &key, const string &parent)
Definition: Signature.cpp:213
std::vector< double > Row
Definition: Signature.h:57
traits
Definition: chartTesting.h:28
specialized key for discrete variables
ofstream os("timeSchurFactors.csv")
ArrayXXf table(10, 4)
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:37
const DiscreteKey & key() const
Definition: Signature.h:80


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