Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite PolynomialInMonomialBasis to avoid specializations #2989

Merged
merged 7 commits into from
May 18, 2021

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented May 18, 2021

This fixes an old code smell that dated back to VS2015.

Copy link
Member

@eggrobin eggrobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we can have that for all types, we should bake the origin into the Taylor polynomials in the elliptic functions.

double const Kʹ = elliptic_K_taylor_0_05(mʹ - 0.05);
return -Kʹ * (1 / π) * std::log(qʹ) * Radian;
} else if (m <= 0.1) {
return elliptic_K_taylor_0_05(m - 0.05) * Radian;
} else if (m <= 0.2) {
return elliptic_K_taylor_0_15(m - 0.15) * Radian;
} else if (m <= 0.3) {
return elliptic_K_taylor_0_25(m - 0.25) * Radian;
} else if (m <= 0.4) {
return elliptic_K_taylor_0_35(m - 0.35) * Radian;
} else if (m <= 0.5) {
return elliptic_K_taylor_0_45(m - 0.45) * Radian;
} else if (m <= 0.6) {
return elliptic_K_taylor_0_55(m - 0.55) * Radian;
} else if (m <= 0.7) {
return elliptic_K_taylor_0_65(m - 0.65) * Radian;
} else if (m <= 0.8) {
return elliptic_K_taylor_0_75(m - 0.75) * Radian;
} else if (m <= 0.85) {
return elliptic_K_taylor_0_825(m - 0.825) * Radian;
} else {
return elliptic_K_taylor_0_875(m - 0.875) * Radian;

@eggrobin eggrobin added the LGTM label May 18, 2021
@pleroy pleroy merged commit a97bfd9 into mockingbirdnest:master May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants