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
MatrixDEIM.m
Go to the documentation of this file.
1 namespace general{
2 
3 
4 /* (Autoinserted by mtoc++)
5  * This source code has been filtered by the mtoc++ executable,
6  * which generates code that can be processed by the doxygen documentation tool.
7  *
8  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
9  * Except for the comments, the function bodies of your M-file functions are untouched.
10  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
11  * attached source files that are highly readable by humans.
12  *
13  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
14  * the correct locations in the source code browser.
15  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
16  */
17 
19  :public general.DEIM {
38  public:
39 
49  public:
50 
67  private:
68 
69  effNumRows;
70 
71 
72  public:
73 
74  function M = evaluate(colvec<double> x,double t) {
75  fx = evaluate@general.DEIM(this, x, t);
76  M = reshape(fx, this.effNumRows, []);
77  }
78 
79 
80  function M = evaluateMulti(colvec<double> x,double t) {
81  fx = evaluateMulti@general.DEIM(this, x, t);
82  M = reshape(fx, this.effNumRows, []);
83  }
84 
85 
87  this.Qk= Qk;
88  U = this.U_nonproj;
89  if isempty(Qk) || isequal(Qk,1)
90  this.effNumRows= this.NumRows;
91  unew = U;
92  else
93  this.effNumRows= size(Qk,2);
94  unew = zeros(size(this.Qk,2)^2, size(U,2));
95  for i=1:size(U,2)
96  umat = reshape(U(:,i),size(this.Qk,1),[]);
97  umat = this.Qk^t*(umat*this.Qk);
98  unew(:,i) = umat(:);
99  end
100  end
101  /* Overwrite the current U with processed U_nonproj. */
102  this.U= unew;
103  }
104 
105 
106  function target = project(V,unused1) {
107  target = project@general.DEIM(this, V, [], this.clone);
108  }
109 
110 
111  function copy = clone() {
112  copy = general.MatrixDEIM;
113  copy = clone@general.DEIM(this, copy);
114  copy.Qk= this.Qk;
115  copy.NumRows= this.NumRows;
116  copy.effNumRows= this.effNumRows;
117  }
118 
119 
120  protected:
121 
122  function updateOrderData() {
123  updateOrderData@general.DEIM(this);
124 
125  /* "special" for jaccompevalwrappers:
126  * they only evaluate to nonzero entries, which is why the DEIM approximation
127  * U, U_nonproj is of size length(J(J ~= 0)) instead of length(J(:)) */
128  if isa(this.f," general.JacCompEvalWrapper ") && ~isempty(this.f.f.JSparsityPattern)
129  fsp = this.f.f.JSparsityPattern;
130  this.U_nonproj= MatUtils.toSparse(this.U_nonproj, find(fsp), numel(fsp)); /* #ok<FNDSB> */
131 
132  end
133 
134  /* Apply partial similarity transform (AFTER original DEIM order
135  * update)
136  * Checks for having Qk set are done there. */
137  this.setSimilarityTransform(this.Qk);
138 
139  /* For now: unset the auxiliary DEIM error estimation matrices
140  * as they are not used (cannot be used?) for matrix DEIMs yet. */
141  this.M1= [];
142  this.M2= [];
143 /* this.Uerr1 = [];
144  * this.Uerr2 = []; */
145  }
153 };
154 }
155 
function M = evaluateMulti(colvec< double > x,double t)
Definition: MatrixDEIM.m:80
DEIM: Implements the DEIM-Algorithm from .
Definition: DEIM.m:18
MatrixDEIM:
Definition: MatrixDEIM.m:18
function target = project(V, unused1)
Definition: MatrixDEIM.m:106
static function Asparse = toSparse(matrix< double > A,rowvec< integer > rowidx, n)
Converts a full matrix A to a sparse matrix, where the entries of A are split up to the row indices s...
Definition: MatUtils.m:467
matrix< double > U_nonproj
If projection is applied, this contains the non-projected full matrix for use in subclasses...
Definition: DEIM.m:178
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
dscomponents.ACompEvalCoreFun f
The function which DEIM is applied to.
Definition: DEIM.m:214
matrix< double > U
The U matrix for the current Order.
Definition: DEIM.m:165
V
The matrix of the biorthogonal pair .
Definition: AProjectable.m:61
NumRows
The number of rows of the output matrices (information needed for reshape command of internal column-...
Definition: MatrixDEIM.m:40
function M = evaluate(colvec< double > x,double t)
Definition: MatrixDEIM.m:74
sparse< logical > JSparsityPattern
Sparsity pattern for the jacobian matrix.
Definition: ACoreFun.m:127
matrix< double > Qk
The custom (partial) similarity transform matrix applied to the approximated matrices via ...
Definition: MatrixDEIM.m:51
function updateOrderData()
Definition: MatrixDEIM.m:122
MatUtils: Matrix utility functions.
Definition: MatUtils.m:17
function setSimilarityTransform(Qk)
Definition: MatrixDEIM.m:86
function copy = clone()
Definition: MatrixDEIM.m:111