blockmatrix: Block Matrix

Description Usage Arguments Details Value See Also Examples

Description

blockmatrix creates a block-matrix from the given set of values
as.bmatrix attempts to turn its argument into a block-matrix
is.bmatrix tests if its argument is a (strict) block-matrix

Usage

1
2
3
4
5
6

Arguments

data

a matrix, a vector, or a blockvector

rowparts

vector of row partitions

colparts

vector of column partitions

parts

optional integer positive vector with the partitions

dims

optional integer positive vector with the block structure

x

an R object

...

additional arguments to be passed to blockmatrix

Details

When data is a blockvector, the return blockmatrix is a column-block (i.e. vertical) matrix

Value

An object of class "blockmatrix"

See Also

blockvector, matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# create a regular matrix
a = matrix(runif(20), 5, 4)

# convert 'a' into a block-matrix
A = blockmatrix(a, c(2, 3), c(2, 2))
A

# test if block-matrix
is.bmatrix(a)  # FALSE
is.bmatrix(A)  # TRUE

# generate a matrix
m = matrix(1:9, 3, 3)

# convert 'm' into a block-matrix (one block)
M = as.bmatrix(m, 3, 3)
M

gastonstat/blockberry documentation built on May 16, 2019, 5:44 p.m.