2 randperm - randomly permute a list or matrix
13 For a list or matrix x, randperm(x) returns a copy of x in which
14 the elements have been randomly permuted. The value of x is not
17 This function uses the rand() subtractive 100 shuffle pseudo-random
24 list (5 elements, 5 nonzero):
33 list (5 elements, 5 nonzero):
47 comp, fact, rand, perm
49 ## Copyright (C) 1999-2006 Landon Curt Noll
51 ## Calc is open software; you can redistribute it and/or modify it under
52 ## the terms of the version 2.1 of the GNU Lesser General Public License
53 ## as published by the Free Software Foundation.
55 ## Calc is distributed in the hope that it will be useful, but WITHOUT
56 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
57 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
58 ## Public License for more details.
60 ## A copy of version 2.1 of the GNU Lesser General Public License is
61 ## distributed with calc under the filename COPYING-LGPL. You should have
62 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
63 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
65 ## @(#) $Revision: 30.1 $
66 ## @(#) $Id: randperm,v 30.1 2007/03/16 11:10:42 chongo Exp $
67 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/randperm,v $
69 ## Under source code control: 1995/07/10 02:09:31
70 ## File existed as early as: 1995
72 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
73 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/