Beispiel #1
0
    def transpose(self):
        rows = int(input("\nHow many rows are in your matrix? "))
        cols = int(input("How many columns are in your matrix? "))

        a = matrixinput.App(rows, cols).matrix

        transpose_a = matrixcalc.Matrix(a).transpose()

        print("\nThe tranposed matrix of Matrix A is:")
        matrixcalc.print_matrix(transpose_a)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #2
0
    def transpose(self):
        rows = int(input("\nHow many rows are in your matrix? "))
        cols = int(input("How many columns are in your matrix? "))

        a = matrixinput.App(rows, cols).matrix        

        transpose_a = matrixcalc.Matrix(a).transpose()

        print("\nThe tranposed matrix of Matrix A is:")
        matrixcalc.print_matrix(transpose_a)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #3
0
    def scalar_mul(self):
        rows = int(input("\nHow many rows are in your matrix? "))
        cols = int(input("How many columns are in your matrix? "))
        scalar = int(input("What scalar are you multiplying your matrix by? "))

        a = matrixinput.App(rows, cols).matrix

        scalar_a = matrixcalc.MatOperators().scalar_mul(a, scalar)

        print("\nThe scalar product of Matrix A is:")
        matrixcalc.print_matrix(scalar_a)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #4
0
    def add_or_sub(self, operator):
        rows = int(input("\nHow many rows are in your matrices? "))
        cols = int(input("How many columns are in your matrices? "))

        a = matrixinput.App(rows, cols).matrix
        b = matrixinput.App(rows, cols).matrix

        ab = operator(a, b)

        print("\nAnswer:")
        matrixcalc.print_matrix(ab)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #5
0
    def scalar_mul(self):
        rows = int(input("\nHow many rows are in your matrix? "))
        cols = int(input("How many columns are in your matrix? "))
        scalar = int(input("What scalar are you multiplying your matrix by? "))

        a = matrixinput.App(rows, cols).matrix        

        scalar_a = matrixcalc.MatOperators().scalar_mul(a, scalar)

        print("\nThe scalar product of Matrix A is:")
        matrixcalc.print_matrix(scalar_a)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #6
0
    def add_or_sub(self, operator):
        rows = int(input("\nHow many rows are in your matrices? "))
        cols = int(input("How many columns are in your matrices? "))

        a = matrixinput.App(rows, cols).matrix
        b = matrixinput.App(rows, cols).matrix

        ab = operator(a, b)

        print("\nAnswer:")
        matrixcalc.print_matrix(ab)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #7
0
    def inverse(self):
        rows = int(input("\nHow many rows and columns are in your matrix? "))

        a = matrixinput.App(rows, rows).matrix

        if matrixcalc.determinant(a) == 0:
            print("\nSorry, matrix not invertible.")
        else:
            inverse_a = matrixcalc.inverse(a)

            print("\nThe inverse of Matrix A is:")
            matrixcalc.print_matrix(inverse_a)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #8
0
    def inverse(self):
        rows = int(input("\nHow many rows and columns are in your matrix? "))

        a = matrixinput.App(rows, rows).matrix          

        if matrixcalc.determinant(a) == 0:
            print("\nSorry, matrix not invertible.")
        else:
            inverse_a = matrixcalc.inverse(a)

            print("\nThe inverse of Matrix A is:")
            matrixcalc.print_matrix(inverse_a)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #9
0
    def mul(self):
        row1 = int(input("\nHow many rows are in Matrix A? "))
        col1 = int(input("How many columns are in Matrix A? "))

        row2 = int(input("\nHow many rows are in Matrix B? "))
        col2 = int(input("How many columns are in Matrix B? "))

        a = matrixinput.App(row1, col1).matrix
        b = matrixinput.App(row2, col2).matrix

        ab = matrixcalc.MatOperators().mul_matrices(a, b)

        print("\nThe product of Matrix A and Matrix B is:")
        matrixcalc.print_matrix(ab)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()
Beispiel #10
0
    def mul(self):
        row1 = int(input("\nHow many rows are in Matrix A? "))
        col1 = int(input("How many columns are in Matrix A? "))

        row2 = int(input("\nHow many rows are in Matrix B? "))
        col2 = int(input("How many columns are in Matrix B? "))

        a = matrixinput.App(row1, col1).matrix
        b = matrixinput.App(row2, col2).matrix

        ab = matrixcalc.MatOperators().mul_matrices(a, b)

        print("\nThe product of Matrix A and Matrix B is:")
        matrixcalc.print_matrix(ab)

        input("\nPress ENTER to return to the menu\n")
        Interface().menu()