102 return start == inOtherSlice.start &&
stop == inOtherSlice.stop &&
step == inOtherSlice.step;
114 return !(*
this == inOtherSlice);
122 [[nodiscard]] std::string
str()
const
149 if (
start >
static_cast<int32>(inArraySize - 1))
159 if (
stop >
static_cast<int32>(inArraySize))
216 std::vector<uint32> indices;
220 indices.push_back(
static_cast<uint32>(i));
235 inOStream << inSlice.
str();
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
A Class for slicing into NdArrays.
Definition: Slice.hpp:45
int32 step
Definition: Slice.hpp:50
void print() const
Definition: Slice.hpp:132
std::vector< uint32 > toIndices(uint32 inArrayDimSize)
Definition: Slice.hpp:214
int32 start
Definition: Slice.hpp:48
void makePositiveAndValidate(uint32 inArraySize)
Definition: Slice.hpp:142
bool operator==(const Slice &inOtherSlice) const noexcept
Definition: Slice.hpp:100
friend std::ostream & operator<<(std::ostream &inOStream, const Slice &inSlice)
Definition: Slice.hpp:233
constexpr Slice(int32 inStart, int32 inStop, int32 inStep) noexcept
Definition: Slice.hpp:86
constexpr Slice(int32 inStop) noexcept
Definition: Slice.hpp:62
uint32 numElements(uint32 inArraySize)
Definition: Slice.hpp:195
constexpr Slice(int32 inStart, int32 inStop) noexcept
Definition: Slice.hpp:73
int32 stop
Definition: Slice.hpp:49
constexpr Slice()=default
std::string str() const
Definition: Slice.hpp:122
bool operator!=(const Slice &inOtherSlice) const noexcept
Definition: Slice.hpp:112
std::string num2str(dtype inNumber)
Definition: num2str.hpp:44
Definition: Cartesian.hpp:40
void swap(NdArray< dtype > &inArray1, NdArray< dtype > &inArray2) noexcept
Definition: swap.hpp:42
std::int32_t int32
Definition: Types.hpp:36
std::uint32_t uint32
Definition: Types.hpp:40