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