def test_empty_matrix_set_to_unit_upper_tri_unb(self): practice = Week3Functions() self.assertEqual([], practice.set_to_unit_upper_triangle_matrix([]))
def test_set_to_zero_function_unb(self): practice = Week3Functions() self.assertEqual( [[0, 0, 0], [0, 0, 0]], practice.set_to_zero_unb(self.matrix_A))
def test_empty_matrix_A_scale_matrix_unb(self): practice = Week3Functions() self.assertEqual([], practice.scale_marix([], self.alpha))
def test_set_to_unit_upper_tri_matrix_unb(self): practice = Week3Functions() self.assertEqual([[1, 2, 3], [0, 1, -3], [0, 0, 1]], practice.set_to_unit_upper_triangle_matrix( self.matrix_A))
def test_empty_matrix_B_transpose_unb(self): practice = Week3Functions() self.assertEqual([], practice.transpose(self.matrix_A, []))
def test_scale_matrix_unb(self): practice = Week3Functions() self.assertEqual([[4, -4, -2], [10, 2, -6], [-20, -40, 0]], practice.scale_marix(self.matrix_A, self.alpha))
def test_zero_matrix_set_to_strictly_upper_tri_unb(self): practice = Week3Functions() self.assertEqual( [[0, 0, 0], [0, 0, 0], [0, 0, 0]], practice.set_to_strictly_lower_triangle_matrix(self.zero_matrix))
def test_zero_matrix_A_transpose_unb(self): practice = Week3Functions() self.assertEqual([[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]], practice.transpose(self.zero_matrix_A, self.matrix_B))
def test_set_to_zero_function(self): practice = Week3Functions() self.assertEqual([0, 0, 0], practice.setToZero(self.vector_x))
def test_set_to_strictly_upper_tri_matrix_unb(self): practice = Week3Functions() self.assertEqual( [[0, 0, 0], [-1, 0, 0], [3, 2, 0]], practice.set_to_strictly_lower_triangle_matrix(self.matrix_A))
def test_illegal_vector_set_to_zero_function_unb(self): practice = Week3Functions() self.assertEqual('FAILED', practice.set_to_zero_unb(None))
def test_empty_vector_set_to_zero_function_unb(self): practice = Week3Functions() self.assertEqual([], practice.set_to_zero_unb([]))
def test_already_zero_vector_set_to_zero_function_unb(self): practice = Week3Functions() self.assertEqual( [[0, 0], [0, 0]], practice.set_to_zero_unb(self.zero_matrix))
def test_empty_matrix_set_to_diagonal_unb(self): practice = Week3Functions() self.assertEqual([], practice.set_to_diagonal_unb([], self.vector_x))
def test_lower_tri_symmetric_matrix_unb(self): practice = Week3Functions() self.assertEqual( [[2, 1, -1], [1, 1, -3], [-1, -3, -1]], practice.set_symmetric_matrix(self.matrix_B))
def test_illegal_matrix_set_to_diagonal_unb(self): practice = Week3Functions() self.assertEqual('FAILED', practice.set_to_diagonal_unb(None, self.vector_x))
def test_diagonal_symmetric_matrix_unb(self): practice = Week3Functions() self.assertEqual( [[1, 0, 0], [0, 1, 0], [0, 0, 1]], practice.set_symmetric_matrix(self.diagonal_matric))
def test_zero_matrix_B_transpose_unb(self): practice = Week3Functions() self.assertEqual( [[1, -1, 100], [2, -5, 90], [3, -10, 80], [4, -20, 3]], practice.transpose(self.matrix_A, self.zero_matrix_B))
def test_zero_matrix_symmetric_matrix_unb(self): practice = Week3Functions() self.assertEqual( [[0, 0, 0], [0, 0, 0], [0, 0, 0]], practice.set_symmetric_matrix(self.zero_matrix))
def test_illegal_matrix_B_transpose_unb(self): practice = Week3Functions() self.assertEqual('FAILED', practice.transpose(self.matrix_A, None))
def test_empty_matrix_symmetric_matrix_unb(self): practice = Week3Functions() self.assertEqual([], practice.set_symmetric_matrix([]))
def test_zero_alpha_scale_matrix_unb(self): practice = Week3Functions() self.assertEqual([[0, 0, 0], [0, 0, 0], [0, 0, 0]], practice.scale_marix(self.matrix_A, 0))
def test_illegal_matrix_symmetric_matrix_unb(self): practice = Week3Functions() self.assertEqual('FAILED', practice.set_symmetric_matrix(None))
def test_illegal_matrix_B_scale_matrix_unb(self): practice = Week3Functions() self.assertEqual('FAILED', practice.scale_marix(self.matrix_A, None))
def test_zero_vector_x_set_to_diagonal_unb(self): practice = Week3Functions() self.assertEqual([[0, 0, 0], [0, 0, 0], [0, 0, 0]], practice.set_to_diagonal_unb(self.matrix_A, [0, 0, 0]))
def test_zero_matrix_set_to_unit_upper_tri_unb(self): practice = Week3Functions() self.assertEqual([[1, 0, 0], [0, 1, 0], [0, 0, 1]], practice.set_to_unit_upper_triangle_matrix( self.zero_matrix))
def test_zero_matrix_set_to_diagonal_unb(self): practice = Week3Functions() self.assertEqual([[1, 0, 0], [0, -2, 0], [0, 0, 10]], practice.set_to_diagonal_unb(self.zero_matrix, self.vector_x))
def test_illegal_matrix_set_to_unit_upper_tri_unb(self): practice = Week3Functions() self.assertEqual('FAILED', practice.set_to_unit_upper_triangle_matrix(None))
def test_string_vector_set_to_zero_function(self): practice = Week3Functions() self.assertEqual('FAILED', practice.setToZero(['a', 'b', 'c']))