gmm:
Multiply two matrices with the output matrix allready allocated.
Description
In effect this function sets C <- A %*% B. This makes it possible to avoid repeated allocation and deallocation steps which are very computationaly costly.
Usage
gmm(A, B, C, trA=FALSE, trB=FALSE, accum=FALSE)
Arguments
A, B
Matrices to multiply together.
C
Matrices where output will be saved.
trA, trB
Should A or B be transposed.
accum
if accum is set to TRUE, the multiplied matrix will be added to C (i.e. C<-C+A %*% B).
Value
Returns C invisibly.
Details
This function takes advantage of the fact that gmatrix objects are stored as pointers making it posible modify the input to a function. Thus the area of memory on the GPU pointed to by the C object is modified to contain A %*% B.