NumCpp  1.0
A C++ implementation of the Python Numpy library
zeros.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/Core/Shape.hpp"
32 #include "NumCpp/Core/Types.hpp"
35 #include "NumCpp/NdArray.hpp"
36 
37 namespace nc
38 {
39  //============================================================================
40  // Method Description:
50  template<typename dtype>
51  NdArray<dtype> zeros(uint32 inSquareSize)
52  {
54 
55  return full(inSquareSize, dtype{ 0 });
56  }
57 
58  //============================================================================
59  // Method Description:
69  template<typename dtype>
70  NdArray<dtype> zeros(uint32 inNumRows, uint32 inNumCols)
71  {
73 
74  return full(inNumRows, inNumCols, dtype{ 0 });
75  }
76 
77  //============================================================================
78  // Method Description:
88  template<typename dtype>
89  NdArray<dtype> zeros(const Shape& inShape)
90  {
92 
93  return full(inShape, dtype{ 0 });
94  }
95 }
nc::zeros
NdArray< dtype > zeros(uint32 inSquareSize)
Definition: zeros.hpp:51
StaticAsserts.hpp
nc::full
NdArray< dtype > full(uint32 inSquareSize, dtype inFillValue)
Definition: full.hpp:49
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:51
nc::NdArray< dtype >
nc::uint32
std::uint32_t uint32
Definition: Types.hpp:41
NdArray.hpp
nc::Shape
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
Shape.hpp
nc
Definition: Coordinate.hpp:45
Types.hpp
full.hpp