Debian Codegraph @

SYMPHONY/Applications/SPP/src/CutGen/spp_cg.c

raw
1 /*===========================================================================*/
2 /* */
3 /* This file is part of a demonstration application for use with the */
4 /* SYMPHONY Branch, Cut, and Price Library. This application is a solver for */
5 /* the Set Partitioning Problem. */
6 /* */
7 /* (c) Copyright 2005-2007 Marta Eso and Ted Ralphs. All Rights Reserved. */
8 /* */
9 /* This application was originally developed by Marta Eso and was modified */
10 /* Ted Ralphs ([email protected]) */
11 /* */
12 /* This software is licensed under the Eclipse Public License. Please see */
13 /* accompanying file for terms. */
14 /* */
15 /*===========================================================================*/
16
17 /* SYMPHONY include files */
18 #include "sym_constants.h"
19 #include "sym_macros.h"
20 #include "sym_cg_u.h"
21
22 /* SPP include files */
23 #include "spp.h"
24
25 /*===========================================================================*/
26
27 /*===========================================================================*\
28 * This file contains user-written functions used by the cut generator
29 * process.
30 \*===========================================================================*/
31
32 /*===========================================================================*\
33 * Here is where the user must receive all of the data sent from
34 * user_send_cg_data() and set up data structures. Note that this function is
35 * only called if one of COMPILE_IN_CG, COMPILE_IN_LP, or COMPILE_IN_TM is
36 * FALSE. For sequential computation, nothing is needed here.
37 \*===========================================================================*/
38
39 int user_receive_cg_data(void **user, int dg_id)
40 {
41 return(USER_DEFAULT);
42 }
43
44 /*===========================================================================*/
45
46 /*===========================================================================*\
47 * If the user wants to fill in a customized routine for sending and receiving
48 * the LP solution, it can be done here. For most cases, the default routines
49 * are fine.
50 \*===========================================================================*/
51
52 int user_receive_lp_solution_cg(void *user)
53 {
54 return(USER_DEFAULT);
55 }
56
57 /*===========================================================================*/
58
59 /*===========================================================================*\
60 * Find cuts violated by a particular LP solution. This can be a fairly
61 * involved function but the bottom line is that an LP solution comes in
62 * and cuts go out. Remember, use the function cg_send_cut() to send cuts out
63 * when they are found.
64 \*===========================================================================*/
65
66 int user_find_cuts(void *user, int varnum, int iter_num, int level,
67 int index, double objval, int *indices, double *values,
68 double ub, double etol, int *cutnum, int *alloc_cuts,
69 cut_data ***cuts)
70 {
71 return(USER_DEFAULT);
72 }
73
74 /*===========================================================================*/
75
76 /*===========================================================================*\
77 * Free the user data structure. If the default setup is used with sequential
78 * computation, nothing needs to be filled in here.
79 \*===========================================================================*/
80
81 int user_free_cg(void **user)
82 {
83 return(USER_DEFAULT);
84 }
85
86 /*===========================================================================*/
87
88 /*===========================================================================*\
89 * This is an undocumented (for now) debugging feature which can allow the user
90 * to identify the cut which cuts off a particular known feasible solution.
91 \*===========================================================================*/
92
93 #ifdef CHECK_CUT_VALIDITY
94 int user_check_validity_of_cut(void *user, cut_data *new_cut)
95 {
96 return(USER_DEFAULT);
97 }
98 #endif