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
GaussConfig.m
Go to the documentation of this file.
1 namespace kernels{
2 namespace config{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
20  :public kernels.config.RBFConfig {
39  public:
40 
42 
44 
45 
46  public:
47 
49  this = this@kernels.config.RBFConfig(varargin[:]);
50 
51  i.KeepUnmatched= true;
52  i.addParamValue('D',[]);
53  i.addParamValue('Eps',eps);
54  i.parse(varargin[:]);
55  r = i.Results;
56  if ~isempty(r.D)
57  ke = kernels.GaussKernel;
58  g = zeros(size(r.D));
59  for k = 1:length(r.D)
60  g(k) = ke.setGammaForDistance(r.D(k),r.Eps);
61  end
62  this.Gammas= g;
63  this.Distances= r.D;
64  this.DistEps= r.Eps;
65  else
66  if isempty(this.Gammas)
67  error(" You must pass either Gamma values (G) or distances (D) ");
68  end
69  end
70  this.RequiredPrototypeClass= " kernels.GaussKernel ";
71  this.Prototype= kernels.GaussKernel;
72  }
73 
74 
75 
76  function k = configureInstance(nr) {
77  k = configureInstance@kernels.config.RBFConfig(this, nr);
78  if ~isempty(this.Distances)
79  this.Gammas(nr) = k.setGammaForDistance(this.Distances(nr),this.DistEps);
80  end
81  }
82 
83 
84  function conf = getSubPart(partNr,totalParts) {
85  conf = getSubPart@kernels.config.RBFConfig(this, partNr, totalParts);
86  if ~isempty(this.Distances)
87  idx = this.getPartIndices(partNr, totalParts);
88  conf.Distances= this.Distances(:,idx);
89  conf.DistEps= this.DistEps;
90  end
91  }
92 
93 
94  function copy = clone() {
95  copy = kernels.config.GaussConfig(" G ",1);
96  copy = clone@kernels.config.RBFConfig(this, copy);
97  copy.Distances= this.Distances;
98  copy.DistEps= this.DistEps;
99  }
100 
101 
102 };
103 }
104 }
105 
function copy = clone()
Definition: GaussConfig.m:94
function idx = getPartIndices(partNr, totalParts)
Definition: IClassConfig.m:130
RBFConfig: Base configuration settings for kernels implementing ARBFKernel.
Definition: RBFConfig.m:19
A variable number of input arguments.
function conf = getSubPart(partNr, totalParts)
Definition: GaussConfig.m:84
ICloneable Prototype
The prototype class that is to be used as base class before configuring a new instance.
Definition: IClassConfig.m:42
char RequiredPrototypeClass
Determines the class that is allowed to be configured.
Definition: IClassConfig.m:55
function k = configureInstance(nr)
Definition: GaussConfig.m:76