Dear All,

   I've a trouble with symbolic ring:

sage: bla = SR(1)
sage: bla.is_unit()
True
sage: bla = SR(0)
sage: bla.is_unit()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

A a result the zero matrix is not known to be non invertible:

sage: m=matrix(SR, 2,2)
sage: m.is_invertible()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

Right now is_unit is inherited from elements with says:

    def is_unit(self):
        if self == 1 or self == -1:
            return True
        raise NotImplementedError

I seems to me that we can harmlessly add

        if self == 0:
            return False

Isn't It ? 


Going further, I understand that it's not always possible to test any symbolic
expression to be equal to zero or not. But at least for symbolic constant, It
should be feasible. Is there any problem to overload is_unit for
SymbolicConstant ?

Florent Hivert
  ---
   Il y a trois sortes de gens dans le monde : ceux qui savent compter et
ceux qui ne savent pas.
   There are three kinds of people in the world: those who can count,
and those who cannot. 
  ---
Professeur, Coordinateur équipe Combinatoire et Algorithmes
Laboratoire d'Informatique, de Traitement de l'Information
  et des Systèmes (EA 4108)

Bureau U2.2.11          --  Campus du Madrillet
Université de Rouen     --  Faculté des Sciences et des Techniques
Avenue de l'université  --  76801 SAINT ETIENNE DU ROUVRAY
Tél. : 02.32.95.52.91   --  Fax : 02.32.95.51.87
Mél. : florent.hiv...@univ-rouen.fr

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to