From e406bcfd1ce4f4531f1697ad2b4c44e98d66f810 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Mon, 21 Sep 2015 16:08:53 +0200 Subject: [PATCH] messages .. --- pub/lib/fit.cpp | 2 +- pub/lib/slice.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pub/lib/fit.cpp b/pub/lib/fit.cpp index c8029ea1..edad512e 100644 --- a/pub/lib/fit.cpp +++ b/pub/lib/fit.cpp @@ -82,7 +82,7 @@ static void compute_residues( for ( int i=0; i<n; i++) { if( !isfinite(cu->to_r(i)) ) - throw S("function evaluation returns infinite value"); + throw "infinite function value at x[" + S(i) + "]=" + S(s->x[i]); if ( wt==COlc::_LIN ) { fvec[mdat+i] = s->y[i] - cu->to_r(i); diff --git a/pub/lib/slice.cpp b/pub/lib/slice.cpp index e20b9b73..fda72fad 100644 --- a/pub/lib/slice.cpp +++ b/pub/lib/slice.cpp @@ -8,6 +8,7 @@ //! \brief CSlice handles z dependent data, is base class for CSpec, CCurve. +#include <iostream> #include <vector> #include <string> #include <algorithm> @@ -183,7 +184,8 @@ void CSpec::intpol( const vector<double>& xx, vector<double>* yy, vector<double> for( int ii=0; ii<nn; ++ii ) { (*yy)[ii] = 0; - (*dd)[ii] = 0; + if(dd) + (*dd)[ii] = 0; } int i = 0, ii = 0; while ( i<n-1 && xx[ii]<x[n-1] ) { @@ -194,6 +196,9 @@ void CSpec::intpol( const vector<double>& xx, vector<double>* yy, vector<double> if( ii>=nn ) return; (*yy)[ii] = ( (x[i+1]-xx[ii])*y[i] + (xx[ii]-x[i])*y[i+1] )/(x[i+1]-x[i]); + if( !isfinite((*yy)[ii]) ) { + std::cout << "TROUBLE " << i << " " << ii << "\n"; + } if( dd ) (*dd)[ii] = sqrt( (x[i+1]-xx[ii])*SQR(dy[i]) + (xx[ii]-x[i])*SQR(dy[i+1]) ) / (x[i+1]-x[i]); -- GitLab