rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
init_values_affine_decomposed.m
1 function U0 = init_values_affine_decomposed(glob, params)
2 %function U0 = init_values_affine_decomposed(glob, params)
3 %
4 % function evaluating a function in the list of global coordinates
5 % specified in the columns of glob. Result is a matrix of initial
6 % data results as columns of U0.
7 %
8 % the function is given by function pointer to components and coefficients:
9 % params.init_values_coefficients_ptr
10 % Function must
11 % allow call U = f(params)
12 % Return is a vector of length Q with (parameter
13 % dependent) coefficients in U.
14 % params.init_values_components_ptr
15 % Functions must
16 % allow call U = f(glob,params)
17 % Return of components is a cell array of matrices of
18 % the same size as glob with the point values
19 % of the components.
20 % Linear combination of components by coefficients then yields the
21 % complete evaluation.
22 
23 % Bernard Haasdonk 27.8.2009
24 
25 % determine affine_decomposition_mode as integer
26 % glob column check
27 if isfield(params, 'debug') && params.debug
28  if ~isempty(glob) && size(glob,1) < size(glob,2)
29  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
30  if params.debug > 2
31  keyboard;
32  end
33  end
34 end
35 decomp_mode = params.decomp_mode;
36 
37 if decomp_mode == 2
38  U0 = params.init_values_coefficients_ptr(params);
39 elseif decomp_mode == 1; % components
40  U0 = params.init_values_components_ptr(glob,params);
41 else % decomp_mode = 0, complete
42  Ucoefficients = params.init_values_coefficients_ptr(params);
43  Ucomponents = params.init_values_components_ptr(glob,params);
44  U0 = lincomb_sequence(Ucomponents,Ucoefficients);
45 end;
46 %| \docupdate