コード例 #1
0
 def __init__(self, name):
     self.__name = name
     self.__coerce_name = '_' + name.lower() + '_'
     self.__seq = -1
     self._available_vars = []
     self._seed = None
     ParentWithBase.__init__(self, self)
コード例 #2
0
ファイル: interface.py プロジェクト: robertwb/sage
 def __init__(self, name):
     self.__name = name
     self.__coerce_name = '_' + name.lower() + '_'
     self.__seq = -1
     self._available_vars = []
     self._seed = None
     ParentWithBase.__init__(self, self)
コード例 #3
0
ファイル: cusps_nf.py プロジェクト: chiragsinghal283/sage
    def __init__(self, number_field):
        """
        See ``NFCusps`` for full documentation.

        EXAMPLES::

            sage: k.<a> = NumberField(x^3 + x^2 + 13)
            sage: kCusps = NFCusps(k); kCusps
            Set of all cusps of Number Field in a with defining polynomial x^3 + x^2 + 13
        """
        self.__number_field = number_field
        ParentWithBase.__init__(self, self)
コード例 #4
0
    def __init__(self):
        r"""
        The set of cusps, i.e. `\mathbb{P}^1(\QQ)`.

        EXAMPLES::

            sage: C = sage.modular.cusps.Cusps_class() ; C
            Set P^1(QQ) of all cusps
            sage: Cusps == C
            True
        """
        ParentWithBase.__init__(self, self)
コード例 #5
0
ファイル: cusps.py プロジェクト: CETHop/sage
    def __init__(self):
        r"""
        The set of cusps, i.e. `\mathbb{P}^1(\QQ)`.

        EXAMPLES::

            sage: C = sage.modular.cusps.Cusps_class() ; C
            Set P^1(QQ) of all cusps
            sage: Cusps == C
            True
        """
        ParentWithBase.__init__(self, self)
コード例 #6
0
    def __init__(self, number_field):
        """
        See ``NFCusps`` for full documentation.

        EXAMPLES::

            sage: k.<a> = NumberField(x^3 + x^2 + 13)
            sage: kCusps = NFCusps(k); kCusps
            Set of all cusps of Number Field in a with defining polynomial x^3 + x^2 + 13
        """
        self.__number_field = number_field
        ParentWithBase.__init__(self, self)
コード例 #7
0
ファイル: formal_sum.py プロジェクト: CETHop/sage
    def __init__(self, base_ring):
        """
        INPUT:

        - ``R`` -- a ring (default: ZZ).

        EXAMPLES::

            sage: FormalSums(ZZ)
            Abelian Group of all Formal Finite Sums over Integer Ring
            sage: FormalSums(GF(7))
            Abelian Group of all Formal Finite Sums over Finite Field of size 7
        """
        ParentWithBase.__init__(self, base_ring)
コード例 #8
0
    def __init__(self, base_ring):
        """
        INPUT:

        - ``R`` -- a ring (default: ZZ).

        EXAMPLES::

            sage: FormalSums(ZZ)
            Abelian Group of all Formal Finite Sums over Integer Ring
            sage: FormalSums(GF(7))
            Abelian Group of all Formal Finite Sums over Finite Field of size 7
        """
        ParentWithBase.__init__(self, base_ring)
コード例 #9
0
ファイル: weightspace.py プロジェクト: EnterStudios/sage-1
    def __init__(self, p, base_ring):
        r"""
        Initialisation function.

        EXAMPLES::

            sage: pAdicWeightSpace(17)
            Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'
        """
        ParentWithBase.__init__(self, base=base_ring)
        p = ZZ(p)
        if not p.is_prime():
            raise ValueError("p must be prime")
        self._p = p
        self._param = Qp(p)((p == 2 and 5) or (p + 1))
コード例 #10
0
ファイル: weightspace.py プロジェクト: bgxcpku/sagelib
    def __init__(self, p, base_ring):
        r"""
        Initialisation function.

        EXAMPLE::

            sage: pAdicWeightSpace(17)
            Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'
        """
        ParentWithBase.__init__(self, base=base_ring)
        p = ZZ(p)
        if not p.is_prime(): 
            raise ValueError, "p must be prime"
        self._p = p
        self._param = Qp(p)((p == 2 and 5) or (p + 1))
コード例 #11
0
ファイル: callable.py プロジェクト: wdv4758h/sage
    def __init__(self, arguments):
        """
        EXAMPLES:

        We verify that coercion works in the case where ``x`` is not an
        instance of SymbolicExpression, but its parent is still the
        SymbolicRing::

            sage: f(x) = 1
            sage: f*e
            x |--> e
        """
        self._arguments = arguments
        ParentWithBase.__init__(self, SR)
        self._populate_coercion_lists_(coerce_list=[SR])
        self.symbols = SR.symbols  # Use the same list of symbols as SR
コード例 #12
0
ファイル: callable.py プロジェクト: ProgVal/sage
    def __init__(self, arguments):
        """
        EXAMPLES:

        We verify that coercion works in the case where ``x`` is not an
        instance of SymbolicExpression, but its parent is still the
        SymbolicRing::

            sage: f(x) = 1
            sage: f*e
            x |--> e
        """
        self._arguments = arguments
        ParentWithBase.__init__(self, SR)
        self._populate_coercion_lists_(coerce_list=[SR])
        self.symbols = SR.symbols  # Use the same list of symbols as SR
コード例 #13
0
ファイル: interface.py プロジェクト: bgxcpku/sagelib
    def __getattr__(self, attrname):
        """
        TESTS::

            sage: ParentWithBase.__getattribute__(singular, '_coerce_map_from_')
            <built-in method _coerce_map_from_ of Singular object at ...>
        """
        try:
            return ParentWithBase.__getattribute__(self, attrname)
        except AttributeError:
            if attrname[:1] == "_":
                raise AttributeError
            return self._function_class()(self, attrname)
コード例 #14
0
ファイル: interface.py プロジェクト: BrentBaccala/sage
    def __init__(self, name):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: Maxima() == maxima
            False
            sage: maxima == maxima
            True

            sage: Maxima() != maxima
            True
            sage: maxima != maxima
            False
        """
        self.__name = name
        self.__coerce_name = '_' + name.lower() + '_'
        self.__seq = -1
        self._available_vars = []
        self._seed = None
        ParentWithBase.__init__(self, self)
コード例 #15
0
    def __getattr__(self, attrname):
        """
        TESTS::

            sage: ParentWithBase.__getattribute__(singular, '_coerce_map_from_')
            <bound method Singular._coerce_map_from_ of Singular>
        """
        try:
            return ParentWithBase.__getattribute__(self, attrname)
        except AttributeError:
            if attrname[:1] == "_":
                raise
            return self._function_class()(self, attrname)
コード例 #16
0
ファイル: interface.py プロジェクト: saraedum/sage-renamed
    def __init__(self, name):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: Maxima() == maxima
            False
            sage: maxima == maxima
            True

            sage: Maxima() != maxima
            True
            sage: maxima != maxima
            False
        """
        self.__name = name
        self.__coerce_name = '_' + name.lower() + '_'
        self.__seq = -1
        self._available_vars = []
        self._seed = None
        ParentWithBase.__init__(self, self)
コード例 #17
0
ファイル: formal_sum.py プロジェクト: bopopescu/spd_notebook
 def __init__(self, base=ZZ):
     ParentWithBase.__init__(self, base)
コード例 #18
0
ファイル: random_variable.py プロジェクト: bgxcpku/sagelib
 def __init__(self, X, RR):
     if not is_ProbabilitySpace(X):
         raise TypeError, "Argument X (= %s) must be a probability space" % X
     ParentWithBase.__init__(self, X)
     self._codomain = RR
コード例 #19
0
 def __init__(self, X, RR):
     if not is_ProbabilitySpace(X):
         raise TypeError("Argument X (= %s) must be a probability space" %
                         X)
     ParentWithBase.__init__(self, X)
     self._codomain = RR
コード例 #20
0
 def __init__(self, base=ZZ):
     ParentWithBase.__init__(self, base)