当前位置: 首页>>代码示例>>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;未经允许,请勿转载。