28 using namespace gtsam;
66 Vector expectedX = (
Vector(6) << -0.1, 0.1, -0.1, -0.1, 0.1, -0.2).finished();
84 TEST( Iterative, conjugateGradientDescent_hard_constraint )
95 boost::shared_ptr<GaussianFactorGraph> fg = graph.
linearize(config);
112 TEST( Iterative, conjugateGradientDescent_soft_constraint )
119 graph.
addPrior(
X(1),
Pose2(0.,0.,0.), noiseModel::Isotropic::Sigma(3, 1
e-10));
122 boost::shared_ptr<GaussianFactorGraph> fg = graph.
linearize(config);
static const Eigen::MatrixBase< Vector3 >::ConstantReturnType Z_3x1
VectorValues optimize(const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
static int runAllTests(TestResult &result)
VectorValues zeroVectors() const
void setEpsilon_rel(double value)
GaussianFactorGraph createGaussianFactorGraph()
void insert(Key j, const Value &val)
EIGEN_DONT_INLINE Scalar zero()
Iterative methods, implementation.
NonlinearFactorGraph graph
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
GaussianFactor::shared_ptr linearize(const Values &x) const override
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static ConjugateGradientParameters parameters
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
std::pair< Matrix, Vector > jacobian(const Ordering &ordering) const
TEST(Iterative, steepestDescent)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Vector conjugateGradientDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)
Create small example with two poses and one landmark.
void setMaxIterations(size_t value)
void setEpsilon_abs(double value)
boost::shared_ptr< GaussianFactorGraph > linearize(const Values &linearizationPoint) const
Linearize a nonlinear factor graph.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
iterator insert(const std::pair< Key, Vector > &key_value)
Vector steepestDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)