Mercurial > hg > camir-aes2014
annotate toolboxes/distance_learning/mlr/util/distToFrom.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 function D = distToFrom(n, Vto, Vfrom, Ito, Ifrom) |
wolffd@0 | 2 Cross = -2 * Vto' * Vfrom; |
wolffd@0 | 3 Tonorm = sum(Vto .^2, 1)'; |
wolffd@0 | 4 Fromnorm = sum(Vfrom .^2, 1); |
wolffd@0 | 5 |
wolffd@0 | 6 D = zeros(n); |
wolffd@0 | 7 D(Ito,Ifrom) = bsxfun(@plus, bsxfun(@plus, Cross, Tonorm), Fromnorm); |
wolffd@0 | 8 end |