MathVM/main.py

24 lines
563 B
Python

import numpy as np
from Simplex import Simplex
table = np.array([[25, -3, 5],
[30, -2, 5],
[10, 1, 0],
[6, 3, -8],
[0, -6, -5]])
result = np.zeros(2)
S = Simplex(table)
table_result = S.calculate(result)
print("Решенная симплекс-таблица:")
for i in range(table_result.shape[0]):
for j in range(table_result.shape[1]):
print(table_result[i, j], end=" ")
print()
print()
print("Решение:")
print("X[1] =", result[0])
print("X[2] =", result[1])