Skip to content

Commit

Permalink
adding is_finite helper function for std::array
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Aug 4, 2016
1 parent 69a38f7 commit a58e267
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/numerics2.hpp
Expand Up @@ -19,6 +19,7 @@
#ifndef NUMERICS_HPP
#define NUMERICS_HPP

#include <array>
#include <cmath>
#include <limits>
#include <cstddef>
Expand Down Expand Up @@ -64,6 +65,12 @@ bool is_finite(const double v[N])
return is_finite;
}

template <typename T, std::size_t N>
bool is_finite(const std::array<T, N>& v)
{
return is_finite<N>(&v[0]);
}

} // namespace flexiblesusy

#endif

0 comments on commit a58e267

Please sign in to comment.