File: simple.R

package info (click to toggle)
rmatrix 0.95.5-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,732 kB
  • ctags: 2,028
  • sloc: ansic: 22,357; makefile: 74; sh: 28
file content (16 lines) | stat: -rw-r--r-- 312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
library(Matrix)

set.seed(123)
mm <- Matrix(rnorm(500 * 150), nc = 150)
stopifnot(validObject(mm))
xpx <- crossprod(mm)# alters mm !
stopifnot(validObject(mm))
stopifnot(validObject(xpx))
str(mm)
str(xpx)
xpy <- crossprod(mm, rnorm(500))
res <- solve(xpx, xpy)
str(xpx)#
stopifnot(validObject(xpx))

proc.time()