rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
calc_inner_product.m
1 function K = calc_inner_product(model,model_data,U1,U2)
2 %function K = calc_inner_product(model,[model_data],U1,U2)
3 %
4 % function computing the inner product between all pairs of
5 % functions in U1,U2. Result is a matrix K of size size(U1,2) x
6 % size(U2,2) with the inner products.
7 
8 % Bernard Haasdonk 20.7.2006
9 %
10 % Oliver Zeeb, 21.09.2012
11 % Original name was fv_inner_product, this function has exactly the same
12 % code and does exactly the same! But since it is not only useful for
13 % FV-functions, the function-name was changed to calc_inner_product
14 
15 % currently simple diagonal weighting of element values sufficient
16 if(isempty(model_data))
17  model_data = model.gen_model_data(model);
18 end
19 W = model.get_inner_product_matrix(model_data);
20 K = U1' * W * U2;