aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/vchisq.hpp
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-06-08 10:26:30 +0800
committerAaron LI <aaronly.me@gmail.com>2016-06-08 10:26:30 +0800
commit6994a9715f05fd49f60a4346171a1d9226ec98d9 (patch)
treef7c7cd2aaa240787b46c2e93aa62a2d8d9188b48 /mass_profile/vchisq.hpp
parent713cb27cab4de6f3fd343ae37a04f54138423b53 (diff)
downloadchandra-acis-analysis-6994a9715f05fd49f60a4346171a1d9226ec98d9.tar.bz2
mass_profile: fix many compilation warnings
Diffstat (limited to 'mass_profile/vchisq.hpp')
-rw-r--r--mass_profile/vchisq.hpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/mass_profile/vchisq.hpp b/mass_profile/vchisq.hpp
index 0780ce8..c3d38b8 100644
--- a/mass_profile/vchisq.hpp
+++ b/mass_profile/vchisq.hpp
@@ -28,7 +28,7 @@ namespace opt_utilities
int n;
bool limit_bound;
typedef std::vector<T> Tp;
-
+
vchisq<T>* do_clone()const
{
return new vchisq<T>(*this);
@@ -38,7 +38,7 @@ namespace opt_utilities
{
return "chi^2 statistic";
}
-
+
public:
void verbose(bool v)
{
@@ -49,7 +49,7 @@ namespace opt_utilities
{
limit_bound=true;
}
-
+
void clear_limit()
{
limit_bound=false;
@@ -58,8 +58,8 @@ namespace opt_utilities
vchisq()
:verb(false),limit_bound(false)
{}
-
-
+
+
T do_eval(const std::vector<T>& p)
{
@@ -71,7 +71,7 @@ namespace opt_utilities
}
}
T result(0);
-
+
std::vector<float> vx;
std::vector<float> vy;
std::vector<float> vye;
@@ -80,7 +80,7 @@ namespace opt_utilities
if(verb)
{
n++;
-
+
if(n%100==0)
{
vx.resize(this->get_data_set().get_data(0).get_y().size());
@@ -88,24 +88,24 @@ namespace opt_utilities
vye.resize(this->get_data_set().get_data(0).get_y().size());
my.resize(this->get_data_set().get_data(0).get_y().size());
}
-
+
}
for(int i=(this->get_data_set()).size()-1;i>=0;--i)
{
const std::vector<double> y_model(this->eval_model(this->get_data_set().get_data(i).get_x(),p));
const std::vector<double>& y=this->get_data_set().get_data(i).get_y();
const std::vector<double>& ye=this->get_data_set().get_data(i).get_y_lower_err();
- for(int j=0;j<y.size();++j)
+ for(size_t j=0;j<y.size();++j)
{
double chi=(y_model[j]-y[j])/ye[j];
result+=chi*chi;
}
-
-
+
+
if(verb&&n%100==0)
{
-
- for(int j=0;j<y.size();++j)
+
+ for(size_t j=0;j<y.size();++j)
{
vx.at(j)=((this->get_data_set().get_data(i).get_x().at(j)+this->get_data_set().get_data(i).get_x().at(j+1))/2.);
vy.at(j)=(y[j]);
@@ -121,9 +121,9 @@ namespace opt_utilities
my[j]=log10(my[j]);
}
-
+
}
-
+
}
if(verb)
{
@@ -148,7 +148,7 @@ namespace opt_utilities
pr.plot_line(vx,my);
}
}
-
+
return result;
}
};