-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.h
37 lines (29 loc) · 849 Bytes
/
structs.h
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
#ifndef _STRUCT_
#define _STRUCT_
#include <stdlib.h>
#define true 1
#define false 0
#define BIGM (1e6)
typedef char bool;
typedef char *string;
typedef double *vector_t;
typedef double **matrix_t;
typedef enum
{
ORIGINAL = 0,
FOLGA,
ARTIFICIAL
} vartype_e;
typedef struct
{
double cost; // Cost in objective function (C)
string name; // Variable name, ex: "x1", "x2".
vartype_e type; // Variable type (Original, Slack or Artificial).
double **aj; // Column with its restrictions.
} variavel_t;
extern size_t number_base; // Dimension of the basic matrix (B).
extern size_t number_Nbase; // Non-basic matrix dimension (N).
extern double **vetor_b; // Vector b, from the system Ax=b.
extern variavel_t *var_base; // Basic variables.
extern variavel_t *var_Nbase; // Non-basic variables.
#endif