Machine Learning Library
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
CKernelCache< Type > Class Template Reference

#include <CKernelCache.h>

Inheritance diagram for CKernelCache< Type >:
CObject< Type >

Public Member Functions

 CKernelCache (CKernel< Type > *pptKernel, vector< CSVCandidate< Type > > *ptDataset, Type tDTPos=0, Type tDTNeg=0, Type tMaxMegaByte=10)
 
 ~CKernelCache ()
 
const CDenseVector< Type > * requestRow (int i1, vector< int > *ptActiveCols=NULL)
 
void init ()
 
void clear ()
 
void calculateRow (CDenseVector< Type > *ptRow, int iIndex)
 
void setKernel (CKernel< Type > *ptKernel)
 
void reorganize (int iSubsetSize=-1)
 
float fillState ()
 
float freeSpace ()
 
void setCacheSize (Type tSize)
 
virtual string className () const
 Returns the class name. More...
 
virtual bool isA (const char *acClass) const
 Check if the object is an instance of the class with given name. More...
 
void setDiagonalTerm (Type tDT)
 
void setDiagonalTerm (Type tDTPos, Type tDTNeg)
 
- Public Member Functions inherited from CObject< Type >
 CObject ()
 Constructor. More...
 
virtual ~CObject ()
 Destructor. More...
 
virtual bool serialize (fstream &stream, IO_MODE mode=READ)
 Read/write from binary stream. More...
 
virtual bool serialize2 (CArchiv &tArchiv)
 
void setVerbose (VERBOSE_LEVEL tVerbose)
 Set the verbose level. More...
 
VERBOSE_LEVEL verbose (void) const
 Return current verbose level. More...
 
DATATYPE dataType () const
 Returns the template data type. More...
 

Static Public Member Functions

static void threadFunction (void *pvData)
 

Public Attributes

vector< CSVCandidate< Type > > * ptDataset
 
CKernel< Type > * ptKernel
 

Protected Attributes

TCachedItem ** pptCachedItems
 
TCachedItem * ptStorageHead
 
TCachedItem * ptStorageEnd
 
Type tCacheSize
 
int iMaxRows
 
int iNumCachedRows
 
int iNumItemsToUse
 
Type tDTPos
 
Type tDTNeg
 
bool bFastGaussian
 
- Protected Attributes inherited from CObject< Type >
unsigned char ucVerbose
 

Constructor & Destructor Documentation

template<class Type >
CKernelCache< Type >::CKernelCache ( CKernel< Type > *  pptKernel,
vector< CSVCandidate< Type > > *  ptDataset,
Type  tDTPos = 0,
Type  tDTNeg = 0,
Type  tMaxMegaByte = 10 
)
template<class Type >
CKernelCache< Type >::~CKernelCache ( )

Member Function Documentation

template<class Type >
void CKernelCache< Type >::calculateRow ( CDenseVector< Type > *  ptRow,
int  iIndex 
)
template<class Type >
virtual string CKernelCache< Type >::className ( ) const
inlinevirtual

Returns the class name.

Reimplemented from CObject< Type >.

Referenced by CKernelCache< Type >::isA().

template<class Type >
void CKernelCache< Type >::clear ( )
template<class Type >
float CKernelCache< Type >::fillState ( )

Returns percentage of cached rows

Returns
Percentage of rows currently cached
template<class Type >
float CKernelCache< Type >::freeSpace ( )

Return left cache meory in MB

Returns
Memory in MB
template<class Type >
void CKernelCache< Type >::init ( )
template<class Type >
virtual bool CKernelCache< Type >::isA ( const char *  acClass) const
inlinevirtual

Check if the object is an instance of the class with given name.

Reimplemented from CObject< Type >.

References CKernelCache< Type >::className(), and CObject< Type >::isA().

template<class Type >
void CKernelCache< Type >::reorganize ( int  iSubsetSize = -1)

Clear current cache. If iSubsetSize is unequal to -1 only the first iSubsetSize elements of the dataset will be cached. In this case, a iSubsetSize X iSubsetSize matrix will similated.

Parameters
Sizeof subset to cache. Whole dataset if equal to -1
template<class Type >
const CDenseVector<Type>* CKernelCache< Type >::requestRow ( int  i1,
vector< int > *  ptActiveCols = NULL 
)
template<class Type >
void CKernelCache< Type >::setCacheSize ( Type  tSize)
inline

Set maximal cache size in MB

Parameters
Cachesize

References CKernelCache< Type >::tCacheSize.

template<class Type >
void CKernelCache< Type >::setDiagonalTerm ( Type  tDT)
template<class Type >
void CKernelCache< Type >::setDiagonalTerm ( Type  tDTPos,
Type  tDTNeg 
)
template<class Type >
void CKernelCache< Type >::setKernel ( CKernel< Type > *  ptKernel)

Update pointer to kernel function object.

Parameters
ptKernelNew pointer
template<class Type >
static void CKernelCache< Type >::threadFunction ( void *  pvData)
static

Member Data Documentation

template<class Type >
bool CKernelCache< Type >::bFastGaussian
protected
template<class Type >
int CKernelCache< Type >::iMaxRows
protected
template<class Type >
int CKernelCache< Type >::iNumCachedRows
protected
template<class Type >
int CKernelCache< Type >::iNumItemsToUse
protected
template<class Type >
TCachedItem** CKernelCache< Type >::pptCachedItems
protected
template<class Type >
vector< CSVCandidate<Type> >* CKernelCache< Type >::ptDataset
template<class Type >
CKernel<Type>* CKernelCache< Type >::ptKernel
template<class Type >
TCachedItem* CKernelCache< Type >::ptStorageEnd
protected
template<class Type >
TCachedItem* CKernelCache< Type >::ptStorageHead
protected
template<class Type >
Type CKernelCache< Type >::tCacheSize
protected
template<class Type >
Type CKernelCache< Type >::tDTNeg
protected
template<class Type >
Type CKernelCache< Type >::tDTPos
protected

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