Skip to content
Snippets Groups Projects
Commit da5b6d2a authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Fix non-array copy and clone functions

Most of the non-array copy and clone functions had wrong calls, wrong
arguments, and/or superfluous arguments; now fixed.
parent bdbb354b
No related branches found
No related tags found
No related merge requests found
;; Combinations ;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51 ;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2010-07-15 23:06:33EDT combination.lisp> ;; Time-stamp: <2010-07-16 17:14:03EDT combination.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -108,12 +108,11 @@ ...@@ -108,12 +108,11 @@
combination destination. The two combinations must have the same size.") combination destination. The two combinations must have the same size.")
(defmethod grid:copy (defmethod grid:copy
((source combination) &rest args &key grid-type destination &allow-other-keys) ((source combination) &key grid-type destination &allow-other-keys)
(if grid-type (if grid-type
(call-next-method) (call-next-method)
(comb-copy (comb-copy
source source
:destination
(or destination (or destination
(make-combination (combination-range source) (size source)))))) (make-combination (combination-range source) (size source))))))
......
;; Permutations ;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51 ;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2010-07-15 23:05:04EDT permutation.lisp> ;; Time-stamp: <2010-07-16 17:14:45EDT permutation.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -93,11 +93,11 @@ ...@@ -93,11 +93,11 @@
permutation destination. The two permutations must have the same size.") permutation destination. The two permutations must have the same size.")
(defmethod grid:copy (defmethod grid:copy
((source permutation) &rest args &key grid-type destination &allow-other-keys) ((source permutation) &key grid-type destination &allow-other-keys)
(if grid-type (if grid-type
(call-next-method) (call-next-method)
(perm-copy (perm-copy
source :destination (or destination (make-permutation (size source)))))) source (or destination (make-permutation (size source))))))
(defmfun swap-elements ((p permutation) i j) (defmfun swap-elements ((p permutation) i j)
"gsl_permutation_swap" "gsl_permutation_swap"
......
;; The histogram structure ;; The histogram structure
;; Liam Healy, Mon Jan 1 2007 - 11:32 ;; Liam Healy, Mon Jan 1 2007 - 11:32
;; Time-stamp: <2010-07-15 22:27:24EDT histogram.lisp> ;; Time-stamp: <2010-07-16 17:10:12EDT histogram.lisp>
;; ;;
;; Copyright 2007, 2008, 2009, 2010 Liam M. Healy ;; Copyright 2007, 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -101,8 +101,8 @@ ...@@ -101,8 +101,8 @@
(defmethod grid:copy ((source histogram) &key destination &allow-other-keys) (defmethod grid:copy ((source histogram) &key destination &allow-other-keys)
(if destination (if destination
(histo-clone destination) (histo-copy destination source)
(histo-copy source))) (histo-clone destination)))
(defmfun histo2d-copy (source destination) (defmfun histo2d-copy (source destination)
"gsl_histogram2d_memcpy" "gsl_histogram2d_memcpy"
...@@ -126,5 +126,5 @@ ...@@ -126,5 +126,5 @@
(defmethod grid:copy ((source histogram2d) &key destination &allow-other-keys) (defmethod grid:copy ((source histogram2d) &key destination &allow-other-keys)
(if destination (if destination
(histo2d-clone destination) (histo2d-copy destination source)
(histo2d-copy source))) (histo2d-clone destination)))
;; Generators of random numbers. ;; Generators of random numbers.
;; Liam Healy, Sat Jul 15 2006 - 14:43 ;; Liam Healy, Sat Jul 15 2006 - 14:43
;; Time-stamp: <2010-07-15 22:43:39EDT generators.lisp> ;; Time-stamp: <2010-07-16 17:11:25EDT generators.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -197,8 +197,8 @@ ...@@ -197,8 +197,8 @@
(defmethod grid:copy (defmethod grid:copy
((source random-number-generator) &key destination &allow-other-keys) ((source random-number-generator) &key destination &allow-other-keys)
(if destination (if destination
(rng-clone destination) (rng-copy source destination)
(rng-copy source))) (rng-clone source)))
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Examples and unit test ;;;; Examples and unit test
......
;; Quasi-random sequences in arbitrary dimensions. ;; Quasi-random sequences in arbitrary dimensions.
;; Liam Healy, Sun Jul 16 2006 - 15:54 ;; Liam Healy, Sun Jul 16 2006 - 15:54
;; Time-stamp: <2010-07-15 22:41:48EDT quasi.lisp> ;; Time-stamp: <2010-07-16 17:10:54EDT quasi.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
(defmethod grid:copy (defmethod grid:copy
((source quasi-random-number-generator) &key destination &allow-other-keys) ((source quasi-random-number-generator) &key destination &allow-other-keys)
(if destination (if destination
(quasi-clone destination) (quasi-copy source destination)
(quasi-copy source))) (quasi-clone source)))
(def-rng-type +niederreiter2+ (def-rng-type +niederreiter2+
;; FDL ;; FDL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment