From f7f3ab579d2b45e5c69e3e10379d6b0ca9741dc9 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Mon, 16 Dec 2024 14:38:48 -0700 Subject: [PATCH] Add const keyword to getters --- epiworld.hpp | 66 +++++++++---------- include/epiworld/math/lfmcmc/lfmcmc-bones.hpp | 36 +++++----- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/epiworld.hpp b/epiworld.hpp index 7fca4528..9a258db8 100644 --- a/epiworld.hpp +++ b/epiworld.hpp @@ -1301,25 +1301,25 @@ class LFMCMC { size_t get_n_params() const {return m_n_params;}; epiworld_double get_epsilon() const {return m_epsilon;}; - const std::vector< epiworld_double > & get_initial_params() {return m_initial_params;}; - const std::vector< epiworld_double > & get_current_proposed_params() {return m_current_proposed_params;}; - const std::vector< epiworld_double > & get_current_accepted_params() {return m_current_accepted_params;}; - const std::vector< epiworld_double > & get_current_proposed_stats() {return m_current_proposed_stats;}; - const std::vector< epiworld_double > & get_current_accepted_stats() {return m_current_accepted_stats;}; - - const std::vector< epiworld_double > & get_observed_stats() {return m_observed_stats;}; - - const std::vector< epiworld_double > & get_all_sample_params() {return m_all_sample_params;}; - const std::vector< epiworld_double > & get_all_sample_stats() {return m_all_sample_stats;}; - const std::vector< bool > & get_all_sample_acceptance() {return m_all_sample_acceptance;}; - const std::vector< epiworld_double > & get_all_sample_drawn_prob() {return m_all_sample_drawn_prob;}; - const std::vector< epiworld_double > & get_all_sample_kernel_scores() {return m_all_sample_kernel_scores;}; - - const std::vector< epiworld_double > & get_all_accepted_params() {return m_all_accepted_params;}; - const std::vector< epiworld_double > & get_all_accepted_stats() {return m_all_accepted_stats;}; - const std::vector< epiworld_double > & get_all_accepted_kernel_scores() {return m_all_accepted_kernel_scores;}; + const std::vector< epiworld_double > & get_initial_params() const {return m_initial_params;}; + const std::vector< epiworld_double > & get_current_proposed_params() const {return m_current_proposed_params;}; + const std::vector< epiworld_double > & get_current_accepted_params() const {return m_current_accepted_params;}; + const std::vector< epiworld_double > & get_current_proposed_stats() const {return m_current_proposed_stats;}; + const std::vector< epiworld_double > & get_current_accepted_stats() const {return m_current_accepted_stats;}; + + const std::vector< epiworld_double > & get_observed_stats() const {return m_observed_stats;}; + + const std::vector< epiworld_double > & get_all_sample_params() const {return m_all_sample_params;}; + const std::vector< epiworld_double > & get_all_sample_stats() const {return m_all_sample_stats;}; + const std::vector< bool > & get_all_sample_acceptance() const {return m_all_sample_acceptance;}; + const std::vector< epiworld_double > & get_all_sample_drawn_prob() const {return m_all_sample_drawn_prob;}; + const std::vector< epiworld_double > & get_all_sample_kernel_scores() const {return m_all_sample_kernel_scores;}; + + const std::vector< epiworld_double > & get_all_accepted_params() const {return m_all_accepted_params;}; + const std::vector< epiworld_double > & get_all_accepted_stats() const {return m_all_accepted_stats;}; + const std::vector< epiworld_double > & get_all_accepted_kernel_scores() const {return m_all_accepted_kernel_scores;}; - std::vector< TData > * get_simulated_data() {return m_simulated_data;}; + std::vector< TData > * get_simulated_data() const {return m_simulated_data;}; std::vector< epiworld_double > get_mean_params(); std::vector< epiworld_double > get_mean_stats(); @@ -1603,25 +1603,25 @@ class LFMCMC { size_t get_n_params() const {return m_n_params;}; epiworld_double get_epsilon() const {return m_epsilon;}; - const std::vector< epiworld_double > & get_initial_params() {return m_initial_params;}; - const std::vector< epiworld_double > & get_current_proposed_params() {return m_current_proposed_params;}; - const std::vector< epiworld_double > & get_current_accepted_params() {return m_current_accepted_params;}; - const std::vector< epiworld_double > & get_current_proposed_stats() {return m_current_proposed_stats;}; - const std::vector< epiworld_double > & get_current_accepted_stats() {return m_current_accepted_stats;}; + const std::vector< epiworld_double > & get_initial_params() const {return m_initial_params;}; + const std::vector< epiworld_double > & get_current_proposed_params() const {return m_current_proposed_params;}; + const std::vector< epiworld_double > & get_current_accepted_params() const {return m_current_accepted_params;}; + const std::vector< epiworld_double > & get_current_proposed_stats() const {return m_current_proposed_stats;}; + const std::vector< epiworld_double > & get_current_accepted_stats() const {return m_current_accepted_stats;}; - const std::vector< epiworld_double > & get_observed_stats() {return m_observed_stats;}; + const std::vector< epiworld_double > & get_observed_stats() const {return m_observed_stats;}; - const std::vector< epiworld_double > & get_all_sample_params() {return m_all_sample_params;}; - const std::vector< epiworld_double > & get_all_sample_stats() {return m_all_sample_stats;}; - const std::vector< bool > & get_all_sample_acceptance() {return m_all_sample_acceptance;}; - const std::vector< epiworld_double > & get_all_sample_drawn_prob() {return m_all_sample_drawn_prob;}; - const std::vector< epiworld_double > & get_all_sample_kernel_scores() {return m_all_sample_kernel_scores;}; + const std::vector< epiworld_double > & get_all_sample_params() const {return m_all_sample_params;}; + const std::vector< epiworld_double > & get_all_sample_stats() const {return m_all_sample_stats;}; + const std::vector< bool > & get_all_sample_acceptance() const {return m_all_sample_acceptance;}; + const std::vector< epiworld_double > & get_all_sample_drawn_prob() const {return m_all_sample_drawn_prob;}; + const std::vector< epiworld_double > & get_all_sample_kernel_scores() const {return m_all_sample_kernel_scores;}; - const std::vector< epiworld_double > & get_all_accepted_params() {return m_all_accepted_params;}; - const std::vector< epiworld_double > & get_all_accepted_stats() {return m_all_accepted_stats;}; - const std::vector< epiworld_double > & get_all_accepted_kernel_scores() {return m_all_accepted_kernel_scores;}; + const std::vector< epiworld_double > & get_all_accepted_params() const {return m_all_accepted_params;}; + const std::vector< epiworld_double > & get_all_accepted_stats() const {return m_all_accepted_stats;}; + const std::vector< epiworld_double > & get_all_accepted_kernel_scores() const {return m_all_accepted_kernel_scores;}; - std::vector< TData > * get_simulated_data() {return m_simulated_data;}; + std::vector< TData > * get_simulated_data() const {return m_simulated_data;}; std::vector< epiworld_double > get_mean_params(); std::vector< epiworld_double > get_mean_stats(); diff --git a/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp b/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp index 7725e746..46146a9a 100755 --- a/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp +++ b/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp @@ -239,25 +239,25 @@ class LFMCMC { size_t get_n_params() const {return m_n_params;}; epiworld_double get_epsilon() const {return m_epsilon;}; - const std::vector< epiworld_double > & get_initial_params() {return m_initial_params;}; - const std::vector< epiworld_double > & get_current_proposed_params() {return m_current_proposed_params;}; - const std::vector< epiworld_double > & get_current_accepted_params() {return m_current_accepted_params;}; - const std::vector< epiworld_double > & get_current_proposed_stats() {return m_current_proposed_stats;}; - const std::vector< epiworld_double > & get_current_accepted_stats() {return m_current_accepted_stats;}; - - const std::vector< epiworld_double > & get_observed_stats() {return m_observed_stats;}; - - const std::vector< epiworld_double > & get_all_sample_params() {return m_all_sample_params;}; - const std::vector< epiworld_double > & get_all_sample_stats() {return m_all_sample_stats;}; - const std::vector< bool > & get_all_sample_acceptance() {return m_all_sample_acceptance;}; - const std::vector< epiworld_double > & get_all_sample_drawn_prob() {return m_all_sample_drawn_prob;}; - const std::vector< epiworld_double > & get_all_sample_kernel_scores() {return m_all_sample_kernel_scores;}; - - const std::vector< epiworld_double > & get_all_accepted_params() {return m_all_accepted_params;}; - const std::vector< epiworld_double > & get_all_accepted_stats() {return m_all_accepted_stats;}; - const std::vector< epiworld_double > & get_all_accepted_kernel_scores() {return m_all_accepted_kernel_scores;}; + const std::vector< epiworld_double > & get_initial_params() const {return m_initial_params;}; + const std::vector< epiworld_double > & get_current_proposed_params() const {return m_current_proposed_params;}; + const std::vector< epiworld_double > & get_current_accepted_params() const {return m_current_accepted_params;}; + const std::vector< epiworld_double > & get_current_proposed_stats() const {return m_current_proposed_stats;}; + const std::vector< epiworld_double > & get_current_accepted_stats() const {return m_current_accepted_stats;}; + + const std::vector< epiworld_double > & get_observed_stats() const {return m_observed_stats;}; + + const std::vector< epiworld_double > & get_all_sample_params() const {return m_all_sample_params;}; + const std::vector< epiworld_double > & get_all_sample_stats() const {return m_all_sample_stats;}; + const std::vector< bool > & get_all_sample_acceptance() const {return m_all_sample_acceptance;}; + const std::vector< epiworld_double > & get_all_sample_drawn_prob() const {return m_all_sample_drawn_prob;}; + const std::vector< epiworld_double > & get_all_sample_kernel_scores() const {return m_all_sample_kernel_scores;}; + + const std::vector< epiworld_double > & get_all_accepted_params() const {return m_all_accepted_params;}; + const std::vector< epiworld_double > & get_all_accepted_stats() const {return m_all_accepted_stats;}; + const std::vector< epiworld_double > & get_all_accepted_kernel_scores() const {return m_all_accepted_kernel_scores;}; - std::vector< TData > * get_simulated_data() {return m_simulated_data;}; + std::vector< TData > * get_simulated_data() const {return m_simulated_data;}; std::vector< epiworld_double > get_mean_params(); std::vector< epiworld_double > get_mean_stats();