From 80fdd69a14b01e458af0bfa72e083a74d14a335f Mon Sep 17 00:00:00 2001 From: kartik arcot Date: Fri, 13 Jan 2023 10:55:43 -0800 Subject: [PATCH] VariableIndex --- gtsam/inference/VariableIndex-inl.h | 3 +-- gtsam/inference/VariableIndex.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) 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