NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::DataCube< dtype > Class Template Reference

Convenience container for holding a uniform array of NdArrays. More...

#include <DataCube.hpp>

Public Types

using const_iterator = typename std::deque< NdArray< dtype > >::const_iterator
 
using iterator = typename std::deque< NdArray< dtype > >::iterator
 

Public Member Functions

 DataCube ()=default
 
 DataCube (uint32 inSize)
 
NdArray< dtype > & at (uint32 inIndex)
 
const NdArray< dtype > & at (uint32 inIndex) const
 
NdArray< dtype > & back () noexcept
 
const_iterator begin () const noexcept
 
iterator begin () noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
void dump (const std::string &inFilename) const
 
const_iterator end () const noexcept
 
iterator end () noexcept
 
NdArray< dtype > & front () noexcept
 
bool isempty () noexcept
 
const NdArray< dtype > & operator[] (uint32 inIndex) const noexcept
 
NdArray< dtype > & operator[] (uint32 inIndex) noexcept
 
void pop_back () noexcept
 
void push_back (const NdArray< dtype > &inArray)
 
const Shapeshape () const noexcept
 
uint32 sizeZ () const noexcept
 
NdArray< dtype > sliceZ (int32 inIndex, Slice inSliceZ) const
 
NdArray< dtype > sliceZ (int32 inRow, int32 inCol, Slice inSliceZ) const
 
NdArray< dtype > sliceZ (int32 inRow, Slice inCol, Slice inSliceZ) const
 
NdArray< dtype > sliceZ (Slice inRow, int32 inCol, Slice inSliceZ) const
 
DataCube< dtype > sliceZ (Slice inRow, Slice inCol, Slice inSliceZ) const
 
NdArray< dtype > sliceZAll (int32 inIndex) const
 
NdArray< dtype > sliceZAll (int32 inRow, int32 inCol) const
 
NdArray< dtype > sliceZAll (int32 inRow, Slice inCol) const
 
NdArray< dtype > sliceZAll (Slice inRow, int32 inCol) const
 
DataCube< dtype > sliceZAll (Slice inRow, Slice inCol) const
 
NdArray< dtype > sliceZAllat (int32 inIndex) const
 
NdArray< dtype > sliceZAllat (int32 inRow, int32 inCol) const
 
NdArray< dtype > sliceZAllat (int32 inRow, Slice inCol) const
 
NdArray< dtype > sliceZAllat (Slice inRow, int32 inCol) const
 
DataCube< dtype > sliceZAllat (Slice inRow, Slice inCol) const
 
NdArray< dtype > sliceZat (int32 inIndex, Slice inSliceZ) const
 
NdArray< dtype > sliceZat (int32 inRow, int32 inCol, Slice inSliceZ) const
 
NdArray< dtype > sliceZat (int32 inRow, Slice inCol, Slice inSliceZ) const
 
NdArray< dtype > sliceZat (Slice inRow, int32 inCol, Slice inSliceZ) const
 
DataCube< dtype > sliceZat (Slice inRow, Slice inCol, Slice inSliceZ) const
 

Detailed Description

template<typename dtype>
class nc::DataCube< dtype >

Convenience container for holding a uniform array of NdArrays.

Member Typedef Documentation

◆ const_iterator

template<typename dtype >
using nc::DataCube< dtype >::const_iterator = typename std::deque<NdArray<dtype> >::const_iterator

◆ iterator

template<typename dtype >
using nc::DataCube< dtype >::iterator = typename std::deque<NdArray<dtype> >::iterator

Constructor & Destructor Documentation

◆ DataCube() [1/2]

template<typename dtype >
nc::DataCube< dtype >::DataCube ( )
default

Default Constructor

◆ DataCube() [2/2]

template<typename dtype >
nc::DataCube< dtype >::DataCube ( uint32  inSize)
inlineexplicit

Constructor, preallocates to the input size

Parameters
inSize

Member Function Documentation

◆ at() [1/2]

template<typename dtype >
NdArray< dtype > & nc::DataCube< dtype >::at ( uint32  inIndex)
inline

Access method, with bounds checking. Returns the 2d z "slice" element of the cube.

Parameters
inIndex
Returns
NdArray

◆ at() [2/2]

template<typename dtype >
const NdArray< dtype > & nc::DataCube< dtype >::at ( uint32  inIndex) const
inline

Const access method, with bounds checking. Returns the 2d z "slice" element of the cube.

Parameters
inIndex
Returns
NdArray

◆ back()

template<typename dtype >
NdArray< dtype > & nc::DataCube< dtype >::back ( )
inlinenoexcept

Returns a reference to the last 2d "slice" of the cube in the z-axis

Returns
NdArray&

◆ begin() [1/2]

template<typename dtype >
const_iterator nc::DataCube< dtype >::begin ( ) const
inlinenoexcept

Returns an const_iterator to the first 2d z "slice" of the cube.

Returns
const_iterator

◆ begin() [2/2]

template<typename dtype >
iterator nc::DataCube< dtype >::begin ( )
inlinenoexcept

Returns an iterator to the first 2d z "slice" of the cube.

Returns
iterator

◆ cbegin()

template<typename dtype >
const_iterator nc::DataCube< dtype >::cbegin ( ) const
inlinenoexcept

Returns an const_iterator to the first 2d z "slice" of the cube.

Returns
const_iterator

◆ cend()

template<typename dtype >
const_iterator nc::DataCube< dtype >::cend ( ) const
inlinenoexcept

Returns an const_iterator to 1 past the last 2d z "slice" of the cube.

Returns
const_iterator

◆ dump()

template<typename dtype >
void nc::DataCube< dtype >::dump ( const std::string &  inFilename) const
inline

Outputs the DataCube as a .bin file

Parameters
inFilename

◆ end() [1/2]

template<typename dtype >
const_iterator nc::DataCube< dtype >::end ( ) const
inlinenoexcept

Returns an const_iterator to 1 past the last 2d z "slice" of the cube.

Returns
const_iterator

◆ end() [2/2]

template<typename dtype >
iterator nc::DataCube< dtype >::end ( )
inlinenoexcept

Returns an iterator to 1 past the last 2d z "slice" of the cube.

Returns
iterator

◆ front()

template<typename dtype >
NdArray< dtype > & nc::DataCube< dtype >::front ( )
inlinenoexcept

Returns a reference to the front 2d "slice" of the cube in the z-axis

Returns
NdArray&

◆ isempty()

template<typename dtype >
bool nc::DataCube< dtype >::isempty ( )
inlinenoexcept

Tests whether or not the container is empty

Returns
bool

◆ operator[]() [1/2]

template<typename dtype >
const NdArray< dtype > & nc::DataCube< dtype >::operator[] ( uint32  inIndex) const
inlinenoexcept

Const access operator, no bounds checking. Returns the 2d z "slice" element of the cube.

Parameters
inIndex
Returns
NdArray

◆ operator[]() [2/2]

template<typename dtype >
NdArray< dtype > & nc::DataCube< dtype >::operator[] ( uint32  inIndex)
inlinenoexcept

Access operator, no bounds checking. Returns the 2d z "slice" element of the cube.

Parameters
inIndex
Returns
NdArray

◆ pop_back()

template<typename dtype >
void nc::DataCube< dtype >::pop_back ( )
inlinenoexcept

Removes the last z "slice" of the cube

◆ push_back()

template<typename dtype >
void nc::DataCube< dtype >::push_back ( const NdArray< dtype > &  inArray)
inline

Adds a new z "slice" to the end of the cube

Parameters
inArray

◆ shape()

template<typename dtype >
const Shape & nc::DataCube< dtype >::shape ( ) const
inlinenoexcept

Returns the x/y shape of the cube

Returns
Shape

◆ sizeZ()

template<typename dtype >
uint32 nc::DataCube< dtype >::sizeZ ( ) const
inlinenoexcept

Returns the size of the z-axis of the cube

Returns
size

◆ sliceZ() [1/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZ ( int32  inIndex,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube

Parameters
inIndexthe flattend 2d index (row, col) to slice
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZ() [2/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZ ( int32  inRow,
int32  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZ() [3/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZ ( int32  inRow,
Slice  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZ() [4/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZ ( Slice  inRow,
int32  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZ() [5/5]

template<typename dtype >
DataCube< dtype > nc::DataCube< dtype >::sliceZ ( Slice  inRow,
Slice  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
DataCube

◆ sliceZAll() [1/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAll ( int32  inIndex) const
inline

Slices the z dimension of the cube

Parameters
inIndexthe flattend 2d index (row, col) to slice
Returns
NdArray

◆ sliceZAll() [2/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAll ( int32  inRow,
int32  inCol 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
Returns
NdArray

◆ sliceZAll() [3/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAll ( int32  inRow,
Slice  inCol 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
Returns
NdArray

◆ sliceZAll() [4/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAll ( Slice  inRow,
int32  inCol 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
Returns
NdArray

◆ sliceZAll() [5/5]

template<typename dtype >
DataCube< dtype > nc::DataCube< dtype >::sliceZAll ( Slice  inRow,
Slice  inCol 
) const
inline

Slices the z dimension of the cube with NO bounds checking

Parameters
inRow
inCol
Returns
DataCube

◆ sliceZAllat() [1/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAllat ( int32  inIndex) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inIndexthe flattend 2d index (row, col) to slice
Returns
NdArray

◆ sliceZAllat() [2/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAllat ( int32  inRow,
int32  inCol 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
Returns
NdArray

◆ sliceZAllat() [3/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAllat ( int32  inRow,
Slice  inCol 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
Returns
NdArray

◆ sliceZAllat() [4/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZAllat ( Slice  inRow,
int32  inCol 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
Returns
NdArray

◆ sliceZAllat() [5/5]

template<typename dtype >
DataCube< dtype > nc::DataCube< dtype >::sliceZAllat ( Slice  inRow,
Slice  inCol 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
Returns
DataCube

◆ sliceZat() [1/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZat ( int32  inIndex,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inIndexthe flattend 2d index (row, col) to slice
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZat() [2/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZat ( int32  inRow,
int32  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZat() [3/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZat ( int32  inRow,
Slice  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZat() [4/5]

template<typename dtype >
NdArray< dtype > nc::DataCube< dtype >::sliceZat ( Slice  inRow,
int32  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
NdArray

◆ sliceZat() [5/5]

template<typename dtype >
DataCube< dtype > nc::DataCube< dtype >::sliceZat ( Slice  inRow,
Slice  inCol,
Slice  inSliceZ 
) const
inline

Slices the z dimension of the cube with bounds checking

Parameters
inRow
inCol
inSliceZthe slice dimensions of the z-axis
Returns
DataCube

The documentation for this class was generated from the following file: