49 template<
typename dtype>
62 rowStart = inOffset * -1;
67 for (
uint32 row = rowStart; row < inN; ++row)
69 for (
uint32 col = 0; col < row + colStart + 1 - rowStart; ++col)
76 returnArray(row, col) = dtype{ 1 };
96 template<
typename dtype>
107 else if (inOffset < 0)
109 rowStart = inOffset * -1;
114 for (
uint32 row = rowStart; row < inN; ++row)
116 for (
uint32 col = 0; col < row + colStart + 1 - rowStart; ++col)
123 returnArray(row, col) = dtype{ 1 };
131 template<
typename dtype>
150 template<
typename dtype>
156 auto outArray = inArray.
copy();
174 template<
typename dtype>
188 else if (inOffset < 0)
190 rowStart = inOffset * -1;
195 for (
uint32 row = rowStart; row < inN; ++row)
197 for (
uint32 col = 0; col < row + colStart + 1 - rowStart; ++col)
204 returnArray(row, col) = dtype{ 0 };
223 template<
typename dtype>
247 template<
typename dtype>
253 auto outArray = inArray.
copy();
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition StaticAsserts.hpp:56
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
self_type & zeros() noexcept
Definition NdArrayCore.hpp:4981
self_type & ones() noexcept
Definition NdArrayCore.hpp:3567
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4591
self_type copy() const
Definition NdArrayCore.hpp:2562
self_type & putMask(const NdArray< bool > &inMask, const value_type &inValue)
Definition NdArrayCore.hpp:4215
A Shape Class for NdArrays.
Definition Core/shape.hpp:41
uint32 rows
Definition Core/shape.hpp:44
uint32 cols
Definition Core/shape.hpp:45
Definition Cartesian.hpp:40
NdArray< dtype > triu(uint32 inN, uint32 inM, int32 inOffset=0)
Definition tri.hpp:175
NdArray< dtype > tril(uint32 inN, int32 inOffset=0)
Definition tri.hpp:50
std::int32_t int32
Definition Types.hpp:36
std::uint32_t uint32
Definition Types.hpp:40