1 function res = matrix_reaction(x, model, df_info, i, j)
2 %
function res = matrix_reaction(x, model, df_info, i, j)
7 hat_phi_i = evaluate_basis_function(df_info, x, i);
8 hat_phi_j = evaluate_basis_function(df_info, x, j);
10 r =
cache_function(@(xarg, xmodel)xmodel.reaction(df_info.grid, 1: ...
11 df_info.grid.nelements, ...
12 xarg, xmodel), x, model);
16 res = hat_phi_i' * hat_phi_j * r;
19 res = cell(1, length(r));
22 res{q} = hat_phi_i
' * hat_phi_j * r{q};
function varargout = cache_function(func_ptr, varargin)
simple caching of function call inputs are cached too!