Revision f3fa0a2ccb9bde3782d3555dfc9ebd3381d1757f authored by Toni Giorgino on 30 November 2007, 00:00:00 UTC, committed by Gabor Csardi on 30 November 2007, 00:00:00 UTC
1 parent 8635857
distance.R
###############################################################
# #
# (c) Toni Giorgino <toni.giorgino@gmail.com> #
# Laboratory for Biomedical Informatics #
# University of Pavia - Italy #
# www.labmedinfo.org #
# #
# $Id: distance.R 45 2007-12-10 18:14:42Z tonig $
# #
###############################################################
## Euclidean squared distance.
## should work on vectors (in R^n) too
## `euclideanSquared` <-
## function(a,b) {
## z<-a-b;
## z<-drop(z %*% z); #inner dot product
## return (z);
## }
`euclideanSquared` <-
function(a,b) {
return((a-b)^2);
}
`euclideanDistance` <-
function(a,b) {
return(abs(a-b));
}
Computing file changes ...