RLP  1.5
read.h
Go to the documentation of this file.
1 
10 #ifndef _READ_
11 #define _READ_
12 
13 #include "array.h"
14 #include "hashmap.h"
15 #include "list.h"
16 
20 typedef struct sExp
21 {
25  int op;
27  double rhs;
28 }SExp;
29 
33 typedef SExp* Exp;
34 
38 typedef struct sProb
39 {
46 }SProb;
47 
51 typedef SProb* Prob;
52 
53 //##############################################################################
54 
62 Exp newExp(int arraysize);
63 
69 Prob newProb();
70 
78 int varhash(const char* varid);
79 
91 int addCoefHead(Prob prob,const char* varid,int varc,double coef);
92 
104 int addCoefTail(Prob prob,const char* varid,int varc,double coef);
105 
115 int setOpRHS(Prob prob,int op,double rhs);
116 
117 #endif
Implementation of a hash table.
Array coefs
Coefficients of the variables.
Definition: read.h:23
SProb * Prob
Problem definition.
Definition: read.h:51
int op
Operator of the expression.
Definition: read.h:25
int setOpRHS(Prob prob, int op, double rhs)
Adds the relational operator and the right-hand side to a condition.
Definition: read.c:201
int addCoefTail(Prob prob, const char *varid, int varc, double coef)
Adds the coefficient of a variable.
Definition: read.c:147
Implementation of a dynamic array.
SExp * Exp
Expression definition.
Definition: read.h:33
Prob newProb()
Creates a problem.
Definition: read.c:53
Implementation of a linked list.
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.
Definition: read.c:83
HashMap pos
Variables and their indexes.
Definition: read.h:41
List exps
List of expressions (objective function, and conditions).
Definition: read.h:45
Hash table structure.
Definition: hashmap.h:82
Problem structure.
Definition: read.h:38
Exp newExp(int arraysize)
Creates an expression.
Definition: read.c:35
int varhash(const char *varid)
Hash function for variables names.
Definition: read.c:71
Array invpos
Variables on each index.
Definition: read.h:43
Linked list structure.
Definition: list.h:37
double rhs
Right-hand side of the expression.
Definition: read.h:27
Array structure.
Definition: array.h:23
Expression structure.
Definition: read.h:20

RLP © 2006, 2009, 2015   Rui Carlos Gonçalves