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]

List of all members.

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 19 of file SGNDArray.cpp.

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

constructor for setting params

Definition at line 25 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 33 of file SGNDArray.cpp.

SGNDArray ( const SGNDArray< T > &  orig  ) 

copy constructor

Definition at line 43 of file SGNDArray.cpp.

~SGNDArray (  )  [virtual]

empty destructor

Definition at line 49 of file SGNDArray.cpp.


Member Function Documentation

void copy_data ( const SGReferencedData orig  )  [protected, virtual]

copy data

Implements SGReferencedData.

Definition at line 54 of file SGNDArray.cpp.

void copy_refcount ( const SGReferencedData orig  )  [protected, inherited]

copy refcount

Definition at line 102 of file SGReferencedData.h.

void free_data (  )  [protected, virtual]

free data

Implements SGReferencedData.

Definition at line 68 of file SGNDArray.cpp.

T* get_matrix ( index_t  matIdx  )  const

get a matrix formed by the two first dimensions

Parameters:
matIdx matrix index
Returns:
pointer to the matrix

Definition at line 46 of file SGNDArray.h.

void init_data (  )  [protected, virtual]

init data

Implements SGReferencedData.

Definition at line 61 of file SGNDArray.cpp.

T& operator[] ( index_t  index  ) 

operator overload for ndarray r/w access

Parameters:
index to access

Definition at line 71 of file SGNDArray.h.

const T& operator[] ( index_t  index  )  const

operator overload for ndarray read only access

Parameters:
index to access

Definition at line 62 of file SGNDArray.h.

int32_t ref (  )  [protected, inherited]

increase reference counter

Returns:
reference count

Definition at line 111 of file SGReferencedData.h.

int32_t ref_count (  )  [inherited]

display reference counter

Returns:
reference count

Definition at line 81 of file SGReferencedData.h.

void transpose_matrix ( index_t  matIdx  )  const

transposes a matrix formed by the two first dimensions

Parameters:
matIdx matrix index

Definition at line 78 of file SGNDArray.cpp.

int32_t unref (  )  [protected, inherited]

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

Returns:
reference count

Definition at line 136 of file SGReferencedData.h.


Member Data Documentation

T* array

array

Definition at line 90 of file SGNDArray.h.

dimension sizes

Definition at line 93 of file SGNDArray.h.

number of dimensions

Definition at line 96 of file SGNDArray.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation