- Timestamp:
- 03/16/08 02:25:01 (8 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
documentation/documentation.html (modified) (3 diffs)
-
init/interface.lisp (modified) (5 diffs)
-
sorting.lisp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/documentation/documentation.html
r34 r37 119 119 properly, unless CFFI and the CL platform provide C stream 120 120 compatibility. 121 <li>Some <a href="Sorting.html">sorting</a> functions fail on amd64 platforms,122 perhaps because of lack of unsigned integer vectors.123 121 <li><a href="BLAS-Support.html">BLAS</a> is completed, but with only very 124 122 limited testing. … … 141 139 <ul> 142 140 <li>CLISP shows three "foreign callout errors". Remedy unknown. 143 <li>Sorting shows two failures on amd64 platforms. This is possibly144 because of the use of integer vectors to store unsigned integer145 vectors.146 141 <li>There are several regression failures that are apparently due to 147 142 changes in GSL between versions 1.8 and 1.10. These are: … … 156 151 <!-- hhmts start --> 157 152 <small> 158 Time-stamp: <2008-03- 09 22:21:24EDT documentation.html>153 Time-stamp: <2008-03-15 21:59:58EDT documentation.html> 159 154 </small> 160 155 <!-- hhmts end --> -
trunk/init/interface.lisp
r29 r37 1 1 ;; Macros to interface GSL functions. 2 2 ;; Liam Healy 3 ;; Time-stamp: <2008-03- 02 21:43:02EST interface.lisp>3 ;; Time-stamp: <2008-03-15 21:51:07EDT interface.lisp> 4 4 ;; $Id$ 5 5 … … 150 150 ;;; after After method. 151 151 ;;; enumeration The name of the enumeration return. 152 ;;; global Bind variable(s) in a let* enclosing the whole body. 152 153 (defmacro defmfun 153 154 (name arglist gsl-name c-arguments … … 155 156 (return nil return-supplied-p) 156 157 (type :function) (index t) (export (not (eq type :method))) 157 null-pointer-info documentation invalidate after enumeration) 158 null-pointer-info documentation invalidate after enumeration 159 global) 158 160 (let* ((cargs (substitute '(mode sf-mode) :mode c-arguments)) 159 161 (carg-symbs … … 171 173 (if (listp c-return) (st-symbol c-return) (make-symbol "CRETURN"))) 172 174 (allocated ; Foreign objects to be allocated 173 (remove-if (lambda (s) (member s arglist-symbs)) carg-symbs)) 175 (remove-if 176 (lambda (s) (or (member s arglist-symbs) (member s global :key #'first))) 177 carg-symbs)) 174 178 (allocated-decl 175 179 (mapcar … … 185 189 (,(if (eq type :function) 'defun 'defmethod) 186 190 ,name 187 ,(if (member :mode c-arguments) 188 `(,@clargs &optional (mode :double-prec)) 189 `(,@clargs)) 191 ,(let ((noaux 192 (if (member :mode c-arguments) 193 `(,@clargs &optional (mode :double-prec)) 194 `(,@clargs)))) 195 (if global 196 (append noaux (cons '&aux global)) 197 noaux)) 190 198 ,(declaration-form clargs-types) 191 199 ,@(when documentation (list documentation)) -
trunk/sorting.lisp
r34 r37 1 1 ;; Sorting 2 2 ;; Liam Healy, Fri Apr 14 2006 - 20:20 3 ;; Time-stamp: <2008-03- 09 21:42:24EDT sorting.lisp>3 ;; Time-stamp: <2008-03-15 22:09:56EDT sorting.lisp> 4 4 ;; $Id$ 5 5 … … 8 8 ;;; #'heapsort has just a cursory port, use CL's #'sort. 9 9 ;;; Raw C array functions not ported, not policy. 10 11 ;;; Errors:12 ;;; sort-vector-smallest-index and sort-vector-largest-index13 ;;; do not work on amd64/SBCL, and should be defined in terms of14 ;;; vector-unsigned-fixnum anyway15 10 16 11 ;;;;**************************************************************************** … … 93 88 :invalidate (dest)) 94 89 95 ;;; p should be gsl-vector-unsigned-fixnum, if that can be made to96 ;;; work (see vector.lisp).97 90 (export 'sort-vector-smallest-index) 98 (defgeneric sort-vector-smallest-index (p vector) 99 (:documentation ; FDL 100 "The indices of the smallest elements of the vector stored 101 in the array p.")) 91 (defgeneric sort-vector-smallest-index (indices vector) 92 (:documentation 93 "The indices of the smallest elements of the vector stored, 94 returned as a CL vector of element type fixnum. If 95 indices is a positive initeger, a vector will be 96 allocated and returned. If it is a CL vector, 97 it will be filled with the indices.")) 102 98 103 99 (defmfun-vdsf sort-vector-smallest-index 104 ( (p vector-fixnum)(v vector))100 (indices (v vector)) 105 101 "gsl_sort_vector_smallest_index" 106 (((gsl-array p) :pointer) ((dim0 p) size) 107 ((pointer v) gsl-vector-c)) 108 :c-return :void 109 :invalidate (p)) 102 ((p (size number)) (number size) ((pointer v) :pointer)) 103 :type :method 104 :global ((number (if (numberp indices) indices (length indices)))) 105 :c-return :void 106 :return 107 ((let* ((vector 108 (if (numberp indices) 109 (make-array (list indices) :element-type 'fixnum) 110 indices))) 111 (dotimes (i number vector) 112 (setf (aref vector i) (scref p i)))))) 110 113 111 114 (export 'sort-vector-largest) … … 125 128 ;;; p should be gsl-vector-unsigned-fixnum, if that can be made to 126 129 ;;; work (see vector.lisp). 127 (defgeneric sort-vector-largest-index (p vector) 128 (:documentation ; FDL 129 "The indices of the largest elements of the vector stored 130 in the array p.")) 131 132 (defmfun-vdsf sort-vector-largest-index 133 ((p vector-fixnum) (v vector)) 130 (defgeneric sort-vector-largest-index (indices vector) 131 (:documentation 132 "The indices of the largest elements of the vector stored, 133 returned as a CL vector of element type fixnum. If 134 indices is a positive initeger, a vector will be 135 allocated and returned. If it is a CL vector, 136 it will be filled with the indices.")) 137 138 (defmfun-vdsf sort-vector-largest-index (indices (v vector)) 134 139 "gsl_sort_vector_largest_index" 135 (((gsl-array p) :pointer) ((dim0 p) size) 136 ((pointer v) gsl-vector-c)) 137 :c-return :void 138 :invalidate (p)) 140 ((p (size number)) (number size) ((pointer v) :pointer)) 141 :type :method 142 :global ((number (if (numberp indices) indices (length indices)))) 143 :c-return :void 144 :return 145 ((let* ((vector 146 (if (numberp indices) 147 (make-array (list indices) :element-type 'fixnum) 148 indices))) 149 (dotimes (i number vector) 150 (setf (aref vector i) (scref p i)))))) 139 151 140 152 ;;;;**************************************************************************** … … 155 167 (sort-vector-smallest smallest vec) 156 168 (data smallest)) 157 (letm ((vec (vector-double-float #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 158 (smallest (vector-fixnum 3))) 159 (sort-vector-smallest-index smallest vec) 160 (data smallest)) 169 (letm ((vec (vector-double-float #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 170 (sort-vector-smallest-index 3 vec)) 161 171 (letm ((vec (vector-double-float #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 162 172 (largest (vector-double-float 3))) 163 173 (sort-vector-largest largest vec) 164 174 (data largest)) 165 (letm ((vec (vector-double-float #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 166 (largest (vector-fixnum 3))) 167 (sort-vector-largest-index largest vec) 168 (data largest))) 175 (letm ((vec (vector-double-float #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 176 (sort-vector-largest-index 3 vec))) 169 177 |# 170 178 179 171 180 (LISP-UNIT:DEFINE-TEST SORTING 172 181 (LISP-UNIT::ASSERT-NUMERICAL-EQUAL 173 182 (LIST #(-3.21d0 -2.0d0 1.0d0 7.1d0 12.8d0)) 174 183 (MULTIPLE-VALUE-LIST 175 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 184 (LETM 185 ((VEC 186 (VECTOR-DOUBLE-FLOAT 187 #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 176 188 (SORT-VECTOR VEC) (DATA VEC)))) 177 189 (LISP-UNIT::ASSERT-NUMERICAL-EQUAL … … 179 191 (MULTIPLE-VALUE-LIST 180 192 (LETM ((PERM (PERMUTATION 5)) 181 (VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))))193 (VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 182 194 (SORT-VECTOR-INDEX PERM VEC) 183 195 (DATA PERM)))) … … 186 198 (MULTIPLE-VALUE-LIST 187 199 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 188 (SMALLEST (VECTOR-DOUBLE-FLOAT 3)))200 (SMALLEST (VECTOR-DOUBLE-FLOAT 3))) 189 201 (SORT-VECTOR-SMALLEST SMALLEST VEC) 190 202 (DATA SMALLEST)))) … … 192 204 (LIST #(3 1 4)) 193 205 (MULTIPLE-VALUE-LIST 206 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 207 (SORT-VECTOR-SMALLEST-INDEX 3 VEC)))) 208 (LISP-UNIT::ASSERT-NUMERICAL-EQUAL 209 (LIST #(12.8d0 7.1d0 1.0d0)) 210 (MULTIPLE-VALUE-LIST 194 211 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 195 (SMALLEST (VECTOR-FIXNUM 3))) 196 (SORT-VECTOR-SMALLEST-INDEX 197 SMALLEST VEC) 198 (DATA SMALLEST)))) 199 (LISP-UNIT::ASSERT-NUMERICAL-EQUAL 200 (LIST #(12.8d0 7.1d0 1.0d0)) 201 (MULTIPLE-VALUE-LIST 202 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 203 (LARGEST (VECTOR-DOUBLE-FLOAT 3))) 212 (LARGEST (VECTOR-DOUBLE-FLOAT 3))) 204 213 (SORT-VECTOR-LARGEST LARGEST VEC) (DATA LARGEST)))) 205 214 (LISP-UNIT::ASSERT-NUMERICAL-EQUAL 206 215 (LIST #(2 0 4)) 207 216 (MULTIPLE-VALUE-LIST 208 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0))) 209 (LARGEST (VECTOR-FIXNUM 3))) 210 (SORT-VECTOR-LARGEST-INDEX LARGEST VEC) 211 (DATA LARGEST))))) 217 (LETM ((VEC (VECTOR-DOUBLE-FLOAT #(7.1d0 -2.0d0 12.8d0 -3.21d0 1.0d0)))) 218 (SORT-VECTOR-LARGEST-INDEX 3 VEC)))))
