28 #ifndef G2O_LINEAR_SOLVER_DENSE_H 29 #define G2O_LINEAR_SOLVER_DENSE_H 31 #include "../core/linear_solver.h" 32 #include "../core/batch_stats.h" 37 #include<Eigen/Cholesky> 45 template <
typename MatrixType>
70 Eigen::MatrixXd& H =
_H;
82 for (
size_t i = 0; i < A.
blockCols().size(); ++i) {
84 assert(c_idx == A.
colBaseOfBlock(i) &&
"mismatch in block indices");
89 for (it = col.begin(); it != col.end(); ++it) {
92 if (it->first <= (
int)i) {
94 H.block(r_idx, c_idx, r_size, c_size) = *(it->second);
96 H.block(c_idx, r_idx, c_size, r_size) = it->second->
transpose();
105 Eigen::VectorXd::MapType xvec(x, m);
106 Eigen::VectorXd::ConstMapType bvec(b, n);
bool transpose(SparseBlockMatrix< MatrixTransposedType > *&dest) const
transposes a block matrix, The transposed type should match the argument false on failure ...
int rowsOfBlock(int r) const
how many rows does the block at block-row r has?
int cols() const
columns of the matrix
bool solve(const SparseBlockMatrix< MatrixType > &A, double *x, double *b)
int colsOfBlock(int c) const
how many cols does the block at block-col c has?
linear solver using dense cholesky decomposition
std::map< int, SparseMatrixBlock * > IntBlockMap
int colBaseOfBlock(int c) const
where does the col at block-col r starts?
const std::vector< IntBlockMap > & blockCols() const
the block matrices per block-column
virtual ~LinearSolverDense()
Eigen::LDLT< Eigen::MatrixXd > _cholesky
int rowBaseOfBlock(int r) const
where does the row at block-row r starts?
Sparse matrix which uses blocks.