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
identity.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include "NumCpp/NdArray.hpp"
31
32namespace nc
33{
34 //============================================================================
35 // Method Description:
46 template<typename dtype>
48 {
50 returnArray.zeros();
51 for (uint32 i = 0; i < inSquareSize; ++i)
52 {
53 returnArray(i, i) = dtype{ 1 };
54 }
55
56 return returnArray;
57 }
58} // 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 > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
NdArray< dtype > identity(uint32 inSquareSize)
Definition identity.hpp:47
std::uint32_t uint32
Definition Types.hpp:40