From c380ede43a82a5b13bf5d93be5ddb6fe7a2b4b8c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 8 Jun 2016 01:13:12 +0800 Subject: constrained_dbeta.hpp: add missing and std:: Also some style adjustments --- mass_profile/constrained_dbeta.hpp | 73 ++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/mass_profile/constrained_dbeta.hpp b/mass_profile/constrained_dbeta.hpp index 24a1ebb..31a4cd4 100644 --- a/mass_profile/constrained_dbeta.hpp +++ b/mass_profile/constrained_dbeta.hpp @@ -1,26 +1,26 @@ #ifndef CONSTRAINED_DBETA #define CONSTRAINED_DBETA #include "projector.hpp" +#include namespace opt_utilities { - template - class constrained_dbeta - :public model,std::vector,std::vector > - { - public: - constrained_dbeta() + template + class constrained_dbeta + :public model,std::vector,std::vector > { - this->push_param_info(param_info,std::string>("n01",1)); - this->push_param_info(param_info,std::string>("beta1",.66)); - this->push_param_info(param_info,std::string>("rc1",100)); + public: + constrained_dbeta() + { + this->push_param_info(param_info,std::string>("n01",1)); + this->push_param_info(param_info,std::string>("beta1",.66)); + this->push_param_info(param_info,std::string>("rc1",100)); - this->push_param_info(param_info,std::string>("n02",1)); - this->push_param_info(param_info,std::string>("beta2",.67)); - this->push_param_info(param_info,std::string>("rc2",110)); - - } + this->push_param_info(param_info,std::string>("n02",1)); + this->push_param_info(param_info,std::string>("beta2",.67)); + this->push_param_info(param_info,std::string>("rc2",110)); + } public: constrained_dbeta* do_clone()const @@ -28,8 +28,7 @@ namespace opt_utilities return new constrained_dbeta(*this); } - std::vector do_eval(const std::vector & x, - const std::vector& p) + std::vector do_eval(const std::vector & x, const std::vector& p) { T n01=std::abs(p[0]); T beta1=p[1]; @@ -39,40 +38,38 @@ namespace opt_utilities T beta2=p[4]; T rc2=p[5]; - - std::vector result(x.size()-1); for(int i=1;i& p)const { if(p.size()!=6) - { - cerr<get_num_params()<get_num_params()<rc1) - { - return true; - } + { + return true; + } else - { - cerr<