--- /dev/null
+from newton import newton
+from steepest import steepest
+from function import gradient_g
+from numpy.linalg import norm
+
+# Run steepest method until tolerance steep_tol, then continue with Newtons
+# method until tolerance newt_tol
+def steepestnewton(x0, H, b, c, steep_tol, newt_tol):
+ x = []
+ r = []
+
+ # Use the starting norm to calculate relative residuals in both algorithms
+ x0_norm = norm(gradient_g(x0, H, b, c))
+ points, residuals = steepest(x0, H, b, c, steep_tol, 100, 0, x0_norm)
+ x.extend(points)
+ r.extend(residuals)
+
+ # Newton starts in the same point as steepest ends in
+ points, residuals = newton.newton(x[len(x)-1], H, b, c, newt_tol, 100, x0_norm)
+ x.extend(points[1:])
+ r.extend(residuals[1:])
+
+ return (x, r)