Revision 7ba95550c2066826c77bc78b974b7cb8cd416301 authored by Hans W. Borchers on 11 January 2017, 00:43:13 UTC, committed by cran-robot on 11 January 2017, 00:43:13 UTC
1 parent 00dcc24
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