Verified Commit 8ef71890 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Use feature for GSL2; abort for now if present

Abort loading with explanation that GSLL does not yet work with GSL
2. Replace incorrect combination of read-time evaluation and read-time
feature with a regular read-time feature on the symbol :gsl2 for when
support is completed.
parent 2d3c6598
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
;; GSL library version
;; Liam Healy 2016-08-06 10:37:52EDT gsl-version.lisp
;; Time-stamp: <2016-08-06 10:48:20EDT gsl-version.lisp>
;; Time-stamp: <2016-08-06 22:05:11EDT gsl-version.lisp>
;;
;; Copyright 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
@@ -20,6 +20,8 @@

(in-package :gsl)

(eval-when (:compile-toplevel :load-toplevel :execute)

  (cffi:defcvar ("gsl_version" *gsl-version* :read-only t) :string
    "The version of the GSL library being used.")
  (export '*gsl-version*)
@@ -34,3 +36,9 @@
		 (read-from-string *gsl-version* nil nil :start (1+ sep-pos))))
	  (and (>= my-major (first major-minor))
	       (>= my-minor (second major-minor))))))
  )

(when (have-at-least-gsl-version '(2 0))
  (pushnew :gsl2 *features*)
  ;; Following form to be deleted when GSL 2 support is present
  (error "GSLL does not currently work with GSL version 2.x"))
+3 −3
Original line number Diff line number Diff line
;; Linear least squares, or linear regression
;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp>
;; Time-stamp: <2016-08-06 12:26:24EDT linear-least-squares.lisp>
;; Time-stamp: <2016-08-06 22:01:47EDT linear-least-squares.lisp>
;;
;; Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
@@ -223,7 +223,7 @@
   Any components which have zero singular value (to machine
   precision) are discarded from the fit.")

#-#.(gsl::have-at-least-gsl-version '(2 0)) ; GSL v1.x
#-gsl2 ; GSL v1.x
(defmfun linear-mfit-svd
    (model observations parameters-or-size tolerance
	   &optional weight
@@ -259,7 +259,7 @@

   The best-fit is found by singular value decomposition of the matrix model using the preallocated workspace provided.  The modified Golub-Reinsch SVD algorithm is used, with column scaling to improve the accuracy of the singular values (unweighted).  Any components which have zero singular value (to machine precision) are discarded  from the fit.  In the second form of the function the components are discarded if the ratio of singular values s_i/s_0 falls below the user-specified tolerance, and the effective rank is returned as the second value.")

#+#.(gsl::have-at-least-gsl-version '(2 0)) ; GSL v2.x
#+gsl2 ; GSL v2.x
(defmfun linear-mfit-svd
    (model observations parameters-or-size tolerance
	   &optional weight
+3 −3
Original line number Diff line number Diff line
;; Elliptic integrals
;; Liam Healy, Mon Mar 20 2006 - 21:50
;; Time-stamp: <2016-08-06 11:49:54EDT elliptic-integrals.lisp>
;; Time-stamp: <2016-08-06 22:03:19EDT elliptic-integrals.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
@@ -65,14 +65,14 @@
  parameters m = k^2 and sin^2(alpha) = k^2, with the change of sign
  n to -n.")

#-#.(gsl::have-at-least-gsl-version '(2 0)) ; GSL v1.x
#-gsl2 ; GSL v1.x
(defmfun elliptic-integral-D (phi k n &optional (mode :double))
  "gsl_sf_ellint_D_e"
  ((phi :double) (k :double) (n :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
  :documentation			; GSL texi
  "The incomplete elliptic integral D(phi,k,n) which is defined through the Carlson form RD(x,y,z) by the relation D(phi,k,n) = RD (1-sin^2(phi), 1-k^2 sin^2(phi), 1).")

#+#.(gsl::have-at-least-gsl-version '(2 0)) ; GSL v2.x
#+gsl2 ; GSL v2.x
(defmfun elliptic-integral-D (phi k &optional (mode :double))
  "gsl_sf_ellint_D_e"
  ((phi :double) (k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))