SAM was substantially sped up by inlining VectorConfig::insert
parent
5e4b23df59
commit
fa6a515bfd
|
@ -35,12 +35,6 @@ std::vector<Symbol> VectorConfig::get_names() const {
|
||||||
return names;
|
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) {
|
void VectorConfig::insert(const VectorConfig& config) {
|
||||||
for (const_iterator it = config.begin(); it!=config.end(); it++) {
|
for (const_iterator it = config.begin(); it!=config.end(); it++) {
|
||||||
|
|
|
@ -40,7 +40,10 @@ namespace gtsam {
|
||||||
std::vector<Symbol> get_names() const;
|
std::vector<Symbol> get_names() const;
|
||||||
|
|
||||||
/** Insert a value into the configuration with a given index */
|
/** 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 */
|
/** Insert a config into another config */
|
||||||
void insert(const VectorConfig& config);
|
void insert(const VectorConfig& config);
|
||||||
|
|
Loading…
Reference in New Issue