NumCpp  2.6.2
A Templatized Header Only C++ Implementation of the Python NumPy Library
reshape.hpp
Go to the documentation of this file.
1 
28 #pragma once
29 
30 #include "NumCpp/Core/Shape.hpp"
31 #include "NumCpp/Core/Types.hpp"
32 #include "NumCpp/NdArray.hpp"
33 
34 namespace nc
35 {
36  //============================================================================
37  // Method Description:
51  template<typename dtype>
53  {
54  inArray.reshape(inSize);
55  return inArray;
56  }
57 
58  //============================================================================
59  // Method Description:
74  template<typename dtype>
75  NdArray<dtype>& reshape(NdArray<dtype>& inArray, int32 inNumRows, int32 inNumCols)
76  {
77  inArray.reshape(inNumRows, inNumCols);
78  return inArray;
79  }
80 
81  //============================================================================
82  // Method Description:
96  template<typename dtype>
97  NdArray<dtype>& reshape(NdArray<dtype>& inArray, const Shape& inNewShape)
98  {
99  inArray.reshape(inNewShape);
100  return inArray;
101  }
102 } // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
NdArray< dtype > & reshape(size_type inSize)
Definition: NdArrayCore.hpp:4260
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
Definition: Coordinate.hpp:45
NdArray< dtype > & reshape(NdArray< dtype > &inArray, uint32 inSize)
Definition: reshape.hpp:52
std::int32_t int32
Definition: Types.hpp:36
std::uint32_t uint32
Definition: Types.hpp:40