33 using namespace gtsam;
81 std::vector<DiscreteKey> discrete_keys = {
mode};
89 for (
size_t mode : {0, 1}) {
103 std::vector<DiscreteKey> discrete_keys = {
mode};
111 for (
size_t mode : {0, 1}) {
133 std::vector<DiscreteKey> discrete_keys = {
mode};
140 std::vector<double>
ratio(2);
141 for (
size_t mode : {0, 1}) {
166 EXPECT(continuousParentKeys.size() == 1);
167 EXPECT(continuousParentKeys[0] ==
X(0));
192 CHECK(jf1->rows() == 2);
198 Vector expected_unwhitened(2);
199 expected_unwhitened << 4.9 - 5.0, -c1;
200 Vector actual_unwhitened = jf1->unweighted_error(
vv);
204 Vector expected_whitened(2);
205 expected_whitened << (4.9 - 5.0) / 3.0, -c1;
206 Vector actual_whitened = jf1->error_vector(
vv);
214 std::vector<double>
ratio(2);
215 for (
size_t mode : {0, 1}) {
A set of GaussianFactors, indexed by a set of discrete keys.
A hybrid conditional in the Conditional Linear Gaussian scheme.
AlgebraicDecisionTree< Key > logProbability(const VectorValues &continuousValues) const
Compute logProbability of the GaussianMixture as a tree.
Matrix< RealScalar, Dynamic, Dynamic > M
static int runAllTests(TestResult &result)
KeyVector continuousParents() const
Returns the continuous keys among the parents.
static bool CheckInvariants(const GaussianMixture &conditional, const VALUES &x)
static const DiscreteValues assignment1
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size ratio
const std::vector< GaussianConditional::shared_ptr > conditionals
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
static const VectorValues vv
A conditional of gaussian mixtures indexed by discrete variables, as part of a Bayes Network...
double error(const HybridValues &values) const override
Compute the error of this Gaussian Mixture.
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Conditional Gaussian Base class.
static const DiscreteValues assignment0
static shared_ptr sharedMeanAndStddev(Args &&... args)
Create shared pointer by forwarding arguments to fromMeanAndStddev.
Eigen::Matrix< double, 1, 1 > Vector1
double logNormalizationConstant() const override
static const HybridValues hv0
std::shared_ptr< GaussianMixtureFactor > likelihood(const VectorValues &given) const
std::pair< Key, size_t > DiscreteKey
const GaussianMixture mixture({Z(0)}, {X(0)}, {mode}, conditionals)
static const HybridValues hv1
Jet< T, N > sqrt(const Jet< T, N > &f)
static const DiscreteKey mode(modeKey, 2)
TEST(SmartFactorBase, Pinhole)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
double evaluate(const HybridValues &values) const override
Calculate probability density for given values.
std::uint64_t Key
Integer nonlinear key type.