Learn R Programming

lazyNumbers (version 1.2.1)

lazyMatrix: Lazy matrices

Description

Create a lazy matrix.

Usage

as.lazyMatrix(x)

lazymat(x, dim = NULL)

Value

An object of class lazyMatrix.

Arguments

x

a numeric matrix, a numeric vector, a lazyVector object, or a lazyMatrix object

dim

ignored if x is a (possibly lazy) matrix; otherwise, i.e. if x is a (possibly lazy) vector, then dim must be NULL or a vector of two integers, and NULL is equivalent to c(length(x), 1) (a column matrix)

Examples

Run this code
library(lazyNumbers)
M <- lazymat(toeplitz(c(1, 2)))
as.double(M + M)
as.double(M * M)
as.double(M %*% M)

Run the code above in your browser using DataLab