rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
IRefineable.m
1 classdef IRefineable < ParameterSampling.Interface
2  % Interface class for parameter sample classes that allow the adaptive
3  % refinement of the sampling
4 
5  properties
6  % cell array of samples that are generated during refinement cycle
7  sample_history = {};
8 
9  % cell array of elements which are refined at each refinement step
10  refined_elements = {};
11  end
12 
13  methods (Abstract)
14 
15  cogs = cogs(this);
16  % function cogs = cogs(this);
17  % returns the center of gravity of sample cells (in case the sample can be
18  % viewed as a grid)
19  %
20  % Usually the center of gravity of grid cells is a new sample vector in
21  % case the element is refined.
22  %
23  % Return values:
24  % cogs: a matrix with sample vectors as row vectors
25  %
26  % @todo Maybe this should be renamed to refinement_candidates, because
27  % otherwise it is restricted to grids.
28 
29  max_vertex = elementwise_maximum_of_vertex_values(this, values);
30  % function max_vertex = elementwise_maximum_of_vertex_values(this, values);
31  % returns `\max_{v \in V(e)} \text{val}_v` for each sample cell `e` (in
32  % case the sample can be viewed as a grid with vertices as sample vectors)
33  %
34  % Return values:
35  % max_vertex: vector of maxima as described above
36 
37  this = refine(this, elems);
38  % function this = refine(this, elems);
39  % refines the object at the the given elements
40  %
41  % At each refinement, the refined elements and the previous sample is added
42  % to the cell arrays #sample_history and #refined_elements
43  %
44  % Parameters:
45  % elems: A vector of element indices to be refined
46  %
47  % Return values:
48  % this: the updated object of type IRefineable
49 
50  level = get_refinement_levels(this);
51  % function level = get_refinement_levels(this);
52  % returns the number of refinement steps for each sample element
53  %
54  % Return values:
55  % level: a vector with number of refinement steps for each sample element
56 
57  skips = skipped_refinements(this);
58  % function skips = skipped_refinements(this);
59  % determines for every sample element how often it was skipped during the
60  % last refinement steps.
61  %
62  % Return values:
63  % skips: a vector of the number of skips for each sample element.
64 
65  end
66  methods
67 
68  function sample = get_sample_at_ref_level(this, ref_level)
69  % function sample = get_sample_at_ref_level(this, ref_level)
70  % helper function returning the sample at a given refinement level
71  %
72  % Parameters:
73  % ref_level: the refinement level
74  %
75  % Return values:
76  % sample: the parameter sample how it looked like before refinement
77  % step 'ref_level'
78 
79  if ref_level > length(this.sample_history)
80  sample = this.sample;
81  else
82  sample = this.sample_history{ref_level};
83  end
84  end
85 
86  end
87 end
Parameter sampling sets.
Definition: Interface.m:1
Interface class for parameter sample classes that allow the adaptive refinement of the sampling...
Definition: IRefineable.m:18
Interface for parameter sampling classes producing discrete parameter sample in the parameter space ...
Definition: Interface.m:18