20 #include <boost/assign/list_of.hpp> 23 using namespace gtsam;
24 using boost::assign::list_of;
32 4, 10, 16, 22, 23, 24,
33 5, 11, 17, 23, 29, 30,
34 6, 12, 18, 24, 30, 36).finished());
88 24, 30, 36).finished();
96 16, 17, 18).finished();
110 0, 0, 0, 0, 0, 0).finished());
118 0, 0, 0, 0, 0, 0).finished());
157 const Vector3 a(1.0, 0.2, 2.0),
b(0.3, 0.8, -1.0),
c(0.1, 0.2, 0.7);
159 inputMatrix.setZero();
160 inputMatrix +=
a *
a.transpose();
161 inputMatrix +=
b *
b.transpose();
162 inputMatrix += c * c.transpose();
163 const Matrix expectedInverse = inputMatrix.inverse();
static int runAllTests(TestResult &result)
Access to matrices via blocks of pre-defined sizes. Used in GaussianFactor and GaussianConditional.
void setOffDiagonalBlock(DenseIndex I, DenseIndex J, const XprType &xpr)
Set an off-diagonal block. Only the upper triangular portion of xpr is evaluated. ...
TEST(SymmetricBlockMatrix, ReadBlocks)
void invertInPlace()
Invert the entire active matrix in place.
void setDiagonalBlock(DenseIndex I, const XprType &xpr)
Set a diagonal block. Only the upper triangular portion of xpr is evaluated.
static SymmetricBlockMatrix testBlockMatrix(list_of(3)(2)(1),(Matrix(6, 6)<< 1, 2, 3, 4, 5, 6, 2, 8, 9, 10, 11, 12, 3, 9, 15, 16, 17, 18, 4, 10, 16, 22, 23, 24, 5, 11, 17, 23, 29, 30, 6, 12, 18, 24, 30, 36).finished())
#define EXPECT(condition)
void updateDiagonalBlock(DenseIndex I, const XprType &xpr)
Increment the diagonal block by the values in xpr. Only reads the upper triangular part of xpr...
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
constBlock aboveDiagonalRange(DenseIndex i_startBlock, DenseIndex i_endBlock, DenseIndex j_startBlock, DenseIndex j_endBlock) const
Get a range [i,j) from the matrix. Indices are in block units.
void setZero()
Set the entire active matrix zero.
Eigen::SelfAdjointView< constBlock, Eigen::Upper > selfadjointView(DenseIndex I, DenseIndex J) const
Return the square sub-matrix that contains blocks(i:j, i:j).
void updateOffDiagonalBlock(DenseIndex I, DenseIndex J, const XprType &xpr)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.