summaryrefslogtreecommitdiff
path: root/gsl-1.9/doc/examples/permseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'gsl-1.9/doc/examples/permseq.c')
-rw-r--r--gsl-1.9/doc/examples/permseq.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gsl-1.9/doc/examples/permseq.c b/gsl-1.9/doc/examples/permseq.c
new file mode 100644
index 0000000..08ebf63
--- /dev/null
+++ b/gsl-1.9/doc/examples/permseq.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <gsl/gsl_permutation.h>
+
+int
+main (void)
+{
+ gsl_permutation * p = gsl_permutation_alloc (3);
+
+ gsl_permutation_init (p);
+
+ do
+ {
+ gsl_permutation_fprintf (stdout, p, " %u");
+ printf ("\n");
+ }
+ while (gsl_permutation_next(p) == GSL_SUCCESS);
+
+ gsl_permutation_free (p);
+
+ return 0;
+}