Revision 04bbc417cf2927b827660bc07743429783569aec authored by HwB on 10 February 2013, 00:00:00 UTC, committed by Gabor Csardi on 10 February 2013, 00:00:00 UTC
1 parent 0e3ae6b
Raw File
distmat.R
##
##  d i s t m a t . R  tests
##

distmat <- pracma::distmat

A <- c(0.0, 0.0, 0.0)
B <- matrix(c(
        0, 0, 0,
        1, 0, 0,
        0, 1, 0,
        0, 0, 1,
        0, 1, 1,
        1, 0, 1,
        1, 1, 0,
        1, 1, 1),
     nrow = 8, ncol = 3, byrow = TRUE)

all.equal(drop(distmat(A, B)),
          c(0, 1, 1, 1, sqrt(2), sqrt(2), sqrt(2), sqrt(3)))
back to top