NumCpp  2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
uniform.hpp
Go to the documentation of this file.
1 #pragma once
29 
33 
34 namespace nc
35 {
36  namespace random
37  {
38  //============================================================================
39  // Method Description:
52  template<typename dtype>
53  dtype uniform(dtype inLow, dtype inHigh)
54  {
55  STATIC_ASSERT_FLOAT(dtype);
56 
57  return randFloat(inLow, inHigh);
58  }
59 
60  //============================================================================
61  // Method Description:
75  template<typename dtype>
76  NdArray<dtype> uniform(const Shape& inShape, dtype inLow, dtype inHigh)
77  {
78  STATIC_ASSERT_FLOAT(dtype);
79 
80  return randFloat(inShape, inLow, inHigh);
81  }
82  } // namespace random
83 } // namespace nc
StaticAsserts.hpp
nc::random::randFloat
dtype randFloat(dtype inLow, dtype inHigh=0.0)
Definition: randFloat.hpp:60
nc::random::uniform
dtype uniform(dtype inLow, dtype inHigh)
Definition: uniform.hpp:53
nc::NdArray< dtype >
nc::Shape
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:40
STATIC_ASSERT_FLOAT
#define STATIC_ASSERT_FLOAT(dtype)
Definition: StaticAsserts.hpp:43
nc
Definition: Coordinate.hpp:44
DtypeInfo.hpp
randFloat.hpp