Ticket #3390: numpy-1.1.patch
| File numpy-1.1.patch, 3.8 kB (added by jason, 5 months ago) |
|---|
-
a/sage/calculus/calculus.py
old new 3122 3122 sage: f.find_maximum_on_interval(0,5) 3123 3123 (0.5610963381910451, 0.8603335890...) 3124 3124 sage: f.find_maximum_on_interval(0,5, tol=0.1, maxfun=10) 3125 (0.561090323458081..., 0.857926501456 )3125 (0.561090323458081..., 0.857926501456...) 3126 3126 """ 3127 3127 minval, x = (-self).find_minimum_on_interval(a, b, var=var, tol=tol, maxfun=maxfun) 3128 3128 return -minval, x … … 3150 3150 EXAMPLES: 3151 3151 sage: f = x*cos(x) 3152 3152 sage: f.find_minimum_on_interval(1, 5) 3153 (-3.2883713955908962, 3.4256184695 7)3153 (-3.2883713955908962, 3.4256184695...) 3154 3154 sage: f.find_minimum_on_interval(1, 5, tol=1e-3) 3155 3155 (-3.288371361890984, 3.42575079030572) 3156 3156 sage: f.find_minimum_on_interval(1, 5, tol=1e-2, maxfun=10) 3157 (-3.2883708459837844, 3.4250840220 3)3157 (-3.2883708459837844, 3.4250840220...) 3158 3158 sage: show(f.plot(0, 20)) 3159 3159 sage: f.find_minimum_on_interval(1, 15) 3160 (-9.4772942594797929, 9.5293344109 5)3160 (-9.4772942594797929, 9.5293344109...) 3161 3161 3162 3162 ALGORITHM: Uses \module{scipy.optimize.fminbound} which uses Brent's method. 3163 3163 -
a/sage/matrix/matrix1.pyx
old new 274 274 Type \code{numpy.typecodes} for a list of the possible typecodes: 275 275 sage: import numpy 276 276 sage: numpy.typecodes 277 {'All': '?bhilqpBHILQPfdgFDGSUVO', 'AllInteger': 'bBhHiIlLqQpP', 'AllFloat': 'fdgFDG', 'UnsignedInteger': 'BHILQP', 'Float': 'fdg', 'Character': ' S1', 'Complex': 'FDG', 'Integer': 'bhilqp'}277 {'All': '?bhilqpBHILQPfdgFDGSUVO', 'AllInteger': 'bBhHiIlLqQpP', 'AllFloat': 'fdgFDG', 'UnsignedInteger': 'BHILQP', 'Float': 'fdg', 'Character': 'c', 'Complex': 'FDG', 'Integer': 'bhilqp'} 278 278 """ 279 279 import numpy 280 280 A = numpy.matrix(self.list(), dtype=dtype) -
a/sage/numerical/optimize.py
old new 101 101 EXAMPLES: 102 102 sage: f = lambda x: x*cos(x) 103 103 sage: find_maximum_on_interval(f, 0,5) 104 (0.561096338191 , 0.8603335890...)104 (0.561096338191..., 0.8603335890...) 105 105 sage: find_maximum_on_interval(f, 0,5, tol=0.1, maxfun=10) 106 (0.561090323458 , 0.857926501456)106 (0.561090323458..., 0.857926501456...) 107 107 """ 108 108 def g(z): 109 109 r""" … … 137 137 EXAMPLES: 138 138 sage: f = lambda x: x*cos(x) 139 139 sage: find_minimum_on_interval(f, 1, 5) 140 (-3.28837139559 , 3.42561846957)140 (-3.28837139559..., 3.4256184695...) 141 141 sage: find_minimum_on_interval(f, 1, 5, tol=1e-3) 142 (-3.28837136189098 , 3.42575079030572)142 (-3.28837136189098..., 3.42575079030572...) 143 143 sage: find_minimum_on_interval(f, 1, 5, tol=1e-2, maxfun=10) 144 (-3.28837084598 , 3.42508402203)144 (-3.28837084598..., 3.4250840220...) 145 145 sage: show(plot(f, 0, 20)) 146 146 sage: find_minimum_on_interval(f, 1, 15) 147 (-9.4772942594 8, 9.52933441095)147 (-9.4772942594..., 9.5293344109...) 148 148 149 149 ALGORITHM: Uses scipy.optimize.fminbound which uses Brent's method. 150 150