From 73c2426e25c91bdc6ecb6b1654187d4e4cc6a947 Mon Sep 17 00:00:00 2001
From: liam <liam@a3d8a0fb-c1db-0310-ace7-a616afeb9e30>
Date: Wed, 19 Apr 2006 04:47:13 +0000
Subject: [PATCH] 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
---
 data/combination.lisp | 5 ++++-
 data/data.lisp        | 5 ++++-
 data/matrix.lisp      | 5 ++++-
 data/permutation.lisp | 5 ++++-
 data/vector.lisp      | 5 ++++-
 5 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/data/combination.lisp b/data/combination.lisp
index ec562eae..052df5b0 100644
--- a/data/combination.lisp
+++ b/data/combination.lisp
@@ -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)))
 
 ;;;;****************************************************************************
diff --git a/data/data.lisp b/data/data.lisp
index c35ae8f7..c669419c 100644
--- a/data/data.lisp
+++ b/data/data.lisp
@@ -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)
diff --git a/data/matrix.lisp b/data/matrix.lisp
index 1a4d8379..c1985683 100644
--- a/data/matrix.lisp
+++ b/data/matrix.lisp
@@ -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)))
 
 ;;;;****************************************************************************
diff --git a/data/permutation.lisp b/data/permutation.lisp
index e94a2c90..36916181 100644
--- a/data/permutation.lisp
+++ b/data/permutation.lisp
@@ -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)))
 
 ;;;;****************************************************************************
diff --git a/data/vector.lisp b/data/vector.lisp
index 9b0bbab5..ed917698 100644
--- a/data/vector.lisp
+++ b/data/vector.lisp
@@ -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)))
 
 ;;;;****************************************************************************
-- 
GitLab