From fa6a515bfdb03a25c8dd410d14e57d526e15cda7 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sun, 31 Jan 2010 16:05:16 +0000 Subject: [PATCH] SAM was substantially sped up by inlining VectorConfig::insert --- cpp/VectorConfig.cpp | 6 ------ cpp/VectorConfig.h | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cpp/VectorConfig.cpp b/cpp/VectorConfig.cpp index 338026fa8..c37875c1b 100644 --- a/cpp/VectorConfig.cpp +++ b/cpp/VectorConfig.cpp @@ -35,12 +35,6 @@ std::vector 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++) { diff --git a/cpp/VectorConfig.h b/cpp/VectorConfig.h index d6f6f9ff1..96637d537 100644 --- a/cpp/VectorConfig.h +++ b/cpp/VectorConfig.h @@ -40,7 +40,10 @@ namespace gtsam { std::vector 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);