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
EpsSelector.m
Go to the documentation of this file.
1 namespace data{
2 namespace selection{
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 data.selection.ASelector {
51  public: /* ( setObservable ) */
52 
53  EpsRad = 5;
82  public: /* ( setObservable ) */
83 
85  this = this@data.selection.ASelector;
86  this.registerProps(" EpsRad "," SubspaceProject ");
87  this.EpsRad= 1;
88  }
89 
90 
91  function copy = clone() {
92  copy = data.selection.EpsSelector;
93  /* copy = clone@data.selection.ASelector(this, copy); */
94  copy.EpsRad= this.EpsRad;
95  copy.SubspaceProject= this.SubspaceProject;
96  }
97 
98 
99 
100 #if 0 //mtoc++: 'set.EpsRad'
101 function EpsRad(value) {
102  if ~isposrealscalar(value)
103  error(" EpsRad must be a positive real scalar. ");
104  end
105  this.EpsRad= value;
106  }
107 
108 #endif
109 
110 
111  protected: /* ( setObservable ) */
112 
113  function [matrixxi , rowvecti , matrixmui , fxi ] = select(models.BaseFullModel model) {
114  td = model.Data.TrajectoryData;
115  if td.getNumTrajectories > 1
116  warning(" KerMor:approx:selection:EpsSelector "," The epsilon-selector can only be used with one trajectory at the moment. Ignoring all but the first. ");
117  end
118  [x, mu] = td.getTrajectoryNr(1);
119  if this.SubspaceProject && ~isempty(model.SpaceReducer)
120  [V, W] = model.assembleProjectionMatrices;
121  x = V*(W^t*x);
122  end
123  /* [m,M] = Utils.getBoundingBox(x);
124  *d = norm(M-m) / 10;
125  *this.EpsRad = d; */
126  selidx = 1;
127  idx = 1;
128  cur = x(:,idx);
129  while idx < size(x,2)
130  while(idx < size(x,2) && norm(x(:,idx)-cur) < this.EpsRad)
131  idx = idx+1;
132  end
133  selidx(end+1) = idx;/* #ok */
134 
135  cur = x(:,idx);
136  idx = idx+1;
137  end
138  xi = x(:,selidx);
139  ti = model.Times(selidx);
140  mui = repmat(mu,1,length(selidx));
141  fxi = [];
142  }
164 };
165 }
166 }
167 
function [ matrix xi , rowvec ti , matrix mui , fxi ] = select(models.BaseFullModel model)
Selects training points with distance EpsSelector.EpsRad, starting from the initial values for each t...
Definition: EpsSelector.m:113
Base interface for any approximation training data selection algorithm.
Definition: ASelector.m:19
The base class for any KerMor detailed model.
Definition: BaseFullModel.m:18
Times
Evaluation points of the model.
Definition: BaseModel.m:206
function copy = clone()
Definition: EpsSelector.m:91
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
Definition: DPCMObject.m:125
function [ V , W ] = assembleProjectionMatrices(target_dim)
virtual function n = getNumTrajectories()
Gets the total number of trajectories.
data.ModelData Data
The full model's data container. Defaults to an empty container.
EpsRad
The distance within there has to be an expansion point for each x. Gets multiplied by ...
Definition: EpsSelector.m:53
spacereduction.BaseSpaceReducer SpaceReducer
The reduction algorithm for subspaces.
function res = isposrealscalar(value)
isposintscalar: Backwards-compatibility function for matlab versions greater than 2012a ...
EpsSelector: Selects as many points from the data that any trajectory point lies within an epsilon ra...
Definition: EpsSelector.m:19
data.ATrajectoryData TrajectoryData
The trajectory training data for the full model (only complete trajectories!)
Definition: ModelData.m:63