Go to the documentation of this file.
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));
188 const auto jf1 = std::dynamic_pointer_cast<JacobianFactor>(gf1);
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}) {
static int runAllTests(TestResult &result)
Eigen::Matrix< double, 1, 1 > Vector1
Conditional Gaussian Base class.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define EXPECT(condition)
A conditional of gaussian mixtures indexed by discrete variables, as part of a Bayes Network....
double logNormalizationConstant() const override
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
KeyVector continuousParents() const
Returns the continuous keys among the parents.
static const VectorValues vv
static const DiscreteValues assignment0
static bool CheckInvariants(const GaussianMixture &conditional, const VALUES &x)
std::shared_ptr< GaussianMixtureFactor > likelihood(const VectorValues &given) const
static const DiscreteValues assignment1
A hybrid conditional in the Conditional Linear Gaussian scheme.
AlgebraicDecisionTree< Key > logProbability(const VectorValues &continuousValues) const
Compute logProbability of the GaussianMixture as a tree.
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
static const HybridValues hv1
static const HybridValues hv0
AlgebraicDecisionTree< Key > errorTree(const VectorValues &continuousValues) const
Compute error of the GaussianMixture as a tree.
TEST(SmartFactorBase, Pinhole)
std::pair< Key, size_t > DiscreteKey
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
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const GaussianMixture mixture({Z(0)}, {X(0)}, {mode}, conditionals)
static const DiscreteKey mode(modeKey, 2)
std::uint64_t Key
Integer nonlinear key type.
double evaluate(const HybridValues &values) const override
Calculate probability density for given values.
Jet< T, N > sqrt(const Jet< T, N > &f)
A set of GaussianFactors, indexed by a set of discrete keys.
static shared_ptr sharedMeanAndStddev(Args &&... args)
Create shared pointer by forwarding arguments to fromMeanAndStddev.
Matrix< RealScalar, Dynamic, Dynamic > M
double error(const HybridValues &values) const override
Compute the error of this Gaussian Mixture.
gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:05:50