Description Usage Arguments Value Author(s) Examples
View source: R/oclKronVectMult1col3Q.R
Function to call OpenCL program to premultiply a matrix by a kronecker product of 3 matrices.
1 | oclKronVectMult1col3Q(kernel, a, b, c, y, ...)
|
kernel |
OpenCL kernel to be run |
a |
first matrix in kronecker product |
b |
second matrix in kronecker product |
c |
third matrix in kronecker product |
y |
matrix to premultiply by kronecker product |
matrix; the product of the kronecker product of the first three arguments and the matrix y
Kate Cowles and Michael Seedorff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(a,b,b2,c)
{
if(!is.numeric(a) | !is.numeric(b) | !is.numeric(c) )
stop("a and b must be numeric matrices")
na1 <- nrow(a)
nb1 <- nrow(b)
nb21 <- nrow(b2)
nc1 <- ncol(c)
a<- as.vector(t(a))
b<- as.vector(t(b))
b2<- as.vector(t(b2))
c<- as.vector(c) # change; not transposed before sent
retvect <- rep(0, na1 * nb1 * nb21* nc1)
out <- .C("doKronVectMult1col3QD", a=as.double(a), b = as.double(b),
b2 = as.double(b2),
c = as.double(c),
retvect=as.double(retvect), na1 = as.integer(na1),
nb1 = as.integer(nb1), nb21=as.integer(nb21),
nc1 = as.integer(nc1), PACKAGE="CARramps" )
return(matrix(out$retvect, nrow=na1*nb1*nb21,byrow=F) ) # change byrow
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.