Is there any method for multiplying matrices having O(n) complexity?

前端 未结 6 1316
礼貌的吻别
礼貌的吻别 2021-02-08 02:45

I want to multiply two matrices but the triple loop has O(n3) complexity. Is there any algorithm in dynamic programming to multiply two matrices with O(n) complexity?

6条回答
  •  情书的邮戳
    2021-02-08 03:15

    If

    • your matrices are large
    • they have a lot of zeroes
    • you are willing to store them in strange formats

    you can devise algorithms whose complexities depend only on the number of non-zero elements. This can be mandatory for some problems (eg. finite element methods).

提交回复
热议问题