GPUMLib  0.2.2
GPU Machine Learning Library
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
BaseMatrix< Type > Class Template Referenceabstract

Base class for HostMatrix and DeviceMatrix classes (Matrix base class) More...

#include <BaseMatrix.h>

Inheritance diagram for BaseMatrix< Type >:
DeviceMatrix< Type > HostMatrix< Type >

Public Member Functions

virtual void Dispose ()=0
 Disposes the matrix.
 
int Rows () const
 
int Columns () const
 
Type * Pointer () const
 
int Elements () const
 
bool IsRowMajor () const
 
void ReplaceByTranspose ()
 
int ResizeWithoutPreservingData (int rows, int columns)
 

Protected Member Functions

void Init ()
 
 BaseMatrix (StoringOrder storingOrder=RowMajor)
 
void MoveFrom (BaseMatrix< Type > &other)
 
virtual void Alloc (int rows, int columns)=0
 

Protected Attributes

Type * matrixData
 
int rows
 
int columns
 
StoringOrder storingOrder
 

Friends

class CudaMatrix< Type >
 

Detailed Description

template<class Type>
class GPUMLib::BaseMatrix< Type >

Base class for HostMatrix and DeviceMatrix classes (Matrix base class)

Definition at line 38 of file BaseMatrix.h.

Member Function Documentation

int Columns ( ) const
inline

Gets the number of columns of the matrix

Returns
the number of columns of the matrix

Definition at line 80 of file BaseMatrix.h.

int Elements ( ) const
inline

Gets the number of elements contained in the matrix

Returns
the number of elements contained in the matrix

Definition at line 94 of file BaseMatrix.h.

bool IsRowMajor ( ) const
inline

Indicates if the information in the matrix is stored in row-major order.

Returns
True if the matrix information is stored in row-major order. False if the information is stored in column-major format.

Definition at line 100 of file BaseMatrix.h.

Type* Pointer ( ) const
inline

Gets a pointer to the matrix data

Attention
Use with caution. Special attention should be given to how the matrix information is stored (row-major or column-major).
Returns
a pointer to the matrix data
See also
IsRowMajor

Definition at line 88 of file BaseMatrix.h.

void ReplaceByTranspose ( )
inline

Replaces this matrix by its transpose

Attention
This method is very fast, however it changes the method for storing information in the matrix (row-major or column-major).
See also
IsRowMajor

Definition at line 107 of file BaseMatrix.h.

int ResizeWithoutPreservingData ( int  rows,
int  columns 
)
inline

Resizes the matrix without preserving its data

Parameters
rowsthe new number of rows
columnsthe new number of columns
Returns
the number of elements of the matrix after being resized.

Definition at line 119 of file BaseMatrix.h.

int Rows ( ) const
inline

Gets the number of rows of the matrix

Returns
the number of rows of the matrix

Definition at line 74 of file BaseMatrix.h.


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