62 if ~isa(f,
" dscomponents.ACompEvalCoreFun ")
63 error(
" The system "" s nonlinearity must be a component-wise evaluable function. ");
67 this =
this@dscomponents.ACompEvalCoreFun(f.System);
75 if ~isempty(f.JSparsityPattern)
76 fdim = length(find(f.JSparsityPattern));
78 fdim = f.fDim * f.xDim;
100 if ~isempty(this.
f.JSparsityPattern)
101 nonzero = find(this.
f.JSparsityPattern);
103 nonzero = 1:this.
f.fDim*this.
f.xDim;
105 J = this.
f.getStateJacobian(x,t,this.
mu);
125 if ~isempty(this.
f.JSparsityPattern)
126 nonzero = find(this.
f.JSparsityPattern);
128 nonzero = 1:this.
f.fDim*this.
f.xDim;
130 fx = zeros(length(nonzero),size(x,2));
131 singlemu = size(mu,2) == 1;
134 this.
f.prepareSimulation(mu);
138 this.
f.prepareSimulation(
mu(:,i));
140 J = this.
f.getStateJacobian(x(:,i),
t(i));
141 fx(:,i) = J(nonzero);
145 this.
f.prepareSimulation(oldmu);
166 this.
f.prepareSimulation(mu);
171 error(
" Boo. Do not call me. (directly implemented evaluate) ");
184 if ~isempty(this.
f.JSparsityPattern)
185 jidx = find(this.
f.JSparsityPattern);
193 if length(unique(pts)) ~= length(pts)
194 error(
" Points have to be unique. ");
199 i = rem(pts-1, this.
f.fDim)+1;
200 j = (pts-i)/this.
f.fDim+1;
209 didx = find(i == ui(
k));
216 this.
f.setPointSet(nr+2, ui, deriv);
219 this.
trafo[nr] = sparse(pos, 1:
l, ones(
l,1),
l,
l);
231 dfx = this.
f.evaluateJacobianSet(nr+2, x, t);
232 fx = this.
trafo[nr]*dfx;
237 dfx = this.
f.evaluateJacobianSetMulti(nr+2, x, t, mu);
238 fx = this.
trafo[nr]*dfx;
243 copy = general.JacCompEvalWrapper(this.
f);
244 copy =
clone@dscomponents.ACompEvalCoreFun(
this, copy);
245 copy.trafo= this.
trafo;
251 proj =
project@dscomponents.ACompEvalCoreFun(
this, V, W, this.
clone);
254 proj.f= this.
f.project(V, W);
255 proj.xDim= proj.f.xDim;
257 proj.fDim= proj.f.fDim*proj.f.xDim;
264 error(
" This should not be called as this is a wrapper for ACompEvalCoreFuns ");
function evaluateCoreFun()
Nothing to do here as the evaluate function is overridden directly.
integer fDim
The current output dimension of the function.
JacCompEvalWrapper: Wraps the evaluation of a ACompEvalCoreFun's jacobian into a vectorized function...
function fx = evaluateComponentSetMulti(nr,colvec< double > x,double t,colvec< double > mu)
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
integer xDim
The current state space dimension of the function's argument .
JacCompEvalWrapper(f)
Creates a new jacobian matrix wrapper for linear indexing, which implements dscomponents.ACompEvalCoreFun.
V
The matrix of the biorthogonal pair .
colvec< double > mu
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime durin...
function setPointSet(nr, pts)
Overrides the setPointSet method of dscomponents.ACompEvalCoreFun to allow transformation of the indi...
sparse< logical > JSparsityPattern
Sparsity pattern for the jacobian matrix.
function proj = project(V, W)
ACompEvalCoreFun: A normal CoreFun which supports single-component evaluation.
function colvec< double > fx = evaluateMulti(colvec< double > x,double t,colvec< double > mu)
Evaluates the jacobian of the wrapped function at multiple locations and returns a vector correspondi...
function colvec< double > fx = evaluate(colvec< double > x,double t)
Evaluates the jacobian of the wrapped function and returns a vector corresponding to the natural line...
W
The matrix of the biorthogonal pair .
function evaluateComponents()
nothing to do here as this is a wrapper
function fx = evaluateComponentSet(nr,colvec< double > x,double t)
function prepareSimulation(colvec< double > mu)