diff --git a/gtsam/linear/GaussianBayesNet.cpp b/gtsam/linear/GaussianBayesNet.cpp index 22f1918e4..87e0ded15 100644 --- a/gtsam/linear/GaussianBayesNet.cpp +++ b/gtsam/linear/GaussianBayesNet.cpp @@ -163,7 +163,8 @@ namespace gtsam { return factorGraph.jacobian(ordering); } else { // recursively call with default ordering - return matrix(this->ordering()); + const auto defaultOrdering = this->ordering(); + return matrix(defaultOrdering); } }