예제 #1
0
파일: morphism.py 프로젝트: CETHop/sage
    def _repr_(self):
        r"""
        String representation of self.

        EXAMPLES::

            sage: M = ModularSymbols(6)
            sage: t = M.Hom(M)(matrix(QQ,3,3,srange(9))); t._repr_()
            'Hecke module morphism defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...'
            sage: t.name('spam'); t._repr_()
            'Hecke module morphism spam defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...'
        """
        name = self.__name
        if name != '':
            name += ' '
        return "Hecke module morphism %sdefined by the matrix\n%s\nDomain: %s\nCodomain: %s"%(\
                name, str(self.matrix()), misc.strunc(self.domain()), misc.strunc(self.codomain()))
예제 #2
0
    def _repr_(self):
        r"""
        String representation of self.

        EXAMPLES::

            sage: M = ModularSymbols(6)
            sage: t = M.Hom(M)(matrix(QQ,3,3,srange(9))); t._repr_()
            'Hecke module morphism defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...'
            sage: t.name('spam'); t._repr_()
            'Hecke module morphism spam defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...'
        """
        name = self.__name
        if name != '':
            name += ' '
        return "Hecke module morphism %sdefined by the matrix\n%r\nDomain: %s\nCodomain: %s"%(
                name, self.matrix(), misc.strunc(self.domain()), misc.strunc(self.codomain()))