ECG-Kit 1.0
(504 bytes)
function K = compute_kernel(a,s,kernel)
% compute a kernel matrix for the objects a w.r.t. the support objects s
% given a kernel description
if isstr(kernel) % routine supplied to compute kernel
K = feval(kernel,a,s);
elseif iscell(kernel)
K = feval(kernel{1},a,s,kernel{2:end});
elseif ismapping(kernel)
K = a*prmap(s,kernel);
elseif kernel == 0 % we have already a kernel
K = a;
else
error('Do not know how to compute kernel matrix')
end
K = +K;
return