Skip to content

Commit

Permalink
Update vectors.h
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 1, 2024
1 parent e66205c commit 582a421
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// return the the magnitude of a vector
template <size_t VECDIM>
[[nodiscard]] [[gnu::const]] constexpr auto vec_len(const std::array<double, VECDIM> vec) -> double {
[[nodiscard]] constexpr auto vec_len(const std::array<double, VECDIM> &vec) -> double {
const double squaredlen = std::accumulate(vec.begin(), vec.end(), 0., [](auto a, auto b) { return a + b * b; });

return std::sqrt(squaredlen);
Expand Down

0 comments on commit 582a421

Please sign in to comment.