3
<title>Permutation functions - GNU Scientific Library -- Reference Manual</title>
4
<meta http-equiv="Content-Type" content="text/html">
5
<meta name="description" content="GNU Scientific Library -- Reference Manual">
6
<meta name="generator" content="makeinfo 4.8">
7
<link title="Top" rel="start" href="index.html#Top">
8
<link rel="up" href="Permutations.html#Permutations" title="Permutations">
9
<link rel="prev" href="Permutation-properties.html#Permutation-properties" title="Permutation properties">
10
<link rel="next" href="Applying-Permutations.html#Applying-Permutations" title="Applying Permutations">
11
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
13
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 The GSL Team.
15
Permission is granted to copy, distribute and/or modify this document
16
under the terms of the GNU Free Documentation License, Version 1.2 or
17
any later version published by the Free Software Foundation; with the
18
Invariant Sections being ``GNU General Public License'' and ``Free Software
19
Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
20
and with the Back-Cover Text being (a) (see below). A copy of the
21
license is included in the section entitled ``GNU Free Documentation
24
(a) The Back-Cover Text is: ``You have freedom to copy and modify this
25
GNU Manual, like GNU software.''-->
26
<meta http-equiv="Content-Style-Type" content="text/css">
27
<style type="text/css"><!--
28
pre.display { font-family:inherit }
29
pre.format { font-family:inherit }
30
pre.smalldisplay { font-family:inherit; font-size:smaller }
31
pre.smallformat { font-family:inherit; font-size:smaller }
32
pre.smallexample { font-size:smaller }
33
pre.smalllisp { font-size:smaller }
34
span.sc { font-variant:small-caps }
35
span.roman { font-family:serif; font-weight:normal; }
36
span.sansserif { font-family:sans-serif; font-weight:normal; }
42
<a name="Permutation-functions"></a>
43
Next: <a rel="next" accesskey="n" href="Applying-Permutations.html#Applying-Permutations">Applying Permutations</a>,
44
Previous: <a rel="previous" accesskey="p" href="Permutation-properties.html#Permutation-properties">Permutation properties</a>,
45
Up: <a rel="up" accesskey="u" href="Permutations.html#Permutations">Permutations</a>
49
<h3 class="section">9.5 Permutation functions</h3>
52
— Function: void <b>gsl_permutation_reverse</b> (<var>gsl_permutation * p</var>)<var><a name="index-gsl_005fpermutation_005freverse-969"></a></var><br>
53
<blockquote><p><a name="index-reversing-a-permutation-970"></a>This function reverses the elements of the permutation <var>p</var>.
54
</p></blockquote></div>
57
— Function: int <b>gsl_permutation_inverse</b> (<var>gsl_permutation * inv, const gsl_permutation * p</var>)<var><a name="index-gsl_005fpermutation_005finverse-971"></a></var><br>
58
<blockquote><p><a name="index-inverting-a-permutation-972"></a>This function computes the inverse of the permutation <var>p</var>, storing
59
the result in <var>inv</var>.
60
</p></blockquote></div>
63
— Function: int <b>gsl_permutation_next</b> (<var>gsl_permutation * p</var>)<var><a name="index-gsl_005fpermutation_005fnext-973"></a></var><br>
64
<blockquote><p><a name="index-iterating-through-permutations-974"></a>This function advances the permutation <var>p</var> to the next permutation
65
in lexicographic order and returns <code>GSL_SUCCESS</code>. If no further
66
permutations are available it returns <code>GSL_FAILURE</code> and leaves
67
<var>p</var> unmodified. Starting with the identity permutation and
68
repeatedly applying this function will iterate through all possible
69
permutations of a given order.
70
</p></blockquote></div>
73
— Function: int <b>gsl_permutation_prev</b> (<var>gsl_permutation * p</var>)<var><a name="index-gsl_005fpermutation_005fprev-975"></a></var><br>
74
<blockquote><p>This function steps backwards from the permutation <var>p</var> to the
75
previous permutation in lexicographic order, returning
76
<code>GSL_SUCCESS</code>. If no previous permutation is available it returns
77
<code>GSL_FAILURE</code> and leaves <var>p</var> unmodified.
78
</p></blockquote></div>