From cd0164bd8bd6cac5226bec718d1ca918099b62e4 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Wed, 4 Jan 2023 20:25:48 -0800 Subject: [PATCH] Add forwarding template for mean-stddev variants --- gtsam/linear/GaussianConditional.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gtsam/linear/GaussianConditional.h b/gtsam/linear/GaussianConditional.h index d25efb2e1..05b8b86b8 100644 --- a/gtsam/linear/GaussianConditional.h +++ b/gtsam/linear/GaussianConditional.h @@ -100,6 +100,12 @@ namespace gtsam { const Matrix& A2, Key parent2, const Vector& b, double sigma); + /// Create shared pointer by forwarding arguments to fromMeanAndStddev. + template + static shared_ptr sharedMeanAndStddev(Args&&... args) { + return boost::make_shared(FromMeanAndStddev(std::forward(args)...)); + } + /** Combine several GaussianConditional into a single dense GC. The conditionals enumerated by * \c first and \c last must be in increasing order, meaning that the parents of any * conditional may not include a conditional coming before it.