![]() |
GURLS++
2.0.00
C++ Implementation of GURLS Matlab Toolbox
|
KernelLinear is the sub-class of Kernel that builds the kernel matrix for a linear model.
#include <linearkernel.h>


Public Member Functions | |
| GurlsOptionsList * | execute (const gMat2D< T > &X, const gMat2D< T > &Y, const GurlsOptionsList &opt) throw (gException) |
| Builds the symmetric kernel matrix of matrix X for a linear model. | |
Static Public Member Functions | |
| static Kernel< T > * | factory (const std::string &id) throw (BadKernelCreation) |
| Factory function returning a pointer to the newly created object. | |
Definition at line 59 of file linearkernel.h.
| GurlsOptionsList * gurls::KernelLinear< T >::execute | ( | const gMat2D< T > & | X, |
| const gMat2D< T > & | Y, | ||
| const GurlsOptionsList & | opt | ||
| ) | throw (gException) [virtual] |
| X | input data matrix |
| Y | labels matrix |
| opt | not udes |
Implements gurls::Kernel< T >.
Definition at line 77 of file linearkernel.h.
{
GurlsOptionsList* kernel = new GurlsOptionsList("kernel");
kernel->addOpt("type", "linear");
gMat2D<T>* K = new gMat2D<T>(X.rows(), X.rows());
dot(X.getData(), X.getData(), K->getData(), X.rows(), X.cols(), X.rows(), X.cols(), K->rows(), K->cols(), CblasNoTrans, CblasTrans, CblasColMajor);
kernel->addOpt("K", new OptMatrix<gMat2D<T> >(*K));
return kernel;
}
| static Kernel<T>* gurls::Kernel< T >::factory | ( | const std::string & | id | ) | throw (BadKernelCreation) [inline, static, inherited] |
Definition at line 110 of file kernel.h.
{
if(id == "linear")
return new KernelLinear<T>;
if(id == "rbf")
return new KernelRBF<T>;
if(id == "chisquared")
return new KernelChisquared<T>;
throw BadKernelCreation(id);
}