NumCpp  1.0
A C++ implementation of the Python Numpy library
full.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/Core/Shape.hpp"
32 #include "NumCpp/Core/Types.hpp"
33 #include "NumCpp/NdArray.hpp"
34 
35 namespace nc
36 {
37  //============================================================================
38  // Method Description:
48  template<typename dtype>
49  NdArray<dtype> full(uint32 inSquareSize, dtype inFillValue)
50  {
51  NdArray<dtype> returnArray(inSquareSize, inSquareSize);
52  returnArray.fill(inFillValue);
53  return returnArray;
54  }
55 
56  //============================================================================
57  // Method Description:
68  template<typename dtype>
69  NdArray<dtype> full(uint32 inNumRows, uint32 inNumCols, dtype inFillValue)
70  {
71  NdArray<dtype> returnArray(inNumRows, inNumCols);
72  returnArray.fill(inFillValue);
73  return returnArray;
74  }
75 
76  //============================================================================
77  // Method Description:
87  template<typename dtype>
88  NdArray<dtype> full(const Shape& inShape, dtype inFillValue)
89  {
90  return full(inShape.rows, inShape.cols, inFillValue);
91  }
92 }
nc::full
NdArray< dtype > full(uint32 inSquareSize, dtype inFillValue)
Definition: full.hpp:49
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
nc::Shape::cols
uint32 cols
Definition: Core/Shape.hpp:46
Shape.hpp
nc
Definition: Coordinate.hpp:45
nc::Shape::rows
uint32 rows
Definition: Core/Shape.hpp:45
Types.hpp
nc::NdArray::fill
NdArray< dtype > & fill(value_type inFillValue) noexcept
Definition: NdArrayCore.hpp:2727