From 44eb911f400467a4326fd80a26ea07115eba3aca Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 7 Feb 2017 13:57:07 +0800 Subject: Fix undeclared variables in projector.hpp --- mass_profile/projector.hpp | 4 ++-- mass_profile/spline.h | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mass_profile/projector.hpp b/mass_profile/projector.hpp index fda6cdb..4ef4b32 100644 --- a/mass_profile/projector.hpp +++ b/mass_profile/projector.hpp @@ -193,7 +193,7 @@ namespace opt_utilities double v = calc_v(x, nsph, nrad) * pow(cm_per_pixel, 3); if(pcfunc) { - cfunc = (*pcfunc)((x[nsph+1] + x[nsph]) / 2.0); + double cfunc = (*pcfunc)((x[nsph+1] + x[nsph]) / 2.0); projected[nrad] += (unprojected[nsph] * unprojected[nsph] * cfunc * v / ne_np_ratio); } @@ -202,7 +202,7 @@ namespace opt_utilities projected[nrad] += unprojected[nsph] * unprojected[nsph] * v; } } - area = pi * (x[nrad+1]*x[nrad+1] - x[nrad]*x[nrad]); + double area = pi * (x[nrad+1]*x[nrad+1] - x[nrad]*x[nrad]); projected[nrad] /= area; projected[nrad] += bkg; } diff --git a/mass_profile/spline.h b/mass_profile/spline.h index 8bc0225..9645845 100644 --- a/mass_profile/spline.h +++ b/mass_profile/spline.h @@ -1,5 +1,6 @@ -#ifndef SPLINEH -#define SPLINEH +#ifndef SPLINE_H +#define SPLINE_H + #include #include #include @@ -58,7 +59,7 @@ public: double b=(x-x_list[n1])/h; return a*y_list[n1]+b*y_list[n2]+((a*a*a-a)*y2_list[n1]+ (b*b*b-b)*y2_list[n2])*(h*h)/6.; - + } void gen_spline(T y2_0,T y2_N) @@ -95,7 +96,7 @@ public: { qn=.5; un=(3./(x_list[n-1]-x_list[n-2]))*(y2_N-(y_list[n-1]-y_list[n-2])/(x_list[n-1]-x_list[n-2])); - + } y2_list[n-1]=(un-qn*u[n-2])/(qn*y2_list[n-2]+1.); for(int i=n-2;i>=0;--i) @@ -106,4 +107,4 @@ public: }; -#endif +#endif /* SPLINE_H */ -- cgit v1.2.2