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