32 using namespace gtsam;
54 GaussianFactor::shared_ptr originalJacobian = originalFactor->
linearize(values);
63 GaussianFactor::shared_ptr antiGaussian = antiFactor->linearize(values);
67 Matrix actual_information = antiHessian->information();
70 Vector expected_linear = -originalHessian->linearTerm();
71 Vector actual_linear = antiHessian->linearTerm();
74 double expected_f = -originalHessian->constantTerm();
75 double actual_f = antiHessian->constantTerm();
97 values.insert(1, pose1);
98 values.insert(2, pose2);
108 VectorValues expectedDeltas = expectedBayesNet->optimize();
TEST(AntiFactor, NegativeHessian)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
static int runAllTests(TestResult &result)
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
std::shared_ptr< This > shared_ptr
A shared_ptr to this class.
std::shared_ptr< AntiFactor > shared_ptr
IsDerived< DERIVEDFACTOR > push_back(std::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
double f2(const Vector2 &x)
NonlinearFactorGraph graph
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
static enum @1107 ordering
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
std::shared_ptr< GaussianFactorGraph > linearize(const Values &linearizationPoint) const
Linearize a nonlinear factor graph.
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
std::shared_ptr< This > shared_ptr
std::shared_ptr< BetweenFactor > shared_ptr
Ordering orderingCOLAMD() const
#define EXPECT(condition)
Matrix information() const override
Contains the HessianFactor class, a general quadratic factor.
std::shared_ptr< BayesNetType > eliminateSequential(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Linear Factor Graph where all factors are Gaussians.
std::shared_ptr< GaussianFactor > linearize(const Values &x) const override
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
Point2 f1(const Point3 &p, OptionalJacobian< 2, 3 > H)
Class between(const Class &g) const
A Gaussian factor using the canonical parameters (information form)
Chordal Bayes Net, the result of eliminating a factor graph.
static const double sigma
void insert(Key j, const Value &val)
Base class and parameters for nonlinear optimization algorithms.
noiseModel::Base::shared_ptr SharedNoiseModel