diff --git a/cppbugs/mcmc.arma.extensions.hpp b/cppbugs/mcmc.arma.extensions.hpp index 565646f..0c02361 100644 --- a/cppbugs/mcmc.arma.extensions.hpp +++ b/cppbugs/mcmc.arma.extensions.hpp @@ -205,17 +205,17 @@ namespace arma { return eOp(X.get_ref(),k); // NOTE: order is swapped } - const double schur(const int x, const double y) { return x * y; } - const double schur(const double x, const int y) { return x * y; } - const double schur(const double& x, const double& y) { return x * y; } - const double schur(const int& x, const int& y) { return x * y; } + double schur(const int x, const double y) { return x * y; } + double schur(const double x, const int y) { return x * y; } + double schur(const double& x, const double& y) { return x * y; } + double schur(const int& x, const int& y) { return x * y; } // insert an 'any' function for bools into the arma namespace - const bool any(const bool x) { + bool any(const bool x) { return x; } - const bool vectorise(bool x) { + bool vectorise(bool x) { return x; } } // namespace arma diff --git a/cppbugs/mcmc.model.hpp b/cppbugs/mcmc.model.hpp index b0bbbd2..25fdfc5 100644 --- a/cppbugs/mcmc.model.hpp +++ b/cppbugs/mcmc.model.hpp @@ -71,7 +71,7 @@ namespace cppbugs { return bad_logp(value) || log(rng_.uniform()) > (value - old_logp) ? true : false; } - const double logp() const { + double logp() const { double ans(0); for(auto node : stochastic_nodes) { ans += node->loglik(); diff --git a/cppbugs/mcmc.stochastic.1p.family.hpp b/cppbugs/mcmc.stochastic.1p.family.hpp index 431e80b..b685c48 100644 --- a/cppbugs/mcmc.stochastic.1p.family.hpp +++ b/cppbugs/mcmc.stochastic.1p.family.hpp @@ -37,7 +37,7 @@ namespace cppbugs { ~Stochastic1p() { if(destory_p1_) { delete &p1_; } } - const double loglik() const { return LOGLIKFUN(DynamicStochastic::value,p1_); } + double loglik() const { return LOGLIKFUN(DynamicStochastic::value,p1_); } }; template @@ -51,7 +51,7 @@ namespace cppbugs { ~ObservedStochastic1p() { if(destory_p1_) { delete &p1_; } } - const double loglik() const { return LOGLIKFUN(Observed::value,p1_); } + double loglik() const { return LOGLIKFUN(Observed::value,p1_); } }; } // namespace cppbugs diff --git a/cppbugs/mcmc.stochastic.2p.family.hpp b/cppbugs/mcmc.stochastic.2p.family.hpp index c253831..8e578b3 100644 --- a/cppbugs/mcmc.stochastic.2p.family.hpp +++ b/cppbugs/mcmc.stochastic.2p.family.hpp @@ -41,7 +41,7 @@ namespace cppbugs { if(destory_p1_) { delete &p1_; } if(destory_p2_) { delete &p2_; } } - const double loglik() const { return LOGLIKFUN(DynamicStochastic::value,p1_,p2_); } + double loglik() const { return LOGLIKFUN(DynamicStochastic::value,p1_,p2_); } }; template @@ -61,7 +61,7 @@ namespace cppbugs { if(destory_p1_) { delete &p1_; } if(destory_p2_) { delete &p2_; } } - const double loglik() const { return LOGLIKFUN(Observed::value,p1_,p2_); } + double loglik() const { return LOGLIKFUN(Observed::value,p1_,p2_); } }; } // namespace cppbugs diff --git a/cppbugs/mcmc.stochastic.hpp b/cppbugs/mcmc.stochastic.hpp index 6768e78..8b37937 100644 --- a/cppbugs/mcmc.stochastic.hpp +++ b/cppbugs/mcmc.stochastic.hpp @@ -27,7 +27,7 @@ namespace cppbugs { public: Stochastic() {} ~Stochastic() {} - virtual const double loglik() const = 0; + virtual double loglik() const = 0; }; } // namespace cppbugs