NumCpp  2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
diag.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include "NumCpp/Core/Types.hpp"
33#include "NumCpp/NdArray.hpp"
34
35namespace nc
36{
37 //============================================================================
38 // Method Description:
50 template<typename dtype>
52 {
53 if (inArray.isflat())
54 {
55 return diagflat(inArray, k);
56 }
57
58 return diagonal(inArray, k, Axis::ROW);
59 }
60} // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
Definition Cartesian.hpp:40
NdArray< dtype > diagonal(const NdArray< dtype > &inArray, int32 inOffset=0, Axis inAxis=Axis::ROW)
Definition diagonal.hpp:47
NdArray< dtype > diag(const NdArray< dtype > &inArray, int32 k=0)
Definition diag.hpp:51
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
NdArray< dtype > diagflat(const NdArray< dtype > &inArray, int32 k=0)
Definition diagflat.hpp:51
std::int32_t int32
Definition Types.hpp:36