Learn R Programming

madness (version 0.2.8)

marithops: Basic Matrix Arithmetic Operations.

Description

These perform basic matrix arithmetic on madness objects: matrix multiplication, cross product, Kronecker product.

Usage

# S4 method for madness,madness
%*%(x, y)

# S4 method for madness,array %*%(x, y)

# S4 method for array,madness %*%(x, y)

# S4 method for madness,madness crossprod(x, y)

# S4 method for madness,ANY crossprod(x, y)

# S4 method for madness,missing crossprod(x, y)

# S4 method for ANY,madness crossprod(x, y)

# S4 method for madness,madness tcrossprod(x, y)

# S4 method for madness,ANY tcrossprod(x, y)

# S4 method for madness,missing tcrossprod(x, y)

# S4 method for ANY,madness tcrossprod(x, y)

Arguments

x, y

madness or numeric matrix values.

Author

Steven E. Pav shabbychef@gmail.com

Examples

Run this code
set.seed(123)
y <- array(rnorm(3*3),dim=c(3,3))
dy <- matrix(rnorm(length(y)*2),ncol=2)
dx <- crossprod(matrix(rnorm(ncol(dy)*100),nrow=100))
obj0 <- madness(val=y,vtag='y',xtag='x',dvdx=dy,varx=dx)
z <- array(rnorm(3*3),dim=c(3,3))

anobj <- obj0 %*% obj0
anobj <- z %*% obj0
anobj <- crossprod(obj0)
anobj <- crossprod(obj0,z)
anobj <- tcrossprod(obj0,obj0)
# NYI: 
# anobj <- obj0 %x% obj0

Run the code above in your browser using DataLab