[lisplab-cvs] r132 - in trunk: . src/core src/matrix
Jørn Inge Vestgården
jivestgarden at common-lisp.net
Tue Feb 23 19:43:24 UTC 2010
Author: jivestgarden
Date: Tue Feb 23 14:43:24 2010
New Revision: 132
Log:
added sgn function
Modified:
trunk/package.lisp
trunk/src/core/level0-functions.lisp
trunk/src/core/level0-interface.lisp
trunk/src/matrix/level2-function.lisp
trunk/src/matrix/level2-matrix-dge.lisp
trunk/src/matrix/store-ordinary-functions.lisp
Modified: trunk/package.lisp
==============================================================================
--- trunk/package.lisp (original)
+++ trunk/package.lisp Tue Feb 23 14:43:24 2010
@@ -74,6 +74,7 @@
".MAX"
".MIN"
".ABS"
+ ".SGN"
".IM"
".RE"
".CONJ"
Modified: trunk/src/core/level0-functions.lisp
==============================================================================
--- trunk/src/core/level0-functions.lisp (original)
+++ trunk/src/core/level0-functions.lisp Tue Feb 23 14:43:24 2010
@@ -62,6 +62,9 @@
(./ (.ln x) (.ln base))
(.ln x)))
+(defmethod .sgn ((a number))
+ (signum a))
+
(defmethod .abs ((a number))
(abs a))
Modified: trunk/src/core/level0-interface.lisp
==============================================================================
--- trunk/src/core/level0-interface.lisp (original)
+++ trunk/src/core/level0-interface.lisp Tue Feb 23 14:43:24 2010
@@ -60,6 +60,9 @@
(defgeneric .min (a b)
(:documentation "Generialized min."))
+(defgeneric .sgn (a)
+ (:documentation "Generialized signum."))
+
(defgeneric .abs (a)
(:documentation "Generialized abs."))
Modified: trunk/src/matrix/level2-function.lisp
==============================================================================
--- trunk/src/matrix/level2-function.lisp (original)
+++ trunk/src/matrix/level2-function.lisp Tue Feb 23 14:43:24 2010
@@ -1,5 +1,5 @@
;;; Lisplab, level2-generic.lisp
-;;; Level2, non-specialized methods for function iteration.
+;;; Level2, non-specialized methods for functions.
;;; Copyright (C) 2009 Joern Inge Vestgaarden
;;;
@@ -31,7 +31,7 @@
.asin .acos .atan
.sinh .cosh .tanh
.asinh .acosh .atanh
- .re .im .abs
+ .re .im .abs .sgn
.exp .ln .sqr .sqrt .conj ))
(defmacro expand-each-element-ordinary-functions ()
Modified: trunk/src/matrix/level2-matrix-dge.lisp
==============================================================================
--- trunk/src/matrix/level2-matrix-dge.lisp (original)
+++ trunk/src/matrix/level2-matrix-dge.lisp Tue Feb 23 14:43:24 2010
@@ -240,7 +240,8 @@
#+nil (.conj . conjugate_dfa)
#+nil (.re . realpart_dfa)
#+nil (.im . imagpart_dfa)
- (.abs . abs_dfa-to-dfa)))
+ (.abs . abs_dfa-to-dfa)
+ (.sgn . signum_dfa-to-dfa)))
(defmacro defmethod-dfa-to-dfa (name underlying-function)
(let ((a (gensym "a"))
Modified: trunk/src/matrix/store-ordinary-functions.lisp
==============================================================================
--- trunk/src/matrix/store-ordinary-functions.lisp (original)
+++ trunk/src/matrix/store-ordinary-functions.lisp Tue Feb 23 14:43:24 2010
@@ -60,7 +60,8 @@
(sqrt . sqrt_dfa-to-dfa)
(exp . exp_dfa-to-dfa)
(log . log_dfa-to-dfa)
- (abs . abs_dfa-to-dfa)))
+ (abs . abs_dfa-to-dfa)
+ (signum . signum_dfa-to-dfa)))
;; the iterative version
#+lisplab-iterative (defmacro defun-dfa-to-dfa-iterative (name op)
More information about the lisplab-cvs
mailing list