Matrix accelerate the number of columns

Matrix Multiplication

Yes, that is to talk aboutSuch a simple thingBut we had better pay attention to:

"Do not look simple matrix multiplication, matrix was not easy (to escape."

And a solution to a problem luogu bit errors, resulting in confusion many beginners,I need to come forward to write a template problem solution to a problem


Look at the definition of matrix multiplication:

If A, B are matrices, the size of A is \ (n-m * \) , B is the size of \ (m * r \)

\ [If C = A * B C then for each element C_ {i, j} have: \]

\[C_{i,j}=\sum_{k=1}^m A_{i,k}*B_{k,j}\]

Therefore, the size of C \ (n-R & lt * \) , we found that the number of columns of the A matrix rows only = B matrix they can be matrix multiplication. So where in matrix multiplication is not necessarily meet the exchange rate, that is, \ (A * B \)\ (B * A \) , said that even if you can \ (A * B \) , but \ (B * A \) is not certainly legitimate.

Luo Gu P1939 matrix Accelerated Templates

If there is a power base matrix fast it is simple.

Set F = []

(Oh, do not Latex ...)

Guess you like

Origin www.cnblogs.com/BaseAI/p/11911139.html