Description Usage Arguments Value Author(s) See Also Examples
Computes the matrix product between a block diagonal square matrix and a column vector (or matrix).
1 2 |
mat |
A block diagonal, square matrix. |
X |
Vector or matrix to multiply by |
n.blocks |
Number of diagonal blocks in |
block.sizes |
A vector of length |
Returns mat * X.
Johan Lindstrom
Other basic linear algebra: crossDist
,
makeCholBlock
, norm2
,
sumLogDiag
Other block matrix functions: calc.FXtF2
,
calc.FX
, calc.mu.B
,
calc.tFXF
, calc.tFX
,
makeCholBlock
, makeSigmaB
,
makeSigmaNu
1 2 3 4 5 6 7 8 9 10 11 12 13 | #create a matrix
mat <- cbind(c(1,0,0), c(0,2,1), c(0,1,2))
#define the number of blocks and block sizes
block.sizes <- c(1,2)
n.blocks <- length(block.sizes)
#define a X vector
X <- matrix(c(1,2,3,1,1,1), 3, 2)
#compute mat %*% X
blockMult(mat, X, n.blocks, block.sizes)
#or the old fashioned way
mat %*% X
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.