Le 6 sept. 2014 11:41, "Volker Braun" <vbraun.n...@gmail.com> a écrit :
>
> I'd just write two different classes for permutations. The underlying
bit-twiddling is different but various high-level structures can be
inherited to both. At the end of the day the permutation should be defined
how it acts on an ordered container, regardless of whether the container is
indexed starting at 0 or 1. Anything that just depends on this action can
be shared between the two classes. And yes, different _repr_ so you don't
get confused all the time. And no coercion between the two permutation
types, if you want to multiply a 0- and a 1-based permutation then you have
to convert explicitly to your favorite representation.
>
>

Yes, I think that's the way to go. We have to separate the Permutation as a
combinatorical mathematical object (which starts at one) and the underlying
structure which starts at 0.

Also, I agree Nathan has a point with the cycle notation. It shouln't be a
single cycle but a list. There is still the problem of backward compatibily.

Appart from that, I won't try anymore to convince people (Nathan) that
1-perm are needed. The point is: they exist, they are used and there is
definitly no consensus to remove them. Nathan, I would be glad if you
could  give *some* credit to the people who use permutations the way they
are and listen when we tell you: we need them to start at 1!! Yes there are
some +-1 in my code but better there than in my head ALL THE TIME. Sage is
mathematical software and I conceive it to print my objects as I use them
in my maths. I don't say that your concerns are ill founded but the
solution is not to remove 1-perms all together.

Cheers

Viviane

>
>
> On Saturday, September 6, 2014 8:13:58 AM UTC+1, Nathann Cohen wrote:
>>
>> > So how about making it explicit, have separate Permutation and
Permutation0 (instead of tuple vs list). They can share most of the
backend, its just a slightly different set that they operate on. In Code,
you just call sigma = Permutation0(sigma) on user input in the beginning to
convert it to your desired presentation if you depend on the actual
integers.
>>
>> This would be cool, but how do we write the code afterwards ? What are
>> the objects returned by Permutation1 and Permutation0 ? The functions
>> of this class have been written with a standard in mind, and if you
>> let it deal with 0-based permutations and 1-based ones some functions
>> will break.
>>
>> And if we make 1-based permutations be 0-based permutations with a
>> diferent __repr__, a different __call__ and a different __getitem__ we
>> will run into problem too.. How could we make this strategy work ?
>>
>> Nathann
>
> --
> You received this message because you are subscribed to the Google Groups
"sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to