NumCpp  2.9.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
standardNormal.hpp
Go to the documentation of this file.
1 #pragma once
29 
31 #include "NumCpp/Core/Shape.hpp"
32 #include "NumCpp/NdArray.hpp"
33 #include "NumCpp/Random/normal.hpp"
34 
35 namespace nc
36 {
37  namespace random
38  {
39  namespace detail
40  {
41  //============================================================================
42  // Method Description:
52  template<typename dtype, typename GeneratorType = std::mt19937>
53  dtype standardNormal(GeneratorType& generator)
54  {
56 
57  return detail::normal<dtype>(generator, 0, 1);
58  }
59 
60  //============================================================================
61  // Method Description:
73  template<typename dtype, typename GeneratorType = std::mt19937>
74  NdArray<dtype> standardNormal(GeneratorType& generator, const Shape& inShape)
75  {
77 
78  return detail::normal<dtype>(generator, inShape, 0, 1);
79  }
80  } // namespace detail
81 
82  //============================================================================
83  // Method Description:
92  template<typename dtype>
94  {
95  return detail::standardNormal<dtype>(generator_);
96  }
97 
98  //============================================================================
99  // Method Description:
110  template<typename dtype>
112  {
113  return detail::standardNormal<dtype>(generator_, inShape);
114  }
115  } // namespace random
116 } // namespace nc
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
dtype standardNormal(GeneratorType &generator)
Definition: standardNormal.hpp:53
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:37
dtype standardNormal()
Definition: standardNormal.hpp:93
Definition: Coordinate.hpp:45