-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatafile.py
28 lines (23 loc) · 1000 Bytes
/
datafile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
###########################################
'''
File Name: datafile.py
Author: Mohammad Yasir
This module creates a list of Method instances which are accessed by the mainscreen module for easy access and management.
'''
###########################################
import newtonraphson
import falseposition
import bisection
import secantmethod
class Method:
'''
Describes a root-finding method (hence the name). The call property stores reference to the function which must be called to perform calculations of the given method. These functions return True or False depending on whether the calculations were succesful or not.
'''
def __init__(self, name, call):
self.name = name
self.call = call
methods = (
Method("Regula Falsi (False Position) Method", falseposition.regulaFalsi),
Method("Bisection Method", bisection.bisection),
Method("Newton Raphson Method", newtonraphson.newtonRaphson),
Method("Secant Method", secantmethod.secantMethod))