From 77dd064975b3b1ba9341f154628060eb9c25f4ba Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Thu, 12 Dec 2024 10:24:50 -0700 Subject: [PATCH] Update verbose_on/off to return lfmcmc object --- epiworld.hpp | 22 +++++++++++++++---- include/epiworld/math/lfmcmc/lfmcmc-bones.hpp | 4 ++-- include/epiworld/math/lfmcmc/lfmcmc-meat.hpp | 14 ++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/epiworld.hpp b/epiworld.hpp index c548dd0b..fdd96e08 100644 --- a/epiworld.hpp +++ b/epiworld.hpp @@ -1321,8 +1321,8 @@ class LFMCMC { std::vector< epiworld_double > get_mean_stats(); // Printing - void verbose_off() { verbose = false; }; - void verbose_on() { verbose = true; }; + LFMCMC & verbose_off(); + LFMCMC & verbose_on(); void print(size_t burnin = 0u) const; }; @@ -1619,8 +1619,8 @@ class LFMCMC { std::vector< epiworld_double > get_mean_stats(); // Printing - void verbose_off() { verbose = false; }; - void verbose_on() { verbose = true; }; + LFMCMC & verbose_off(); + LFMCMC & verbose_on(); void print(size_t burnin = 0u) const; }; @@ -2436,6 +2436,20 @@ inline std::vector< epiworld_double > LFMCMC::get_mean_stats() } +template +inline LFMCMC & LFMCMC::verbose_off() +{ + verbose = false; + return *this; +} + +template +inline LFMCMC & LFMCMC::verbose_on() +{ + verbose = true; + return *this; +} + #endif /*////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// diff --git a/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp b/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp index 79a90237..ace7b637 100755 --- a/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp +++ b/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp @@ -259,8 +259,8 @@ class LFMCMC { std::vector< epiworld_double > get_mean_stats(); // Printing - void verbose_off() { verbose = false; }; - void verbose_on() { verbose = true; }; + LFMCMC & verbose_off(); + LFMCMC & verbose_on(); void print(size_t burnin = 0u) const; }; diff --git a/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp b/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp index caf4b853..c4f68f47 100755 --- a/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp +++ b/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp @@ -554,4 +554,18 @@ inline std::vector< epiworld_double > LFMCMC::get_mean_stats() } +template +inline LFMCMC & LFMCMC::verbose_off() +{ + verbose = false; + return *this; +} + +template +inline LFMCMC & LFMCMC::verbose_on() +{ + verbose = true; + return *this; +} + #endif \ No newline at end of file