Go to the documentation of this file.
42 using namespace gtsam;
51 HybridGaussianFactor::const_iterator const_it =
factor.
begin();
61 auto A1 = Matrix::Zero(2, 1);
62 auto A2 = Matrix::Zero(2, 2);
63 auto b = Matrix::Zero(2, 1);
65 auto f10 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(2),
A2,
b);
66 auto f11 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(2),
A2,
b);
75 std::vector<GaussianFactorValuePair> pairs{{
f10, 0.0}, {
f11, 0.0}};
94 auto A3 = Matrix::Zero(2, 3);
95 auto f20 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(3),
A3,
b);
96 auto f21 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(3),
A3,
b);
97 auto f22 = std::make_shared<JacobianFactor>(
X(1),
A1,
X(3),
A3,
b);
112 R
"(Hybrid [x1 x2; 1]{
148 dKeys.emplace_back(
M(0), 2);
149 dKeys.emplace_back(
M(1), 2);
151 auto gaussians = std::make_shared<GaussianConditional>();
163 auto A01 = Matrix2::Identity();
164 auto A02 = Matrix2::Identity();
166 auto A11 = Matrix2::Identity();
167 auto A12 = Matrix2::Identity() * 2;
169 auto b = Vector2::Zero();
171 auto f0 = std::make_shared<JacobianFactor>(
X(1), A01,
X(2), A02,
b);
172 auto f1 = std::make_shared<JacobianFactor>(
X(1),
A11,
X(2),
A12,
b);
177 continuousValues.insert(
X(2),
Vector2(1, 1));
181 hybridFactor.errorTree(continuousValues);
183 std::vector<DiscreteKey> discrete_keys = {
m1};
185 std::vector<double> errors = {1, 4};
192 discreteValues[
m1.first] = 1;
194 4.0, hybridFactor.error({continuousValues, discreteValues}), 1
e-9);
static int runAllTests(TestResult &result)
Linear Factor Graph where all factors are Gaussians.
A hybrid conditional in the Conditional Linear Gaussian scheme.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#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)
iterator insert(const std::pair< Key, Vector > &key_value)
bool assert_print_equal(const std::string &expected, const V &actual, const std::string &s="")
A Bayes net of Gaussian Conditionals indexed by discrete keys.
DiscreteKeys is a set of keys that can be assembled using the & operator.
const_iterator begin() const
A set of GaussianFactors, indexed by a set of discrete keys.
const std::vector< GaussianConditional::shared_ptr > conditionals
Provides additional testing facilities for common data structures.
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
A conditional of gaussian conditionals indexed by discrete variables, as part of a Bayes Network....
const_iterator end() const
static const double A12[]
const HybridGaussianFactor hybridFactorB(m2, {{f20, 20}, {f21, 21}, {f22, 22}})
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
TEST(HybridGaussianFactor, Constructor)
Linearized Hybrid factor graph that uses type erasure.
const KeyVector & keys() const
Access the factor's involved variable keys.
std::pair< Key, size_t > DiscreteKey
Implementation of a discrete-conditioned hybrid factor. Implements a joint discrete-continuous factor...
const KeyVector & continuousKeys() const
Return only the continuous keys for this factor.
static const double A11[]
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const DiscreteKeys & discreteKeys() const
Return the discrete keys for this factor.
Matrix< RealScalar, Dynamic, Dynamic > M
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:16:29