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
RBFConfig.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 
19 class RBFConfig
20  :public IClassConfig {
39  public:
40 
42 
43 
44  public:
45 
47 
48  i.KeepUnmatched= true;
49  i.addParamValue('G',[]);
50  i.parse(varargin[:]);
51  r = i.Results;
52  if isempty(r.G)
53  this.Gammas= 1;
54  else
55  this.Gammas= r.G;
56  end
57  this.RequiredPrototypeClass= " kernels.ARBFKernel ";
58  }
59 
60 
61  function n = getNumConfigurations() {
62  n = length(this.Gammas);
63  }
64 
65 
66  function k = configureInstance(nr) {
67  k = this.getProtoClass;
68  k.Gamma= this.Gammas(nr);
69  }
70 
71 
72  function str = getConfigurationString(nr,asCell) {
73  if nargin < 3
74  asCell = false;
75  end
76  if asCell
77  str = [];
78  if ~isempty(this.Gammas)
79  str[1] = sprintf(" %g ",this.Gammas(nr));
80  end
81  else
82  str = [];
83  if ~isempty(this.Gammas)
84  str = sprintf(" \\gamma: %g ",this.Gammas(nr));
85  end
86  end
87  }
88 
89 
90  function str = getConfiguredPropertiesString() {
91  str = " \gamma ";
92  }
93 
94 
95  function conf = getSubPart(partNr,totalParts) {
96  conf = this.clone;
97  conf.Gammas= this.Gammas(this.getPartIndices(partNr, totalParts));
98  }
99 
100 
101  function copy = clone(copy) {
102  if nargin < 2
103  copy = kernels.config.RBFConfig;
104  end
105  copy = clone@IClassConfig(this, copy);
106  copy.Gammas= this.Gammas;
107  }
108 
109 
110  protected:
111 
112  function collectRanges(ptable,proppath) {
113  this.addRange(ptable, [proppath [" gamma "]],min(this.Gammas),max(this.Gammas));
114  }
115 
116 
117  public: /* ( Static ) */
118 
119  static function dists = getDists(data.ApproxTrainData atd,integer num) {
120 
121  dfun = @logsp; /* distances comp fun (linsp / logsp) */
122 
123 
124  Mf = 2;
125  mf = .5;
126  if isscalar(mf)
127  mf = ones(3,1)*mf;
128  end
129  if isscalar(Mf)
130  Mf = ones(3,1)*Mf;
131  end
132  xm = atd.xiDia;
133  dists = dfun(mf(1)*xm, Mf(1)*atd.xiDia);
134  if atd.hasTime
135  tm = atd.tiDia;
136  dists(2,:) = dfun(mf(2)*tm, Mf(2)*atd.tiDia);
137  end
138  if atd.hasParams
139  mum = atd.muiDia;
140  dists(3,:) = dfun(mf(3)*mum, Mf(3)*atd.muiDia);
141  end
142 
143  function d = linsp(from, to)/* #ok */
144 
145  d = linspace(from,to,num);
146  end
147 
148  function d = logsp(from, to)
149  d = logspace(log10(from),log10(to),num);
150  end
151  }
170 };
171 }
172 }
173 
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
function copy = clone(copy)
The interface method with returns a copy of the current class instance.
Definition: RBFConfig.m:101
function idx = getPartIndices(partNr, totalParts)
Definition: IClassConfig.m:130
function ptype = getProtoClass()
Definition: IClassConfig.m:122
function n = getNumConfigurations()
Returns the number of configurations that can be applied.
Definition: RBFConfig.m:61
An integer value.
double muiDia
The diameter of the parameter space samples.
RBFConfig: Base configuration settings for kernels implementing ARBFKernel.
Definition: RBFConfig.m:19
double tiDia
The time span of the time samples.
function addRange(ptable, proppath, minval, maxval)
Definition: IClassConfig.m:136
A variable number of input arguments.
double xiDia
The diameter of the state space samples.
function conf = getSubPart(partNr, totalParts)
Definition: RBFConfig.m:95
logical hasTime
Flag that indicates if time samples are present.
char RequiredPrototypeClass
Determines the class that is allowed to be configured.
Definition: IClassConfig.m:55
ApproxTrainData: Data class for approximation training data, containing several useful bounding box p...
function k = configureInstance(nr)
Definition: RBFConfig.m:66
function collectRanges(ptable, proppath)
Definition: RBFConfig.m:112
function str = getConfiguredPropertiesString()
Returns a string of the changed properties by this IClassConfig instance.
Definition: RBFConfig.m:90
static function dists = getDists(data.ApproxTrainData atd,integer num)
Computes the distances for the different RBF kernel Gamma configurations using the atd data and the a...
Definition: RBFConfig.m:119
function str = getConfigurationString(nr, asCell)
Definition: RBFConfig.m:72