27 lines
1.4 KiB
Diff
27 lines
1.4 KiB
Diff
diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx
|
|
index 5d19067f2ed..97e50fb2616 100644
|
|
--- a/src/sage/matrix/matrix_double_dense.pyx
|
|
+++ b/src/sage/matrix/matrix_double_dense.pyx
|
|
@@ -867,7 +867,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
|
|
# set cutoff as RDF element
|
|
if eps == 'auto':
|
|
if scipy is None: import scipy
|
|
- eps = 2*max(self._nrows, self._ncols)*scipy.finfo(float).eps*sv[0]
|
|
+ eps = 2*max(self._nrows, self._ncols)*numpy.finfo(float).eps*sv[0]
|
|
eps = RDF(eps)
|
|
# locate non-zero entries
|
|
rank = 0
|
|
diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
|
|
index 708d440a205..9f973c6bd69 100644
|
|
--- a/src/sage/numerical/optimize.py
|
|
+++ b/src/sage/numerical/optimize.py
|
|
@@ -426,7 +426,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
|
|
hess = func.hessian()
|
|
hess_fast = [ [fast_callable(a, vars=var_names, domain=float) for a in row] for row in hess]
|
|
hessian = lambda p: [[a(*p) for a in row] for row in hess_fast]
|
|
- from scipy import dot
|
|
+ from numpy import dot
|
|
hessian_p = lambda p,v: dot(numpy.array(hessian(p)),v)
|
|
min = optimize.fmin_ncg(f, [float(_) for _ in x0], fprime=gradient,
|
|
fhess=hessian, fhess_p=hessian_p, disp=verbose, **args)
|