[lisplab-cvs] r206 - in trunk: . src/core src/util
jivestgarden at common-lisp.net
jivestgarden at common-lisp.net
Sun Oct 9 14:12:52 UTC 2011
Author: jivestgarden
Date: Sun Oct 9 07:12:51 2011
New Revision: 206
Log:
changed utilities dependency
Added:
trunk/src/util/level0-basic.lisp
- copied unchanged from r205, trunk/src/core/level0-basic.lisp
trunk/src/util/level0-const.lisp
- copied unchanged from r205, trunk/src/core/level0-const.lisp
Deleted:
trunk/src/core/level0-basic.lisp
trunk/src/core/level0-const.lisp
Modified:
trunk/lisplab.asd
Modified: trunk/lisplab.asd
==============================================================================
--- trunk/lisplab.asd Sun Oct 9 06:51:59 2011 (r205)
+++ trunk/lisplab.asd Sun Oct 9 07:12:51 2011 (r206)
@@ -47,6 +47,20 @@
(:file "package")
(:file "version")
+ (:module :src/util
+ :depends-on ()
+ :serial t
+ :components
+ ((:file "type")
+ (:file "level0-basic")
+ (:file "level0-const")
+ (:file "ref")
+ (:file "level1-util")
+ (:file "store-operators")
+ (:file "store-ordinary-functions")
+ (:file "permutation")
+ ))
+
;;
;; All core none-matrix stuff (level 0)
;;
@@ -54,27 +68,12 @@
:depends-on ("package")
:serial t
:components
- (
- (:file "level0-basic")
- (:file "level0-const")
- (:file "level0-interface")
+ ((:file "level0-interface")
;; (:file "level0-default")
(:file "level0-functions")
(:file "level0-thread")
))
- (:module :src/util
- :depends-on (src/core) ; Fixit: it only needs package and define-constant
- :serial t
- :components
- ((:file "type")
- (:file "ref")
- (:file "level1-util")
- (:file "store-operators")
- (:file "store-ordinary-functions")
- (:file "permutation")
- ))
-
(:module :src/vector1
:depends-on (:src/core :src/util)
:serial t
@@ -116,7 +115,6 @@
(:file "vector2-zge")
))
-
(:module :src/list
:depends-on (:src/core)
:serial t
Copied: trunk/src/util/level0-basic.lisp (from r205, trunk/src/core/level0-basic.lisp)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/util/level0-basic.lisp Sun Oct 9 07:12:51 2011 (r206, copy of r205, trunk/src/core/level0-basic.lisp)
@@ -0,0 +1,52 @@
+;;; Lisplab, level0-basic.lisp
+;;; Basic definitions, speical variables and general macros.
+
+;;; Copyright (C) 2009 Joern Inge Vestgaarden
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+;; TODO clean up. Here's a lot of unused stuff
+
+(in-package :lisplab)
+
+;; Here non ansi stuff.
+;; First we need the truely-the macro
+
+#+sbcl(import 'sb-ext::truly-the)
+;; Help, not tested
+#-sbcl(defmacro truely-the (type val) `(the ,type ,val))
+
+(defmacro define-constant (name value &optional doc)
+ "Works as defconstant. Made to avoid trouble with sbcl's strict
+interpretation of the ansi standard."
+ (let ((old-value (gensym)))
+ `(defconstant ,name
+ (if (boundp ',name)
+ (let ((,old-value (symbol-value ',name)))
+ (if (equalp ,old-value ,value)
+ ,old-value
+ ,value))
+ ,value)
+ ,@(when doc (list doc)))))
+
+(defun to-df (x)
+ "Coerce x to double float."
+ (coerce x 'double-float))
+
+(defun make-dvec (n)
+ "Creates a double vector with n elements."
+ (make-array n :element-type 'double-float :initial-element 0d0))
+
+
Copied: trunk/src/util/level0-const.lisp (from r205, trunk/src/core/level0-const.lisp)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/util/level0-const.lisp Sun Oct 9 07:12:51 2011 (r206, copy of r205, trunk/src/core/level0-const.lisp)
@@ -0,0 +1,62 @@
+;;; Lisplab, level0-const.lisp
+;;; General purpose constants
+
+;;; Copyright (C) 2009 Joern Inge Vestgaarden
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+(in-package :lisplab)
+
+;;; Float and complex constants
+(define-constant %e (exp 1d0) "The number e = exp(1).")
+(define-constant %i #C(0d0 1d0) "The imaginary unit i=sqrt(-1).")
+(define-constant -%i #C(0d0 -1d0) "The negative imaginary unit -i=-sqrt(-1).")
+
+;;; Type constants
+;;; TODO: throw them out or use deftype in stead
+(define-constant %df 'double-float)
+(define-constant %cdf '(complex double-float))
+(define-constant %sb32 '(signed-byte 32))
+(define-constant %ub32 '(unsigned-byte 32))
+
+;;;; Constants from gsl.
+
+;;; TODO: throw them out
+
+(define-constant +lisplab-dbl-epsilon+ 2.2204460492503131d-16)
+(define-constant +lisplab-sqrt-dbl-epsilon+ 1.4901161193847656d-08)
+(define-constant +lisplab-root3-dbl-epsilon+ 6.0554544523933429d-06)
+(define-constant +lisplab-root4-dbl-epsilon+ 1.2207031250000000d-04)
+(define-constant +lisplab-root5-dbl-epsilon+ 7.4009597974140505d-04)
+(define-constant +lisplab-root6-dbl-epsilon+ 2.4607833005759251d-03)
+(define-constant +lisplab-log-dbl-epsilon+ -3.6043653389117154d+01)
+
+(define-constant +lisplab-dbl-min+ 2.2250738585072014d-308)
+(define-constant +lisplab-sqrt-dbl-min+ 1.4916681462400413d-154)
+(define-constant +lisplab-root3-dbl-min+ 2.8126442852362996d-103)
+(define-constant +lisplab-root4-dbl-min+ 1.2213386697554620d-77)
+(define-constant +lisplab-root5-dbl-min+ 2.9476022969691763d-62)
+(define-constant +lisplab-root6-dbl-min+ 5.3034368905798218d-52)
+(define-constant +lisplab-log-dbl-min+ -7.0839641853226408d+02)
+
+(define-constant +lisplab-dbl-max+ 1.7976931348623157d+308)
+(define-constant +lisplab-sqrt-dbl-max+ 1.3407807929942596d+154)
+(define-constant +lisplab-root3-dbl-max+ 5.6438030941222897d+102)
+(define-constant +lisplab-root4-dbl-max+ 1.1579208923731620d+77)
+(define-constant +lisplab-root5-dbl-max+ 4.4765466227572707d+61)
+(define-constant +lisplab-root6-dbl-max+ 2.3756689782295612d+51)
+(define-constant +lisplab-log-dbl-max+ 7.0978271289338397d+02)
+
+
More information about the lisplab-cvs
mailing list