Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move troublesome, messy function closer to its only sender

  • Loading branch information...
commit c0b558a1dd193a578cbedaaec2d6de4df94b4287 1 parent d50dc3f
@apauley authored
Showing with 12 additions and 12 deletions.
  1. +0 −12 Chapter1/Python/helpers.py
  2. +12 −0 Chapter1/Python/muller.py
View
12 Chapter1/Python/helpers.py
@@ -11,18 +11,6 @@ def example_deriv(x):
"3 + cos x - e^x"
return 3 + math.cos(x) - math.exp(x)
-def swap_points(x):
- s = []
- s = x
- s.sort()
- f = s[1]
- sn = s[2]
- t = s[0]
- s[0] = f
- s[1] = sn
- s[2] = t
- return s
-
def print_header(t, f):
print "\n"
print "-" * 50
View
12 Chapter1/Python/muller.py
@@ -2,6 +2,18 @@
from helpers import *
+def swap_points(x):
+ s = []
+ s = x
+ s.sort()
+ f = s[1]
+ sn = s[2]
+ t = s[0]
+ s[0] = f
+ s[1] = sn
+ s[2] = t
+ return s
+
def mullers_method(func, a, b, r, max_steps=MaxSteps):
print_header("Muller's method", func.__doc__)
x = [a,b,r]
Please sign in to comment.
Something went wrong with that request. Please try again.