b_diag {lazy.mat} | R Documentation |
Makes a Block Diagonal Matrix from the Arguments
b_diag(...)
... |
Input matrices or vectors |
If ... contains a vector, it will be treated as a col vector.
If ... contains t( vector ) it will be a row vector.
Can be used with character matrices.
A block diagonal matrix
A matrix
b_diag( demomat(2,2), demomat(3,3) ) b_diag( demomat(2,2), 1:2, demomat(2,2) ) b_diag( demomat(2,2), t(1:2), demomat(2,2) ) ## Not run: # Semi Symbolic Partitioned Matrix: Super Matrix with SMdim attributes library(lazy.symbolic2) A=demomat(c(2,3),c(2,3),root="a") Printb(A) resA=b_diag(A,A) Printb(resA) resAB=b_diag(A,demomat(2,2,root="b"),A) Printb(resAB, sep=".") # Fully Symbolic Partitioned Matrix: # No SMdim attribute but fullsymb attribute Ap=demomat(2,2,root="A", fullsymb=1) Print(Ap) resAp=b_diag(Ap,Ap) Print(resAp) resABp=b_diag(Ap,demomat(2,2,root="b"),Ap) Print(resABp) ## End(Not run)