Examples for 'Matrix::expand'


Expand a (Matrix) Decomposition into Factors

Aliases: expand expand,CHMfactor-method expand,MatrixFactorization-method expand,denseLU-method expand,sparseLU-method

Keywords: algebra

### ** Examples

(x <- Matrix(round(rnorm(9),2), 3, 3))
3 x 3 Matrix of class "dgeMatrix"
      [,1]  [,2]  [,3]
[1,] -0.21  2.14  0.58
[2,] -0.79 -3.04 -2.12
[3,] -0.33 -0.13  0.34
(ex <- expand(lux <- lu(x)))
$L
3 x 3 Matrix of class "dtrMatrix" (unitriangular)
     [,1]      [,2]      [,3]     
[1,] 1.0000000         .         .
[2,] 0.2658228 1.0000000         .
[3,] 0.4177215 0.3866466 1.0000000

$U
3 x 3 Matrix of class "dtrMatrix"
     [,1]       [,2]       [,3]      
[1,] -0.7900000 -3.0400000 -2.1200000
[2,]          .  2.9481013  1.1435443
[3,]          .          .  0.7834221

$P
3 x 3 sparse Matrix of class "pMatrix"
          
[1,] . | .
[2,] | . .
[3,] . . |

[Package Matrix version 1.5-3 Index]