sparse_gen: Sparse Matrix Generators

Description Usage Arguments Details Value

Description

Generate sparse matrices.

Usage

1
2
3
spar_gen_bandish(nrows, ncols, seed)

spar_gen_banded(nrows, ncols, band = 2)

Arguments

nrows, ncols

The dimension

seed

Random seed.

band

The band size, a positive integer. band=1 returns a matrix whose diagonal entries are all 1; band=2 returns a matrix with 1 on each diagonal entry and 1 on each entry directly above and below the main diagonal; etc.

Details

spar_gen_bandish() generates a "band-ish" matrix, a matrix whose entries are probabilistically more likely to be 1 the closer to the main diagonal they are.

spar_gen_banded() generates a banded matrix.

Value

A sparse "dgCMatrix" object is returned.


RBigData/cop documentation built on March 10, 2021, 8:21 p.m.