4 #include "CoinSort.hpp"
12 const int c0,
const int c1,
const int c2,
const int c3,
50 if (sum > 2 + minviol) {
52 double row[4] = {1.0, 1.0, 1.0, -1.0};
53 CoinSort_2(cut, cut+4, row);
55 }
else if (sum < - minviol) {
56 std::rotate(cut, cut+3, cut+4);
58 double row[4] = {1.0, -1.0, -1.0, -1.0};
59 CoinSort_2(cut, cut+4, row);
66 const double*
x,
const double minviol,
69 const int* cycle = cycles;
70 for (
int i = 0; i <
n; ++i) {
71 const int c0 = cycle[0];
72 const int c1 = cycle[1];
73 const int c2 = cycle[2];
74 const int c3 = cycle[3];
75 const double x0 = x[c0];
76 const double x1 = x[c1];
77 const double x2 = x[c2];
78 const double x3 = x[c3];
93 const double*
x,
const double minviol,
96 const int* cycle = cycles;
98 for (
int i = 0; i <
n; ++i) {
99 const int c0 = cycle[0];
100 const int c1 = cycle[1];
101 const int c2 = cycle[2];
102 const double x0 = x[c0];
103 const double x1 = x[c1];
104 const double x2 = x[c2];
106 if (x0+x1+x2 > 2 + minviol) {
108 double row[3] = {1.0, 1.0, 1.0};
111 if (+ x0 - x1 - x2 > minviol) {
113 double row[3] = {1.0, -1.0, -1.0};
116 if (- x0 + x1 - x2 > minviol) {
121 double row[3] = {-1.0, 1.0, -1.0};
124 if (- x0 - x1 + x2 > minviol) {
129 double row[3] = {-1.0, -1.0, 1.0};
void push_back(const_reference x)
Append x to the end of the vector.
static void MC_test_ising_four_cycle(const double sum, const double minviol, const int c0, const int c1, const int c2, const int c3, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows)
void MC_test_ising_triangles(const int n, const int *cycles, const double *x, const double minviol, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows)
void MC_test_ising_four_cycles(const int n, const int *cycles, const double *x, const double minviol, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows)
void fint fint fint real fint real * x
This class holds a row in a compressed form.