NumCpp  1.0
A 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
 
iterator begin () noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
void dump (const std::string &inFilename) const
 
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 pop_front () noexcept
 
void push_back (const NdArray< dtype > &inArray)
 
void push_front (const NdArray< dtype > &inArray)
 
const Shapeshape () const noexcept
 
uint32 size () const noexcept
 

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)
inline

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

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

Parameters
inIndex
Returns
NdArray

◆ back()

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

Returns a reference to the last element of the array

Returns
NdArray&

◆ begin()

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

Returns an iterator to the beginning of the container

Returns
iterator

◆ cbegin()

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

Returns a const_iterator to the beginning of the container

Returns
const_iterator

◆ cend()

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

Returns a const_iterator to 1 past the end of the container

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()

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

Returns an iterator to 1 past the end of the container

Returns
iterator

◆ front()

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

returns a reference to the first element of the array

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

Parameters
inIndex
Returns
NdArray

◆ operator[]() [2/2]

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

Access operator, no bounds checking

Parameters
inIndex
Returns
NdArray

◆ pop_back()

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

Removes the last element in the container

◆ pop_front()

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

Removes the first element in the container

◆ push_back()

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

Adds a new element at the end of the container

Parameters
inArray

◆ push_front()

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

Adds a new element at the beginning of the container

Parameters
inArray

◆ shape()

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

returns the number shape of the element arrays

Returns
Shape

◆ size()

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

Returns the size of the container array

Returns
size

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