Skip to content

Commit

Permalink
Update random_vector.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
AreaZR committed Nov 2, 2022
1 parent 9ea997f commit 3319dac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/boost/math/tools/random_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace boost { namespace math {
static constexpr std::size_t global_seed = 0;
static constexpr std::size_t global_size = 128;

template<typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = true>
template<typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
std::vector<T> generate_random_vector(std::size_t size, std::size_t seed)
{
if (seed == 0)
Expand All @@ -35,7 +35,7 @@ std::vector<T> generate_random_vector(std::size_t size, std::size_t seed)
return v;
}

template<typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = true>
template<typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
std::vector<T> generate_random_uniform_vector(std::size_t size, std::size_t seed, T lower_bound = T(0), T upper_bound = T(1))
{
if (seed == 0)
Expand All @@ -57,7 +57,7 @@ std::vector<T> generate_random_uniform_vector(std::size_t size, std::size_t seed
return v;
}

template<typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = true>
template<typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
std::vector<T> generate_random_vector(std::size_t size, std::size_t seed, T mean, T stddev)
{
if (seed == 0)
Expand Down

0 comments on commit 3319dac

Please sign in to comment.