Skip to content

Commit

Permalink
Merge a5a6c55 into 7356c36
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev committed Mar 22, 2024
2 parents 7356c36 + a5a6c55 commit 8fe6d58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ql/experimental/math/laplaceinterpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace QuantLib {
// handling of the "corners", all second derivs are zero in the op
// this directly generalizes Numerical Recipes, 3rd ed, eq 3.8.6
Real sum_corner_h =
std::accumulate(corner_h.begin(), corner_h.end(), 0.0, std::plus<Real>());
std::accumulate(corner_h.begin(), corner_h.end(), Real(0.0), std::plus<Real>());
for (Size j = 0; j < dim.size(); ++j) {
std::vector<Size> coord_j(coord);
coord_j[j] = corner_neighbour_index[j];
Expand All @@ -152,7 +152,7 @@ namespace QuantLib {
if (i != j)
weight += corner_h[i];
}
weight = dim.size() == 1 ? 1.0 : weight / sum_corner_h;
weight = dim.size() == 1 ? Real(1.0) : Real(weight / sum_corner_h);
g(count, layout_->index(coord_j)) = -weight;
}
g(count, count) = 1.0;
Expand Down

0 comments on commit 8fe6d58

Please sign in to comment.