move SparseMatrixBoostTriplets typedef to gfg
parent
b5951d033e
commit
286898a847
|
|
@ -75,12 +75,6 @@ GTSAM_MAKE_MATRIX_DEFS(9);
|
||||||
typedef Eigen::Block<Matrix> SubMatrix;
|
typedef Eigen::Block<Matrix> SubMatrix;
|
||||||
typedef Eigen::Block<const Matrix> ConstSubMatrix;
|
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.
|
// Matrix formatting arguments when printing.
|
||||||
// Akin to Matlab style.
|
// Akin to Matlab style.
|
||||||
const Eigen::IOFormat& matlabFormat();
|
const Eigen::IOFormat& matlabFormat();
|
||||||
|
|
|
||||||
|
|
@ -99,30 +99,31 @@ namespace gtsam {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using BoostTriplets = GaussianFactorGraph::SparseMatrixBoostTriplets;
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian(
|
BoostTriplets GaussianFactorGraph::sparseJacobian(
|
||||||
const Ordering& ordering, size_t& nrows, size_t& ncols) const {
|
const Ordering& ordering, size_t& nrows, size_t& ncols) const {
|
||||||
SparseMatrixBoostTriplets entries;
|
BoostTriplets entries;
|
||||||
entries.reserve(60 * size());
|
entries.reserve(60 * size());
|
||||||
sparseJacobianInPlace(entries, ordering, nrows, ncols);
|
sparseJacobianInPlace(entries, ordering, nrows, ncols);
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian(
|
BoostTriplets GaussianFactorGraph::sparseJacobian(
|
||||||
const Ordering& ordering) const {
|
const Ordering& ordering) const {
|
||||||
size_t dummy1, dummy2;
|
size_t dummy1, dummy2;
|
||||||
return sparseJacobian(ordering, dummy1, dummy2);
|
return sparseJacobian(ordering, dummy1, dummy2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian(
|
BoostTriplets GaussianFactorGraph::sparseJacobian(
|
||||||
size_t& nrows, size_t& ncols) const {
|
size_t& nrows, size_t& ncols) const {
|
||||||
return sparseJacobian(Ordering(this->keys()), nrows, ncols);
|
return sparseJacobian(Ordering(this->keys()), nrows, ncols);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
SparseMatrixBoostTriplets GaussianFactorGraph::sparseJacobian() const {
|
BoostTriplets GaussianFactorGraph::sparseJacobian() const {
|
||||||
size_t dummy1, dummy2;
|
size_t dummy1, dummy2;
|
||||||
return sparseJacobian(dummy1, dummy2);
|
return sparseJacobian(dummy1, dummy2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,9 @@ namespace gtsam {
|
||||||
///@name Linear Algebra
|
///@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
|
* 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
|
* augmented Jacobian matrix, where i(k) and j(k) are the base 0 row and
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue