Please use this class and it's member functions to implement your functions when appropriate. This class is instantiated as the class attribute objects A and and allows for indexing operations similar to Python lists and NumPy arrays as well as the row operation functions. I am provided a Matrix class definition that has been extended from the one you implemented in assignment12. Add a row swapping strategy such that the iteration will work if there is a 0 entry on the diagonal of the A matrix. Convert this script to the object-oriented class member function gauss_seidel_solve below. I have provided a Python/Numpy implementation of a Gauss-Seidel iteration solver in the course notes.
Matrix must be a Python list or NumPy ndarray.')ĭef gauss_seidel_solve(self, tolerance=1e-10,