SCM

SCM Repository

[bigmemory] View of /pkg/bigalgebra/R/methods.R
ViewVC logotype

View of /pkg/bigalgebra/R/methods.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 421 - (download) (annotate)
Tue Dec 11 05:18:32 2012 UTC (7 years, 6 months ago) by blewis
File size: 743 byte(s)
Major update--temporarily pared back functions to focus only on dgemm as a prototype. Methods now always follow standard R memory allocation/side-effect rules. Added a number of global package options for controlling output. Singificant doc and vignette updates describe all the changes in detail. Finally, we now default to using native R blas but still include option for long-integer blas
setMethod("%*%",signature(x="big.matrix", y="big.matrix"),
  function(x,y) dgemm(A=x, B=y),
  valueClass="big.matrix"
)

setMethod("%*%",signature(x="matrix", y="big.matrix"),
  function(x,y)
  {
    if(dim(x)[2] != dim(y)[1]) stop("non-conformant matrices")
    R = options("bigalgebra.mixed_airthmetic_returns_R_matrix")[[1]]
    if(!is.null(R) && R) return(dgemm(A=x, B=y, C=0))
    dgemm(A=x, B=y)
  },
  valueClass="matrix"
)

setMethod("%*%",signature(x="big.matrix", y="matrix"),
  function(x,y) 
  {
    if(dim(x)[2] != dim(y)[1]) stop("non-conformant matrices")
    R = options("bigalgebra.mixed_airthmetic_returns_R_matrix")[[1]]
    if(!is.null(R) && R) return(dgemm(A=x, B=y, C=0))
    dgemm(A=x, B=y)
  },
  valueClass="matrix"
)

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge