Kernel Gram matrix with modified diagonal. More...
#include <shark/LinAlg/RegularizedKernelMatrix.h>
Public Types | |
typedef Matrix::QpFloatType | QpFloatType |
Public Member Functions | |
RegularizedKernelMatrix (AbstractKernelFunction< InputType > const &kernelfunction, Data< InputType > const &data, const RealVector &diagModification) | |
QpFloatType | operator() (std::size_t i, std::size_t j) const |
return a single matrix entry More... | |
QpFloatType | entry (std::size_t i, std::size_t j) const |
return a single matrix entry More... | |
void | row (std::size_t k, std::size_t start, std::size_t end, QpFloatType *storage) const |
Computes the i-th row of the kernel matrix. More... | |
template<class M > | |
void | matrix (blas::matrix_expression< M, blas::cpu_tag > &storage) const |
Computes the kernel-matrix. More... | |
void | flipColumnsAndRows (std::size_t i, std::size_t j) |
swap two variables More... | |
std::size_t | size () const |
return the size of the quadratic matrix More... | |
unsigned long long | getAccessCount () const |
query the kernel access counter More... | |
void | resetAccessCount () |
reset the kernel access counter More... | |
Protected Attributes | |
Matrix | m_matrix |
RealVector | m_diagMod |
Kernel Gram matrix with modified diagonal.
Definition at line 62 of file RegularizedKernelMatrix.h.
typedef Matrix::QpFloatType shark::RegularizedKernelMatrix< InputType, CacheType >::QpFloatType |
Definition at line 67 of file RegularizedKernelMatrix.h.
|
inline |
Constructor
kernelfunction | kernel function |
data | data to evaluate the kernel function |
diagModification | vector d of diagonal modifiers |
Definition at line 73 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::size(), and SIZE_CHECK.
|
inline |
return a single matrix entry
Definition at line 86 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::m_diagMod, and shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix.
Referenced by shark::RegularizedKernelMatrix< InputType, CacheType >::operator()().
|
inline |
swap two variables
Definition at line 117 of file RegularizedKernelMatrix.h.
References shark::KernelMatrix< InputType, CacheType >::flipColumnsAndRows(), shark::RegularizedKernelMatrix< InputType, CacheType >::m_diagMod, shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix, and shark::swap().
|
inline |
query the kernel access counter
Definition at line 127 of file RegularizedKernelMatrix.h.
References shark::KernelMatrix< InputType, CacheType >::getAccessCount(), and shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix.
|
inline |
Computes the kernel-matrix.
Definition at line 107 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::m_diagMod, shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix, shark::KernelMatrix< InputType, CacheType >::matrix(), and shark::RegularizedKernelMatrix< InputType, CacheType >::size().
|
inline |
return a single matrix entry
Definition at line 82 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::entry().
|
inline |
reset the kernel access counter
Definition at line 131 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix, and shark::KernelMatrix< InputType, CacheType >::resetAccessCount().
|
inline |
Computes the i-th row of the kernel matrix.
The entries start,...,end of the i-th row are computed and stored in storage. There must be enough room for this operation preallocated.
Definition at line 97 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::m_diagMod, shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix, and shark::KernelMatrix< InputType, CacheType >::row().
|
inline |
return the size of the quadratic matrix
Definition at line 123 of file RegularizedKernelMatrix.h.
References shark::RegularizedKernelMatrix< InputType, CacheType >::m_matrix, and shark::KernelMatrix< InputType, CacheType >::size().
Referenced by shark::RegularizedKernelMatrix< InputType, CacheType >::matrix(), and shark::RegularizedKernelMatrix< InputType, CacheType >::RegularizedKernelMatrix().
|
protected |
Definition at line 136 of file RegularizedKernelMatrix.h.
Referenced by shark::RegularizedKernelMatrix< InputType, CacheType >::entry(), shark::RegularizedKernelMatrix< InputType, CacheType >::flipColumnsAndRows(), shark::RegularizedKernelMatrix< InputType, CacheType >::matrix(), and shark::RegularizedKernelMatrix< InputType, CacheType >::row().
|
protected |
Definition at line 135 of file RegularizedKernelMatrix.h.
Referenced by shark::RegularizedKernelMatrix< InputType, CacheType >::entry(), shark::RegularizedKernelMatrix< InputType, CacheType >::flipColumnsAndRows(), shark::RegularizedKernelMatrix< InputType, CacheType >::getAccessCount(), shark::RegularizedKernelMatrix< InputType, CacheType >::matrix(), shark::RegularizedKernelMatrix< InputType, CacheType >::resetAccessCount(), shark::RegularizedKernelMatrix< InputType, CacheType >::row(), and shark::RegularizedKernelMatrix< InputType, CacheType >::size().