Matrix multiplication efficiency

I have a reproduction $A * B * A^T$, where $B$ is a covariance matrix (i.e. symmetrical, square) and also $A$ is an approximate matrix with suitable measurements. Offered the proportion of $B$ and also the reality that I increase by $A$ and also $A^T$, it actually seems like there have to be an extra reliable means to calculate the outcome than 2 reproductions, yet I have not had the ability to locate anything. Does any person have any kind of understanding on the trouble, or why there isn't any far better means of doing it?

Many thanks!

2022-06-07 14:35:04
Source Share
Answers: 2

Since $B$ is symmetrical, $ABA^T$ is additionally symmetrical, therefore you just require to establish the access over the angled. Hence, as opposed to doing 2 matrix reproductions, you can use one and also a fifty percent.

Nonetheless, without there being anything else unique concerning $A$ or $B$, I am cynical that any kind of speedup you get will certainly be greater than a constant variable. Specifically, it is really not likely that calculating $ABA^T$ can be done much faster than calculating $AB$. Algorithmically, this suggests that your will not scuff of size of the run time of whatever you are utilizing this for, therefore unless you are doing a lots of matrix reproductions, seeking a brilliant optimization will not likely net you wonderful gains.

Nonetheless, on a relevant note, something that will certainly quicken the reproduction, at the very least when you are managing huge matrices, is Strassen's algorithm, which is an algorithm for increasing $2\times 2$ matrices with 7 reproductions as opposed to 8, which can recursively be made use of to increase huge matrices with each other promptly ($O(n^{\log_2 7+o(1)})$ as opposed to $O(n^3)$).

2022-06-07 14:55:13

If you are mosting likely to be making use of the very same $A$ for several $B$, it could pay to precompute the matrices $C_{ii} = A E_{ii} A^T$ and also $C_{ij} = A (E_{ij} + E_{ji}) A^T$ for all $i \le j$, where $E_{ij}$ is the matrix with $(i,j)$ access $1$ and also all others $0$. After that $A B A^T = \sum_i \sum_{j \ge i} b_{ij} C_{ij}$.

2022-06-07 14:55:06