26 using namespace gtsam;
48 ZZ
z =
set.project2(
p);
65 set.project2(
p, Fs,
E);
78 expectedV << -1, -2, -3, -4;
84 F <<
F1, Matrix29::Zero(), Matrix29::Zero(),
F1;
86 Matrix34 Et =
E.transpose();
91 schur << Ft *
F - Ft *
E *
P * Et *
F,
v,
v.transpose(), 30;
97 Set::UpdateSchurComplement<3>(Fs,
E,
P,
b, allKeys,
keys, actualReduced);
102 Set::UpdateSchurComplement<3>(Fs,
E,
P,
b, allKeys, keys2, actualReduced);
104 reverse_b <<
b.tail<2>(),
b.head<2>();
105 Vector reverse_v = Ft * (reverse_b -
E *
P * Et * reverse_b);
107 A << Ft *
F - Ft *
E *
P * Et *
F, reverse_v, reverse_v.transpose(), 30;
135 std::vector<Eigen::Matrix<double, 2, 12>,
137 Fs.push_back(1 * Matrix::Ones(2, 12));
138 Fs.push_back(2 * Matrix::Ones(2, 12));
139 Fs.push_back(3 * Matrix::Ones(2, 12));
140 Matrix E = 4 * Matrix::Identity(6, 3) + Matrix::Ones(6, 3);
146 Vector b = 5 * Vector::Ones(6);
155 Matrix F = Matrix::Zero(6, 3 * 12);
156 F.block<2, 12>(0, 0) = 1 * Matrix::Ones(2, 12);
157 F.block<2, 12>(2, 12) = 2 * Matrix::Ones(2, 12);
158 F.block<2, 12>(4, 24) = 3 * Matrix::Ones(2, 12);
163 Matrix expectedAugmentedHessian = Matrix::Zero(3 * 12 + 1, 3 * 12 + 1);
164 expectedAugmentedHessian.block<36, 36>(0, 0) =
H;
165 expectedAugmentedHessian.block<36, 1>(0, 36) =
v;
166 expectedAugmentedHessian.block<1, 36>(36, 0) =
v.transpose();
167 expectedAugmentedHessian(36, 36) =
b.squaredNorm();
174 nonuniqueKeys.push_back(0);
175 nonuniqueKeys.push_back(1);
176 nonuniqueKeys.push_back(1);
177 nonuniqueKeys.push_back(2);
178 nonuniqueKeys.push_back(2);
179 nonuniqueKeys.push_back(0);
182 uniqueKeys.push_back(0);
183 uniqueKeys.push_back(1);
184 uniqueKeys.push_back(2);
188 Set::SchurComplementAndRearrangeBlocks<3, 12, 6>(
189 Fs,
E,
P,
b, nonuniqueKeys, uniqueKeys);
194 Matrix F = Matrix::Zero(6, 18);
195 F.block<2, 6>(0, 0) = Fs[0].block<2, 6>(0, 0);
196 F.block<2, 6>(0, 6) = Fs[0].block<2, 6>(0, 6);
197 F.block<2, 6>(2, 6) = Fs[1].block<2, 6>(0, 0);
198 F.block<2, 6>(2, 12) = Fs[1].block<2, 6>(0, 6);
199 F.block<2, 6>(4, 12) = Fs[2].block<2, 6>(0, 0);
200 F.block<2, 6>(4, 0) = Fs[2].block<2, 6>(0, 6);
205 Matrix expectedAugmentedHessian(19, 19);
206 expectedAugmentedHessian <<
H,
v,
v.transpose(),
b.squaredNorm();
225 ZZ
z =
set.project2(
p);
241 set.project2(
p, Fs,
E);