Commit 54786c68 authored by Lynn Garren's avatar Lynn Garren

replace finite with std::isfinite

parent a7473510
2010-07-20 Lynn Garren <garren@fnal.gov>
* src/AnalyticConvolution.cc: replace finite with std::isfinite
2010-03-09 Lynn Garren <garren@fnal.gov>
* GenericFunctions/src/RKIntegrator.cc:
......
// -*- C++ -*-
// $Id: AnalyticConvolution.cc,v 1.5 2009/06/26 12:45:32 boudreau Exp $
// $Id: AnalyticConvolution.cc,v 1.6 2010/07/20 21:43:47 garren Exp $
#include "CLHEP/GenericFunctions/AnalyticConvolution.hh"
#include "CLHEP/GenericFunctions/Gaussian.hh"
#include "CLHEP/GenericFunctions/Exponential.hh"
#include <cmath> // for isfinite
namespace Genfun {
FUNCTION_OBJECT_IMP(AnalyticConvolution)
......@@ -73,7 +74,7 @@ double AnalyticConvolution::operator() (double argument) const {
if (_type==SMEARED_NEG_EXP) {
expG = exp((sigma*sigma +2*tau*(/*offset*/x))/(2.0*tau*tau)) *
erfc((sigma*sigma+tau*(/*offset*/x))/(sqrtTwo*sigma*tau))/(2.0*tau);
if (!finite(expG)) {
if (!std::isfinite(expG)) {
expG=0.0;
}
return expG;
......@@ -85,7 +86,7 @@ double AnalyticConvolution::operator() (double argument) const {
// Both sign distribution=> return smeared exponential:
if (_type==SMEARED_EXP) {
if (!finite(expG)) {
if (!std::isfinite(expG)) {
expG=0.0;
}
return expG;
......
......@@ -4,7 +4,7 @@
#include "CLHEP/GenericFunctions/PtRelFcn.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include <assert.h>
#include <cmath> // for pow() and exp()
#include <cmath> // for pow() and exp() and isfinite()
#include <float.h>
#if (defined __STRICT_ANSI__) || (defined _WIN32)
......@@ -62,7 +62,7 @@ double PtRelFcn::operator() (double x) const {
norm*p0*pow(x,p1)*exp(-p2*pow(x,p3)) +
(2.0/(1+_erf(p5/p4/s2))*(1.0-p0)/(sqrt(2*M_PI)*p4))*exp(-(x-p5)*(x-p5)/(2.0*p4*p4));
//if (!finite(retVal)) return 1.0E-10;
//if (!std::isfinite(retVal)) return 1.0E-10;
return std::max(retVal,1.0E-10);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment