summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/stitch/src/matlab/dist2.m
diff options
context:
space:
mode:
authorleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
committerleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
commit25d94aa8aabb8ac3e8bbea0bc439ea6148444cc8 (patch)
treeba80e76d25d9ca9486092e2f6b6d76f0e3352bf7 /SD-VBS/benchmarks/stitch/src/matlab/dist2.m
parente2b50015cebdfba68699abd6e8575e38230f5a78 (diff)
debug libextra and remove matlab
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src/matlab/dist2.m')
-rwxr-xr-xSD-VBS/benchmarks/stitch/src/matlab/dist2.m31
1 files changed, 0 insertions, 31 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/dist2.m b/SD-VBS/benchmarks/stitch/src/matlab/dist2.m
deleted file mode 100755
index 89116ac..0000000
--- a/SD-VBS/benchmarks/stitch/src/matlab/dist2.m
+++ /dev/null
@@ -1,31 +0,0 @@
1function n2 = dist2(x, c)
2%DIST2 Calculates squared distance between two sets of points.
3%
4% Description
5% D = DIST2(X, C) takes two matrices of vectors and calculates the
6% squared Euclidean distance between them. Both matrices must be of
7% the same column dimension. If X has M rows and N columns, and C has
8% L rows and N columns, then the result has M rows and L columns. The
9% I, Jth entry is the squared distance from the Ith row of X to the
10% Jth row of C.
11%
12% See also
13% GMMACTIV, KMEANS, RBFFWD
14%
15
16% Copyright (c) Christopher M Bishop, Ian T Nabney (1996, 1997)
17
18[ndata, dimx] = size(x);
19[ncentres, dimc] = size(c);
20if dimx ~= dimc
21 error('Data dimension does not match dimension of centres')
22end
23
24ct = c';
25opt = (x.^2)';
26op2t = (x.^2)';
27tempT = (ones(ncentres, 1) * sum(opt, 1))';
28n2 = tempT + ones(ndata, 1) * sum(op2t,1) - 2.*(x*ct);
29
30
31