coin-Bcp
MKC_optim.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef _MKC_OPTIM_H
4 #define _MKC_OPTIM_H
5 
6 #include "BCP_vector.hpp"
7 
10 class MKC_knapsack_set;
11 class BCP_var;
12 class MKC_var;
13 
14 
15 //#############################################################################
16 
17 void
18 MKC_greedy_knapsack(const int clr[2],
19  const MKC_knapsack_entry* entries, // this knapsack prob
20  const int entry_num,
21  // for this KS:
22  // fixings, capacity, cost, index of it in the list
23  const MKC_knapsack_fixing& ksf,
24  const double capacity,
25  const double ks_cost,
26  const int ks_ind,
27  // the total number of knapsacks
28  const int ks_num,
29  // how good sol's we are looking for
30  double& cutoff,
31  // the generated vars
32  BCP_vec<BCP_var*>& new_vars,
33  // temporary vector
34  int * tmp_chosen);
35 
36 void
37 MKC_exact_knapsack(const int clr[2],
38  const MKC_knapsack_entry* entries, // this knapsack prob
39  const int entry_num,
40  // for this KS:
41  // fixings, capacity, cost, index of it in the list
42  const MKC_knapsack_fixing& ksf,
43  const double capacity,
44  const double ks_cost,
45  const int ks_ind,
46  // the total number of knapsacks
47  const int ks_num,
48  // how good sol's we are looking for
49  double& cutoff,
50  // the generated vars
51  BCP_vec<BCP_var*>& new_vars,
52  // temporary vector
53  int * tmp_chosen);
54 
55 MKC_var*
56 MKC_create_var(const int clr[2],
58  const int * entry_ind, const int size,
59  const double ks_cost, const int ks_num, const int ks_ind,
60  const MKC_knapsack_fixing& ksf);
61 
62 void
64  BCP_vec<MKC_var*>* enumerated_ks,
65  const int max_enumerated_size);
66 
67 void
68 MKC_enumerate_one_ks(const int clr[2],
69  const MKC_knapsack_entry * entries, const int size,
70  BCP_vec<MKC_var*>& enumerated,
71  const int ks_num, const int ks_ind, const double ks_cost,
72  const double ks_capacity, char * flag, double * w);
73 
74 #endif
int entry_num
Definition: MKC_var.hpp:19
void MKC_exact_knapsack(const int clr[2], const MKC_knapsack_entry *entries, const int entry_num, const MKC_knapsack_fixing &ksf, const double capacity, const double ks_cost, const int ks_ind, const int ks_num, double &cutoff, BCP_vec< BCP_var * > &new_vars, int *tmp_chosen)
void MKC_enumerate_one_ks(const int clr[2], const MKC_knapsack_entry *entries, const int size, BCP_vec< MKC_var * > &enumerated, const int ks_num, const int ks_ind, const double ks_cost, const double ks_capacity, char *flag, double *w)
MKC_var * MKC_create_var(const int clr[2], const MKC_knapsack_entry *entries, const int *entry_ind, const int size, const double ks_cost, const int ks_num, const int ks_ind, const MKC_knapsack_fixing &ksf)
Abstract base class that defines members common to all types of variables.
Definition: BCP_var.hpp:28
void MKC_enumerate_knapsacks(MKC_knapsack_set &kss, BCP_vec< MKC_var * > *enumerated_ks, const int max_enumerated_size)
void MKC_greedy_knapsack(const int clr[2], const MKC_knapsack_entry *entries, const int entry_num, const MKC_knapsack_fixing &ksf, const double capacity, const double ks_cost, const int ks_ind, const int ks_num, double &cutoff, BCP_vec< BCP_var * > &new_vars, int *tmp_chosen)
int * entries
Definition: MKC_var.hpp:20