SAM was substantially sped up by inlining VectorConfig::insert

release/4.3a0
Frank Dellaert 2010-01-31 16:05:16 +00:00
parent 5e4b23df59
commit fa6a515bfd
2 changed files with 4 additions and 7 deletions

View File

@ -35,12 +35,6 @@ std::vector<Symbol> VectorConfig::get_names() const {
return names;
}
/* ************************************************************************* */
VectorConfig& VectorConfig::insert(const Symbol& name, const Vector& val) {
values.insert(std::make_pair(name,val));
return *this;
}
/* ************************************************************************* */
void VectorConfig::insert(const VectorConfig& config) {
for (const_iterator it = config.begin(); it!=config.end(); it++) {

View File

@ -40,7 +40,10 @@ namespace gtsam {
std::vector<Symbol> get_names() const;
/** Insert a value into the configuration with a given index */
VectorConfig& insert(const Symbol& name, const Vector& val);
inline VectorConfig& insert(const Symbol& name, const Vector& val) {
values.insert(std::make_pair(name,val));
return *this;
}
/** Insert a config into another config */
void insert(const VectorConfig& config);