RLP  1.5
read.h File Reference

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.

Data Structures

struct  SExp
 Expression structure. More...
 
struct  SProb
 Problem structure. More...
 

Typedefs

typedef SExpExp
 Expression definition. More...
 
typedef SProbProb
 Problem definition. More...
 

Functions

Exp newExp (int arraysize)
 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...
 

Detailed Description

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.h.

Typedef Documentation

typedef SExp* Exp

Expression definition.

Definition at line 33 of file read.h.

typedef SProb* Prob

Problem definition.

Definition at line 51 of file read.h.

Function Documentation

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
probthe problem.
varidthe variable identifier.
varcthe index of the variable if it does not exist.
coefthe 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
probthe problem.
varidthe variable identifier.
varcthe index of the variable if it does not exist.
coefthe 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
arraysizesize of the coefficients array.
Returns
NULL if an error occurred; the new expression otherwise.

Definition at line 35 of file read.c.

Prob newProb ( )

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
probthe problem.
opthe identifier of the relational operator.
rhsthe 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
varidthe variable identifier.
Returns
the hash code of the variable.

Definition at line 71 of file read.c.

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