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
ExpansionConfig.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 IClassConfig {
38  public:
39 
50  public:
51 
53  this.RequiredPrototypeClass= " kernels.KernelExpansion ";
54  this.Prototype= kernels.KernelExpansion;
55  }
56 
57 
58  function n = getNumConfigurations() {
59  n = 0;
60  if ~isempty(this.StateConfig)
62  end
63  }
64 
65 
66  function kernels.KernelExpansionkexp = configureInstance(nr) {
67  kexp = this.getProtoClass;
68  if ~isempty(this.StateConfig)
69  kexp.Kernel= this.StateConfig.configureInstance(nr);
70  end
71  }
72 
73 
74  function str = getConfigurationString(nr,asCell) {
75  if nargin < 3
76  asCell = false;
77  end
78  str = [];
79  if ~isempty(this.StateConfig)
80  str = sprintf(" StateKernel: %s ",...
81  this.StateConfig.getConfigurationString(nr, asCell));
82  end
83  }
84 
85 
86  function str = getConfiguredPropertiesString() {
88  }
89 
90 
91  function conf = getSubPart(partNr,totalParts) {
92  conf = this.clone;
93  if ~isempty(this.StateConfig)
94  conf.StateConfig= this.StateConfig.getSubPart(partNr, totalParts);
95  end
96  }
97 
98 
99  function copy = clone(copy) {
100  if nargin < 2
101  copy = kernels.config.ExpansionConfig;
102  end
103  copy = clone@IClassConfig(this, copy);
104  if ~isempty(this.StateConfig)
105  copy.StateConfig= this.StateConfig.clone;
106  end
107  }
108 
109 
110  function guessGammaConfigs(data.ApproxTrainData atd,integer ng,double mf,double Mf) {
111 
112  if ~isa(atd," data.ApproxTrainData ")
113  error(" First argument has to be a data.ApproxTrainData instance ");
114  end
115  gameps = .1;
116  if nargin < 5
117  Mf = 2;
118  if nargin < 4
119  mf = .5;
120  end
121  end
122  dfun = @logsp;
123 
124  dists = zeros(3,ng);
125  dists(1,:) = dfun(mf*atd.xiDia, Mf*atd.xiDia);
126  if atd.hasTime
127  dists(2,:) = dfun(mf*atd.tiDia, Mf*atd.tiDia);
128  end
129  if atd.hasParams
130  dists(3,:) = dfun(mf*atd.muiDia, Mf*atd.muiDia);
131  end
132  k = kernels.GaussKernel;
133  this.Gammas= zeros(size(dists));
134  for i=1:ng
135  this.Gammas(1,i) = k.setGammaForDistance(dists(1,i),gameps);
136  this.Gammas(2,i) = k.setGammaForDistance(dists(2,i),gameps);
137  this.Gammas(3,i) = k.setGammaForDistance(dists(3,i),gameps);
138  end
139 
140  function linsp(from, to)/* #ok */
141 
142  d = linspace(from,to,ng);
143  end
144 
145  function d = logsp(from, to)
146  d = logspace(log10(from),log10(to),ng);
147  end
148  }
163  protected:
164 
165  function collectRanges(ptable,proppath) {
166  if ~isempty(this.StateConfig)
167  this.StateConfig.collectRanges(ptable, ...
168  [proppath [sprintf(" State(%s) ",this.StateConfig.getClassName)]]);
169  end
170  }
171 
172 
173  function obj = loadobj() {
174  if ~isa(obj, " kernels.config.ExpansionConfig ")
175  from = obj;
176  obj = kernels.config.ExpansionConfig;
177  obj = loadobj@IClassConfig(obj, from);
178  obj.StateConfig= from.StateConfig;
179  end
180  }
181 
182 
183 
184 };
185 }
186 }
187 
logical hasParams
Flag that indicates if param samples are present.
IClassConfig: Abstract interface for a set of configurations that can be applied to a given algorithm...
Definition: IClassConfig.m:17
virtual function integer n = getNumConfigurations()
Returns the number of configurations that can be applied.
IClassConfig StateConfig
The state space kernel configuration.
virtual function char str = getConfiguredPropertiesString()
Returns a string of the changed properties by this IClassConfig instance.
function collectRanges(ptable, proppath)
virtual function IClassConfig conf = getSubPart(integer partNr,integer totalParts)
Returns a sub-part of this configuration as a new instance.
function ptype = getProtoClass()
Definition: IClassConfig.m:122
function copy = clone(copy)
The interface method with returns a copy of the current class instance.
Definition: IClassConfig.m:109
An integer value.
virtual function collectRanges(ptable, proppath)
double muiDia
The diameter of the parameter space samples.
double tiDia
The time span of the time samples.
double xiDia
The diameter of the state space samples.
function conf = getSubPart(partNr, totalParts)
virtual function integer str = getConfigurationString(integer nr,logical asCell)
Returns the number of configurations that can be applied.
ICloneable Prototype
The prototype class that is to be used as base class before configuring a new instance.
Definition: IClassConfig.m:42
function cn = getClassName()
Returns the simple class name of this object without packages.
Definition: KerMorObject.m:108
function kernels.KernelExpansion kexp = configureInstance(nr)
function n = getNumConfigurations()
Returns the number of configurations that can be applied.
function guessGammaConfigs(data.ApproxTrainData atd,integer ng,double mf,double Mf)
Guesses ng values that might be geometrically senseful and sets the applicable RBFConfig instances...
logical hasTime
Flag that indicates if time samples are present.
function str = getConfiguredPropertiesString()
Returns a string of the changed properties by this IClassConfig instance.
char RequiredPrototypeClass
Determines the class that is allowed to be configured.
Definition: IClassConfig.m:55
function copy = clone(copy)
The interface method with returns a copy of the current class instance.
virtual function ICloneable object = configureInstance(integer nr)
Creates a new instance with given configuration.
ApproxTrainData: Data class for approximation training data, containing several useful bounding box p...
ExpansionConfig: Base class config for kernel expansions.
function str = getConfigurationString(nr, asCell)