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
changed std::pow to Utilities::pow in include/ source/ #14759
Conversation
Thank you for your patch! You need to include the utilities header in
|
@@ -418,14 +420,14 @@ namespace LineMinimization | |||
const NumberType r1 = f2 - f1 - g1 * x2_shift; | |||
const NumberType r2 = f3 - f1 - g1 * x3_shift; | |||
const NumberType denom = | |||
std::pow(x2_shift * x3_shift, 2) * (x2_shift - x3_shift); | |||
Utilities::pow(2, x2_shift * x3_shift) * (x2_shift - x3_shift); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you switch the order of the arguments? There are supposed to be same as std::pow
I think these should be |
@@ -76,7 +76,7 @@ namespace Functions | |||
const SymmetricTensor<2, dim> hess = | |||
unit_symmetric_tensor<dim>() / distance - | |||
symmetrize(outer_product(center_to_point, center_to_point)) / | |||
std::pow(distance, 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed changing to fixed_power
in source/base/function_signed_distance.cc
source/grid/grid_generator.cc
Outdated
, n_cells_x_1(Utilities::pow(2, refinements) * n_subdivision_x_1) | ||
, n_cells_x_2(Utilities::pow(2, refinements) * n_subdivision_x_2) | ||
, n_cells_y(Utilities::pow(2, refinements) * n_subdivision_y) | ||
, n_cells_x_0(Utilities::fixed_power<2>(refinements) * n_subdivision_x_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to keep Utilities::pow
or std::pow
here.
This statement should calculate 2^refinements
, and not refinements^2
.
Since this is not a constexpr
(as refinements
is not known at compile time), you could actually turn it into std::pow
, but that's up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll fix it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch looks good to me! Thank you for the contribution!
Can you make sure that your commit contains your first and lastname? |
I've changed the author name for my commits. |
Squashing them into one commit using After squashing on your local branch, you can check with |
On a different note: Your master branch is from October 2022, 900 commits behind, which causes two of our testers to fail. Could you also rebase on the current master branch? |
2a9f1e0
to
97599ca
Compare
Looks like the indentation is off. Could you run |
97599ca
to
22f263c
Compare
22f263c
to
ed19691
Compare
I fixed this in the last pushed files. It should work fine now. |
as discussed in #13321.
list of changed files: