If you are thinking about the tr (ABC) element,

l = 10, n = 40,000, m = 80,000.
The number of multiplications above using sparseness Bis np * 10, where np is the number of nonzero elements B.
The number of pre-calculation CPU multiplications is 10 * 40,000 * 80,000. After that, using sparsity B, the number of multiplications tr (B (CA)) is np. Thus, if you do not do this calculation more than 1 / (density B) times, just tr (ABC) calculation is faster.
However, I do not think that a preliminary calculation of CA is necessary.
source
share