Commit 73c2426e authored by liam's avatar liam
Browse files

Generic function gsl-array to get a pointer to the C array with data.


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3040 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent 1d01e540
......@@ -3,7 +3,7 @@
; description: Combinations
; date: Sun Mar 26 2006 - 11:51
; author: Liam M. Healy
; modified: Sun Apr 16 2006 - 14:07
; modified: Tue Apr 18 2006 - 23:28
;********************************************************
;;; $Id: $
......@@ -22,6 +22,9 @@
;;; Allocation, freeing, reading and writing
(defdata "combination" :size 'fixnum 2)
(defmethod gsl-array ((object gsl-combination))
(foreign-slot-value (pointer object) 'gsl-combination-c 'data))
(add-wrap-type gsl-combination-c (lambda (x) `(pointer ,x)))
;;;;****************************************************************************
......
......@@ -3,7 +3,7 @@
; description: Using GSL storage.
; date: Sun Mar 26 2006 - 16:32
; author: Liam M. Healy
; modified: Sun Apr 16 2006 - 21:32
; modified: Wed Apr 19 2006 - 00:46
;********************************************************
;;; $Id: $
......@@ -46,6 +46,9 @@
(when contents
(princ (data object) stream))))
(defgeneric gsl-array (object)
(:documentation "A pointer to the GSL array with the data contents."))
;;; Accessing elements
(export 'gsl-aref)
(defgeneric gsl-aref (object &rest indices)
......
......@@ -3,7 +3,7 @@
; description: Matrices
; date: Sun Mar 26 2006 - 11:51
; author: Liam M. Healy
; modified: Sun Apr 16 2006 - 14:04
; modified: Tue Apr 18 2006 - 23:27
;********************************************************
;;; $Id: $
......@@ -25,6 +25,9 @@
;;; Allocation, freeing, reading and writing
(defdata "matrix" :double 'double-float 2)
(defmethod gsl-array ((object gsl-matrix))
(foreign-slot-value (pointer object) 'gsl-matrix-c 'data))
(add-wrap-type gsl-matrix-c (lambda (x) `(pointer ,x)))
;;;;****************************************************************************
......
......@@ -3,7 +3,7 @@
; description: Permutations
; date: Sun Mar 26 2006 - 11:51
; author: Liam M. Healy
; modified: Sun Apr 16 2006 - 14:10
; modified: Tue Apr 18 2006 - 23:27
;********************************************************
;;; $Id: $
......@@ -21,6 +21,9 @@
;;; Allocation, freeing, reading and writing
(defdata "permutation" :size 'fixnum)
(defmethod gsl-array ((object gsl-permutation))
(foreign-slot-value (pointer object) 'gsl-permutation-c 'data))
(add-wrap-type gsl-permutation-c (lambda (x) `(pointer ,x)))
;;;;****************************************************************************
......
......@@ -3,7 +3,7 @@
; description: Vectors
; date: Sun Mar 26 2006 - 11:51
; author: Liam M. Healy
; modified: Mon Apr 17 2006 - 09:11
; modified: Tue Apr 18 2006 - 23:27
;********************************************************
;;; $Id: $
......@@ -50,6 +50,9 @@ deallocated with the vector.
;;; Allocation, freeing, reading and writing
(defdata "vector" :double 'double-float)
(defmethod gsl-array ((object gsl-vector))
(foreign-slot-value (pointer object) 'gsl-vector-c 'data))
(add-wrap-type gsl-vector-c (lambda (x) `(pointer ,x)))
;;;;****************************************************************************
......
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