diff --git a/gtsam/inference/VariableIndex-inl.h b/gtsam/inference/VariableIndex-inl.h index 727ef8fd8..adfd68671 100644 --- a/gtsam/inference/VariableIndex-inl.h +++ b/gtsam/inference/VariableIndex-inl.h @@ -24,8 +24,7 @@ namespace gtsam { /* ************************************************************************* */ template -void VariableIndex::augment(const FG& factors, - boost::optional newFactorIndices) { +void VariableIndex::augment(const FG& factors, const FactorIndices* newFactorIndices) { gttic(VariableIndex_augment); // Augment index for each factor diff --git a/gtsam/inference/VariableIndex.h b/gtsam/inference/VariableIndex.h index 47438ecd6..f934a72af 100644 --- a/gtsam/inference/VariableIndex.h +++ b/gtsam/inference/VariableIndex.h @@ -126,7 +126,16 @@ class GTSAM_EXPORT VariableIndex { * solving problems incrementally. */ template - void augment(const FG& factors, boost::optional newFactorIndices = boost::none); + void augment(const FG& factors, const FactorIndices* newFactorIndices = nullptr); + + /** + * An overload of augment() that takes a single factor. and l-value + * reference to FactorIndeces. + */ + template + void augment(const FG& factor, const FactorIndices& newFactorIndices) { + augment(factor, &newFactorIndices); + } /** * Augment the variable index after an existing factor now affects to more