uncomplicate / neanderthal

Fast Clojure Matrix Library
http://neanderthal.uncomplicate.org
Eclipse Public License 1.0
1.06k stars 56 forks source link

det returns incorrect determinant? #116

Closed mchampine closed 2 years ago

mchampine commented 2 years ago

[uncomplicate/neanderthal "0.43.1"] [uncomplicate.neanderthal.linalg :as linalg]

(def my2x2 (dge 2 2 [2 -3 4 1])) ;; => #RealGEMatrix[double, mxn:2x2, layout:column, offset:0] ;; ▥ ↓ ↓ ┓
;; → 2.00 4.00
;; → -3.00 1.00
;; ┗ ┛

(linalg/det (linalg/trf my2x2)) ;; => -14.0

But the determinant should be 14: 2x1 - (-3x4) = 2 + 12 = 14

blueberry commented 2 years ago

Hi @mchampine

Thank you for discovering and reporting this bug. The fixed version 0.43.3 has just been released to Clojars.