KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ARBFKernel.m
Go to the documentation of this file.
1 namespace kernels{
2 
3 
4 /* (Autoinserted by mtoc++)
5  * This source code has been filtered by the mtoc++ executable,
6  * which generates code that can be processed by the doxygen documentation tool.
7  *
8  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
9  * Except for the comments, the function bodies of your M-file functions are untouched.
10  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
11  * attached source files that are highly readable by humans.
12  *
13  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
14  * the correct locations in the source code browser.
15  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
16  */
17 
19  :public kernels.BaseKernel {
53  public: /* ( setObservable ) */
54 
70  public: /* ( setObservable ) */
71 
73  this = this@kernels.BaseKernel;
74  this.IsRBF= true;
75  }
76 
77 
79  K = this.evaluateScalar(sqrt(this.getSqDiffNorm(x, y)));
80  }
103  function bool = eq(B) {
104  bool = eq@kernels.BaseKernel(A, B) && A.Gamma == B.Gamma;
105  }
106 
107 
108  function copy = clone(copy) {
109  copy = clone@kernels.BaseKernel(this, copy);
110  copy.Gamma= this.Gamma;
111  }
112 
113 
114  public: /* ( Sealed ) */ /* ( setObservable ) */
115 
117  if ~isempty(this.fP)
118  x = x(this.fP,:);
119  end
120  sx = this.fG*x;
121  n1sq = sum(x.*sx,1);
122  n1 = size(x,2);
123  if isempty(y)
124  n2sq = n1sq;
125  n2 = n1;
126  y = x;
127  else
128  if ~isempty(this.fP)
129  y = y(this.fP,:);
130  end
131  n2sq = sum(y.*(this.fG*y),1);
132  n2 = size(y,2);
133  end;
134  r = ((ones(n2,1)*n1sq)" + ones(n1,1)*n2sq - 2*sx "*y);
135  }
163  /* % Getter & setter */
164  public: /* ( setObservable ) */
165 
166 
167 #if 0 //mtoc++: 'set.Gamma'
168 function Gamma(value) {
169  if ~isreal(value) || ~isscalar(value) || value <= 0
170  error(" Only positive scalar values allowed for Gamma. ");
171  end
172  this.Gamma= value;
173  }
174 
175 #endif
176 
182  public: /* ( Abstract ) */ /* ( setObservable ) */
183 
184  virtual function phir = evaluateScalar(matrix<double> r) = 0;
204 };
205 }
206 
207 
208 
logical IsRBF
Flag that determines if the current kernel is a radial basis function, i.e. its evaluation is of the ...
Definition: BaseKernel.m:88
A double value.
double Gamma
Univariate scaling.
Definition: ARBFKernel.m:55
function copy = clone(copy)
The interface method with returns a copy of the current class instance.
Definition: ARBFKernel.m:108
virtual function phir = evaluateScalar(matrix< double > r)
Allows the evaluation of the function for scalar directly.
function K = evaluate(matrix< double > x,matrix< double > y)
Evaluates the rotation and translation invariant kernel.
Definition: ARBFKernel.m:78
function bool = eq(B)
Definition: ARBFKernel.m:103
function r = getSqDiffNorm(matrix< double > x,matrix< double > y)
Returns the weighted squared norm of the difference .
Definition: ARBFKernel.m:116
Abstract class for radial basis function / rotation- and translation invariant kernels.
Definition: ARBFKernel.m:18
Base class for all KerMor Kernels.
Definition: BaseKernel.m:18