NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
NeuralEngine::Array4< T > Class Template Reference

The Array4 class represents a 4-dimensional array that minimizes the number of new and delete calls. The T objects are stored in a contiguous array.
More...

#include <NeArray4.h>

Collaboration diagram for NeuralEngine::Array4< T >:

Public Member Functions

 Array4 (size_t bound0, size_t bound1, size_t bound2, size_t bound3)
 Constructor. More...
 
 Array4 (size_t bound0, size_t bound1, size_t bound2, size_t bound3, T *objects)
 Constructor. More...
 
 Array4 ()
 Default constructor. More...
 
 Array4 (Array4 const &)
 
Array4operator= (Array4 const &)
 
 Array4 (Array4 &&)
 
Array4operator= (Array4 &&)
 
size_t GetBound0 () const
 
size_t GetBound1 () const
 
size_t GetBound2 () const
 
size_t GetBound3 () const
 
T **const * operator[] (int cuboid) const
 
T *** operator[] (int cuboid)
 

Private Member Functions

void SetPointers (T *objects)
 
void SetPointers (Array4 const &other)
 

Private Attributes

size_t mBound0
 
size_t mBound1
 
size_t mBound2
 
size_t mBound3
 
std::vector< T > mObjects
 
std::vector< T * > mIndirect1
 
std::vector< T ** > mIndirect2
 
std::vector< T *** > mIndirect3
 

Detailed Description

template<typename T>
class NeuralEngine::Array4< T >

The Array4 class represents a 4-dimensional array that minimizes the number of new and delete calls. The T objects are stored in a contiguous array.

Hmetal T, 04.08.2016.

Definition at line 30 of file NeArray4.h.

Constructor & Destructor Documentation

◆ Array4() [1/3]

template<typename T >
Array4::Array4 ( size_t  bound0,
size_t  bound1,
size_t  bound2,
size_t  bound3 
)

Constructor.

<note> The first constructor generates an array of objects that are owned by Array4. The array has bound0 columns, bound1 rows, bound2 slices, and bound3 cuboids. </note>

Hmetal T, 04.08.2016.

Parameters
bound0The bound 0.
bound1The first bound.
bound2The second bound.
bound3The third bound.

File: NECore/DataTypes/NeArray4.inl

Author:
Email:
Site:

Copyright (c) 2016 . All rights reserved.

Definition at line 12 of file NeArray4.inl.

◆ Array4() [2/3]

template<typename T >
Array4::Array4 ( size_t  bound0,
size_t  bound1,
size_t  bound2,
size_t  bound3,
T *  objects 
)

Constructor.

<note> The second constructor is given an array of objects that are owned by the caller. The array has bound0 columns, bound1 rows, bound2 slices, and bound3 cuboids. </note>

Hmetal T, 04.08.2016.

Parameters
bound0The bound 0.
bound1The first bound.
bound2The second bound.
bound3The third bound.
objects[in,out] If non-null, the objects.

Definition at line 27 of file NeArray4.inl.

◆ Array4() [3/3]

template<typename T >
Array4::Array4 ( )

Default constructor.

<note> Support for dynamic resizing, copying, or moving. If 'other' does not own the original 'objects', they are not copied by the assignment operator. </note>

Hmetal T, 04.08.2016.

Definition at line 41 of file NeArray4.inl.

Member Function Documentation

◆ GetBound0()

template<typename T >
size_t Array4::GetBound0 ( ) const
inline

Definition at line 81 of file NeArray4.inl.

◆ GetBound1()

template<typename T >
size_t Array4::GetBound1 ( ) const
inline

Definition at line 87 of file NeArray4.inl.

◆ GetBound2()

template<typename T >
size_t Array4::GetBound2 ( ) const
inline

Definition at line 93 of file NeArray4.inl.

◆ GetBound3()

template<typename T >
size_t Array4::GetBound3 ( ) const
inline

Definition at line 99 of file NeArray4.inl.

◆ operator[]() [1/2]

template<typename T >
T **const * Array4::operator[] ( int  cuboid) const
inline

Definition at line 105 of file NeArray4.inl.

◆ operator[]() [2/2]

template<typename T >
T *** Array4::operator[] ( int  cuboid)
inline

Definition at line 111 of file NeArray4.inl.

◆ SetPointers() [1/2]

template<typename T >
void Array4::SetPointers ( T *  objects)
private

Definition at line 117 of file NeArray4.inl.

◆ SetPointers() [2/2]

template<typename T >
void Array4::SetPointers ( Array4< T > const &  other)
private

Definition at line 137 of file NeArray4.inl.

Member Data Documentation

◆ mBound0

template<typename T >
size_t NeuralEngine::Array4< T >::mBound0
private

Definition at line 106 of file NeArray4.h.

◆ mBound1

template<typename T >
size_t NeuralEngine::Array4< T >::mBound1
private

Definition at line 106 of file NeArray4.h.

◆ mBound2

template<typename T >
size_t NeuralEngine::Array4< T >::mBound2
private

Definition at line 106 of file NeArray4.h.

◆ mBound3

template<typename T >
size_t NeuralEngine::Array4< T >::mBound3
private

Definition at line 106 of file NeArray4.h.

◆ mObjects

template<typename T >
std::vector<T> NeuralEngine::Array4< T >::mObjects
private

Definition at line 107 of file NeArray4.h.

◆ mIndirect1

template<typename T >
std::vector<T*> NeuralEngine::Array4< T >::mIndirect1
private

Definition at line 108 of file NeArray4.h.

◆ mIndirect2

template<typename T >
std::vector<T**> NeuralEngine::Array4< T >::mIndirect2
private

Definition at line 109 of file NeArray4.h.

◆ mIndirect3

template<typename T >
std::vector<T***> NeuralEngine::Array4< T >::mIndirect3
private

Definition at line 110 of file NeArray4.h.


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