minor efficiency modifications

release/4.3a0
Gerry Chen 2021-01-19 14:38:10 -05:00
parent 77c65f8176
commit ada83d92dc
2 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,7 @@ namespace gtsam {
for (size_t j = 0; j < (size_t) whitenedA.cols(); j++) {
double s = whitenedA(i, j);
if (std::abs(s) > 1e-12)
entries.push_back(boost::make_tuple(row + i, column_start + j, s));
entries.emplace_back(row + i, column_start + j, s);
}
}

View File

@ -30,7 +30,9 @@
namespace gtsam {
typedef Eigen::SparseMatrix<double> SparseEigen;
/// Eigen-format sparse matrix. Note: ColMajor is ~20% faster since
/// InnerIndices must be sorted
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseEigen;
/// Constructs an Eigen-format SparseMatrix of a GaussianFactorGraph
SparseEigen sparseJacobianEigen(