Daniel-Diaz / matrix

A Haskell native implementation of matrices and their operations.
BSD 3-Clause "New" or "Revised" License
35 stars 31 forks source link

Exception from Reduced Row Echelon Form Conversion #52

Closed Tuplanolla closed 6 years ago

Tuplanolla commented 6 years ago

The following expression throws an exception when it should return a Left value.

> rref (matrix 2 3 (fromIntegral . uncurry (*)))
Right ( *** Exception: getElem: Trying to get the (2,1) element from a 1x2 matrix.
wchresta commented 6 years ago

This does what you wanted in the newest version; but this is not what should happen. We should actually get a Right value:

octave:1> A = [1,2,3;2,4,6]
A =

   1   2   3
   2   4   6

octave:2> rref(A)
ans =

   1   2   3
   0   0   0
Tuplanolla commented 6 years ago

Right you are. Jolly good work.