示例#1
0
文件: utilities.py 项目: drupel/sage
    def __init__(self, ex):
        r"""
        Initialize ``self``.

        TESTS::

            sage: f = function('f')(x)
            sage: df = f.diff(x)
            sage: df
            D[0](f)(x)
            sage: from sage.manifolds.utilities import ExpressionNice
            sage: df_nice = ExpressionNice(df)
            sage: df_nice
            d(f)/dx

        """
        from sage.symbolic.ring import SR
        self._parent = SR
        Expression.__init__(self, SR, x=ex)
示例#2
0
文件: utilities.py 项目: shalec/sage
    def __init__(self, ex):
        r"""
        Initialize ``self``.

        TESTS::

            sage: f = function('f')(x)
            sage: df = f.diff(x)
            sage: df
            diff(f(x), x)
            sage: from sage.manifolds.utilities import ExpressionNice
            sage: df_nice = ExpressionNice(df)
            sage: df_nice
            d(f)/dx

        """
        from sage.symbolic.ring import SR
        self._parent = SR
        Expression.__init__(self, SR, x=ex)
示例#3
0
    def __init__(self, ex):
        r"""
        Construct an instance of ExpressionNice using expression.

        TESTS::

            sage: f = function('f', x)
            sage: df = f.diff(x)
            sage: df
            D[0](f)(x)
            sage: from sage.geometry.manifolds.utilities import ExpressionNice
            sage: df_nice = ExpressionNice(df)
            sage: df_nice
            d(f)/dx

        """

        from sage.symbolic.ring import SR
        self._parent = SR
        Expression.__init__(self, SR, x=ex)
示例#4
0
    def __init__(self, ex):
        r"""
        Construct an instance of ExpressionNice using expression.

        TESTS::

            sage: f = function('f', x)
            sage: df = f.diff(x)
            sage: df
            D[0](f)(x)
            sage: from sage.geometry.manifolds.utilities import ExpressionNice
            sage: df_nice = ExpressionNice(df)
            sage: df_nice
            d(f)/dx

        """

        from sage.symbolic.ring import SR
        self._parent = SR
        Expression.__init__(self, SR, x=ex)