Ticket #3655: 10058.patch

File 10058.patch, 1.9 kB (added by wdj, 6 months ago)

based on 3.0.4

  • a/sage/functions/piecewise.py

    old new  
    3333    domain 
    3434    range 
    3535    list 
    36     __add__ - addition (of functions) 
    37     __mul__ - multiplication (of functions, or fcn*scalar - ie, *right* multiplication by QQ) 
     36    __add__  - addition (of functions) 
     37    __mul__  - multiplication (of functions, or fcn*scalar - ie, *right* multiplication by QQ) 
     38    __rmul__ - *left* multiplication by QQ 
    3839    extend_by_zero_to 
    3940    unextend 
    4041            
     
    6667        DJ (2007-09) - bug fixes due to behaviour of SymbolicArithmetic 
    6768        DJ (2008-04) - fixed docstring bugs reported by J Morrow; added support for  
    6869                       laplace transform of functions with infinite support. 
     70        DJ (2008-07) - fixed a left multiplication bug reported by C. Boncelet  
     71                       (by defining __rmul__ = __mul__). 
    6972         
    7073""" 
    7174 
     
    13341337    def __add__(self,other): 
    13351338        """ 
    13361339        Returns the piecewise defined function which is the sum of  
    1337         self and other. Doesnot require both domains be the same. 
     1340        self and other. Does not require both domains be the same. 
    13381341         
    13391342        EXAMPLES: 
    13401343            sage: x = PolynomialRing(QQ,'x').gen() 
     
    14151418            fcn.append([(endpts[j],endpts[j+1]),self.which_function(x0)*other.which_function(x0)])       
    14161419        return Piecewise(fcn) 
    14171420 
     1421    __rmul__ = __mul__ 
     1422 
    14181423    def __eq__(self,other): 
    14191424        """ 
    14201425        Implements Boolean == operator.