當前位置: 首頁>>代碼示例>>Python>>正文


Python ProjectiveSpace._coordinate_ring方法代碼示例

本文整理匯總了Python中sage.schemes.projective.projective_space.ProjectiveSpace._coordinate_ring方法的典型用法代碼示例。如果您正苦於以下問題:Python ProjectiveSpace._coordinate_ring方法的具體用法?Python ProjectiveSpace._coordinate_ring怎麽用?Python ProjectiveSpace._coordinate_ring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sage.schemes.projective.projective_space.ProjectiveSpace的用法示例。


在下文中一共展示了ProjectiveSpace._coordinate_ring方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from sage.schemes.projective.projective_space import ProjectiveSpace [as 別名]
# 或者: from sage.schemes.projective.projective_space.ProjectiveSpace import _coordinate_ring [as 別名]
    def __init__(self, poly, ambient=None):
        """
        Return the projective hypersurface in the space ambient
        defined by the polynomial poly.

        If ambient is not given, it will be constructed based on
        poly.

        EXAMPLES::

            sage: P.<x, y, z> = ProjectiveSpace(ZZ, 2)
            sage: ProjectiveHypersurface(x-y, P)
            Projective hypersurface defined by x - y in Projective Space of dimension 2 over Integer Ring

        ::

            sage: R.<x, y, z> = QQ[]
            sage: ProjectiveHypersurface(x-y)
            Projective hypersurface defined by x - y in Projective Space of dimension 2 over Rational Field

        TESTS::

            sage: H = ProjectiveHypersurface(x-y)
            sage: H == loads(dumps(H))
            True
        """
        if not is_MPolynomial(poly):
            raise TypeError, \
                  "Defining polynomial (=%s) must be a multivariate polynomial."%poly
        if not poly.is_homogeneous():
            raise TypeError, "Defining polynomial (=%s) must be homogeneous."%poly
        if ambient == None:
            R = poly.parent()
            from sage.schemes.projective.projective_space import ProjectiveSpace
            ambient = ProjectiveSpace(R.base_ring(), R.ngens()-1)
            ambient._coordinate_ring = R
        AlgebraicScheme_subscheme_projective.__init__(self, ambient, [poly])
開發者ID:CETHop,項目名稱:sage,代碼行數:39,代碼來源:hypersurface.py


注:本文中的sage.schemes.projective.projective_space.ProjectiveSpace._coordinate_ring方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。