diff options
| author | Aaron LI <aaronly.me@gmail.com> | 2016-06-08 10:26:30 +0800 | 
|---|---|---|
| committer | Aaron LI <aaronly.me@gmail.com> | 2016-06-08 10:26:30 +0800 | 
| commit | 6994a9715f05fd49f60a4346171a1d9226ec98d9 (patch) | |
| tree | f7c7cd2aaa240787b46c2e93aa62a2d8d9188b48 /mass_profile/chisq.hpp | |
| parent | 713cb27cab4de6f3fd343ae37a04f54138423b53 (diff) | |
| download | chandra-acis-analysis-6994a9715f05fd49f60a4346171a1d9226ec98d9.tar.bz2 | |
mass_profile: fix many compilation warnings
Diffstat (limited to 'mass_profile/chisq.hpp')
| -rw-r--r-- | mass_profile/chisq.hpp | 26 | 
1 files changed, 12 insertions, 14 deletions
| diff --git a/mass_profile/chisq.hpp b/mass_profile/chisq.hpp index 575f1c0..bdfadcb 100644 --- a/mass_profile/chisq.hpp +++ b/mass_profile/chisq.hpp @@ -46,7 +46,7 @@ namespace opt_utilities      bool verb;
      bool limit_bound;
      int n;
 -    
 +
      statistic<Ty,Tx,Tp,Ts,Tstr>* do_clone()const
      {
        // return const_cast<statistic<Ty,Tx,Tp>*>(this);
 @@ -76,15 +76,15 @@ namespace opt_utilities      chisq()
        :verb(true),limit_bound(false)
      {}
 -    
 -    
 +
 +
      Ty do_eval(const Tp& p)
      {
        if(limit_bound)
  	{
  	  Tp p1=this->get_fitter().get_model().reform_param(p);
 -	  for(int i=0;i<p1.size();++i)
 +	  for(size_t i=0;i<p1.size();++i)
  	    {
  	      if(p1[i]>this->get_fitter().get_param_info(i).get_upper_limit()||
  		 p1[i]<this->get_fitter().get_param_info(i).get_lower_limit())
 @@ -111,7 +111,7 @@ namespace opt_utilities  	      vye2.resize(this->get_data_set().size());
  	      my.resize(this->get_data_set().size());
  	    }
 -	  
 +
  	}
        for(int i=(this->get_data_set()).size()-1;i>=0;--i)
 @@ -132,7 +132,7 @@ namespace opt_utilities  	  Ty y_model=this->eval_model(this->get_data_set().get_data(i).get_x(),p);
  	  Ty y_obs=this->get_data_set().get_data(i).get_y();
  	  Ty y_err;
 -	  
 +
  	  Ty errx=0;
  	  if(errx1<errx2)
  	    {
 @@ -170,7 +170,7 @@ namespace opt_utilities  	  Ty chi=(y_obs-y_model)/std::sqrt(y_err*y_err+errx*errx);
  	  result+=chi*chi;
 -	  
 +
  	  if(verb&&n%display_interval==0)
  	    {
  	      vx.at(i)=this->get_data_set().get_data(i).get_x();
 @@ -178,7 +178,7 @@ namespace opt_utilities  	      vye1.at(i)=std::abs(this->get_data_set().get_data(i).get_y_lower_err());
  	      vye2.at(i)=std::abs(this->get_data_set().get_data(i).get_y_upper_err());
  	      my.at(i)=y_model;
 -	      
 +
  	      xmin=std::min(vx.at(i),xmin);
  	      ymin=std::min(vy.at(i),ymin-vye1[i]);
  	      xmax=std::max(vx.at(i),xmax);
 @@ -192,7 +192,7 @@ namespace opt_utilities  	  if(n%display_interval==0)
  	    {
  	      cerr<<result<<"\t";
 -	      for(int i=0;i<(int)get_size(p);++i)
 +	      for(size_t i=0;i<get_size(p);++i)
  		{
  		  cerr<<get_element(p,i)<<",";
  		}
 @@ -205,15 +205,13 @@ namespace opt_utilities  	    }
  	}
 -      
 +
        return result;
      }
    };
 -  
 -  
 +
 +
  }
  #endif
  //EOF
 -
 -
 | 
