From adb4bd58384cdd9f138af1f04f74f8050e14ffa5 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 15 Feb 2013 19:47:42 +0000 Subject: [PATCH] Use qualified names for math functions in RxnRates.h See Issue 136. Cherry-pick of r2121 from trunk. --- include/cantera/kinetics/RxnRates.h | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index 9c3fe5694..9a9e44de4 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -49,7 +49,7 @@ public: if (m_A <= 0.0) { m_logA = -1.0E300; } else { - m_logA = log(m_A); + m_logA = std::log(m_A); } } @@ -98,7 +98,7 @@ public: * factor. */ doublereal updateRC(doublereal logT, doublereal recipT) const { - return m_A * exp(m_b*logT - m_E*recipT); + return m_A * std::exp(m_b*logT - m_E*recipT); } @@ -231,7 +231,7 @@ public: if (m_A <= 0.0) { m_logA = -1.0E300; } else { - m_logA = log(m_A); + m_logA = std::log(m_A); } const vector_fp& data = rdata.rateCoeffParameters; @@ -272,7 +272,7 @@ public: // changed n to k, dgg 1/22/04 th = std::max(theta[k], Tiny); // th = fmaxx(theta[n], Tiny); - m_mcov += m_mc[n]*log(th); + m_mcov += m_mc[n]*std::log(th); } } @@ -295,7 +295,7 @@ public: * factor. */ doublereal updateRC(doublereal logT, doublereal recipT) const { - return m_A * exp(m_acov + m_b*logT - (m_E + m_ecov)*recipT + m_mcov); + return m_A * std::exp(m_acov + m_b*logT - (m_E + m_ecov)*recipT + m_mcov); } doublereal activationEnergy_R() const { @@ -394,7 +394,7 @@ public: if (m_A <= 0.0) { m_logA = -1.0E300; } else { - m_logA = log(m_A); + m_logA = std::log(m_A); } } @@ -411,7 +411,7 @@ public: if (m_A <= 0.0) { m_logA = -1.0E300; } else { - m_logA = log(m_A); + m_logA = std::log(m_A); } } @@ -443,7 +443,7 @@ public: * factor. */ doublereal updateRC(doublereal logT, doublereal recipT) const { - return m_A * exp(m_b*logT - m_E*recipT); + return m_A * std::exp(m_b*logT - m_E*recipT); } void writeUpdateRHS(std::ostream& s) const { @@ -496,7 +496,7 @@ public: for (iter_t iter = rdata.plogParameters.begin(); iter != rdata.plogParameters.end(); iter++) { - double logp = log(iter->first); + double logp = std::log(iter->first); if (pressures_.empty() || pressures_.rbegin()->first != logp) { // starting a new group pressures_[logp] = std::make_pair(j, j+1); @@ -520,7 +520,7 @@ public: iter != pressures_.end(); iter++) { if (iter->second.first == iter->second.second - 1) { - A_[iter->second.first] = log(A_[iter->second.first]); + A_[iter->second.first] = std::log(A_[iter->second.first]); } } @@ -590,9 +590,9 @@ public: } else { double k = 1e-300; // non-zero to make log(k) finite for (size_t m = 0; m < m1_; m++) { - k += A1_[m] * exp(n1_[m] * logT - Ea1_[m] * recipT); + k += A1_[m] * std::exp(n1_[m] * logT - Ea1_[m] * recipT); } - log_k1 = log(k); + log_k1 = std::log(k); } if (m2_ == 1) { @@ -600,9 +600,9 @@ public: } else { double k = 1e-300; // non-zero to make log(k) finite for (size_t m = 0; m < m2_; m++) { - k += A2_[m] * exp(n2_[m] * logT - Ea2_[m] * recipT); + k += A2_[m] * std::exp(n2_[m] * logT - Ea2_[m] * recipT); } - log_k2 = log(k); + log_k2 = std::log(k); } return log_k1 + (log_k2 - log_k1) * (logP_ - logP1_) * rDeltaP_; @@ -614,7 +614,7 @@ public: * This function returns the actual value of the rate constant. */ doublereal updateRC(doublereal logT, doublereal recipT) const { - return exp(update(logT, recipT)); + return std::exp(update(logT, recipT)); } doublereal activationEnergy_R() const { @@ -645,7 +645,7 @@ public: throw CanteraError("Plog::validate", "Invalid rate coefficient for reaction #" + int2str(rdata.number) + ":\n" + rdata.equation + "\n" + - "at P = " + fp2str(exp((++iter)->first)) + + "at P = " + fp2str(std::exp((++iter)->first)) + ", T = " + fp2str(T[i])); } } @@ -697,8 +697,8 @@ public: chebCoeffs_(rdata.chebCoeffs), dotProd_(rdata.chebDegreeT) { - double logPmin = log10(rdata.chebPmin); - double logPmax = log10(rdata.chebPmax); + double logPmin = std::log10(rdata.chebPmin); + double logPmax = std::log10(rdata.chebPmax); double TminInv = 1.0 / rdata.chebTmin; double TmaxInv = 1.0 / rdata.chebTmax; @@ -754,7 +754,7 @@ public: * This function returns the actual value of the rate constant. */ doublereal updateRC(doublereal logT, doublereal recipT) const { - return pow(10, update(logT, recipT)); + return std::pow(10, update(logT, recipT)); } doublereal activationEnergy_R() const {