scale is const !

release/4.3a0
Frank Dellaert 2009-12-11 04:57:31 +00:00
parent c57501eddd
commit 299fcf1e04
2 changed files with 3 additions and 4 deletions

View File

@ -27,12 +27,11 @@ void check_size(const string& key, const Vector & vj, const Vector & dj) {
} }
/* ************************************************************************* */ /* ************************************************************************* */
VectorConfig VectorConfig::scale(double gain) { VectorConfig VectorConfig::scale(double gain) const {
VectorConfig scaled; VectorConfig scaled;
string key; Vector val; string key; Vector val;
FOREACH_PAIR(key, val, values) { FOREACH_PAIR(key, val, values)
scaled.insert(key, gain*val); scaled.insert(key, gain*val);
}
return scaled; return scaled;
} }

View File

@ -60,7 +60,7 @@ namespace gtsam {
VectorConfig exmap(const VectorConfig & delta) const; VectorConfig exmap(const VectorConfig & delta) const;
/** Scales the configuration by a gain */ /** Scales the configuration by a gain */
VectorConfig scale(double gain); VectorConfig scale(double gain) const;
const_iterator begin() const {return values.begin();} const_iterator begin() const {return values.begin();}
const_iterator end() const {return values.end();} const_iterator end() const {return values.end();}