This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Permutations
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Alberto Manuel Brandão Simões <albie at alfarrabio dot di dot uminho dot pt>
- Cc: GSL Mailing list <gsl-discuss at sourceware dot cygnus dot com>
- Date: Mon, 25 Feb 2002 19:08:02 +0000 (GMT)
- Subject: Re: Permutations
- References: <1014647209.10655.11.camel@mondego>
Alberto Manuel Brandão Simões writes:
> What's the correct way to construct a permutation? To access the
> memory directly, or there is any non-documented function to put
> elements at specific locations?
> If the solution is to access memory... linear buffer?
If you start from the identity permutation there's a swap function for
exchanging elements. Otherwise you have to directly into the data[]
array. If you plan to do this extensively define a macro like,
#define PERM_SET(p,i,k) ((p)->data[(i)]=(k))
in case you need to change things later.
Brian