25 using namespace gtsam;
32 Matrix A1 = I_2x2, A2 = I_2x2, A3 = I_2x2;
34 const vector<pair<Key, Matrix> > terms {{0, A1}, {1, A2}, {3, A3}};
57 RegularHessianFactor<2> factor2(0, 1, 3, G11, G12, G13, g1, G22, G23, g2, G33, g3, f);
62 vector<Matrix> Gs {G11, G12, G13, G22, G23, G33};
63 vector<Vector> gs {
g1,
g2, g3};
79 vector<size_t> dims {2, 2, 2};
88 HessianFactor::const_iterator i1 = factor.
begin();
89 HessianFactor::const_iterator i2 = i1 + 1;
91 Vector Y(6); Y << 9, 12, 9, 12, 9, 12;
97 expected.
insert(0, Y.segment<2>(0));
98 expected.
insert(1, Y.segment<2>(2));
99 expected.
insert(3, Y.segment<2>(4));
104 actualVV.
insert(0, Vector2::Zero());
105 actualVV.
insert(1, Vector2::Zero());
106 actualVV.
insert(3, Vector2::Zero());
111 Vector expected_y(8); expected_y << 9, 12, 9, 12, 0, 0, 9, 12;
112 Vector fast_y = Vector8::Zero();
113 double xvalues[8] = {1,2,3,4,0,0,5,6};
static int runAllTests(TestResult &result)
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)
iterator insert(const std::pair< Key, Vector > &key_value)
Matrix augmentedInformation() const override
#define EXPECT(condition)
Matrix information() const override
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
HessianFactor class with constant sized blocks.
Linear Factor Graph where all factors are Gaussians.
TEST(RegularHessianFactor, Constructors)
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
const_iterator begin() const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Pose3 g2(g1.expmap(h *V1_g1))
const SymmetricBlockMatrix & info() const
Return underlying information matrix.
void multiplyHessianAdd(double alpha, const VectorValues &x, VectorValues &y) const override
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).