]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
Define product = prod, which is provided by Sage.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 5 Dec 2012 00:15:32 +0000 (19:15 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 5 Dec 2012 00:15:32 +0000 (19:15 -0500)
mjo/interpolation.py
mjo/misc.py

index fa784dd8c86fc2ab9406592622599f0320ba8941..cbba68e03a4e2bd3ae5601ec51844aada3cf435d 100644 (file)
@@ -1,5 +1,5 @@
 from sage.all import *
-from misc import product
+product = prod
 
 
 def lagrange_denominator(k, xs):
index 061a5090fe96741c965f96b1f13f66e6551a4b18..1b3a5a94090bb2bfa7120d355d3f25683c2116f2 100644 (file)
@@ -3,7 +3,6 @@ Stuff that doesn't fit anywhere else.
 """
 
 from sage.all import *
-from functools import reduce
 
 
 def legend_latex(obj):
@@ -13,32 +12,3 @@ def legend_latex(obj):
     legend label.
     """
     return '$%s$' % latex(obj)
-
-
-def product(factors):
-    """
-    Returns the product of the elements in the list ``factors``. If
-    the list is empty, we return 1.
-
-    EXAMPLES:
-
-    Normal integer multiplication::
-
-        sage: product([1,2,3])
-        6
-
-    And with symbolic variables::
-
-        sage: x,y,z = SR.var('x,y,z')
-        sage: product([x,y,z])
-        x*y*z
-
-    TESTS:
-
-    The empty product is the multiplicative identity (one)::
-
-        sage: product([])
-        1
-
-    """
-    return reduce(operator.mul, factors, 1)