From da5b6d2ad43f1fce4814b7afc5f184193f51ebf3 Mon Sep 17 00:00:00 2001 From: "Liam M. Healy" <lnp@healy.washington.dc.us> Date: Fri, 16 Jul 2010 17:19:47 -0400 Subject: [PATCH] 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. --- data/combination.lisp | 5 ++--- data/permutation.lisp | 6 +++--- histogram/histogram.lisp | 10 +++++----- random/generators.lisp | 6 +++--- random/quasi.lisp | 6 +++--- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/data/combination.lisp b/data/combination.lisp index 2e1ad1b9..ae57ad5b 100644 --- a/data/combination.lisp +++ b/data/combination.lisp @@ -1,6 +1,6 @@ ;; 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)))))) diff --git a/data/permutation.lisp b/data/permutation.lisp index bcaa660c..3eb8b7d9 100644 --- a/data/permutation.lisp +++ b/data/permutation.lisp @@ -1,6 +1,6 @@ ;; 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" diff --git a/histogram/histogram.lisp b/histogram/histogram.lisp index 50aae82e..0a671670 100644 --- a/histogram/histogram.lisp +++ b/histogram/histogram.lisp @@ -1,6 +1,6 @@ ;; 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))) diff --git a/random/generators.lisp b/random/generators.lisp index e938813e..45736e7c 100644 --- a/random/generators.lisp +++ b/random/generators.lisp @@ -1,6 +1,6 @@ ;; 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 diff --git a/random/quasi.lisp b/random/quasi.lisp index 2def9355..605de960 100644 --- a/random/quasi.lisp +++ b/random/quasi.lisp @@ -1,6 +1,6 @@ ;; 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 -- GitLab