59 template<
typename dtype>
64 if (inStep > 0 && inStop < inStart)
69 if (inStep < 0 && inStop > inStart)
74 std::vector<dtype> values;
76 dtype theValue = inStart;
77 auto counter = dtype{ 1 };
81 while (theValue < inStop)
83 values.push_back(theValue);
84 theValue = inStart + inStep * counter++;
89 while (theValue > inStop)
91 values.push_back(theValue);
92 theValue = inStart + inStep * counter++;
118 template<
typename dtype>
126 return arange<dtype>(0, inStop, 1);
148 template<
typename dtype>
151 return arange<dtype>(inSlice.
start, inSlice.
stop, inSlice.
step);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
A Class for slicing into NdArrays.
Definition: Slice.hpp:44
int32 step
Definition: Slice.hpp:49
int32 start
Definition: Slice.hpp:47
int32 stop
Definition: Slice.hpp:48
Definition: Coordinate.hpp:45
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition: arange.hpp:60