コード例 #1
0
ファイル: parent.py プロジェクト: sagemath/sagetrac-mirror
    def __init__(self, base_ring, ambient_dim, backend):
        """
        The Python constructor.

        EXAMPLES::

            sage: from sage.geometry.polyhedron.parent import Polyhedra
            sage: Polyhedra(QQ, 3)
            Polyhedra in QQ^3

        TESTS::

            sage: from sage.geometry.polyhedron.parent import Polyhedra
            sage: P = Polyhedra(QQ, 3)
            sage: TestSuite(P).run()
            sage: P = Polyhedra(QQ, 0)
            sage: TestSuite(P).run()
        """
        self._backend = backend
        self._ambient_dim = ambient_dim
        from sage.categories.polyhedra import PolyhedralSets
        from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
        category = PolyhedralSets(base_ring)
        if ambient_dim == 0:
            category = category & FiniteEnumeratedSets()
        else:
            category = category.Infinite()

        Parent.__init__(self, base=base_ring, category=category)
        self._Inequality_pool = []
        self._Equation_pool = []
        self._Vertex_pool = []
        self._Ray_pool = []
        self._Line_pool = []
コード例 #2
0
ファイル: parent.py プロジェクト: wdv4758h/sage
    def __init__(self, base_ring, ambient_dim):
        """
        The Python constructor.

        EXAMPLES::

            sage: from sage.geometry.polyhedron.parent import Polyhedra
            sage: Polyhedra(QQ, 3)
            Polyhedra in QQ^3

        TESTS::

            sage: from sage.geometry.polyhedron.parent import Polyhedra
            sage: P = Polyhedra(QQ, 3)
            sage: TestSuite(P).run(skip='_test_pickling')
        """
        self._ambient_dim = ambient_dim
        from sage.categories.polyhedra import PolyhedralSets
        Parent.__init__(self,
                        base=base_ring,
                        category=PolyhedralSets(base_ring))
        self._Inequality_pool = []
        self._Equation_pool = []
        self._Vertex_pool = []
        self._Ray_pool = []
        self._Line_pool = []