Skip to content

Commit

Permalink
Static cast in dot product.
Browse files Browse the repository at this point in the history
  • Loading branch information
odlomax committed Jan 6, 2024
1 parent f865b49 commit c52e50f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/tests/interpolation/test_interpolation_spherical_vector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ template <int Rank>
double dotProduct(const array::ArrayView<double, Rank>& a,
const array::ArrayView<double, Rank>& b) {
auto dotProd = 0.;
arrayForEachDim(
std::make_integer_sequence<int, Rank>{}, std::tie(a, b),
[&](auto&& aElem, auto&& bElem) { dotProd += aElem * bElem; });
arrayForEachDim(std::make_integer_sequence<int, Rank>{}, std::tie(a, b),
[&](auto&& aElem, auto&& bElem) {
dotProd += static_cast<double>(aElem) * static_cast<double>(bElem);
});
return dotProd;
}

Expand Down Expand Up @@ -175,9 +176,6 @@ void testInterpolation(const Config& config) {
auto sourceView = array::make_view<double, Rank>(sourceField);
auto targetView = array::make_view<double, Rank>(targetField);

// MacOS test failing if I don't pre-assign field.
targetView.assign(0.);

ArrayForEach<0>::apply(std::tie(sourceLonLat, sourceView),
[](auto&& lonLat, auto&& sourceColumn) {

Expand Down

0 comments on commit c52e50f

Please sign in to comment.