-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
46 lines (28 loc) · 1.18 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import numpy as np
from simplex_2phases import complete_simplex
#Os problemas devem ser apresentados na forma padrâo , isto é:
#b>0 e todas as restrições na forma de igualdade, com as variaveis de folga já implementadas
#Teste 1 - Funcionando
A = np.array([[1, 0, 1, 0, 0], [0, 1, 0, 1, 0], [3, 2, 0, 0, 1]])
c = np.array([-3, -5, 0, 0, 0])
b = np.array([4, 6, 18])
#Teste 2 - Ilimitado
A = np.array([[-1,1,1,0],[-0.5,1,0,1]])
b = np.array([1,2])
c = np.array([-2,-2,0,0])
# Teste 3 - Infactibilidade
b = np.array([24,21,6,3])
c = np.array([-2,-2,0,0,0,0])
A = np.array([[-8,3,1,0,0,0],[3,5,0,-1,0,0],[3,-4,0,0,-1,0],[3,0,0,0,0,1]])
# Teste 4 - Multiplas Soluções
A = np.array([[2,3,4,5,9,19,0,0,0,0,1,0,0],[3,7,17,23,4,1,2,4,5,6,0,1,0],[4,56,2,13,4,5,2,0,0,1,0,0,1]])
b = np.array([15,21,34])
c = np.array([1,10,5,2,3,4,6,7,20,30,0,0,0])
# Teste 5 - Solução Degenerada
A = np.array([[1,1,1,0,0,0],[1,2,0,1,0,0],[2,1,0,0,1,0],[1,-2,0,0,0,1]])
b = np.array([10,15,15,1])
c = np.array([-3,-5,0,0,0,0])
#Teste 6 - Matrix 3x10
A = np.array([[2,3,4,5,9,19,0,0,0,0],[3,7,17,23,4,1,2,4,5,6],[4,56,2,13,4,5,2,0,0,1]])
b = np.array([15,21,34])
c = np.array([1,10,5,2,3,4,6,7,20,30])