Changes between Initial Version and Version 3 of Ticket #5200


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5200

    • Property Owner changed from mhansen to hivert
  • Ticket #5200 – Description

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