SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
SGNDArray< T > Class Template Reference

Detailed Description

template<class T>
class shogun::SGNDArray< T >

shogun n-dimensional array

Definition at line 22 of file SGNDArray.h.

Public Member Functions

 SGNDArray ()
 SGNDArray (T *a, index_t *d, index_t nd, bool do_free_ndarray=false)
 SGNDArray (index_t *d, index_t nd, bool do_free_ndarray=false)
 SGNDArray (const SGNDArray &orig)
virtual ~SGNDArray ()
virtual void free_ndarray ()
virtual void destroy_ndarray ()
T * get_matrix (index_t matIdx) const
const T & operator[] (index_t index) const
T & operator[] (index_t index)
void transpose_matrix (index_t matIdx) const

Public Attributes

T * array
index_tdims
index_t num_dims
bool do_free

Constructor & Destructor Documentation

SGNDArray ( )

default constructor

Definition at line 26 of file SGNDArray.h.

SGNDArray ( T *  a,
index_t d,
index_t  nd,
bool  do_free_ndarray = false 
)

constructor for setting params

Definition at line 29 of file SGNDArray.h.

SGNDArray ( index_t d,
index_t  nd,
bool  do_free_ndarray = false 
)

constructor to create new ndarray in memory

Definition at line 33 of file SGNDArray.h.

SGNDArray ( const SGNDArray< T > &  orig)

copy constructor

Definition at line 43 of file SGNDArray.h.

virtual ~SGNDArray ( )
virtual

empty destructor

Definition at line 48 of file SGNDArray.h.

Member Function Documentation

virtual void destroy_ndarray ( )
virtual

destroy ndarray

Definition at line 67 of file SGNDArray.h.

virtual void free_ndarray ( )
virtual

free ndarray

Definition at line 53 of file SGNDArray.h.

T* get_matrix ( index_t  matIdx) const

get a matrix formed by the two first dimensions

Parameters
matIdxmatrix index
Returns
pointer to the matrix

Definition at line 78 of file SGNDArray.h.

const T& operator[] ( index_t  index) const

operator overload for ndarray read only access

Parameters
indexto access

Definition at line 88 of file SGNDArray.h.

T& operator[] ( index_t  index)

operator overload for ndarray r/w access

Parameters
indexto access

Definition at line 97 of file SGNDArray.h.

void transpose_matrix ( index_t  matIdx) const

transposes a matrix formed by the two first dimensions

Parameters
matIdxmatrix index

Definition at line 106 of file SGNDArray.h.

Member Data Documentation

T* array

array

Definition at line 130 of file SGNDArray.h.

index_t* dims

dimension sizes

Definition at line 132 of file SGNDArray.h.

bool do_free

whether ndarry needs to be freed

Definition at line 136 of file SGNDArray.h.

index_t num_dims

number of dimensions

Definition at line 134 of file SGNDArray.h.


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

SHOGUN Machine Learning Toolbox - Documentation