示例#1
0
    def __init__(self, weights):
        """
        TESTS::

            sage: C = WeightedIntegerVectors([2,1,3])
            sage: C.__class__
            <class 'sage.combinat.integer_vector_weighted.WeightedIntegerVectors_all_with_category'>
            sage: C.category()
            Join of Category of sets with grading and Category of infinite enumerated sets
            sage: TestSuite(C).run()
        """
        self._weights = weights
        from sage.sets.all import Family, NonNegativeIntegers
        # Use "partial" to make the basis function (with the weights
        # argument specified) pickleable.  Otherwise, it seems to
        # cause problems...
        from functools import partial
        F = Family(NonNegativeIntegers(),
                   partial(WeightedIntegerVectors, weight=weights))
        DisjointUnionEnumeratedSets.__init__(
            self,
            F,
            facade=True,
            keepkey=False,
            category=(SetsWithGrading(), InfiniteEnumeratedSets()))
示例#2
0
    def __init__(self):
        r"""
        TESTS::

            sage: TestSuite(SetsWithGrading().example()).run()
        """
        Parent.__init__(self, category=SetsWithGrading(), facade=IntegerRing())
示例#3
0
    def __init__(self):
        """
        TESTS::

            sage: PF = ParkingFunctions()
            sage: TestSuite(PF).run()
        """
        cat = InfiniteEnumeratedSets() & SetsWithGrading()
        Parent.__init__(self, category=cat)
示例#4
0
    def __init__(self):
        """
        TESTS::

            sage: PF = NonDecreasingParkingFunctions()
            sage: PF == loads(dumps(PF))
            True
        """
        cat = InfiniteEnumeratedSets() & SetsWithGrading()
        Parent.__init__(self, category=cat)