Commit 2317ccf0 authored by Liam Healy's avatar Liam Healy
Browse files

Moved element-types.lisp from init to grid

Continued separation of GSLL into two packages and eventually systems,
the definitions in element-types.lisp are now in the c-array package.
parent 8d5cd4a5
;; Use the foreign-friendly arrays package.
;; Liam Healy 2008-03-22 15:40:08EDT
;; Time-stamp: <2009-05-19 21:32:06EDT foreign-friendly.lisp>
;; Time-stamp: <2009-12-07 22:51:17EST foreign-friendly.lisp>
;; $Id$
;;; Foreign-friendly arrays (original implementation by Tamas Papp)
......@@ -23,9 +23,9 @@
"Make an array of one or two dimensions for possible use in foreign code.
Syntax is similar to make-array, but note that element-type
is mandatory and limited to certain types."
(assert (member element-type *array-element-types* :test 'equal)
(assert (member element-type c-array:*array-element-types* :test 'equal)
"Specified element-type must be one of *array-element-types*.")
"Specified element-type must be one of c-array:*array-element-types*.")
(let* ((initial-matrix (listp (first initial-contents)))
(and initial-contents-p
;; Get/set array or elements: cl-array, maref
;; Liam Healy 2008-08-27 22:43:10EDT maref.lisp
;; Time-stamp: <2009-12-06 19:51:39EST maref.lisp>
;; Time-stamp: <2009-12-07 22:51:18EST maref.lisp>
;; $Id: $
(in-package :gsl)
......@@ -103,7 +103,7 @@
,@(if value-symbol
(list (c-array:cl-cffi tp) value-symbol)
(list (c-array:cl-cffi tp))))))
(defmethod maref
((pointer #.+foreign-pointer-class+) index &optional index2
......@@ -125,14 +125,14 @@
`("gsl_" :category :type ,"_get")
'vector tp)))
(mapcar (lambda (tp)
`("gsl_" :category :type ,"_get")
'matrix tp)))
(defmethod (setf maref)
(value (pointer #.+foreign-pointer-class+) index &optional index2
......@@ -154,14 +154,14 @@
`("gsl_" :category :type ,"_set")
'vector tp)))
(mapcar (lambda (tp)
'(setf maref)
`("gsl_" :category :type ,"_set")
'matrix tp)))
;; A "marray" is an array in both GSL and CL
;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <2009-12-06 19:50:09EST marray.lisp>
;; Time-stamp: <2009-12-07 22:46:41EST marray.lisp>
(in-package :gsl)
......@@ -107,7 +107,7 @@
(pushnew ',(cons class-name element-type-cl)
*class-element-type* :test #'equal)
(export ',class-name))))
;;;; Make data from either the dimensions provided or from the initial values
......@@ -277,7 +277,7 @@ GSLL has many functions that work on vectors (one-dimensional arrays)
and matrices (two-dimensional arrays). GSLL supports all array
element types that are supported by CFFI, the CL implementation,
GSL, and the platform. This list is available in the
variable <code>*array-element-types*</code>. On implementations that
variable <code>c-array:*array-element-types*</code>. On implementations that
support it (currently only SBCL), the contents are directly available
to the GSL functions without copying between the Lisp area and the C
area of memory.</p>
......@@ -450,7 +450,7 @@ and arrays used internally or for function return.
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
Time-stamp: <2009-11-09 15:27:51EST index.html>
Time-stamp: <2009-12-07 22:51:15EST index.html>
<!-- hhmts end -->
;; Mapping of element type names
;; Liam Healy 2008-04-13 11:22:46EDT element-types.lisp
;; Time-stamp: <2009-12-06 19:50:12EST element-types.lisp>
;; Time-stamp: <2009-12-07 22:51:13EST element-types.lisp>
;; $Id$
(in-package :gsl)
(in-package :c-array)
(export '(*array-element-types* *array-element-types-no-complex*
*float-complex-types* *float-types* *complex-types*
*double-types* element-types))
;;;; Common element type groups for generic functions
(defparameter *array-element-types*
(remove-duplicates (c-array:all-types c-array:*cstd-cl-type-mapping* t) :test 'equal)
(remove-duplicates (all-types *cstd-cl-type-mapping* t) :test 'equal)
"All the array element types supported.")
(defparameter *array-element-types-no-complex*
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2009-12-06 22:14:49EST gsll.asd>
;; Time-stamp: <2009-12-07 22:58:36EST gsll.asd>
(when (asdf:find-system :fsbv nil)
(pushnew :fsbv *features*))
......@@ -20,7 +20,8 @@
((:file "pkgdcl")
(:file "types" :depends-on ("pkgdcl"))
(:file "complex-types" :depends-on ("types"))))
(:file "complex-types" :depends-on ("pkgdcl" "types"))
(:file "element-types" :depends-on ("pkgdcl"))))
(:module init
:depends-on (grid)
......@@ -41,12 +42,9 @@
(cffi-grovel:grovel-file "callback-struct"
:depends-on ("types" "libgsl"))
(:file "funcallable" :depends-on ("utility"))
(:file "element-types" :depends-on ("init"))
(:file "interface"
:depends-on ("init" "conditions" "element-types"
(:file "defmfun"
:depends-on ("init" "forms" "element-types" "interface"))
:depends-on ("init" "conditions" "number-conversion"))
(:file "defmfun" :depends-on ("init" "forms" "interface"))
(:file "defmfun-array"
:depends-on ("defmfun" "callback-included"))
(:file "defmfun-single"
;; Helpers for defining GSL functions on arrays
;; Liam Healy 2009-01-07 22:01:16EST defmfun-array.lisp
;; Time-stamp: <2009-12-06 22:05:00EST defmfun-array.lisp>
;; Time-stamp: <2009-12-07 22:55:39EST defmfun-array.lisp>
;; $Id: $
(in-package :gsl)
......@@ -104,7 +104,7 @@
(actual-gfn gsl-name)
(actual-element-c-type eltype c-arguments)
(element-types element-types))))
(c-array:element-types element-types))))
(defun actual-gsl-function-name (base-name category type)
"Create the GSL or BLAS function name for data from the base name
;; Macro for defining GSL functions.
;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp
;; Time-stamp: <2009-11-18 09:14:07EST defmfun.lisp>
;; Time-stamp: <2009-12-07 22:53:35EST defmfun.lisp>
(in-package :gsl)
......@@ -41,7 +41,7 @@
;;; qualifier A method qualifier such as :after or :before.
;;; element-types
;;; Permissible types for elements of arrays. May be
;;; NIL meaning all of *array-element-types*, :no-complex
;;; NIL meaning all of c-array:*array-element-types*, :no-complex
;;; meaning that list without the complex types,
;;; :float meaning only the float types, :complex only
;;; the complex types, :float-complex both float and complex,
;; Define examples.
;; Liam Healy 2008-09-07 21:00:48EDT generate-tests.lisp
;; Time-stamp: <2009-12-06 22:05:00EST generate-examples.lisp>
;; Time-stamp: <2009-12-07 23:01:41EST generate-examples.lisp>
;; $Id: $
;;; Define examples that can be displayed by users with the function
......@@ -148,7 +148,7 @@
(defun generate-all-array-tests-body (element-types test)
(loop for det in (element-types element-types)
(loop for det in (c-array:element-types element-types)
(let ((default-element-type det))
(declare (special default-element-type starting-element))
;; Number types used by GSL functions, and specification conversion
;; Liam Healy 2008-12-31 21:06:34EST types.lisp
;; Time-stamp: <2009-12-07 22:26:03EST types.lisp>
;; Time-stamp: <2009-12-07 22:53:34EST types.lisp>
;; $Id: $
(in-package :gsl)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment