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
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -108,12 +108,11 @@
combination destination. The two combinations must have the same size.")
(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
(call-next-method)
(comb-copy
source
:destination
(or destination
(make-combination (combination-range source) (size source))))))
......
;; Permutations
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -93,11 +93,11 @@
permutation destination. The two permutations must have the same size.")
(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
(call-next-method)
(perm-copy
source :destination (or destination (make-permutation (size source))))))
source (or destination (make-permutation (size source))))))
(defmfun swap-elements ((p permutation) i j)
"gsl_permutation_swap"
......
;; The histogram structure
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -101,8 +101,8 @@
(defmethod grid:copy ((source histogram) &key destination &allow-other-keys)
(if destination
(histo-clone destination)
(histo-copy source)))
(histo-copy destination source)
(histo-clone destination)))
(defmfun histo2d-copy (source destination)
"gsl_histogram2d_memcpy"
......@@ -126,5 +126,5 @@
(defmethod grid:copy ((source histogram2d) &key destination &allow-other-keys)
(if destination
(histo2d-clone destination)
(histo2d-copy source)))
(histo2d-copy destination source)
(histo2d-clone destination)))
;; Generators of random numbers.
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -197,8 +197,8 @@
(defmethod grid:copy
((source random-number-generator) &key destination &allow-other-keys)
(if destination
(rng-clone destination)
(rng-copy source)))
(rng-copy source destination)
(rng-clone source)))
;;;;****************************************************************************
;;;; Examples and unit test
......
;; Quasi-random sequences in arbitrary dimensions.
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -84,8 +84,8 @@
(defmethod grid:copy
((source quasi-random-number-generator) &key destination &allow-other-keys)
(if destination
(quasi-clone destination)
(quasi-copy source)))
(quasi-copy source destination)
(quasi-clone source)))
(def-rng-type +niederreiter2+
;; 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