CProp
Constraint propagation engine for Mixed Integer Programs
cprop.h
Go to the documentation of this file.
1 #ifndef CPROP
2 #define CPROP
3 
15 typedef struct _CProp CProp;
16 
17 
18 #include "containers.h"
19 
20 
32 CProp *cprop_create( int cols, const char integer[], const double lb[], const double ub[], const char **name );
33 
34 
50 int cprop_add_constraint( CProp *cprop, int nz, const int idx[], const double coef[], char sense, double rhs, const char rname[] );
51 
52 
65 int cprop_update_bound( CProp *cprop, int j, double l, double u );
66 
67 
76 void cprop_undo( CProp *cprop );
77 
78 
83 char cprop_feasible( const CProp *cprop );
84 
85 
91 const char *cprop_inf_msg( const CProp *cprop );
92 
93 
101 int cprop_n_implications( const CProp *cprop );
102 
111 int cprop_implied_var( const CProp *cprop, int i );
112 
113 
119 double cprop_get_lb( const CProp *cprop, int j );
120 
121 
128 double cprop_get_ub( const CProp *cprop, int j );
129 
131 enum IGNType {
135 };
136 
137 
145 enum IGNType cprop_impl_graph_node_type( const CProp *cprop, int nodeId );
146 
147 
155 int cprop_impl_graph_node_var( const CProp *cprop, int nodeId );
156 
157 
166 int cprop_impl_graph_node_id( const CProp *cprop, enum IGNType ntype , int col );
167 
168 
177 int cprop_impl_graph_in_d( const CProp *cprop, int nodeId );
178 
179 
187 int cprop_impl_graph_in_neigh( const CProp *cprop, int nodeId, int i );
188 
189 
195 void cprop_save_impl_graph( const CProp *cprop, const char *fName );
196 
197 
203 int cprop_n_cuts( const CProp *cprop );
204 
205 
212 int cprop_cut_nz( const CProp *cprop, int idxCut );
213 
214 
221 const int *cprop_cut_idx( const CProp *cprop, int idxCut );
222 
223 
230 const double *cprop_cut_coef( const CProp *cprop, int idxCut );
231 
232 
239 char cprop_cut_sense( const CProp *cprop, int idxCut );
240 
241 
248 double cprop_cut_rhs( const CProp *cprop, int idxCut );
249 
250 
260 void cprop_set_verbose( CProp *cprop, char verbose );
261 
262 
268 void cprop_free( CProp **cprop );
269 
270 
271 #endif
272 
int cprop_n_implications(const CProp *cprop)
returns how many implications the last change produced
void cprop_undo(CProp *cprop)
undo the last bound changed and all its implications
int cprop_cut_nz(const CProp *cprop, int idxCut)
returns the number of variables that appear on cut idxCut
const double * cprop_cut_coef(const CProp *cprop, int idxCut)
returns a vector with all coefficients of cut idxCut
enum IGNType cprop_impl_graph_node_type(const CProp *cprop, int nodeId)
returns the node type
char cprop_feasible(const CProp *cprop)
returns 1 if problem is still feasible, zero otherwise
void cprop_save_impl_graph(const CProp *cprop, const char *fName)
saves the implication graph in the DOT file format (graphviz)
void cprop_free(CProp **cprop)
frees memory of cprop object
double cprop_get_lb(const CProp *cprop, int j)
returns the current lower bound for column j
int cprop_impl_graph_in_d(const CProp *cprop, int nodeId)
number of incident arcs in implication graph node
const int * cprop_cut_idx(const CProp *cprop, int idxCut)
returns a vector with all columns of cut idxCut
char cprop_cut_sense(const CProp *cprop, int idxCut)
returns the sense of cut idxCut
int cprop_implied_var(const CProp *cprop, int i)
returns the i-th variable which bound was implied in the last operation
double cprop_get_ub(const CProp *cprop, int j)
returns the current upper bound for column j
int cprop_update_bound(CProp *cprop, int j, double l, double u)
updates the bounds of a variable
int cprop_impl_graph_node_var(const CProp *cprop, int nodeId)
returns the variable which a node refers
int cprop_impl_graph_node_id(const CProp *cprop, enum IGNType ntype, int col)
returns the node id
CProp * cprop_create(int cols, const char integer[], const double lb[], const double ub[], const char **name)
creates a new CProp object
int cprop_impl_graph_in_neigh(const CProp *cprop, int nodeId, int i)
returns the origin of the i-th incident arc to nodeId
void cprop_set_verbose(CProp *cprop, char verbose)
activates detailed printing of implications as they are discovered
int cprop_n_cuts(const CProp *cprop)
returns the number of cuts found processing the last infeasible solution
Definition: cprop.h:133
int cprop_add_constraint(CProp *cprop, int nz, const int idx[], const double coef[], char sense, double rhs, const char rname[])
adds a new constraint
IGNType
Implication Graph Node Types.
Definition: cprop.h:131
const char * cprop_inf_msg(const CProp *cprop)
message explaining how infeasibility was detected
Definition: cprop.h:132
double cprop_cut_rhs(const CProp *cprop, int idxCut)
returns the right hand side of cut idxCut