SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/R/diagMatrix.R
ViewVC logotype

Diff of /pkg/Matrix/R/diagMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1617, Fri Oct 6 15:42:12 2006 UTC revision 1635, Tue Oct 17 21:21:44 2006 UTC
# Line 247  Line 247 
247                dx <- dim(x)                dx <- dim(x)
248                dy <- dim(y)                dy <- dim(y)
249                if(dx[2] != dy[1]) stop("non-matching dimensions")                if(dx[2] != dy[1]) stop("non-matching dimensions")
250                as(if(y@diag == "U") x else x * rep.int(y@x, dx[1]), "Matrix")                as(if(y@diag == "U") x else x * rep(y@x, each = dx[1]), "Matrix")
251            })            })
252    
253  setMethod("%*%", signature(x = "dgeMatrix", y = "diagonalMatrix"),  setMethod("%*%", signature(x = "dgeMatrix", y = "diagonalMatrix"),
# Line 256  Line 256 
256                dy <- dim(y)                dy <- dim(y)
257                if(dx[2] != dy[1]) stop("non-matching dimensions")                if(dx[2] != dy[1]) stop("non-matching dimensions")
258                if(y@diag == "N")                if(y@diag == "N")
259                    x@x <- x@x * rep.int(y@x, dx[1])                    x@x <- x@x * rep(y@x, each = dx[1])
260                x                x
261            })            })
262    

Legend:
Removed from v.1617  
changed lines
  Added in v.1635

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