const correctness

release/4.3a0
Frank Dellaert 2013-10-29 04:58:51 +00:00
parent 3c33e44c46
commit daf5938577
5 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ namespace gtsam {
virtual GaussianFactor::shared_ptr negate() const = 0;
/// y += alpha * A'*A*x
virtual void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) = 0;
virtual void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) const = 0;
/// A'*b for Jacobian, eta for Hessian
virtual VectorValues gradientAtZero() const = 0;

View File

@ -501,7 +501,7 @@ GaussianFactor::shared_ptr HessianFactor::negate() const
/* ************************************************************************* */
void HessianFactor::multiplyHessianAdd(double alpha, const VectorValues& x,
VectorValues& y) {
VectorValues& y) const {
for (size_t i = 0; i < size(); ++i) {
pair<VectorValues::iterator, bool> it = y.tryInsert(keys_[i], Vector());

View File

@ -357,7 +357,7 @@ namespace gtsam {
void updateATA(const HessianFactor& update, const Scatter& scatter);
/** y += alpha * A'*A*x */
void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y);
void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) const;
/// eta for Hessian
VectorValues gradientAtZero() const;

View File

@ -434,7 +434,7 @@ namespace gtsam {
/* ************************************************************************* */
void JacobianFactor::multiplyHessianAdd(double alpha, const VectorValues& x,
VectorValues& y) {
VectorValues& y) const {
Vector Ax = (*this)*x;
transposeMultiplyAdd(alpha,Ax,y);
}

View File

@ -260,7 +260,7 @@ namespace gtsam {
Vector operator*(const VectorValues& x) const;
/** y += alpha * A'*A*x */
void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y);
void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) const;
/** x += A'*e. If x is initially missing any values, they are created and assumed to start as
* zero vectors. */