Calculate matrix multiplication using "divide and conquer technique", which accelerates the computation to be faster.

xxt(X, window.size = 5)

Arguments

X

An input matrix to be processed.

window.size

The window size of matrices to be devided. The default value is 5.

Value

The multiplication matrix of X.t(X).

Examples



#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