Пример #1
0
def find_max_from_env(inp_matrix):

    size = len(inp_matrix)

    tmp = np.eye(size)

    for i in range(0,len(inp_matrix)):
        for j in range(0,len(inp_matrix)):
            tmp[i][j] = inp_matrix[i][j]


    eival, eivect = jac.jacobi(tmp)

    maxim = inp_matrix[0][0]

    for i in range(1, len(eival)):
        if eival[i] > maxim:
            maxim = eival[i]

    return maxim
Пример #2
0
def find_min_from_env(inp_matrix):

    size = len(inp_matrix)

    tmp = np.eye(size)

    for i in range(0,len(inp_matrix)):
        for j in range(0,len(inp_matrix)):
            tmp[i][j] = inp_matrix[i][j]


    eival, eivect = jac.jacobi(tmp)

    minimal = tmp[0][0]

    for i in range(1, len(eival)):
        if eival[i] < minimal:
            minimal = eival[i]

    return minimal