45 template<
typename dtype>
109 return cube_.begin();
119 return cube_.cbegin();
129 return cube_.cbegin();
140 if (!f.has_extension())
142 f.replace_extension(
"bin");
145 std::ofstream
ofile(f.c_str(), std::ios::binary);
166 return cube_.empty();
206 return cube_.front();
216 return elementShape_;
226 return static_cast<uint32>(cube_.size());
246 if (elementShape_.
rows == 0 && elementShape_.
cols == 0)
543 if (numElements >
sizeZ())
613 if (numElements >
sizeZ())
630 auto numRows =
inRow.numElements(elementShape_.
rows);
631 if (numRows > elementShape_.
rows)
659 auto numRows =
inRow.numElements(elementShape_.
rows);
660 if (numRows > elementShape_.
rows)
676 if (numElements >
sizeZ())
693 auto numCols =
inCol.numElements(elementShape_.
cols);
694 if (numCols > elementShape_.
cols)
722 auto numCols =
inCol.numElements(elementShape_.
cols);
723 if (numCols > elementShape_.
cols)
739 if (numElements >
sizeZ())
756 if (
inRow.numElements(elementShape_.
rows) > elementShape_.
rows)
761 if (
inCol.numElements(elementShape_.
cols) > elementShape_.
cols)
779 if (
inRow.numElements(elementShape_.
rows) > elementShape_.
rows)
784 if (
inCol.numElements(elementShape_.
cols) > elementShape_.
cols)
790 if (numElements >
sizeZ())
824 std::vector<NdArray<dtype>> cube_{};
825 Shape elementShape_{ 0, 0 };
#define THROW_RUNTIME_ERROR(msg)
Definition Error.hpp:40
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
Convenience container for holding a uniform array of NdArrays.
Definition DataCube.hpp:47
void push_back(const NdArray< dtype > &inArray)
Definition DataCube.hpp:242
typename std::deque< NdArray< dtype > >::const_iterator const_iterator
Definition DataCube.hpp:51
NdArray< dtype > sliceZAll(int32 inIndex) const
Definition DataCube.hpp:267
iterator begin() noexcept
Definition DataCube.hpp:107
const NdArray< dtype > & at(uint32 inIndex) const
Definition DataCube.hpp:87
NdArray< dtype > & at(uint32 inIndex)
Definition DataCube.hpp:75
NdArray< dtype > & operator[](uint32 inIndex) noexcept
Definition DataCube.hpp:805
NdArray< dtype > sliceZ(int32 inRow, int32 inCol, Slice inSliceZ) const
Definition DataCube.hpp:346
DataCube< dtype > sliceZat(Slice inRow, Slice inCol, Slice inSliceZ) const
Definition DataCube.hpp:777
typename std::deque< NdArray< dtype > >::iterator iterator
Definition DataCube.hpp:50
NdArray< dtype > sliceZAllat(Slice inRow, int32 inCol) const
Definition DataCube.hpp:628
uint32 sizeZ() const noexcept
Definition DataCube.hpp:224
NdArray< dtype > sliceZAll(Slice inRow, int32 inCol) const
Definition DataCube.hpp:376
DataCube< dtype > sliceZ(Slice inRow, Slice inCol, Slice inSliceZ) const
Definition DataCube.hpp:491
NdArray< dtype > sliceZat(Slice inRow, int32 inCol, Slice inSliceZ) const
Definition DataCube.hpp:657
DataCube(uint32 inSize)
Definition DataCube.hpp:63
DataCube< dtype > sliceZAll(Slice inRow, Slice inCol) const
Definition DataCube.hpp:472
void pop_back() noexcept
Definition DataCube.hpp:232
NdArray< dtype > sliceZAllat(int32 inRow, Slice inCol) const
Definition DataCube.hpp:691
NdArray< dtype > sliceZat(int32 inIndex, Slice inSliceZ) const
Definition DataCube.hpp:530
const Shape & shape() const noexcept
Definition DataCube.hpp:214
NdArray< dtype > sliceZAll(int32 inRow, int32 inCol) const
Definition DataCube.hpp:316
iterator end() noexcept
Definition DataCube.hpp:174
NdArray< dtype > & front() noexcept
Definition DataCube.hpp:204
NdArray< dtype > sliceZAllat(int32 inIndex) const
Definition DataCube.hpp:508
NdArray< dtype > & back() noexcept
Definition DataCube.hpp:97
const NdArray< dtype > & operator[](uint32 inIndex) const noexcept
Definition DataCube.hpp:817
void dump(const std::string &inFilename) const
Definition DataCube.hpp:137
bool isempty() noexcept
Definition DataCube.hpp:164
const_iterator cend() const noexcept
Definition DataCube.hpp:194
const_iterator end() const noexcept
Definition DataCube.hpp:184
NdArray< dtype > sliceZAllat(int32 inRow, int32 inCol) const
Definition DataCube.hpp:558
const_iterator begin() const noexcept
Definition DataCube.hpp:117
const_iterator cbegin() const noexcept
Definition DataCube.hpp:127
NdArray< dtype > sliceZAll(int32 inRow, Slice inCol) const
Definition DataCube.hpp:424
NdArray< dtype > sliceZ(Slice inRow, int32 inCol, Slice inSliceZ) const
Definition DataCube.hpp:400
NdArray< dtype > sliceZ(int32 inIndex, Slice inSliceZ) const
Definition DataCube.hpp:291
NdArray< dtype > sliceZ(int32 inRow, Slice inCol, Slice inSliceZ) const
Definition DataCube.hpp:448
NdArray< dtype > sliceZat(int32 inRow, Slice inCol, Slice inSliceZ) const
Definition DataCube.hpp:720
DataCube< dtype > sliceZAllat(Slice inRow, Slice inCol) const
Definition DataCube.hpp:754
NdArray< dtype > sliceZat(int32 inRow, int32 inCol, Slice inSliceZ) const
Definition DataCube.hpp:591
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
A Shape Class for NdArrays.
Definition Core/shape.hpp:41
uint32 rows
Definition Core/shape.hpp:44
uint32 cols
Definition Core/shape.hpp:45
uint32 size() const noexcept
Definition Core/shape.hpp:104
A Class for slicing into NdArrays.
Definition Slice.hpp:45
Definition Cartesian.hpp:40
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
std::int32_t int32
Definition Types.hpp:36
std::uint32_t uint32
Definition Types.hpp:40