Let's Run Jinyeah

Outer product, Inner product 본문

Programming/Algorithm

Outer product, Inner product

jinyeah 2022. 10. 6. 05:02

Outer product

  • uvT
  • output: matrix
  • time complexity: O(n2)

Inner product

  • uTv
  • output: scalar
  • time complexity: O(n)
    • a = [a0, a1, a2, ... , aN-1], b = [b0, b1, b2, ...., bN-1]
    • a0*b0 + a1*b1 + aN-1*bN-1
    • Assuming that multiplication and addition are constant-time operations, the time-complexity is O(n)
      • Multiply O(n) + add O(n) = O(n)

Top: Inner product, Down: Outer product

 

Comments