diff --git a/gtsam/linear/GaussianBayesNet.cpp b/gtsam/linear/GaussianBayesNet.cpp index bc96452b9..e9938ceb6 100644 --- a/gtsam/linear/GaussianBayesNet.cpp +++ b/gtsam/linear/GaussianBayesNet.cpp @@ -187,16 +187,16 @@ namespace gtsam { } /* ************************************************************************* */ - double GaussianBayesNet::logDeterminant() const - { + double GaussianBayesNet::logDeterminant() const { double logDet = 0.0; - for(const sharedConditional& cg: *this) { - if(cg->get_model()) { + for (const sharedConditional& cg : *this) { + if (cg->get_model()) { Vector diag = cg->R().diagonal(); cg->get_model()->whitenInPlace(diag); - logDet += diag.unaryExpr(ptr_fun(log)).sum(); + logDet += diag.unaryExpr([](double x) { return log(x); }).sum(); } else { - logDet += cg->R().diagonal().unaryExpr(ptr_fun(log)).sum(); + logDet += + cg->R().diagonal().unaryExpr([](double x) { return log(x); }).sum(); } } return logDet; diff --git a/gtsam/linear/GaussianBayesTree.cpp b/gtsam/linear/GaussianBayesTree.cpp index 8d0fafb61..13c19bce6 100644 --- a/gtsam/linear/GaussianBayesTree.cpp +++ b/gtsam/linear/GaussianBayesTree.cpp @@ -40,11 +40,11 @@ namespace gtsam { parentSum += clique->conditional() ->R() .diagonal() - .unaryExpr(std::ptr_fun(log)) + .unaryExpr([](double x) { return log(x); }) .sum(); return 0; } - } + } // namespace internal /* ************************************************************************* */ bool GaussianBayesTree::equals(const This& other, double tol) const