28 using namespace gtsam;
64 Vector expectedX = (
Vector(6) << -0.1, 0.1, -0.1, -0.1, 0.1, -0.2).finished();
82 TEST( Iterative, conjugateGradientDescent_hard_constraint )
93 std::shared_ptr<GaussianFactorGraph> fg = graph.
linearize(config);
110 TEST( Iterative, conjugateGradientDescent_soft_constraint )
117 graph.
addPrior(
X(1),
Pose2(0.,0.,0.), noiseModel::Isotropic::Sigma(3, 1
e-10));
120 std::shared_ptr<GaussianFactorGraph> fg = graph.
linearize(config);
static const Eigen::MatrixBase< Vector3 >::ConstantReturnType Z_3x1
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
static int runAllTests(TestResult &result)
void setEpsilon_rel(double value)
GaussianFactorGraph createGaussianFactorGraph()
EIGEN_DONT_INLINE Scalar zero()
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Iterative methods, implementation.
iterator insert(const std::pair< Key, Vector > &key_value)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
NonlinearFactorGraph graph
VectorValues optimize(const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
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)
Vector conjugateGradientDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)
VectorValues zeroVectors() const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static ConjugateGradientParameters parameters
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
TEST(Iterative, steepestDescent)
std::pair< Matrix, Vector > jacobian(const Ordering &ordering) const
Create small example with two poses and one landmark.
void insert(Key j, const Value &val)
void setMaxIterations(size_t value)
void setEpsilon_abs(double value)
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Vector steepestDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)