Go to the documentation of this file.
34 using namespace gtsam;
42 const auto A1 = Matrix::Zero(2, 1);
43 const auto A2 = Matrix::Zero(2, 2);
44 const auto b = Matrix::Zero(2, 1);
46 const auto f10 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(2),
A2,
b);
47 const auto f11 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(2),
A2,
b);
50 const auto A3 = Matrix::Zero(2, 3);
51 const auto f20 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(3),
A3,
b);
52 const auto f21 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(3),
A3,
b);
53 const auto f22 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(3),
A3,
b);
58 m2, {{
f20, 20}, {
nullptr, 1000}, {
f22, 22}});
95 Matrix11
R = I_1x1,
S = I_1x1;
96 auto gc1 = std::make_shared<GaussianConditional>(
X(1),
d,
R,
X(2),
S);
97 auto gc2 = std::make_shared<GaussianConditional>(
X(2),
d,
R);
101 product += std::static_pointer_cast<GaussianFactor>(gc1);
102 product += std::static_pointer_cast<GaussianFactor>(gc2);
169 auto actual00 =
product({{
M(1), 0}, {
M(2), 0}});
174 auto actual12 =
product({{
M(1), 1}, {
M(2), 2}});
192 #ifdef GTSAM_DT_MERGING
193 auto pruned =
product.removeEmpty();
static int runAllTests(TestResult &result)
Conditional Gaussian Base class.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
#define EXPECT_LONGS_EQUAL(expected, actual)
const HybridGaussianFactor hybridFactorA(m1, {{f10, 10}, {f11, 11}})
Concept check for values that can be used in unit tests.
#define EXPECT(condition)
Alias for DecisionTree of GaussianFactorGraphs and their scalar sums.
A set of GaussianFactors, indexed by a set of discrete keys.
Provides additional testing facilities for common data structures.
TEST(HybridGaussianProductFactor, Construct)
static const DiscreteKey mode(modeKey, 2)
const HybridGaussianFactor hybridFactorB(m2, {{f20, 20}, {f21, 21}, {f22, 22}})
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
virtual HybridGaussianProductFactor asProductFactor() const
Helper function to return factors and functional to create a DecisionTree of Gaussian Factor Graphs.
static const DiscreteKey m2(M(2), 3)
static const DiscreteKey m1(M(1), 2)
std::pair< Key, size_t > DiscreteKey
Implementation of a discrete-conditioned hybrid factor. Implements a joint discrete-continuous factor...
void product(const MatrixType &m)
The matrix class, also used for vectors and row-vectors.
static NonlinearClusterTree Construct()
Rot2 R(Rot2::fromAngle(0.1))
const HybridGaussianFactor prunedFactorB(m2, {{f20, 20}, {nullptr, 1000}, {f22, 22}})
Matrix< RealScalar, Dynamic, Dynamic > M
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:07:38