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