29 using namespace gtsam;
32 TEST( PCGsolver, verySimpleLinearSystem) {
46 exactSolution.
insert(0, (
Vector(2) << 1./11., 7./11.).finished());
57 pcg->maxIterations = 500;
58 pcg->epsilon_abs = 0.0;
59 pcg->epsilon_rel = 0.0;
64 std::make_shared<gtsam::DummyPreconditionerParameters>();
71 std::make_shared<gtsam::BlockJacobiPreconditionerParameters>();
73 pcg->maxIterations = 1500;
87 simpleGFG.
emplace_shared<
JacobianFactor>(2, (
Matrix(2,2)<< -10, 0, 0, -10).finished(), 0, (
Matrix(2,2)<< 10, 0, 0, 10).finished(), (
Vector(2) << 2, -1).finished(), unit2);
88 simpleGFG.
emplace_shared<
JacobianFactor>(2, (
Matrix(2,2)<< -5, 0, 0, -5).finished(), 1, (
Matrix(2,2)<< 5, 0, 0, 5).finished(), (
Vector(2) << 0, 1).finished(), unit2);
89 simpleGFG.
emplace_shared<
JacobianFactor>(0, (
Matrix(2,2)<< -5, 0, 0, -5).finished(), 1, (
Matrix(2,2)<< 5, 0, 0, 5).finished(), (
Vector(2) << -1, 1.5).finished(), unit2);
97 expectedSolution.
insert(0, (
Vector(2) << 0.100498, -0.196756).finished());
98 expectedSolution.insert(2, (
Vector(2) << -0.0990413, -0.0980577).finished());
99 expectedSolution.insert(1, (
Vector(2) << -0.0973252, 0.100582).finished());
110 pcg->maxIterations = 500;
111 pcg->epsilon_abs = 0.0;
112 pcg->epsilon_rel = 0.0;
116 pcg->preconditioner =
117 std::make_shared<gtsam::DummyPreconditionerParameters>();
123 pcg->preconditioner =
124 std::make_shared<gtsam::BlockJacobiPreconditionerParameters>();