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

Detailed Description

template<class T>
class shogun::SGMatrixList< T >

shogun matrix list

Definition at line 22 of file SGMatrixList.h.

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

Public Member Functions

 SGMatrixList ()
 SGMatrixList (SGMatrix< T > *ml, int32_t nmats, bool ref_counting=true)
 SGMatrixList (int32_t nmats, bool ref_counting=true)
 SGMatrixList (SGMatrixList const &orig)
virtual ~SGMatrixList ()
SGMatrix< T > get_matrix (index_t index) const
SGMatrix< T > operator[] (index_t index) const
void set_matrix (index_t index, const SGMatrix< T > matrix)
int32_t ref_count ()

Static Public Member Functions

static SGMatrixList< T > split (SGMatrix< T > matrix, int32_t num_components)

Public Attributes

SGMatrix< T > * matrix_list
int32_t num_matrices

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

default constructor

Definition at line 17 of file SGMatrixList.cpp.

SGMatrixList ( SGMatrix< T > *  ml,
int32_t  nmats,
bool  ref_counting = true 
)

constructor for setting parameters

Definition at line 23 of file SGMatrixList.cpp.

SGMatrixList ( int32_t  nmats,
bool  ref_counting = true 
)

constructor to create a new matrix list in memory

Definition at line 29 of file SGMatrixList.cpp.

SGMatrixList ( SGMatrixList< T > const &  orig)

copy constructor

Definition at line 36 of file SGMatrixList.cpp.

~SGMatrixList ( )
virtual

destructor

Definition at line 42 of file SGMatrixList.cpp.

Member Function Documentation

void copy_data ( const SGReferencedData orig)
protectedvirtual

copy data

Implements SGReferencedData.

Definition at line 66 of file SGMatrixList.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 80 of file SGMatrixList.cpp.

SGMatrix< T > get_matrix ( index_t  index) const

get a matrix of the list

Parameters
indexmatrix index, index must be less than num_matrices although no check is performed in the method
Returns
the matrix at position index of the list

Definition at line 48 of file SGMatrixList.cpp.

void init_data ( )
protectedvirtual

initialize empty data

Implements SGReferencedData.

Definition at line 73 of file SGMatrixList.cpp.

SGMatrix< T > operator[] ( index_t  index) const

operator overload to get a matrix for read & write access

Parameters
indexmatrix index, index must be less than num_matrices although no check is performed in the method
Returns
the matrix at position index of the list

Definition at line 54 of file SGMatrixList.cpp.

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 set_matrix ( index_t  index,
const SGMatrix< T >  matrix 
)

set a matrix of the list

Parameters
indexmatrix index, index must be less than num_matrices although no check is performed in the method
matrixmatrix to set at index

Definition at line 60 of file SGMatrixList.cpp.

SGMatrixList< T > split ( SGMatrix< T >  matrix,
int32_t  num_components 
)
static

divide the matrix into a list of matrices. Each of the new matrices has the same number of rows as the original so the splits to the original matrix are done column-wise.

Parameters
matrixmatrix to split
num_componentsnumber of new matrices
Returns
list of matrices

Definition at line 88 of file SGMatrixList.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

SGMatrix<T>* matrix_list

matrix list

Definition at line 90 of file SGMatrixList.h.

int32_t num_matrices

number of matrices of matrix list

Definition at line 93 of file SGMatrixList.h.


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

SHOGUN Machine Learning Toolbox - Documentation