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
ASelector.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 
19 class ASelector
20  :public KerMorObject,
21  public ICloneable {
57  public:
58 
73  public:
74 
75 
77  this = this@KerMorObject;
78  }
79 
80 
81  function data.ApproxTrainDataatd = selectTrainingData(model) {
82  if ~isa(model," models.BaseFullModel ")
83  error(" The model parameter must be a BaseFullModel subclass. ");
84  elseif model.Data.TrajectoryData.getNumTrajectories == 0
85  error(" No training data available to select approximation training data from. ");
86  end
87 
88  [xi, ti, mui, fxi] = this.select(model);
89  if ~isa(xi," data.FileMatrix ")
90  fmxi = data.FileMatrix(size(xi,1),size(xi,2)," Dir ",model.Data.DataDirectory);
91  fmxi(:,:) = xi;
92  else
93  fmxi = xi;
94  end
95  atd = data.ApproxTrainData(fmxi, ti, mui);
96  /* Also already assign fxi data if provided by the selector */
97  if ~isempty(fxi)
98  if ~isa(fxi," data.FileMatrix ")
99  fmfxi = data.FileMatrix(size(fxi,1),size(fxi,2)," Dir ",model.Data.DataDirectory);
100  fmfxi(:,:) = fxi;
101  atd.fxi= fmfxi;
102  else
103  atd.fxi= fxi;
104  end
105  end
106  if this.EnsureUniqueData
107  atd.makeUniqueXi;
108  end
109  }
138 #if 0 //mtoc++: 'set.EnsureUniqueData'
139 function EnsureUniqueData(value) {
140  if ~islogical(value) || ~isscalar(value)
141  error(" EnsureUniqueData must be a logical scalar. ");
142  end
143  this.EnsureUniqueData= value;
144  }
145 
146 #endif
147 
148 
149  protected: /* ( Abstract ) */
150 
151  virtual function [data.FileMatrixxi , rowvecti , matrixmui ] = select(models.BaseFullModel model) = 0;
169 };
170 }
171 }
172 
173 
174 
ICLONEABLE Interface for cloneable handle classes.
Definition: ICloneable.m:17
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
function data.ApproxTrainData atd = selectTrainingData(model)
Performs the selection procedure.
Definition: ASelector.m:81
Base class for any KerMor class.
Definition: KerMorObject.m:17
A boolean value.
KerMorObject()
Constructs a new KerMor object.
Definition: KerMorObject.m:55
logical EnsureUniqueData
Flag to enable automatic "uniqueification" if selected training data. Uniqueness is determined by the...
Definition: ASelector.m:59
virtual function [ data.FileMatrix xi , rowvec ti , matrix mui ] = select(models.BaseFullModel model)
Template method for subclasses to specify selection behaviour.