Small bug-fixes for managing linearization points

release/4.3a0
Alex Cunningham 2012-09-03 03:06:08 +00:00
parent bd6cb53d5e
commit d8e0a95890
2 changed files with 7 additions and 2 deletions

View File

@ -205,7 +205,7 @@ GaussianFactor::shared_ptr LinearContainerFactor::negate(const Ordering& orderin
/* ************************************************************************* */
NonlinearFactor::shared_ptr LinearContainerFactor::negate() const {
GaussianFactor::shared_ptr antifactor = factor_->negate(); // already has keys in place
return NonlinearFactor::shared_ptr(new LinearContainerFactor(antifactor));
return NonlinearFactor::shared_ptr(new LinearContainerFactor(antifactor,linearizationPoint_));
}
/* ************************************************************************* */

View File

@ -23,6 +23,11 @@ protected:
GaussianFactor::shared_ptr factor_;
boost::optional<Values> linearizationPoint_;
/** direct copy constructor */
LinearContainerFactor(const GaussianFactor::shared_ptr& factor,
const boost::optional<Values>& linearizationPoint)
: factor_(factor), linearizationPoint_(linearizationPoint) {}
public:
/** Primary constructor: store a linear factor and decode the ordering */
@ -105,7 +110,7 @@ public:
* Clones the underlying linear factor
*/
NonlinearFactor::shared_ptr clone() const {
return NonlinearFactor::shared_ptr(new LinearContainerFactor(factor_));
return NonlinearFactor::shared_ptr(new LinearContainerFactor(factor_,linearizationPoint_));
}
// casting syntactic sugar