R/qmatmult.R

Defines functions qmatmult

Documented in qmatmult

qmatmult <- function(x, y) {

    if (! (is.numeric(x) || is.character(x)))
        stop("'x' not numeric or character")
    if (! (is.numeric(y) || is.character(y)))
        stop("'y' not numeric or character")

    if (is.numeric(x))
        x <- d2q(x)
    if (is.numeric(y))
        y <- d2q(y)

    if (! (is.character(x) && is.character(y))) {
        stop("Cannot happen!")
    }

    if (! (is.matrix(x) && is.matrix(y)))
        stop("'x' and 'y' must be matrices")

    stopifnot(ncol(x) == nrow(y))

    .Call(C_qmatmult, x, y)
}

Try the rcdd package in your browser

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

rcdd documentation built on April 25, 2023, 1:09 a.m.