Changes between Version 3 and Version 5 of Ticket #5200


Ignore:
Timestamp:
03/01/09 15:26:32 (12 years ago)
Author:
hivert
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5200

    • Property Status changed from new to assigned
  • Ticket #5200 – Description

    v3 v5  
    1 I've uploaded a new patch according to remark of Nicolas and Mike. It should be ready for review and hopefully integration.
     1This patches improves subwords and subsets and deals with several issues:
     2  1. It implements subsets for finite multisets (sets with repetitions).
     3{{{
     4sage: Subsets([2,2,3], multiset=True).list()
     5[[], [2], [3], [2, 2], [2, 3], [2, 2, 3]]
     6}}}
     7  1. It implement {{{__contains__}}} which was missing for subsets and subwords:
     8     Before:
     9{{{
     10sage: st = Subsets([1,2,2,3]); Set([1,2]) in st
     11---------------------------------------------------------------------------
     12NotImplementedError                       Traceback (most recent call last)
     13}}}
     14     After:
     15{{{
     16sage: st = Subsets([1,2,2,3]); Set([1,2]) in st
     17True
     18}}}
     19  1. It fixes a bug in smallest_positions:
     20     Before:
     21{{{
     22sage: sage.combinat.subword.smallest_positions([2,4,3,3,1,2],[1,3,3])
     23[4, 4, 4]
     24}}}
     25     After:
     26{{{
     27sage.combinat.subword.smallest_positions([2,4,3,3,1,2],[1,3,3])
     28False
     29}}}
     30     which means that 113 is not a subword of 243312. 
     31  4. It finally improves the doc and the tests.
     32
     33Cheers,
     34
     35Florent