shogun n-dimensional array
Definition at line 23 of file SGNDArray.h.
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_t * | dims |
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 () |
SGNDArray | ( | ) |
default constructor
Definition at line 19 of file SGNDArray.cpp.
constructor for setting params
Definition at line 25 of file SGNDArray.cpp.
constructor to create new ndarray in memory
Definition at line 33 of file SGNDArray.cpp.
copy constructor
Definition at line 43 of file SGNDArray.cpp.
~SGNDArray | ( | ) | [virtual] |
empty destructor
Definition at line 49 of file SGNDArray.cpp.
void copy_data | ( | const SGReferencedData & | orig | ) | [protected, virtual] |
void copy_refcount | ( | const SGReferencedData & | orig | ) | [protected, inherited] |
copy refcount
Definition at line 102 of file SGReferencedData.h.
void free_data | ( | ) | [protected, virtual] |
T* get_matrix | ( | index_t | matIdx | ) | const |
get a matrix formed by the two first dimensions
matIdx | matrix index |
Definition at line 46 of file SGNDArray.h.
void init_data | ( | ) | [protected, virtual] |
T& operator[] | ( | index_t | index | ) |
operator overload for ndarray r/w access
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
index | to access |
Definition at line 62 of file SGNDArray.h.
int32_t ref | ( | ) | [protected, inherited] |
increase reference counter
Definition at line 111 of file SGReferencedData.h.
int32_t ref_count | ( | ) | [inherited] |
void transpose_matrix | ( | index_t | matIdx | ) | const |
transposes a matrix formed by the two first dimensions
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
Definition at line 136 of file SGReferencedData.h.
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.