rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
dirichlet_values_weighted_boxes_components.m
1 function U = dirichlet_values_weighted_boxes_components(glob, params)
2 %function U = dirichlet_values_weighted_boxes_components(glob, params)
3 %
4 % function evaluating a function in the list of global coordinates
5 % specified in the columns of glob. Result is a cell array of
6 % matrices of dirichlet value components results as columns.
7 %
8 % values constant params.c_dir in box given by
9 % (beta=1): model.dir_box_xrange{1} and dir_box_yrange{1}
10 % (beta=0): model.dir_box_xrange{2} and dir_box_yrange{2}
11 % for intermediate betas, the two boxes are weighted
12 
13 % Bernard Haasdonk 27.8.2009
14 
15 % glob column check
16 if params.debug
17  if ~isempty(glob) && size(glob,1) < size(glob,2)
18  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
19  if params.debug > 2
20  keyboard;
21  end
22  end
23 end
24 U = cell(2,1);
25 for q=1:2
26  U{q} = zeros(size(glob,1));
27  xrange = params.dir_box_xrange{q};
28  yrange = params.dir_box_yrange{q};
29  fi = (X > xrange(1) & ...
30  X < xrange(2) & ...
31  Y > yrange(1) & ...
32  Y < yrange(2));
33  U{q}(fi) = 1;
34 end;
35 if ~ismember('beta',params.mu_names)
36  % merge to one component
37  U = {params.beta*U{1} + ...
38  (1-params.beta)*U{2}};
39 end;%| \docupdate