algorithms icon indicating copy to clipboard operation
algorithms copied to clipboard

Matrix code make the "&&" to "||", make sure the rows and cols bve the same

Open halokid opened this issue 8 years ago • 0 comments

}

func (A *Matrix) add(B *Matrix) error {

  • if A.cols != B.cols && A.rows != B.rows {
  • if A.cols != B.cols || A.rows != B.rows { return errors.New("Wrong input sizes") } for i := 0; i < A.rows; i++ { @@ -102,7 +102,7 @@ func (A *Matrix) add(B *Matrix) error { }

func (A *Matrix) substract(B *Matrix) error {

  • if A.cols != B.cols && A.rows != B.rows {
  • if A.cols != B.cols || A.rows != B.rows { return errors.New("Wrong input sizes") } for i := 0; i < A.rows; i++ {

halokid avatar Jun 11 '16 07:06 halokid