From c5b7245b14f14d11eaed388154c6a0e4a7308978 Mon Sep 17 00:00:00 2001 From: Claudio Scafuri <claudio.scafuri@elettra.eu> Date: Fri, 8 May 2020 15:22:04 +0200 Subject: [PATCH] remove deprecated (?) throws in methods decl. --- .gitignore | 8 ++++++++ Makefile | 9 ++++----- interpolator.cpp | 2 +- interpolator.h | 6 +++--- multipolynomial.cpp | 4 ++-- multipolynomial.h | 4 ++-- periodicspline.cpp | 4 ++-- periodicspline.h | 4 ++-- spline.cpp | 4 ++-- spline.h | 4 ++-- 10 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 0ea3d3f..a43aa8a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,13 @@ .settings obj bin +lib core* *~ *.pyc *.so *.so* +*.o .pylintrc .metadata .idea @@ -16,3 +18,9 @@ core* .nse_depinfo software oldsrc +spltest +test_freespline +test_inverse +test_multipoly +test_periodicspline +test_spline diff --git a/Makefile b/Makefile index 939dd05..39ff645 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,6 @@ RANLIB = ranlib OPTIM = -O2 INCLUDE = -I. - CXXFLAGS += -std=c++11 -fPIC -D_REENTRANT $(DEBUG) $(OPTIM) $(WARN) $(INCLUDE) CFLAGS = $(CXXFLAGS) PROJECTHOME = . @@ -56,9 +55,9 @@ SHLIB_SUFFIX = so # release numbers for libraries # - LIBVERSION = 1 - LIBRELEASE = 1 - LIBSUBRELEASE = 1 + LIBVERSION = 2 + LIBRELEASE = 0 + LIBSUBRELEASE = 0 # LIBRARY = $(BASELIBNAME).a @@ -82,7 +81,7 @@ OBJS = periodicspline.o spline.o multipolynomial.o interpolator.o ######################################################################################## # compiler warnings -WARN = -Wall -Wextra -Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wshadow +WARN = -Wall -Wextra -Wdeprecated -Woverloaded-virtual -Wsign-promo -Wshadow #WARN += -Weffc++ -Wold-style-cast -Wuninitialized -Wmissing-braces -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wswitch-default -Wswitch-enum -Winit-self -Wundef -Wmissing-field-initializers -Winline WARN+= -pedantic -Wno-long-long # test with mysql due to long long variables! ######################################################################################## diff --git a/interpolator.cpp b/interpolator.cpp index dee53a6..447832a 100644 --- a/interpolator.cpp +++ b/interpolator.cpp @@ -83,7 +83,7 @@ bool Interpolator::bracket(double goal,double initial,double tol, double& xlow, } -double Interpolator::solve(double goal,double x1,double x2,double tol,unsigned int maxiter) throw (std::range_error) +double Interpolator::solve(double goal,double x1,double x2,double tol,unsigned int maxiter) { double fl,fh,xl,xh,del,f,rtf,dx; fl = goal - evaluate(x1); diff --git a/interpolator.h b/interpolator.h index d2dbae4..92a0f6c 100644 --- a/interpolator.h +++ b/interpolator.h @@ -48,7 +48,7 @@ public: * @return interpolated value y=f(x) * @exception std::range_error */ - virtual double evaluate (double in_val ) throw (std::range_error)=0; + virtual double evaluate (double in_val )=0; /** @@ -67,7 +67,7 @@ public: * @param in_val * @exception std::range_error */ - virtual doubleVector evaluate (doubleVector in_val ) throw(std::range_error)=0; + virtual doubleVector evaluate (doubleVector in_val )=0; /** * returns the existence filed of y=f(x). It is assumed the f(x) has values for all @@ -106,7 +106,7 @@ public: * @exception std::range_error initial range does not bracket a solution */ - double solve(double goal,double xlow,double xhigh,double tol,unsigned int maxiter=100) throw (std::range_error); + double solve(double goal,double xlow,double xhigh,double tol,unsigned int maxiter=100); /** diff --git a/multipolynomial.cpp b/multipolynomial.cpp index a6432bf..a792a91 100644 --- a/multipolynomial.cpp +++ b/multipolynomial.cpp @@ -80,7 +80,7 @@ multiPolynomial::~multiPolynomial ( ) delete [] range; } -double multiPolynomial::evaluate(double v) throw (std::range_error) +double multiPolynomial::evaluate(double v) { if ( v < _min || v > _max ) throw std::range_error("input value out of range"); //find the correct polynomial to use @@ -106,7 +106,7 @@ double multiPolynomial::evaluate(double v) throw (std::range_error) return p; } -doubleVector multiPolynomial::evaluate (doubleVector in_val ) throw(std::range_error) +doubleVector multiPolynomial::evaluate (doubleVector in_val ) { //simplicistic implementation. Should make better use of the indexing doubleVector outval; diff --git a/multipolynomial.h b/multipolynomial.h index 7c509c6..56d6e06 100644 --- a/multipolynomial.h +++ b/multipolynomial.h @@ -68,7 +68,7 @@ public: * @exception lenght_error wrong number of polynomial (>=1) * @exception range_error at least one input data is outside the [min,max] range */ - double evaluate(double in_val) throw (std::range_error); + double evaluate(double in_val); /** * estimate the value of the inverse iterpolator x=g(y) @@ -86,7 +86,7 @@ public: * @param in_val doubleVector of input values * @exception range_error: at least one input data is outside the [min,max] range */ - doubleVector evaluate (doubleVector in_val ) throw(std::range_error); + doubleVector evaluate (doubleVector in_val ); protected: double* range; /**< auxiliary struct to search the polynomial to use */ diff --git a/periodicspline.cpp b/periodicspline.cpp index 4765ae9..6da6d8d 100644 --- a/periodicspline.cpp +++ b/periodicspline.cpp @@ -201,7 +201,7 @@ void periodicSpline::get_base_points (doubleVector& xvalues, doubleVector& yvalu return; } -double periodicSpline::evaluate (double v ) throw(std::range_error) +double periodicSpline::evaluate (double v ) { int klo,khi,k; @@ -220,7 +220,7 @@ double periodicSpline::evaluate (double v ) throw(std::range_error) return( ( ( ( a[klo] * delta) + b[klo] ) * delta + c[klo] ) * delta + y_base[klo]); } -doubleVector periodicSpline::evaluate (doubleVector in_val ) throw(std::range_error) +doubleVector periodicSpline::evaluate (doubleVector in_val ) { //simplicistic implementation. Should make better use of the indexing doubleVector outval; diff --git a/periodicspline.h b/periodicspline.h index 8218419..f3b2f04 100644 --- a/periodicspline.h +++ b/periodicspline.h @@ -75,7 +75,7 @@ public: * @param in_val input value * @exception range_error input value is outside the [min,max] range */ - double evaluate(double in_val) throw (std::range_error); + double evaluate(double in_val); /** * calculate the interpolated value v[]=f(in_val[]). Vector version @@ -83,7 +83,7 @@ public: * @param in_val doubleVector of input values * @exception range_error at least one input data is outside the [min,max] range */ - doubleVector evaluate (doubleVector in_val ) throw(std::range_error); + doubleVector evaluate (doubleVector in_val ); protected: diff --git a/spline.cpp b/spline.cpp index 624818f..fb49d68 100644 --- a/spline.cpp +++ b/spline.cpp @@ -156,7 +156,7 @@ void Spline::get_base_points (doubleVector& xvalues, doubleVector& yvalues ) con return; } -double Spline::evaluate (double v ) throw(std::range_error) +double Spline::evaluate (double v ) { int klo,khi,k; double h,b,a; @@ -176,7 +176,7 @@ double Spline::evaluate (double v ) throw(std::range_error) return a*y_base[klo]+b*y_base[khi]+((a*a*a-a)*y2[klo]+(b*b*b-b)*y2[khi])*(h*h)/6.0; } -doubleVector Spline::evaluate (doubleVector in_val ) throw(std::range_error) +doubleVector Spline::evaluate (doubleVector in_val ) { //simplicistic implementation. Should make better use of the indexing doubleVector outval; diff --git a/spline.h b/spline.h index 34e28df..0779819 100644 --- a/spline.h +++ b/spline.h @@ -72,7 +72,7 @@ public: * @param in_val input value * @exception range_error input value is outside the [min,max] range */ - double evaluate(double in_val) throw (std::range_error); + double evaluate(double in_val); /** * calculate the interpolated value v[]=f(in_val[]). Vector version @@ -80,7 +80,7 @@ public: * @param in_val doubleVector of input values * @exception range_error at least one input data is outside the [min,max] range */ - doubleVector evaluate (doubleVector in_val ) throw(std::range_error); + doubleVector evaluate (doubleVector in_val ); protected: -- GitLab