/home/coin/SVN-release/CoinAll-1.1.0/SYMPHONY/include/sym_cp.h

Go to the documentation of this file.
00001 /*===========================================================================*/
00002 /*                                                                           */
00003 /* This file is part of the SYMPHONY MILP Solver Framework.                  */
00004 /*                                                                           */
00005 /* SYMPHONY was jointly developed by Ted Ralphs (tkralphs@lehigh.edu) and    */
00006 /* Laci Ladanyi (ladanyi@us.ibm.com).                                        */
00007 /*                                                                           */
00008 /* (c) Copyright 2000-2008 Ted Ralphs. All Rights Reserved.                  */
00009 /*                                                                           */
00010 /* This software is licensed under the Common Public License. Please see     */
00011 /* accompanying file for terms.                                              */
00012 /*                                                                           */
00013 /*===========================================================================*/
00014 
00015 #ifndef _CUT_POOL_H
00016 #define _CUT_POOL_H
00017 
00018 #include "symphony.h"
00019 #include "sym_proto.h"
00020 #include "sym_types.h"
00021 #include "sym_cp_params.h"
00022 #include "sym_cp_u.h"
00023 
00024 #define PREPARE_TO_CHECK_CUTS  0
00025 #define CHECK_ONE_CUT          1
00026 #define FINISH_TO_CHECK_CUTS   2
00027 
00028 /*===========================================================================*\
00029  * This data structure contains the cut pool itself
00030 \*===========================================================================*/
00031 
00032 typedef struct CP_CUT_DATA{
00033    cut_data      cut;
00034    int           touches;
00035    int           level;
00036    int           check_num;
00037    double        quality;
00038 }cp_cut_data;
00039 
00040 /*===========================================================================*/
00041 
00042 typedef struct CUT_POOL{
00043    void         *user;
00044    int           master;
00045    int           tree_manager;
00046    double        cut_pool_time;
00047    int           msgtag;        /* the message tag of the last message */
00048    double        lpetol;        /* the zero tolerance in the lp process */
00049    cp_params     par;           /* cut pool parameters */
00050    int           size;          /* the total size of all the cuts in the pool*/
00051    int           cut_num;       /* the number of cuts in the pool */
00052    int           allocated_cut_num;   /* the possible number of cuts */
00053    cp_cut_data **cuts;          /* the list of all the cuts in the pool*/
00054    int           total_cut_num;
00055    int           reorder_count; /* Only reorder the cuts periodically */
00056    lp_sol        cur_sol;
00057 #ifdef COMPILE_IN_CP
00058    int           cuts_to_add_num;
00059    cut_data    **cuts_to_add;
00060    int           cuts_to_add_size;
00061 #endif
00062 }cut_pool;
00063 
00064 /*===========================================================================*/
00065 /*==================== CP basic functions (cp_func.c) =======================*/
00066 /*===========================================================================*/
00067 
00068 cut_pool *get_cp_ptr PROTO((cut_pool ** cp_list, int index));
00069 void cp_initialize PROTO((cut_pool *cp, int master_tid));
00070 
00071 /*------- Functions related to deletion of cuts (size management) -----------*/
00072 
00073 int unsigned_memcmp PROTO((char *coef0, char *coef1, int size));
00074 int cutcmp PROTO((const void *cut0ptr, const void *cut1ptr));
00075 int delete_ineffective_cuts PROTO((cut_pool *cp));
00076 int delete_duplicate_cuts PROTO((cut_pool *cp));
00077 int which_cut_to_delete PROTO((cut_data *cut1, cut_data *cut2));
00078 
00079 /*---------------------- Checking the cuts ----------------------------------*/
00080 
00081 int cut_quality_cmp PROTO((const void *cut0ptr, const void *cut1ptr));
00082 void order_cuts_by_quality PROTO((cut_pool *cp));
00083 
00084 /*--------------- Functions related to logging ------------------------------*/
00085 
00086 int write_cp_cut_list PROTO((cut_pool *cp, char *file, char append));
00087 int read_cp_cut_list PROTO((cut_pool *cp, char *file));
00088 int cp_read_tm_cut_list PROTO((cut_pool *cp, char *file));
00089 
00090 /*---------------------------- Closing --------------------------------------*/
00091 
00092 void cp_close PROTO((cut_pool *cp));
00093 
00094 /*===========================================================================*/
00095 /*=============== CP communication functions (cp_proccomm.c) ================*/
00096 /*===========================================================================*/
00097 
00098 void cp_process_message PROTO((cut_pool *cp, int r_bufid));
00099 void cut_pool_send_cut PROTO((cut_pool *cp, cut_data *cut, int tid));
00100 void cut_pool_receive_cuts PROTO((cut_pool *cp, int bc_level));
00101 
00102 /*===========================================================================*/
00103 /*================= CP wrapper functions (cp_wrapper.c) =====================*/
00104 /*===========================================================================*/
00105 
00106 int receive_cp_data_u PROTO((cut_pool *cp));
00107 int receive_lp_solution_cp_u PROTO((cut_pool *cp));
00108 void free_cut_pool_u PROTO((cut_pool *cp));
00109 int check_cuts_u PROTO((cut_pool *cp, lp_sol *cur_sol));
00110 int check_cut_u PROTO((cut_pool *cp, lp_sol *cur_sol, cut_data *cut,
00111                        int *is_violated, double *quality));
00112 
00113 #endif

Generated on Sun Nov 14 14:06:42 2010 for Coin-All by  doxygen 1.4.7