4 #include "CoinHelperFunctions.hpp"
5 #include "CoinSort.hpp"
14 const double alpha,
const double beta,
16 const int heurswitchround,
17 const bool do_edge_switch_heur,
const int struct_switch_heur)
25 int * edgeorder =
new int[
m];
26 int * edges_in_tree =
new int[n-1];
27 double * composite_weight =
new double[
m];
30 switch (edge_ordering) {
32 if (w == NULL || beta == 0.0) {
33 for (j = 0; j <
m; ++
j)
34 composite_weight[j] = alpha * x[j];
36 for (j = 0; j <
m; ++
j)
37 composite_weight[j] = alpha * x[j] - beta * w[j];
41 if (w == NULL || beta == 0.0) {
42 for (j = 0; j <
m; ++
j)
43 composite_weight[j] = alpha * (1.0-x[j]);
45 for (j = 0; j <
m; ++
j)
46 composite_weight[j] = alpha * (1.0-x[j]) - beta * w[
j];
50 if (w == NULL || beta == 0.0) {
51 for (j = 0; j <
m; ++
j)
52 composite_weight[j] = alpha * CoinMin(x[j], 1.0-x[j]);
54 for (j = 0; j <
m; ++
j)
55 composite_weight[j] = alpha*CoinMin(x[j], 1.0-x[j]) - beta*w[
j];
59 CoinIotaN(edgeorder, m, 0);
61 CoinSort_2(composite_weight, composite_weight + m, edgeorder);
65 delete[] composite_weight;
66 delete[] edges_in_tree;
69 sol =
new MC_solution(nodesign, mc, heurswitchround,
70 do_edge_switch_heur, struct_switch_heur);
iterator begin()
Return an iterator to the beginning of the object.
void MC_kruskal(const MC_problem &mc, const int *edgeorder, const double *x, int *nodesign, int *edges_in_tree)
MC_solution * MC_mst_heur(const MC_problem &mc, const double *x, const double *w, const double alpha, const double beta, const MC_EdgeOrdering edge_ordering, const int heurswitchround, const bool do_edge_switch_heur, const int struct_switch_heur)
void fint fint fint real fint real real real real real real real real * w
void fint fint fint real fint real * x