NumCpp  2.12.1
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
34namespace nc
35{
36 //============================================================================
37 // Method Description:
50 template<typename dtype>
52 {
53 inArray.reshape(inSize);
54 return inArray;
55 }
56
57 //============================================================================
58 // Method Description:
72 template<typename dtype>
73 NdArray<dtype>& reshape(NdArray<dtype>& inArray, int32 inNumRows, int32 inNumCols)
74 {
75 inArray.reshape(inNumRows, inNumCols);
76 return inArray;
77 }
78
79 //============================================================================
80 // Method Description:
93 template<typename dtype>
94 NdArray<dtype>& reshape(NdArray<dtype>& inArray, const Shape& inNewShape)
95 {
96 inArray.reshape(inNewShape);
97 return inArray;
98 }
99} // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
self_type & reshape(size_type inSize)
Definition: NdArrayCore.hpp:4271
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
Definition: Cartesian.hpp:40
std::int32_t int32
Definition: Types.hpp:36
NdArray< dtype > & reshape(NdArray< dtype > &inArray, uint32 inSize)
Definition: reshape.hpp:51
std::uint32_t uint32
Definition: Types.hpp:40