Definitions of data types and functions required to read and store the data about the problem.
More...
Go to the source code of this file.
|
#define | POS(R, C, NC) ((R)*(NC)+(C)) |
| Given a row (R ), a column (C ), and the number of columns (NC ) of a matrix, computes an equivalent 1D position. More...
|
|
|
Exp | newExp (int size) |
| Creates an expression. More...
|
|
Prob | newProb () |
| Creates a problem. More...
|
|
int | varhash (const char *varid) |
| Hash function for variables names. More...
|
|
int | addCoefHead (Prob prob, const char *varid, int varc, double coef) |
| Adds a new condition to the problem, and adds the coefficients of a variable. More...
|
|
int | addCoefTail (Prob prob, const char *varid, int varc, double coef) |
| Adds the coefficient of a variable. More...
|
|
int | setOpRHS (Prob prob, int op, double rhs) |
| Adds the relational operator and the right-hand side to a condition. More...
|
|
Definitions of data types and functions required to read and store the data about the problem.
- Author
- Rui Carlos Gonçalves
- Version
- 1.5
- Date
- 08/2015
Definition in file read.c.
#define POS |
( |
|
R, |
|
|
|
C, |
|
|
|
NC |
|
) |
| ((R)*(NC)+(C)) |
Given a row (R
), a column (C
), and the number of columns (NC
) of a matrix, computes an equivalent 1D position.
Definition at line 19 of file read.c.
int addCoefHead |
( |
Prob |
prob, |
|
|
const char * |
varid, |
|
|
int |
varc, |
|
|
double |
coef |
|
) |
| |
Adds a new condition to the problem, and adds the coefficients of a variable.
If the variable did not exist in the variables set, it is added.
- Parameters
-
prob | the problem. |
varid | the variable identifier. |
varc | the index of the variable if it does not exist. |
coef | the coefficient of the variable. |
- Returns
- 0 if the variable already existed; 0 otherwise.
Definition at line 83 of file read.c.
int addCoefTail |
( |
Prob |
prob, |
|
|
const char * |
varid, |
|
|
int |
varc, |
|
|
double |
coef |
|
) |
| |
Adds the coefficient of a variable.
If the variable did not exist in the variables set, it is added.
- Parameters
-
prob | the problem. |
varid | the variable identifier. |
varc | the index of the variable if it does not exist. |
coef | the coefficient of the variable. |
- Returns
- 0 if the variable already existed; 0 otherwise.
Definition at line 147 of file read.c.
Exp newExp |
( |
int |
arraysize | ) |
|
Creates an expression.
- Parameters
-
arraysize | size of the coefficients array. |
- Returns
NULL
if an error occurred; the new expression otherwise.
Definition at line 35 of file read.c.
Creates a problem.
- Returns
NULL
if an error occurred; the new problem otherwise.
Definition at line 53 of file read.c.
int setOpRHS |
( |
Prob |
prob, |
|
|
int |
op, |
|
|
double |
rhs |
|
) |
| |
Adds the relational operator and the right-hand side to a condition.
- Parameters
-
prob | the problem. |
op | the identifier of the relational operator. |
rhs | the right-hand side of the condition. |
- Returns
- 0.
Definition at line 201 of file read.c.
int varhash |
( |
const char * |
varid | ) |
|
Hash function for variables names.
- Parameters
-
varid | the variable identifier. |
- Returns
- the hash code of the variable.
Definition at line 71 of file read.c.
Initial value:={"ERROR! Function \'setCoefHead\' -> \'malloc\'.\n"
,"ERROR! Function \'setCoefHead\' -> \'listInsertLst\'.\n"
,"ERROR! Function \'setCoefHead\' -> \'arrayInsert\'.\n"
,"ERROR! Function \'setCoefHead\' -> \'newExp\'.\n"
,"ERROR! Function \'setCoefHead\' -> \'hashInsert\'.\n"
,"ERROR! Function \'setCoefTail\' -> \'malloc\'.\n"
,"ERROR! Function \'setCoefTail\' -> \'hashInsert\' or"
"\'arrayInsert\'.\n"
,"ERROR! Function \'setCoefTail\' -> \'arrayInsert\'.\n"
}
Error messages.
Definition at line 22 of file read.c.