move SparseMatrixBoostTriplets typedef to gfg

release/4.3a0
Gerry Chen 2021-01-20 12:25:20 -05:00
parent b5951d033e
commit 286898a847
3 changed files with 9 additions and 11 deletions

View File

@ -75,12 +75,6 @@ GTSAM_MAKE_MATRIX_DEFS(9);
typedef Eigen::Block<Matrix> SubMatrix;
typedef Eigen::Block<const Matrix> ConstSubMatrix;
/// Sparse matrix representation as vector of tuples.
/// See SparseMatrix.h for additional representations SparseMatrixEigenTriplets
/// and SparseMatrixEigen
typedef std::vector<boost::tuple<size_t, size_t, double>>
SparseMatrixBoostTriplets;
// Matrix formatting arguments when printing.
// Akin to Matlab style.
const Eigen::IOFormat& matlabFormat();

View File

@ -99,30 +99,31 @@ namespace gtsam {
return result;
}
using BoostTriplets = GaussianFactorGraph::SparseMatrixBoostTriplets;
/* ************************************************************************* */
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian(
BoostTriplets GaussianFactorGraph::sparseJacobian(
const Ordering& ordering, size_t& nrows, size_t& ncols) const {
SparseMatrixBoostTriplets entries;
BoostTriplets entries;
entries.reserve(60 * size());
sparseJacobianInPlace(entries, ordering, nrows, ncols);
return entries;
}
/* ************************************************************************* */
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian(
BoostTriplets GaussianFactorGraph::sparseJacobian(
const Ordering& ordering) const {
size_t dummy1, dummy2;
return sparseJacobian(ordering, dummy1, dummy2);
}
/* ************************************************************************* */
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian(
BoostTriplets GaussianFactorGraph::sparseJacobian(
size_t& nrows, size_t& ncols) const {
return sparseJacobian(Ordering(this->keys()), nrows, ncols);
}
/* ************************************************************************* */
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian() const {
BoostTriplets GaussianFactorGraph::sparseJacobian() const {
size_t dummy1, dummy2;
return sparseJacobian(dummy1, dummy2);
}

View File

@ -180,6 +180,9 @@ namespace gtsam {
///@name Linear Algebra
///@{
typedef std::vector<boost::tuple<size_t, size_t, double>>
SparseMatrixBoostTriplets; ///< Sparse matrix representation as vector of tuples.
/**
* Populates a container of triplets: (i, j, s) to generate an m-by-n sparse
* augmented Jacobian matrix, where i(k) and j(k) are the base 0 row and