1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-23 02:38:51 -05:00

minor warnings

This commit is contained in:
hrocho 2018-10-09 11:54:11 +02:00
parent ac6e0569a2
commit 94cc227db0
5 changed files with 8 additions and 13 deletions

View File

@ -26,7 +26,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(warnings "-Wall -Wextra -Werror") set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-parameter")
endif() endif()
if(APPLE) if(APPLE)

View File

@ -67,13 +67,14 @@ int main( int argc, char * argv[] )
if(e.count("min")>0 && e.count("max")>0 && (e.count("num")>0 || e.count("step")>0)){ if(e.count("min")>0 && e.count("max")>0 && (e.count("num")>0 || e.count("step")>0)){
double emin = e["min"].get<double>(); double emin = e["min"].get<double>();
double emax = e["max"].get<double>(); double emax = e["max"].get<double>();
int num; int num=0;
if(e.count("step")){ if(e.count("step")){
num = 1+(emax-emin)/e["step"].get<int>(); num = 1+(emax-emin)/e["step"].get<int>();
} }
if(e.count("num")){ if(e.count("num")){
num = e["num"].get<int>(); num = e["num"].get<int>();
} }
if(num>2)
energies = linspace_vector(emin,emax,num); energies = linspace_vector(emin,emax,num);
} }
} }

View File

@ -456,7 +456,7 @@ double sezi_dedx_e(const Projectile &p, const Target &t){
return se; return se;
} }
else{ // heavy ion else{ // heavy ion
double h1,h2,h3,h4; double h1,h4;
double a,q,b; double a,q,b;
double l1,l0,l; double l1,l0,l;
double YRmin = 0.130; // YRmin = VR / ZP**0.67 <= 0.13 OR VR <= 1.0 double YRmin = 0.130; // YRmin = VR / ZP**0.67 <= 0.13 OR VR <= 1.0
@ -817,8 +817,10 @@ double z_eff_Schiwietz(double pz, double beta, double tz){
} }
double z_eff_atima14(double pz, double T, double tz){ double z_eff_atima14(double pz, double T, double tz){
double qmean = 0.0;
#ifdef GLOBAL
double qpb; double qpb;
double qhigh,qwinger,qglobal,qmean=0; double qhigh,qwinger,qglobal;
double c1 = 1.4; double c1 = 1.4;
double c2 = 0.28; double c2 = 0.28;
double c3 = 0.04; double c3 = 0.04;
@ -826,7 +828,6 @@ double z_eff_atima14(double pz, double T, double tz){
double gamma = gamma_from_T(T); double gamma = gamma_from_T(T);
double emax, emin; double emax, emin;
qpb = z_eff_Pierce_Blann(pz,beta); qpb = z_eff_Pierce_Blann(pz,beta);
#ifdef GLOBAL
if(T>30.0 && T<1500.0 && pz>28){ if(T>30.0 && T<1500.0 && pz>28){
qglobal = z_eff_global(pz,T,tz); qglobal = z_eff_global(pz,T,tz);

View File

@ -29,7 +29,6 @@ bool operator==(const Config &a, const Config&b){
double dedx(Projectile &p, double T, const Material &mat, const Config &c){ double dedx(Projectile &p, double T, const Material &mat, const Config &c){
double sum = 0; double sum = 0;
double w=0;
if(T<=0)return 0.0; if(T<=0)return 0.0;
sum += dedx_n(p,mat); sum += dedx_n(p,mat);
@ -108,7 +107,6 @@ std::vector<double> dedx_from_range(Projectile &p, const std::vector<double> &T,
} }
double range_straggling(Projectile &p, double T, const Material &t, const Config &c){ double range_straggling(Projectile &p, double T, const Material &t, const Config &c){
double r=0;
auto data = _storage.Get(p,t,c); auto data = _storage.Get(p,t,c);
Interpolator range_straggling_spline(energy_table.values,data.range_straggling.data(),energy_table.num); Interpolator range_straggling_spline(energy_table.values,data.range_straggling.data(),energy_table.num);
return sqrt(range_straggling_spline(T)); return sqrt(range_straggling_spline(T));
@ -133,7 +131,6 @@ double da2de(Projectile &p, double T, const Material &t, const Config &c){
} }
double angular_straggling_from_E(Projectile &p, double T, double Tout, const Material &t, const Config &c){ double angular_straggling_from_E(Projectile &p, double T, double Tout, const Material &t, const Config &c){
double r=0;
auto data = _storage.Get(p,t,c); auto data = _storage.Get(p,t,c);
Interpolator angular_straggling_spline(energy_table.values,data.angular_variance.data(),energy_table.num); Interpolator angular_straggling_spline(energy_table.values,data.angular_variance.data(),energy_table.num);
return sqrt(angular_straggling_spline(T) - angular_straggling_spline(Tout)); return sqrt(angular_straggling_spline(T) - angular_straggling_spline(Tout));
@ -151,7 +148,6 @@ double energy_straggling_from_E(Projectile &p, double T, double Tout,const Mater
double energy_out(double T, double thickness, Interpolator &range_spline){ double energy_out(double T, double thickness, Interpolator &range_spline){
constexpr double epsilon = 1E-5; constexpr double epsilon = 1E-5;
int counter = 0; int counter = 0;
double lo=0,hi=T;
double range; double range;
double dedx; double dedx;
double e,r; double e,r;
@ -381,7 +377,6 @@ DataPoint calculate_DataPoint(Projectile p, const Material &t, const Config &c){
dp.range.resize(max_datapoints); dp.range.resize(max_datapoints);
dp.range_straggling.resize(max_datapoints); dp.range_straggling.resize(max_datapoints);
dp.angular_variance.resize(max_datapoints); dp.angular_variance.resize(max_datapoints);
double dedxval;
auto fdedx = [&](double x)->double{ auto fdedx = [&](double x)->double{
return 1.0/dedx(p,x,t,c); return 1.0/dedx(p,x,t,c);
}; };

View File

@ -54,8 +54,6 @@ std::vector<double> band_matrix::trig_solve(const std::vector<double>& b) const
assert( this->dim()==(int)b.size() ); assert( this->dim()==(int)b.size() );
std::vector<double> x(this->dim()); std::vector<double> x(this->dim());
std::vector<double> g(this->dim()); std::vector<double> g(this->dim());
int j_stop;
double sum;
assert(d[0]!=0.0); assert(d[0]!=0.0);
x[0] = b[0]/d[0]; x[0] = b[0]/d[0];