testGaussianDensity.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
21 
22 using namespace gtsam;
23 using namespace std;
24 
25 /* ************************************************************************* */
27 {
28  Matrix R = (Matrix(2,2) <<
29  -12.1244, -5.1962,
30  0., 4.6904).finished();
31 
32  Vector d = Vector2(1.0, 2.0), s = Vector2(3.0, 4.0);
33  GaussianConditional conditional(1, d, R, noiseModel::Diagonal::Sigmas(s));
34 
35  GaussianDensity copied(conditional);
36  EXPECT(assert_equal(d, copied.d()));
37  EXPECT(assert_equal(s, copied.get_model()->sigmas()));
38 }
39 
40 /* ************************************************************************* */
41 int main() { TestResult tr; return TestRegistry::runAllTests(tr);}
42 /* ************************************************************************* */
static int runAllTests(TestResult &result)
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:43
Rot2 R(Rot2::fromAngle(0.1))
Definition: Half.h:150
A Gaussian Density.
Eigen::VectorXd Vector
Definition: Vector.h:38
#define EXPECT(condition)
Definition: Test.h:151
RealScalar s
const constBVector d() const
const SharedDiagonal & get_model() const
traits
Definition: chartTesting.h:28
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:42
int main()
Eigen::Vector2d Vector2
Definition: Vector.h:42
static shared_ptr Sigmas(const Vector &sigmas, bool smart=true)
Definition: NoiseModel.cpp:270
TEST(LPInitSolver, InfiniteLoopSingleVar)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:46:38