11 #ifndef CUBBYFLOW_ARRAY_BASE_HPP 12 #define CUBBYFLOW_ARRAY_BASE_HPP 18 template <
typename T,
size_t N,
typename DerivedArray>
31 [[nodiscard]]
size_t Index(
size_t i)
const;
33 template <
typename... Args>
34 [[nodiscard]]
size_t Index(
size_t i, Args... args)
const;
36 template <
size_t... I>
45 template <
size_t M = N>
46 std::enable_if_t<(M > 0),
size_t>
Width()
const;
48 template <
size_t M = N>
49 std::enable_if_t<(M > 1),
size_t>
Height()
const;
51 template <
size_t M = N>
52 std::enable_if_t<(M > 2),
size_t>
Depth()
const;
54 [[nodiscard]]
bool IsEmpty()
const;
56 [[nodiscard]]
size_t Length()
const;
78 template <
typename... Args>
81 template <
typename... Args>
92 template <
typename... Args>
95 template <
typename... Args>
115 template <
typename... Args>
128 template <
typename... Args>
129 [[nodiscard]]
size_t IndexInternal(
size_t d,
size_t i, Args... args)
const;
131 [[nodiscard]]
size_t IndexInternal(
size_t,
size_t i)
const;
133 template <
size_t... I>
135 std::index_sequence<I...>)
const;
T ValueType
Definition: ArrayBase.hpp:23
Reference operator[](size_t i)
Definition: ArrayBase-Impl.hpp:176
void SwapPtrAndSize(ArrayBase &other)
Definition: ArrayBase-Impl.hpp:269
ArrayBase & operator=(const ArrayBase &other)
Definition: ArrayBase-Impl.hpp:232
std::enable_if_t<(M > 2), size_t > Depth() const
void ClearPtrAndSize()
Definition: ArrayBase-Impl.hpp:263
virtual ~ArrayBase()=default
Definition: ArrayBase.hpp:19
Iterator end()
Definition: ArrayBase-Impl.hpp:102
Pointer m_ptr
Definition: ArrayBase.hpp:124
T & Reference
Definition: ArrayBase.hpp:24
Vector< size_t, N > m_size
Definition: ArrayBase.hpp:125
const T & ConstReference
Definition: ArrayBase.hpp:25
Definition: Matrix.hpp:27
const T * ConstPointer
Definition: ArrayBase.hpp:27
Definition: pybind11Utils.hpp:20
std::enable_if_t<(M > 1), size_t > Height() const
Iterator begin()
Definition: ArrayBase-Impl.hpp:90
size_t Length() const
Definition: ArrayBase-Impl.hpp:84
std::enable_if_t<(M > 0), size_t > Width() const
Generic N-dimensional array class interface.
Definition: Array.hpp:32
Reference operator()(size_t i, Args... args)
Iterator rbegin()
Definition: ArrayBase-Impl.hpp:114
Pointer data()
Definition: ArrayBase-Impl.hpp:39
ArrayBase()
Definition: ArrayBase-Impl.hpp:214
bool IsEmpty() const
Definition: ArrayBase-Impl.hpp:78
const T * ConstIterator
Definition: ArrayBase.hpp:29
const Vector< size_t, N > & Size() const
Definition: ArrayBase-Impl.hpp:51
size_t Index(size_t i) const
Definition: ArrayBase-Impl.hpp:17
Iterator rend()
Definition: ArrayBase-Impl.hpp:126
T * Pointer
Definition: ArrayBase.hpp:26
Reference At(size_t i)
Definition: ArrayBase-Impl.hpp:138
T * Iterator
Definition: ArrayBase.hpp:28
void SetPtrAndSize(Pointer ptr, size_t ni, Args... args)
Definition: ArrayBase-Impl.hpp:250