From 402996adc1bcfdd512952efd4a8f9b18cd128833 Mon Sep 17 00:00:00 2001 From: Alex Long Date: Tue, 17 Aug 2021 15:03:14 -0600 Subject: [PATCH] Hard code std::pow of max double as there's no constexpr pow in msvc --- src/cdi/CDI.hh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/cdi/CDI.hh b/src/cdi/CDI.hh index 29632c20f..a4725b08b 100644 --- a/src/cdi/CDI.hh +++ b/src/cdi/CDI.hh @@ -185,8 +185,7 @@ constexpr double polylog_series_minus_one_planck(double const x, double const ei /** * \brief Integrate the normalized Planckian spectrum from 0 to \f$ x (\frac{h\nu}{kT}) \f$. * - * \param scaled_freq upper integration limit, scaled by the temperature. - * \param exp_scaled_freq upper integration limit, scaled by an exponential function. + * \param[in] scaled_freq upper integration limit, scaled by the temperature. * \return integrated normalized Planckian from 0 to x \f$(\frac{h\nu}{kT})\f$ * * There are 3 cases to consider: @@ -246,7 +245,7 @@ constexpr double Planck2Rosseland(double const freq, double const exp_freq) { // Case 1: if nu/T is sufficiently large, then the evaluation is 0.0. // this evaluation also prevents overflow when evaluating (nu/T)^4. - if (freq > std::pow(std::numeric_limits::max(), 1.0 / 4.0)) + if (freq > 1.15792038e77) // hard-coded pow(numeric_limits::max(), 1/4) return 0.0; double const freq_3 = freq * freq * freq; @@ -263,10 +262,10 @@ constexpr double Planck2Rosseland(double const freq, double const exp_freq) { /*! \brief Integrate the normalized Planckian and Rosseland spectra from 0 to \f$ x * (\frac{h\nu}{kT}) \f$. * - * \param scaled_freq frequency upper integration limit scaled by temperature - * \param exp_scaled_freq upper integration limit, scaled by an exponential function. - * \param planck Variable to return the Planck integral - * \param rosseland Variable to return the Rosseland integral + * \param[in] scaled_freq frequency upper integration limit scaled by temperature + * \param[in] exp_scaled_freq upper integration limit, scaled by an exponential function. + * \param[in] planck Variable to return the Planck integral + * \param[in] rosseland Variable to return the Rosseland integral */ constexpr void integrate_planck_rosseland(double const scaled_freq, double const exp_scaled_freq, double &planck, double &rosseland) { @@ -335,8 +334,8 @@ constexpr double integratePlanckSpectrum(double low, double high, const double T * and temperature is in K, then low and high must first be multiplied by Planck's constant and * temperature by Boltzmann's constant before they are passed to this function. * - * \param low Lower limit of frequency range. - * \param high Higher limit of frequency range. + * \param[in] low Lower limit of frequency range. + * \param[in] high Higher limit of frequency range. * \param[in] T Temperature (must be greater than 0.0). * \param[out] planck On return, contains the integrated normalized Planckian from low to high. * \param[out] rosseland On return, contains the integrated normalized Rosseland from low to high @@ -390,9 +389,9 @@ constexpr void integrate_Rosseland_Planckian_Spectrum(double low, double high, d * and temperature is in K, then low and high must first be multiplied by Planck's constant and * temperature by Boltzmann's constant before they are passed to this function. * - * \param low lower frequency bound. - * \param high higher frequency bound. - * \param T the temperature (must be greater than 0.0) + * \param[in] low lower frequency bound. + * \param[in] high higher frequency bound. + * \param[in] T the temperature (must be greater than 0.0) * * \return integrated normalized Rosseland from low to high */