[lisplab-cvs] r163 - trunk/src/matrix

Jørn Inge Vestgården jivestgarden at common-lisp.net
Thu May 13 16:20:55 UTC 2010


Author: jivestgarden
Date: Thu May 13 12:20:55 2010
New Revision: 163

Log:
fixed acosh

Modified:
   trunk/src/matrix/level2-matrix-dge.lisp
   trunk/src/matrix/store-ordinary-functions.lisp

Modified: trunk/src/matrix/level2-matrix-dge.lisp
==============================================================================
--- trunk/src/matrix/level2-matrix-dge.lisp	(original)
+++ trunk/src/matrix/level2-matrix-dge.lisp	Thu May 13 12:20:55 2010
@@ -239,7 +239,7 @@
       (.cosh . cosh_dfa-to-dfa) 
       (.tanh . tanh_dfa-to-dfa) 
       (.asinh . asinh_dfa-to-dfa) 
-      (.acosh . acosh_dfa-to-dfa) 
+      #+nil (.acosh . acosh_dfa-to-dfa) 
       (.exp . exp_dfa-to-dfa) 
       #+nil (.ln . log_dfa) 
       #+nil (.sqrt . sqrt_dfat) 
@@ -330,6 +330,15 @@
 	  (atanh_dfa-to-cdfa (matrix-store a) (matrix-store out))
 	  out))))
 
+(defmethod .acosh ((a matrix-base-dge))
+  (if (>= (mmin a) 1d0)
+      (let ((out (mcreate a)))
+	(acosh_dfa-to-dfa (matrix-store a) (matrix-store out))
+	out)
+      (let ((out (mcreate* a :element-type :z)))
+	(acosh_dfa-to-cdfa (matrix-store a) (matrix-store out))
+	out)))
+
 ;;; Some special functions with with complex output for real input
 
 (defmethod .besh1 (n (x matrix-base-dge))

Modified: trunk/src/matrix/store-ordinary-functions.lisp
==============================================================================
--- trunk/src/matrix/store-ordinary-functions.lisp	(original)
+++ trunk/src/matrix/store-ordinary-functions.lisp	Thu May 13 12:20:55 2010
@@ -113,7 +113,9 @@
       (acos . acos_dfa-to-cdfa) 
       (atanh . atanh_dfa-to-cdfa)
       (log . log_dfa-to-cdfa) 
-      (sqrt . sqrt_dfa-to-cdfa)))
+      (sqrt . sqrt_dfa-to-cdfa)
+      (acosh . acosh_dfa-to-cdfa)
+      ))
 
 (defmacro defun-dfa-to-cdfa (name op)
   (let ((a (gensym))




More information about the lisplab-cvs mailing list