5% speedup by using faster setAllZero
parent
d8b75f6bd0
commit
02c8f02a10
|
@ -256,11 +256,16 @@ namespace gtsam {
|
||||||
full().triangularView<Eigen::Upper>() = xpr.template triangularView<Eigen::Upper>();
|
full().triangularView<Eigen::Upper>() = xpr.template triangularView<Eigen::Upper>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the entire active matrix zero.
|
/// Set the entire *active* matrix zero.
|
||||||
void setZero() {
|
void setZero() {
|
||||||
full().triangularView<Eigen::Upper>().setZero();
|
full().triangularView<Eigen::Upper>().setZero();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set entire matrix zero.
|
||||||
|
void setAllZero() {
|
||||||
|
matrix_.setZero();
|
||||||
|
}
|
||||||
|
|
||||||
/// Negate the entire active matrix.
|
/// Negate the entire active matrix.
|
||||||
void negate();
|
void negate();
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ HessianFactor::HessianFactor(const GaussianFactorGraph& factors,
|
||||||
|
|
||||||
// Form A' * A
|
// Form A' * A
|
||||||
gttic(update);
|
gttic(update);
|
||||||
info_.setZero();
|
info_.setAllZero();
|
||||||
for(const auto& factor: factors)
|
for(const auto& factor: factors)
|
||||||
if (factor)
|
if (factor)
|
||||||
factor->updateHessian(keys_, &info_);
|
factor->updateHessian(keys_, &info_);
|
||||||
|
|
Loading…
Reference in New Issue