示例#1
0
def main():
    n = int(input("n: "))
    A_matrix = generate_random_matrix(n)
    print_formatted_matrix(A_matrix, "Matrix A:")
    B_matrix = generate_random_matrix(n)
    print_formatted_matrix(B_matrix, "Matrix B:")
    mid_norma = mid_arithmetic_mNorm(A_matrix, B_matrix)
    print("Mid Arithmetic of two norms: ", mid_norma)
示例#2
0
def main():
    n = int(input("Enter n: "))
    matrix_A = generate_random_matrix(n)
    print_formatted_matrix(matrix_A, 'Matrix A:')
    matrix_B = generate_random_matrix(n)
    print_formatted_matrix(matrix_B, 'Matrix B:')
    matrix_C = generate_random_matrix(n)
    print_formatted_matrix(matrix_C, 'Matrix C:')

    max_sum, matrix = justify_sum_of_elements(matrix_A, matrix_B, matrix_C)
    print('Max sum:', max_sum)

    replaced_matrix = replacement(matrix, max_sum)
    print_formatted_matrix(replaced_matrix, "Replaced matrix: ")
示例#3
0
def main():
    n = int(input("Enter n: "))
    matrix_A = generate_random_matrix(n)
    print_formatted_matrix(matrix_A, 'Matrix A:')
    matrix_B = generate_random_matrix(n)
    print_formatted_matrix(matrix_B, 'Matrix B:')
    matrix_C = generate_random_matrix(n)
    print_formatted_matrix(matrix_C, 'Matrix C:')

    minimal_sum, lovest_sum_matrix = get_lovest_matrix(matrix_A, matrix_B,
                                                       matrix_C)
    print('Lovest sum -', minimal_sum)

    print_formatted_matrix(sort_rows_of_matrix(lovest_sum_matrix),
                           "Sorted lovest sum matrix:")
示例#4
0
def main():
    matrix = generate_random_matrix(int(input("n: ")))
    print_formatted_matrix(matrix, "Standart matrix:")
    sortted_matrix = sorting_by_first_column(matrix)
    print_formatted_matrix(sortted_matrix, "Sortted matrix:")
    vector = diagonal_vector(sortted_matrix)
    print(vector)
示例#5
0
def main():
    matrix = generate_random_matrix(int(input("Enter n: ")))
    print_formatted_matrix(matrix, "Started matrix:")
    central_element = get_central_element(matrix)
    print("Central element:", central_element)
    print_formatted_matrix(change_positions_of_matrix_elements(matrix),
                           "New matrix:")
示例#6
0
def main():
    matrix = generate_random_matrix(int(input("Enter n: ")))
    print_formatted_matrix(matrix, "Matrix before:")
    sum = sum_of_elements(matrix)
    print("Sum of elements in matrix -", sum)
    max = max_element(matrix)
    print("Max element in matrix -", max)
    romb = get_romb(matrix)
    print_formatted_matrix(romb, 'Romb: ')
示例#7
0
def main():
    matrix = generate_random_matrix(int(input("Enter n: ")))
    print_formatted_matrix(matrix, "Standart matrix:")
    cut_matrix = cut_matrix_diagonaly(matrix)
    print_formatted_matrix(cut_matrix, "Cut matrix:")
    max = max_value(cut_matrix)
    index_max = index_of_max_value(matrix, max)
    print("Max element:", max)
    new_matrix = delete_column(index_max, matrix)
    print_formatted_matrix(new_matrix, "New matrix:")
示例#8
0
def main():
    n = int(input("n: "))
    matrix = generate_random_matrix(n)
    print_formatted_matrix(matrix, 'Before:')
    new_matrix = fill_new_matrix(matrix, n)
    print_formatted_matrix(new_matrix, 'After:')
示例#9
0
def main():
    matrix = generate_random_matrix(int(input("Length of matrix: ")))
    print_formatted_matrix(matrix, 'Before:')
    vector = skalyar_multiplication(matrix)
    print(vector)
示例#10
0
def main():
    matrix = generate_random_matrix(int(input("n: ")))
    print_formatted_matrix(matrix, "Before:")
    new_matrix = cut_matrix(matrix)
    print_formatted_matrix(new_matrix, "After:")
示例#11
0
def main():
    matrix = generate_random_matrix(int(input("Enter n: ")))
    print_formatted_matrix(matrix, "Started matrix:")
    minimal_matrix = sort_by_minimal(matrix)
    print_formatted_matrix(minimal_matrix, "Minimal matrix:")