R/kmndirs.R

Defines functions kmndirs

kmndirs <-
function(x, k, nrandom = 1000L, maxiter = 10L)
{
    ## Currently only dense matrix support.
    x <- as.matrix(x)
    ## Normalize.
    x <- x / sqrt(rowSums(x ^ 2))

    n <- nrow(x)

    .C(R_kmndirs, x, n, ncol(x), as.integer(k), as.integer(nrandom),
       as.integer(maxiter), ids = integer(n))$ids
}

Try the kmndirs package in your browser

Any scripts or data that you put into this service are public.

kmndirs documentation built on May 2, 2019, 6:53 p.m.