R/matrix.multiply.R
xxt.Rd
Calculate matrix multiplication using "divide and conquer technique", which accelerates the computation to be faster.
xxt(X, window.size = 5)
An input matrix to be processed.
The window size of matrices to be devided. The default value is 5.
The multiplication matrix of X.t(X)
.
#Use the example files embedded in the package.
X <-matrix(runif(100), ncol=20)
R1 <- xxt(X)
#Show the result (R1)
print(R1)
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 6.899048 5.485498 4.865450 5.928020 6.033482
#> [2,] 5.485498 8.296732 4.919057 5.979427 7.016924
#> [3,] 4.865450 4.919057 5.806132 5.341819 4.702617
#> [4,] 5.928020 5.979427 5.341819 8.017443 6.354752
#> [5,] 6.033482 7.016924 4.702617 6.354752 8.296569
R2 <- X %*% t(X)
#Show the result (R2)
print(R2)
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 6.899048 5.485498 4.865450 5.928020 6.033482
#> [2,] 5.485498 8.296732 4.919057 5.979427 7.016924
#> [3,] 4.865450 4.919057 5.806132 5.341819 4.702617
#> [4,] 5.928020 5.979427 5.341819 8.017443 6.354752
#> [5,] 6.033482 7.016924 4.702617 6.354752 8.296569