Swaps the matrix list with a cube
Examples
# Create matrix list
matLst <- cvPost(10, lotri::lotri(a+b~c(1, 0.25, 1)), 3)
print(matLst)
#> [[1]]
#> a b
#> a 2.236749 -1.204714
#> b -1.204714 2.456392
#>
#> [[2]]
#> a b
#> a 1.0020557 0.1998196
#> b 0.1998196 2.4359680
#>
#> [[3]]
#> a b
#> a 1.47206777 -0.05884101
#> b -0.05884101 1.04139365
#>
# Convert to cube
matCube <- swapMatListWithCube(matLst)
print(matCube)
#> , , 1
#>
#> a b
#> a 2.236749 -1.204714
#> b -1.204714 2.456392
#>
#> , , 2
#>
#> a b
#> a 1.0020557 0.1998196
#> b 0.1998196 2.4359680
#>
#> , , 3
#>
#> a b
#> a 1.47206777 -0.05884101
#> b -0.05884101 1.04139365
#>
# Convert back to list
matLst2 <- swapMatListWithCube(matCube)
print(matLst2)
#> [[1]]
#> a b
#> a 2.236749 -1.204714
#> b -1.204714 2.456392
#>
#> [[2]]
#> a b
#> a 1.0020557 0.1998196
#> b 0.1998196 2.4359680
#>
#> [[3]]
#> a b
#> a 1.47206777 -0.05884101
#> b -0.05884101 1.04139365
#>