Skip to contents

Treats a matrix as a block matrix and multiplies each block by a given block.

Usage

rblockmult(x, b)

Arguments

x

the matrix.

b

the block.

Details

x is split into blocks [x1 ... xn] so that ncol(xi)==nrow(b) and each block is multiplied by b. The result is the matrix [x1 b ... xn b].

Value

the matrix obtained as described above

Author

Georgi N. Boshnakov

Examples

m <- matrix(1:12, nrow = 2)
b <- matrix(c(0, 1, 1, 0), nrow = 2)
rblockmult(m,b)
#>      [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,]    3    1    7    5   11    9
#> [2,]    4    2    8    6   12   10