is.rowblock: Test block-matrix structure

Description Usage Arguments Examples

Description

is.rowblock tests if its argument is one row block-matrix
is.colblock tests if its argument is one column block-matrix
is.oneblock tests if its argument is one single block-matrix
is.megablock tests if its argument is a block-matrix with more than one block by rows and columns

Usage

1

Arguments

x

an R object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# create a regular matrix
a = matrix(runif(20), 5, 4)

# block-matrix with one single block
A1 = blockmatrix(a, 5, 4)
# block-matrix with one column block
A2 = blockmatrix(a, c(2, 3), 4)
# block-matrix with one row block
A3 = blockmatrix(a, 5, c(2,2))
# block-matrix with 2 row-blocks and 2 col-blocks
A4 = blockmatrix(a, c(2, 3), c(2, 2))

# test if row-block
is.rowblock(A1)  # TRUE
is.rowblock(A2)  # FALSE
is.rowblock(A3)  # TRUE
is.rowblock(A4)  # FALSE

# test if col-block
is.colblock(A1)  # TRUE
is.colblock(A2)  # TRUE
is.colblock(A3)  # FALSE
is.colblock(A4)  # FALSE

# test if one-block
is.oneblock(A1)  # TRUE
is.oneblock(A2)  # FALSE
is.oneblock(A3)  # FALSE
is.oneblock(A4)  # FALSE

# test if mega-block
is.megablock(A1)  # FALSE
is.megablock(A2)  # FALSE
is.megablock(A3)  # FALSE
is.megablock(A4)  # TRUE

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