NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
zeros.hpp
Go to the documentation of this file.
1
#pragma once
29
30
#include "
NumCpp/Core/Internal/StaticAsserts.hpp
"
31
#include "
NumCpp/Core/Shape.hpp
"
32
#include "
NumCpp/Core/Types.hpp
"
33
#include "
NumCpp/Functions/full.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
{
52
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
(dtype);
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
{
71
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
(dtype);
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
{
90
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
(dtype);
91
92
return
full
(inShape, dtype{ 0 });
93
}
94
}
// namespace nc
nc::zeros
NdArray< dtype > zeros(uint32 inSquareSize)
Definition:
zeros.hpp:50
StaticAsserts.hpp
nc::full
NdArray< dtype > full(uint32 inSquareSize, dtype inFillValue)
Definition:
full.hpp:48
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition:
StaticAsserts.hpp:50
nc::NdArray< dtype >
nc::uint32
std::uint32_t uint32
Definition:
Types.hpp:40
NdArray.hpp
nc::Shape
A Shape Class for NdArrays.
Definition:
Core/Shape.hpp:40
Shape.hpp
nc
Definition:
Coordinate.hpp:44
Types.hpp
full.hpp
include
NumCpp
Functions
zeros.hpp
Generated by
1.8.17