Notes - Numerical Analysis HT24, Flops


Flashcards

What is one flop?


One scalar multiply/division/addition/subtraction.

What is the exact flop count for the simple method of multiplying a $(m \times n)$ matrix by an $(n \times \ell)$ matrix, and as a special case, what is it for multiplying an $m \times n$ matrix by a vector?


\[m(2n-1)\ell\]

Then for a multiplication $Av$ where $A$ is $m \times n$ and $v$ is $n \times 1$, this is just

\[m(2n-1)\]

Quick justification:

  • $m\ell$ elements in the final matrix
  • Each one involved $n$ multiplications, followed by $n-1$ additions (we need to do one less addition since we can add $n-1$ multiplications to the first multiplication, rather than adding $n$ muliplications to $0$)
  • So $m\ell (2n-1)$ total



Related posts