61 public Conditional<HybridFactor, HybridConditional> {
90 : BaseFactor(continuousKeys, discreteKeys),
BaseConditional(nFrontals) {}
113 const std::shared_ptr<GaussianConditional>& continuousConditional);
122 const std::shared_ptr<DiscreteConditional>& discreteConditional);
138 const std::string&
s =
"Hybrid Conditional: ",
176 std::shared_ptr<Factor>
inner()
const {
return inner_; }
182 double logProbability(
const HybridValues& values)
const override;
189 double logNormalizationConstant()
const override;
192 double evaluate(
const HybridValues& values)
const override;
196 for (
Key key : frontals()) {
207 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 209 friend class boost::serialization::access;
210 template <
class Archive>
211 void serialize(Archive& ar,
const unsigned int ) {
212 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(BaseFactor);
214 ar& BOOST_SERIALIZATION_NVP(inner_);
219 boost::serialization::void_cast_register<DiscreteConditional, Factor>(
221 }
else if (isContinuous()) {
222 boost::serialization::void_cast_register<GaussianConditional, Factor>(
225 boost::serialization::void_cast_register<GaussianMixture, Factor>(
void print(const Matrix &A, const string &s, ostream &stream)
const gtsam::Symbol key('X', 0)
A hybrid conditional in the Conditional Linear Gaussian scheme.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
Base class for conditional densities.
std::string serialize(const T &input)
serializes to a string
Conditional< BaseFactor, This > BaseConditional
Typedef to our conditional base class.
HybridFactor BaseFactor
Typedef to our factor base class.
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
DiscreteConditional::shared_ptr asDiscrete() const
Return conditional as a DiscreteConditional.
std::shared_ptr< Factor > inner() const
Get the type-erased pointer to the inner type.
A conditional of gaussian mixtures indexed by discrete variables, as part of a Bayes Network...
bool frontalsIn(const VectorValues &measurements) const
Check if VectorValues measurements contains all frontal keys.
GaussianConditional::shared_ptr asGaussian() const
Return HybridConditional as a GaussianConditional.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Conditional Gaussian Base class.
HybridConditional(const KeyVector &continuousKeys, const DiscreteKeys &discreteKeys, size_t nFrontals)
Construct a new Hybrid Conditional object.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Linearized Hybrid factor graph that uses type erasure.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
GaussianMixture::shared_ptr asMixture() const
Return HybridConditional as a GaussianMixture.
HybridConditional This
Typedef to this class.
std::shared_ptr< GaussianMixture > shared_ptr
std::shared_ptr< This > shared_ptr
shared_ptr to this class
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
std::uint64_t Key
Integer nonlinear key type.
std::shared_ptr< Factor > inner_
Type-erased pointer to the inner type.
DiscreteKeys is a set of keys that can be assembled using the & operator.