Re-did with move semantics. Dangerously imperative.

release/4.3a0
dellaert 2014-10-06 12:13:52 +02:00
parent f887ca47b9
commit c748fdb404
1 changed files with 3 additions and 4 deletions

View File

@ -53,12 +53,11 @@ public:
typedef std::map<Key, Matrix> MapType;
MapType terms;
Augmented<T> augmented = expression_.augmented(x);
// copy terms to H, which is pre-allocated to correct size
// TODO apply move semantics
// move terms to H, which is pre-allocated to correct size
size_t j = 0;
MapType::const_iterator it = augmented.jacobians().begin();
MapType::iterator it = augmented.jacobians().begin();
for (; it != augmented.jacobians().end(); ++it)
(*H)[j++] = it->second;
it->second.swap((*H)[j++]);
return measurement_.localCoordinates(augmented.value());
} else {
const T& value = expression_.value(x);