crossprodop: (Parallel) Matrix product operator

%c%R Documentation

(Parallel) Matrix product operator

Description

This operator computes the matrix-product between two matrices. It can be used as a replacement for %*% in many cases. The operator only accepts matrices of types: matrix or dgCMatrix. In the case of two dense matrices the operator will compute the crossproduct in parallel (Eigen + OpenMP)

Usage

X%c%Y	

Arguments

X

Matrix or vector (treated as column-vector) of type: matrix or dgCMatrix

Y

as X

Value

Matrix of type: matrix or dgCMatrix

Examples


# Least Squares Solving

# Generate random data 

n = 1000
p = 500

M <- matrix(rnorm(n*p),n,p)
y <- rnorm(n)

# least squares solution:

b <- csolve(t(M) %c% M, t(M) %c% y)


cheuerde/cpgen documentation built on July 27, 2023, 11:34 a.m.