Matrix Multiplication with operator overloading

前端 未结 2 393
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 10:49

I am attempting to create an overloaded operator for a matrix class that I have built. My matrix class stores the matrix in a dynamically allocated multidimensional array. I

2条回答
  •  自闭症患者
    2021-01-03 11:17

    1. i actually goes from 0 to this->rows - 2 (because of i < n-1 for i = n-1 is false). Same for other loops. This seems not to be correct behaviour for matrices multiplication.
    2. Nevertheless, this code fragment seems to be correct. Can you provide us with full class implementation?

    P.S. If T is type of matrix elements, then type of sum_elems should be T.

提交回复
热议问题