Dip  0.92.4
sym_cg.h
Go to the documentation of this file.
1 /*===========================================================================*/
2 /* */
3 /* This file is part of the SYMPHONY MILP Solver Framework. */
4 /* */
5 /* SYMPHONY was jointly developed by Ted Ralphs (ted@lehigh.edu) and */
6 /* Laci Ladanyi (ladanyi@us.ibm.com). */
7 /* */
8 /* (c) Copyright 2000-2019 Ted Ralphs. All Rights Reserved. */
9 /* */
10 /* This software is licensed under the Eclipse Public License. Please see */
11 /* accompanying file for terms. */
12 /* */
13 /*===========================================================================*/
14 
15 #ifndef _CUT_GEN_H
16 #define _CUT_GEN_H
17 
18 #include "symphony.h"
19 #include "sym_types.h"
20 #include "sym_cg_params.h"
21 #include "sym_cg_u.h"
22 #include "sym_lp_solver.h"
23 
24 /*===========================================================================*/
25 
26 /*stores the data needed by the cut_generator*/
27 typedef struct CG_PROB{
29  void *user;
30  int msgtag;
31  int master;
32  int draw_graph; /* the tid of DrawGraph */
33  int tree_manager; /* the tid of the tree manager */
34  cg_params par; /* the parameters for the cut generator */
35  char has_ub; /* is there an upper bound */
36  double ub; /* the current best upper bound if there
37  is one */
38  double tt;
40 #ifdef COMPILE_IN_CG
41  int cuts_to_add_num;
42  cut_data **cuts_to_add;
43  int cuts_to_add_size;
44 #endif
45 }cg_prob;
46 
47 /*===========================================================================*/
48 /*==================== CG basic functions (cg_func.c) =======================*/
49 /*===========================================================================*/
50 
51 cg_prob *get_cg_ptr PROTO((cg_prob **cg_list));
52 void cg_initialize PROTO((cg_prob *p, int master_tid));
53 void cg_close PROTO((cg_prob * p));
54 cut_data *create_explicit_cut PROTO((int nzcnt, int *indices, double *values,
55  double rhs, double range, char sense,
56  char send_to_cp));
57 int cg_add_explicit_cut PROTO((int nzcnt, int *indices, double *values,
58  double rhs, double range, char sense,
59  char send_to_cp, int *num_cuts, int *alloc_cuts,
60  cut_data ***cuts));
61 int cg_add_user_cut PROTO((cut_data *new_cut, int *num_cuts, int *alloc_cuts,
62  cut_data ***cuts));
63 
64 /*===========================================================================*/
65 /*=============== CG communication functions (cg_proccomm.c) ================*/
66 /*===========================================================================*/
67 
68 int cg_process_message PROTO((cg_prob *p, int r_bufid));
69 int cg_send_cut PROTO((cut_data *new_cut, int *num_cuts, int *alloc_cuts,
70  cut_data ***cuts));
71 
72 /*===========================================================================*/
73 /*==================== LP wrapper functions (cg_wrapper.c) ==================*/
74 /*===========================================================================*/
75 
76 int receive_cg_data_u PROTO((cg_prob *p));
77 int receive_lp_solution_cg_u PROTO((cg_prob *p));
78 int free_cg_u PROTO((cg_prob *p));
79 int find_cuts_u PROTO((cg_prob *p, LPdata *lp_data, int *num_cuts));
80 int check_validity_of_cut_u PROTO((cg_prob *p, cut_data *new_cut));
81 
82 #endif
double ub
Definition: sym_cg.h:36
#define PROTO(x)
Definition: sym_proto.h:27
Definition: sym_cg.h:27
struct CG_PROB cg_prob
cg_params par
Definition: sym_cg.h:34
int msgtag
Definition: sym_cg.h:30
void * user
Definition: sym_cg.h:29
int tree_manager
Definition: sym_cg.h:33
int master
Definition: sym_cg.h:31
int draw_graph
Definition: sym_cg.h:32
char has_ub
Definition: sym_cg.h:35
lp_sol cur_sol
Definition: sym_cg.h:39
double tt
Definition: sym_cg.h:38
int proc_index
Definition: sym_cg.h:28