STK++ 0.9.13
STK_Kernel_IKernel.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Stat::Kernel
27 * created on: 5 avr. 2015
28 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
36#ifndef STK_KERNEL_IKERNEL_H
37#define STK_KERNEL_IKERNEL_H
38
39#include <Sdk.h>
41
42namespace STK
43{
44
45namespace Kernel
46{
59class IKernel: public IRunnerBase
60{
61 public:
63 inline IKernel(): IRunnerBase(), gram_() {}
69 inline virtual ~IKernel() {}
70
71 // getters
75 inline CSquareX const& k() const { return gram_;}
79 inline CSquareX const& gram() const { return gram_;}
80
81 // method using the gram matrix
85 inline Real kcomp(int i, int j) const { return gram_(i,j);}
89 inline Real kdist(int i, int j) const { return gram_(i,i)+gram_(j,j)-2*gram_(i,j);}
93 inline Real kdiag(int i) const { return gram_(i,i);};
94
95 // method computing the values of the gram matrix
100 virtual Real comp(int i, int j) const =0;
104 inline Real dist(int i, int j) const { return comp(i,i)+comp(j,j)-2*comp(i,j);}
109 virtual inline Real diag(int i) const { return comp(i,i);};
110
111 // pure virtual
115 virtual int nbSample() const =0;
119 virtual int nbVariable() const =0;
120
121 protected:
124};
125
126
127} // namespace Kernel
128
129} // namespace STK
130
131#endif /* STK_KERNEL_IKERNEL_H */
In this file we implement the final class CArraySquare.
This file include all the other header files of the project Sdk.
Abstract base class for all classes having a.
Definition STK_IRunner.h:65
Interface class for the kernels classes.
Real dist(int i, int j) const
Real kdiag(int i) const
Real kcomp(int i, int j) const
virtual int nbVariable() const =0
pure virtual method.
virtual Real diag(int i) const
virtual method.
virtual Real comp(int i, int j) const =0
pure virtual method.
CSquareX gram_
the resulting gram_ matrix
CSquareX const & gram() const
CSquareX const & k() const
virtual int nbSample() const =0
pure virtual method.
Real kdist(int i, int j) const
virtual ~IKernel()
destructor
IKernel()
default constructor
IKernel(IKernel const &kernel)
copy constructor
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.