22 using namespace gtsam;
25 std::vector<size_t>{3, 2, 1},
30 4, 10, 16, 22, 23, 24,
31 5, 11, 17, 23, 29, 30,
32 6, 12, 18, 24, 30, 36).finished());
86 24, 30, 36).finished();
94 16, 17, 18).finished();
102 const std::vector<size_t>
dimensions{2, 3, 1};
109 0, 0, 0, 0, 0, 0).finished());
117 0, 0, 0, 0, 0, 0).finished());
156 const Vector3 a(1.0, 0.2, 2.0),
b(0.3, 0.8, -1.0),
c(0.1, 0.2, 0.7);
158 inputMatrix.setZero();
159 inputMatrix +=
a *
a.transpose();
160 inputMatrix +=
b *
b.transpose();
161 inputMatrix += c * c.transpose();
162 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. ...
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.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
TEST(SymmetricBlockMatrix, ReadBlocks)
void invertInPlace()
Invert the entire active matrix in place.
Eigen::SelfAdjointView< constBlock, Eigen::Upper > selfadjointView(DenseIndex I, DenseIndex J) const
Return the square sub-matrix that contains blocks(i:j, i:j).
void setDiagonalBlock(DenseIndex I, const XprType &xpr)
Set a diagonal block. Only the upper triangular portion of xpr is evaluated.
static SymmetricBlockMatrix testBlockMatrix(std::vector< size_t >{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...
void setZero()
Set the entire active matrix zero.
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.
const std::vector< size_t > dimensions
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).