58 template<
typename dtype>
74 if (inStop <= inStart)
88 returnArray.
front() = inStart;
89 returnArray.
back() = inStop;
91 dtype step = (inStop - inStart) /
static_cast<dtype
>(inNum - 1);
93 for (
uint32 i = 1; i < inNum - 1; ++i)
95 returnArray[i] = inStart +
static_cast<dtype
>(i) * step;
103 dtype step = (inStop - inStart) / (inNum);
109 returnArray.
front() = inStart;
111 dtype step = (inStop - inStart) /
static_cast<dtype
>(inNum);
113 for (
uint32 i = 1; i < inNum; ++i)
115 returnArray[i] = inStart +
static_cast<dtype
>(i) * step;
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:135
const_reference back() const noexcept
Definition NdArrayCore.hpp:2359
const_reference front() const noexcept
Definition NdArrayCore.hpp:2936
Definition Cartesian.hpp:39
NdArray< dtype > linspace(dtype inStart, dtype inStop, uint32 inNum=50, EndPoint endPoint=EndPoint::YES)
Definition linspace.hpp:59
std::uint32_t uint32
Definition Types.hpp:40
EndPoint
End Point boolean.
Definition Enums.hpp:74
@ YES
Definition Enums.hpp:75