;; test the double float matrix and vectors (in-package :ll-user) (defparameter test-dge-3x3 #md((1 2 -12) (2 3 4) (1 0 4))) (defparameter test-dge (make-test-suite "test dge")) (def-test-ok test-dge "simple arithmetic 1" (= 7 (msum (.> (.^ (.- (.* (.+ test-dge-3x3 4) test-dge-3x3) 4) 2) 1)))) (def-test-ok test-dge "log exp " (approx= (.log (.exp test-dge-3x3)) test-dge-3x3)) (def-test-ok test-dge "sin asin" (approx= (.sin (.asin test-dge-3x3)) test-dge-3x3)) (def-test-ok test-dge "cos acos" (approx= (.cos (.acos test-dge-3x3)) test-dge-3x3)) (def-test-ok test-dge "tan atan" (approx= (.tan (.atan test-dge-3x3)) test-dge-3x3)) (def-test-ok test-dge "LU factor" (destructuring-bind (L U P) (lu-factor test-dge-3x3) (approx= (m* (m* P L) U ) test-dge-3x3))) (def-test-ok test-dge "minv" (approx= (m* (minv test-dge-3x3) test-dge-3x3) #md((1 0 0) (0 1 0) (0 0 1))))