Skip to content

Commit

Permalink
Change one constexpr to const.
Browse files Browse the repository at this point in the history
* Produces same exact code.
* Works in clang.
  • Loading branch information
eulisse committed Jan 8, 2013
1 parent 8de2e23 commit 2b48db7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TrackPropagation/RungeKutta/src/RKAdaptiveSolver.icc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RKAdaptiveSolver<T,StepWithPrec,N>::operator()( Scalar startPar, const Vector& s
currentPar += stepSize;
// increase step size
// double factor = std::min( Safety * pow( std::fabs(eps/tryStep.second),0.2), 4.); // gives division by 0 FPE
constexpr float cut = std::pow(4.f/Safety,5.f);
const float cut = std::pow(4.f/Safety,5.f);
// float factor = (eps < cut*acc) ? Safety * std::pow(eps/acc,0.2f) : 4.f;
float factor = (eps < cut*acc) ? Safety * fastPow(eps/acc,0.2) : 4.f;
// stepSize = std::min( stepSize*factor, remainigStep);
Expand Down
2 changes: 1 addition & 1 deletion TrackPropagation/RungeKutta/test/testFastPow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inline double fastPow(double a, double b) {
int main() {
constexpr double Safety = 0.9;
double eps=1.e-5;
constexpr float cut = std::pow(10.f/Safety,5.f);
const float cut = std::pow(10.f/Safety,5.f);
double accMin = eps/cut;
std::cout << "eps/cut/accMin " << eps << " " << cut << " " << accMin
<< std::endl;
Expand Down

0 comments on commit 2b48db7

Please sign in to comment.