/*===========================================================================*/ /* */ /* This file is part of the SYMPHONY Branch, Cut, and Price Library. */ /* */ /* SYMPHONY was jointly developed by Ted Ralphs (ted@lehigh.edu) and */ /* Laci Ladanyi (ladanyi@us.ibm.com). */ /* */ /* (c) Copyright 2000-2007 Ted Ralphs. All Rights Reserved. */ /* */ /* This software is licensed under the Eclipse Public License. Please see */ /* accompanying file for terms. */ /* */ /*===========================================================================*/ /* SYMPHONY include files */ #include "sym_constants.h" #include "sym_macros.h" #include "sym_cg_u.h" /* User include files */ #include "user.h" /*===========================================================================*/ /*===========================================================================*\ * This file contains user-written functions used by the cut generator * process. \*===========================================================================*/ /*===========================================================================*\ * Here is where the user must receive all of the data sent from * user_send_cg_data() and set up data structures. Note that this function is * only called if one of COMPILE_IN_CG, COMPILE_IN_LP, or COMPILE_IN_TM is * FALSE. For sequential computation, nothing is needed here. \*===========================================================================*/ int user_receive_cg_data(void **user, int dg_id) { return(USER_DEFAULT); } /*===========================================================================*/ /*===========================================================================*\ * If the user wants to fill in a customized routine for sending and receiving * the LP solution, it can be done here. For most cases, the default routines * are fine. \*===========================================================================*/ int user_receive_lp_solution_cg(void *user) { return(USER_DEFAULT); } /*===========================================================================*/ /*===========================================================================*\ * Find cuts violated by a particular LP solution. This can be a fairly * involved function but the bottom line is that an LP solution comes in * and cuts go out. Remember, use the function cg_send_cut() to send cuts out * when they are found. \*===========================================================================*/ int user_find_cuts(void *user, int varnum, int iter_num, int level, int index, double objval, int *indices, double *values, double ub, double etol, int *num_cuts, int *alloc_cuts, cut_data ***cuts) { user_problem *prob = (user_problem *) user; /* Fill in cut generation here if desired */ return(USER_DEFAULT); } /*===========================================================================*/ /*===========================================================================*\ * Free the user data structure. If the default setup is used with sequential * computation, nothing needs to be filled in here. \*===========================================================================*/ int user_free_cg(void **user) { return(USER_DEFAULT); } /*===========================================================================*/ /*===========================================================================*\ * This is an undocumented (for now) debugging feature which can allow the user * to identify the cut which cuts off a particular known feasible solution. \*===========================================================================*/ #ifdef CHECK_CUT_VALIDITY int user_check_validity_of_cut(void *user, cut_data *new_cut) { return(USER_DEFAULT); } #endif