📄 rbfpeval.m
字号:
function values = rbfPeval (evalpoints, intpoints, bndpoints, coeff) % evaluate at evalpoints
% an RBF approximation to a Poisson problem defined by centers in intpoints and bndpoints,
% using coeff as a general vector of coefficients
global RBForder;
[numeval,evaldim]=size(evalpoints);
[numint,intdim]=size(intpoints);[numbnd,bnddim]=size(bndpoints);
[numcoeff,coeffdim]=size(coeff);
if evaldim~=intdim
error('Unequal dimensions for evaluation and interior points')
end
if evaldim~=bnddim
error('Unequal dimensions for evaluation and boundary points')
end
if numcoeff~=numint+numbnd+RBForder+(RBForder*(RBForder-1)*(evaldim-1))/2
error('Number of data points must match number of coefficients')
end
if coeffdim~=1
error('Coefficients must be a vector')
end
evalsquares=sum(evalpoints.^2,2);
intsquares=sum(intpoints.^2,2);bndsquares=sum(bndpoints.^2,2);
if RBForder==0
fullmat=[rbfLaplace(sqrt(repmat(evalsquares,1,numint)+repmat(intsquares,1,numeval)'...
-2*evalpoints*intpoints'))...
rbf(sqrt(repmat(evalsquares,1,numbnd)+repmat(bndsquares,1,numeval)'...
-2*evalpoints*bndpoints'))];
elseif RBForder==1
fullmat=[rbfLaplace(sqrt(repmat(evalsquares,1,numint)+repmat(intsquares,1,numeval)'...
-2*evalpoints*intpoints'))...
rbf(sqrt(repmat(evalsquares,1,numbnd)+repmat(bndsquares,1,numeval)'...
-2*evalpoints*bndpoints'))...
ones(numeval,1)];
elseif RBForder==2
fullmat=[rbfLaplace(sqrt(repmat(evalsquares,1,numint)+repmat(intsquares,1,numeval)'...
-2*evalpoints*intpoints'))...
rbf(sqrt(repmat(evalsquares,1,numbnd)+repmat(bndsquares,1,numeval)'...
-2*evalpoints*bndpoints'))...
ones(numeval,1) evalpoints];
end
values=fullmat*coeff;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -