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

Detailed Description

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

shogun n-dimensional array

Definition at line 23 of file SGNDArray.h.

Inheritance diagram for SGNDArray< T >:
Inheritance graph
[legend]

Public Member Functions

 SGNDArray ()
 SGNDArray (T *a, index_t *d, index_t nd, bool ref_counting=true)
 SGNDArray (index_t *d, index_t nd, bool ref_counting=true)
 SGNDArray (const SGNDArray &orig)
virtual ~SGNDArray ()
T * get_matrix (index_t matIdx) const
void transpose_matrix (index_t matIdx) const
const T & operator[] (index_t index) const
T & operator[] (index_t index)
int32_t ref_count ()

Public Attributes

T * array
index_tdims
index_t num_dims

Protected Member Functions

virtual void copy_data (const SGReferencedData &orig)
virtual void init_data ()
virtual void free_data ()
void copy_refcount (const SGReferencedData &orig)
int32_t ref ()
int32_t unref ()

Constructor & Destructor Documentation

SGNDArray ( )

default constructor

Definition at line 20 of file SGNDArray.cpp.

SGNDArray ( T *  a,
index_t d,
index_t  nd,
bool  ref_counting = true 
)

constructor for setting params

Definition at line 26 of file SGNDArray.cpp.

SGNDArray ( index_t d,
index_t  nd,
bool  ref_counting = true 
)

constructor to create new ndarray in memory

Definition at line 34 of file SGNDArray.cpp.

SGNDArray ( const SGNDArray< T > &  orig)

copy constructor

Definition at line 44 of file SGNDArray.cpp.

~SGNDArray ( )
virtual

empty destructor

Definition at line 50 of file SGNDArray.cpp.

Member Function Documentation

void copy_data ( const SGReferencedData orig)
protectedvirtual

copy data

Implements SGReferencedData.

Definition at line 55 of file SGNDArray.cpp.

void copy_refcount ( const SGReferencedData orig)
protectedinherited

copy refcount

Definition at line 58 of file SGReferencedData.cpp.

void free_data ( )
protectedvirtual

free data

Implements SGReferencedData.

Definition at line 69 of file SGNDArray.cpp.

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 46 of file SGNDArray.h.

void init_data ( )
protectedvirtual

init data

Implements SGReferencedData.

Definition at line 62 of file SGNDArray.cpp.

const T& operator[] ( index_t  index) const

operator overload for ndarray read only access

Parameters
indexto access

Definition at line 62 of file SGNDArray.h.

T& operator[] ( index_t  index)

operator overload for ndarray r/w access

Parameters
indexto access

Definition at line 71 of file SGNDArray.h.

int32_t ref ( )
protectedinherited

increase reference counter

Returns
reference count

Definition at line 67 of file SGReferencedData.cpp.

int32_t ref_count ( )
inherited

display reference counter

Returns
reference count

Definition at line 44 of file SGReferencedData.cpp.

void transpose_matrix ( index_t  matIdx) const

transposes a matrix formed by the two first dimensions

Parameters
matIdxmatrix index

Definition at line 79 of file SGNDArray.cpp.

int32_t unref ( )
protectedinherited

decrement reference counter and deallocate object if refcount is zero before or after decrementing it

Returns
reference count

Definition at line 87 of file SGReferencedData.cpp.

Member Data Documentation

T* array

array

Definition at line 90 of file SGNDArray.h.

index_t* dims

dimension sizes

Definition at line 93 of file SGNDArray.h.

index_t num_dims

number of dimensions

Definition at line 96 of file SGNDArray.h.


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

SHOGUN Machine Learning Toolbox - Documentation