NumCpp  2.6.2
A Templatized Header Only C++ Implementation of the Python NumPy Library
zeros.hpp
Go to the documentation of this file.
1 
28 #pragma once
29 
31 #include "NumCpp/Core/Shape.hpp"
32 #include "NumCpp/Core/Types.hpp"
34 #include "NumCpp/NdArray.hpp"
35 
36 namespace nc
37 {
38  //============================================================================
39  // Method Description:
49  template<typename dtype>
50  NdArray<dtype> zeros(uint32 inSquareSize)
51  {
53 
54  return full(inSquareSize, dtype{ 0 });
55  }
56 
57  //============================================================================
58  // Method Description:
68  template<typename dtype>
69  NdArray<dtype> zeros(uint32 inNumRows, uint32 inNumCols)
70  {
72 
73  return full(inNumRows, inNumCols, dtype{ 0 });
74  }
75 
76  //============================================================================
77  // Method Description:
87  template<typename dtype>
88  NdArray<dtype> zeros(const Shape& inShape)
89  {
91 
92  return full(inShape, dtype{ 0 });
93  }
94 } // namespace nc
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:50
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
Definition: Coordinate.hpp:45
NdArray< dtype > full(uint32 inSquareSize, dtype inFillValue)
Definition: full.hpp:48
NdArray< dtype > zeros(uint32 inSquareSize)
Definition: zeros.hpp:50
std::uint32_t uint32
Definition: Types.hpp:40