Code covered by the BSD License
 [interpolant,points]=main
 circle(tri,x,y)
CIRCLE Return center for circumcircles
 differenceMatrix(datacoor...DM = DifferenceMatrix(datacoord,centercoord)
 distanceMatrix(ctrs,dsites)
DM = DistanceMatrix(dsites,ctrs)
 main
 phileja (h, A, varargin)
 phileja (h, A, varargin)

View all files
meshfree exponential integrator
by
Stefan Rainer
25 Mar 2013
experimetal code for meshfree exponential integrators

distanceMatrix(ctrs,dsites)

% DM = DistanceMatrix(dsites,ctrs)
% Forms the distance matrix of two sets of points in R^s,
% i.e., DM(i,j) =  datasite_i  center_j _2.
% Input
% dsites: Mxs matrix representing a set of M data sites in R^s
% (i.e., each row contains one sdimensional point)
% ctrs: Nxs matrix representing a set of N centers in R^s
% (one center per row)
% Output
% DM: MxN matrix whose i,j position contains the Euclidean
% distance between the ith data site and jth center
function DM = distanceMatrix(ctrs,dsites)
[M,s] = size(dsites); [N,s] = size(ctrs);
DM = zeros(M,N);
% Accumulate sum of squares of coordinate differences
% The ndgrid command produces two MxN matrices:
% dr, consisting of N identical columns (each containing
% the dth coordinate of the M data sites)
% cc, consisting of M identical rows (each containing
% the dth coordinate of the N centers)
for d=1:s
[dr,cc] = ndgrid(dsites(:,d),ctrs(:,d));
DM = DM + (drcc).^2;
end
DM = sqrt(DM);


Contact us