A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://scip.zib.de/doc/html/cuts_8c_source.php below:

SCIP Doxygen Documentation: cuts.c Source File

81 for

( i = 0; i < cutnnz; ++i )

100 if

( cutcoefs[i] > 0.0 )

123#define NONZERO(x) (COPYSIGN(1e-100, (x)) + (x)) 139

assert(inds !=

NULL

);

140

assert(vals !=

NULL

);

141

assert(nnz !=

NULL

);

142

assert(row !=

NULL

);

145 for

( i = 0 ; i < row->

len

; ++i )

151

val = vals[probindex];

154

inds[(*nnz)++] = probindex;

156

val += row->

vals

[i] * scale;

162

vals[probindex] = val;

184

assert(inds !=

NULL

);

185

assert(vals !=

NULL

);

186

assert(nnz !=

NULL

);

187

assert(row !=

NULL

);

190 for

( i = 0 ; i < row->

len

; ++i )

200

inds[(*nnz)++] = probindex;

231

assert(inds !=

NULL

);

232

assert(vals !=

NULL

);

233

assert(nnz !=

NULL

);

234

assert(row !=

NULL

);

237 for

( i = 0 ; i < row->

len

; ++i )

248

inds[(*nnz)++] = probindex;

284

assert(cutcoefs !=

NULL

);

285

assert(cutinds !=

NULL

);

289 switch

(

scip

->set->sepa_efficacynorm )

292 for

( i = 0; i < cutnnz; ++i )

295

norm +=

SQR

(cutcoefs[i]);

300 for

( i = 0; i < cutnnz; ++i )

305

absval =

REALABS

(cutcoefs[i]);

306

norm =

MAX

(norm, absval);

310 for

( i = 0; i < cutnnz; ++i )

317 for

( i = 0; i < cutnnz; ++i )

329 return

(activity - cutrhs) /

MAX

(1e-6, norm);

348 switch

(

scip

->set->sepa_efficacynorm )

351 for

( i = 0; i < nnz; ++i )

359 for

( i = 0; i < nnz; ++i )

365

norm =

MAX

(norm, absval);

369 for

( i = 0; i < nnz; ++i )

376 for

( i = 0; i < nnz; ++i )

412

assert(cutcoefs !=

NULL

);

413

assert(cutinds !=

NULL

);

418 switch

(

scip

->set->sepa_efficacynorm )

421 for

( i = 0; i < cutnnz; ++i )

430 for

( i = 0; i < cutnnz; ++i )

437

norm =

MAX

(norm, absval);

441 for

( i = 0; i < cutnnz; ++i )

449 for

( i = 0; i < cutnnz; ++i )

462 return

(activity - cutrhs) /

MAX

(1e-6, norm);

486 for

( i = 0; i < *cutnnz; )

545

cutinds[i] = cutinds[*cutnnz];

582 for

( i = 0; i < *cutnnz; )

610 if

(

EPSZ

(val, minval) || isfixed )

641

cutinds[i] = cutinds[*cutnnz];

670 if

( abscoef1 < abscoef2 )

672 if

( abscoef2 < abscoef1 )

686

abscoef1 =

REALABS

(coefs[ind1]);

687

abscoef2 =

REALABS

(coefs[ind2]);

689 if

( abscoef1 < abscoef2 )

691 if

( abscoef2 < abscoef1 )

817

assert(redundant !=

NULL

);

821 for

( i = 0; i < *cutnnz; ++i )

825

assert(cutinds[i] >= 0);

826

assert(vars[cutinds[i]] !=

NULL

);

837 if

( cutinds[i] < nintegralvars )

855 if

( cutinds[i] < nintegralvars )

887

equiscale = 1.0 /

MIN

((maxact -

QUAD_TO_DBL

(*cutrhs)), maxabsintval);

889 for

( i = 0; i < *cutnnz; ++i )

900

(

SCIP_Longint

)

scip

->set->sepa_maxcoefratio,

scip

->set->sepa_maxcoefratio, &intscalar, &success) );

907

intscalar *= equiscale;

910 for

( i = 0; i < *cutnnz; )

939

cutinds[i] = cutinds[*cutnnz];

949 for

( i = 0; i < *cutnnz; ++i )

953

assert(cutinds[i] >= 0);

954

assert(vars[cutinds[i]] !=

NULL

);

992

maxabsintval *= equiscale;

994 for

( i = 0; i < *cutnnz; ++i )

1011

maxabsval =

MIN

(maxabsval, maxabsintval);

1012

maxabsval =

MAX

(maxabsval, maxabscontval);

1014

scale = 1.0 / maxabsval;

1019

maxabsintval *= scale;

1021 for

( i = 0; i < *cutnnz; ++i )

1044 SCIPsortDownInd

(cutinds, compareAbsCoefsQuad, (

void

*) cutcoefs, *cutnnz);

1047 for

( i = 0; i < *cutnnz; )

1051 if

( cutinds[i] >= nintegralvars )

1084 SCIPdebugMsg

(

scip

,

"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n"

,

1103

cutinds[i] = cutinds[*cutnnz];

1131 SCIPdebugMsg

(

scip

,

"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n"

,

1150

cutinds[i] = cutinds[*cutnnz];

1192

assert(redundant !=

NULL

);

1193

*redundant =

FALSE

;

1196 for

( i = 0; i < *cutnnz; ++i )

1201

assert(cutinds[i] >= 0);

1202

assert(vars[cutinds[i]] !=

NULL

);

1204

val = cutcoefs[cutinds[i]];

1213 if

( cutinds[i] < nintegralvars )

1214

maxabsintval =

MAX

(maxabsintval, -val);

1217

maxabscontval =

MAX

(maxabscontval, -val);

1218

isintegral =

FALSE

;

1231 if

( cutinds[i] < nintegralvars )

1232

maxabsintval =

MAX

(maxabsintval, val);

1235

maxabscontval =

MAX

(maxabscontval, val);

1236

isintegral =

FALSE

;

1263

equiscale = 1.0 /

MIN

((maxact -

QUAD_TO_DBL

(*cutrhs)), maxabsintval);

1265 for

( i = 0; i < *cutnnz; ++i )

1269

val = equiscale * cutcoefs[cutinds[i]];

1275

(

SCIP_Longint

)

scip

->set->sepa_maxcoefratio,

scip

->set->sepa_maxcoefratio, &intscalar, &success) );

1282

intscalar *= equiscale;

1285 for

( i = 0; i < *cutnnz; )

1290

val = cutcoefs[cutinds[i]];

1302 if

( intval != 0.0 )

1304

cutcoefs[cutinds[i]] = intval;

1310

cutcoefs[cutinds[i]] = 0.0;

1312

cutinds[i] = cutinds[*cutnnz];

1322 for

( i = 0; i < *cutnnz; ++i )

1327

assert(cutinds[i] >= 0);

1328

assert(vars[cutinds[i]] !=

NULL

);

1330

val = cutcoefs[cutinds[i]];

1336

maxabsintval =

MAX

(maxabsintval, -val);

1345

maxabsintval =

MAX

(maxabsintval, val);

1359

isintegral =

FALSE

;

1364

maxabsintval *= equiscale;

1366 for

( i = 0; i < *cutnnz; ++i )

1367

cutcoefs[cutinds[i]] *= equiscale;

1377

maxabsval =

MIN

(maxabsval, maxabsintval);

1378

maxabsval =

MAX

(maxabsval, maxabscontval);

1380

scale = 1.0 / maxabsval;

1385

maxabsintval *= scale;

1387 for

( i = 0; i < *cutnnz; ++i )

1388

cutcoefs[cutinds[i]] *= scale;

1404 SCIPsortDownInd

(cutinds, compareAbsCoefs, (

void

*) cutcoefs, *cutnnz);

1407 for

( i = 0; i < *cutnnz; )

1411 if

( cutinds[i] >= nintegralvars )

1417

val = cutcoefs[cutinds[i]];

1444 SCIPdebugMsg

(

scip

,

"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n"

,

1460

cutcoefs[cutinds[i]] = 0.0;

1462

cutinds[i] = cutinds[*cutnnz];

1490 SCIPdebugMsg

(

scip

,

"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n"

,

1506

cutcoefs[cutinds[i]] = 0.0;

1508

cutinds[i] = cutinds[*cutnnz];

1546

assert(nchgcoefs !=

NULL

);

1554

assert(nchgcoefs !=

NULL

);

1557 for

( i = 0; i < *cutnnz; ++i )

1561

assert(cutinds[i] >= 0);

1562

assert(vars[cutinds[i]] !=

NULL

);

1564 if

( cutcoefs[i] < 0.0 )

1571 if

( cutinds[i] < nintegralvars )

1573

maxabsval =

MAX

(maxabsval, -cutcoefs[i]);

1574

absvals[i] = -cutcoefs[i];

1589 if

( cutinds[i] < nintegralvars )

1591

maxabsval =

MAX

(maxabsval, cutcoefs[i]);

1592

absvals[i] = cutcoefs[i];

1619 for

( i = 0; i < *cutnnz; ++i )

1622 if

( cutinds[i] >= nintegralvars )

1627 if

( cutcoefs[i] < 0.0 &&

SCIPisLE

(

scip

, maxact + cutcoefs[i], *cutrhs) )

1634 if

( coef > cutcoefs[i] )

1643 SCIPdebugMsg

(

scip

,

"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n"

,

1644

cutcoefs[i], coef, (*cutrhs),

QUAD_TO_DBL

(tmp), lb,

1662

cutinds[i] = cutinds[*cutnnz];

1663

cutcoefs[i] = cutcoefs[*cutnnz];

1668 else if

( cutcoefs[i] > 0.0 &&

SCIPisLE

(

scip

, maxact - cutcoefs[i], *cutrhs) )

1675 if

( coef < cutcoefs[i] )

1684 SCIPdebugMsg

(

scip

,

"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n"

,

1703

cutinds[i] = cutinds[*cutnnz];

1704

cutcoefs[i] = cutcoefs[*cutnnz];

1730

assert(aggrrow !=

NULL

);

1741

(*aggrrow)->local =

FALSE

;

1742

(*aggrrow)->nnz = 0;

1743

(*aggrrow)->rank = 0;

1745

(*aggrrow)->rowsinds =

NULL

;

1746

(*aggrrow)->slacksign =

NULL

;

1747

(*aggrrow)->rowweights =

NULL

;

1748

(*aggrrow)->nrows = 0;

1749

(*aggrrow)->rowssize = 0;

1763

assert(aggrrow !=

NULL

);

1787

assert(aggrrow !=

NULL

);

1790

assert(vars !=

NULL

);

1793

assert(messagehdlr);

1796 if

( aggrrow->

nnz

== 0 )

1799 for

( i = 0; i < aggrrow->

nnz

; ++i )

1822

assert(aggrrow !=

NULL

);

1823

assert(source !=

NULL

);

1830

(*aggrrow)->nnz = source->

nnz

;

1833 if

( source->

nrows

> 0 )

1845

(*aggrrow)->rowsinds =

NULL

;

1846

(*aggrrow)->slacksign =

NULL

;

1847

(*aggrrow)->rowweights =

NULL

;

1850

(*aggrrow)->nrows = source->

nrows

;

1851

(*aggrrow)->rowssize = source->

nrows

;

1852

(*aggrrow)->rank = source->

rank

;

1853

(*aggrrow)->local = source->

local

;

1872

assert(row->

lppos

>= 0);

1880

i = aggrrow->

nrows

++;

1893 if

( sidetype == -1 )

1898 else if

( sidetype == 1 )

1956

assert(valid !=

NULL

);

1959

v = aggrrow->

inds

[pos];

1997

aggrrow->

inds

[pos] = aggrrow->

inds

[aggrrow->

nnz

];

2016

assert(aggrrow !=

NULL

);

2022 if

( aggrrow->

nnz

== 0 )

2025 for

( i = 0; i < nvars; ++i )

2035

aggrrow->

inds

[aggrrow->

nnz

++] = i;

2046 for

( i = 0 ; i < nvars; ++i )

2058

aggrrow->

inds

[aggrrow->

nnz

++] = i;

2066

assert(

QUAD_HI

(val) != 0.0);

2095

assert(weight >= 0.0);

2109 for

( i = 0 ; i < len; ++i )

2112 int

probindex = inds[i];

2117

aggrrow->

inds

[aggrrow->

nnz

++] = probindex;

2124

assert(

QUAD_HI

(val) != 0.0);

2142 for

( i = 0; i < aggrrow->

nnz

; ++i )

2148

aggrrow->

nrows

= 0;

2187

assert( rowtoolong !=

NULL

);

2188

*rowtoolong =

FALSE

;

2223 if

( weight > 0.0 && ((negslack == 0) || (negslack == 1 && !row->

integral

)) )

2235 if

( weight < 0.0 && ((negslack == 0) || (negslack == 1 && !row->

integral

)) )

2251

i = aggrrow->

nrows

++;

2264

aggrrow->

slacksign

[i] = uselhs ? -1 : 1;

2270 if

( aggrrow->

nnz

> maxaggrlen )

2271

*rowtoolong =

TRUE

;

2300

assert( aggrrow !=

NULL

);

2301

assert( valid !=

NULL

);

2309 if

( rowinds !=

NULL

&& nrowinds > -1 )

2311 for

( k = 0; k < nrowinds; ++k )

2313 SCIP_CALL

(

addOneRow

(

scip

, aggrrow, rows[rowinds[k]], weights[rowinds[k]], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );

2321 for

( k = 0; k < nrows; ++k )

2323 if

( weights[k] != 0.0 )

2325 SCIP_CALL

(

addOneRow

(

scip

, aggrrow, rows[k], weights[k], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );

2360

assert(cutinds !=

NULL

);

2361

assert(cutcoefs !=

NULL

);

2362

assert(cutrhs !=

NULL

);

2363

assert(success !=

NULL

);

2387 for

( i = 0; i < *nnz; ++i )

2390

maxcoef =

MAX

(absval, maxcoef);

2393

maxcoef /=

scip

->set->sepa_maxcoefratio;

2395

minallowedcoef =

MAX

(minallowedcoef, maxcoef);

2397

*success = !

removeZeros

(

scip

, minallowedcoef, cutislocal, cutcoefs,

QUAD

(&rhs), cutinds, nnz);

2428

assert(cutinds !=

NULL

);

2429

assert(cutcoefs !=

NULL

);

2431

assert(success !=

NULL

);

2452 for

( i = 0; i < *nnz; ++i )

2458

maxcoef =

MAX

(abscoef, maxcoef);

2461

maxcoef /=

scip

->set->sepa_maxcoefratio;

2463

minallowedcoef =

MAX

(minallowedcoef, maxcoef);

2478

assert(aggrrow !=

NULL

);

2479

assert(valid !=

NULL

);

2482 QUAD

(&aggrrow->rhs), aggrrow->

inds

, &aggrrow->

nnz

);

2490

assert(aggrrow !=

NULL

);

2492 return

aggrrow->

nrows

;

2500

assert(aggrrow !=

NULL

);

2511

assert(aggrrow !=

NULL

);

2526

assert(aggrrow !=

NULL

);

2527

assert(row !=

NULL

);

2531 for

( i = 0; i < aggrrow->

nrows

; ++i )

2533 if

( aggrrow->

rowsinds

[i] == rowind )

2545

assert(aggrrow !=

NULL

);

2547 return

aggrrow->

inds

;

2555

assert(aggrrow !=

NULL

);

2557 return

aggrrow->

nnz

;

2565

assert(aggrrow !=

NULL

);

2567 return

aggrrow->

rank

;

2575

assert(aggrrow !=

NULL

);

2577 return

aggrrow->

local

;

2585

assert(aggrrow !=

NULL

);

2592#define MAXCMIRSCALE 1e+6 2607

assert(bestlb !=

NULL

);

2608

assert(bestlbtype !=

NULL

);

2625

*simplebound = *bestlb;

2633 if

( bestvlbidx >= 0 && (bestvlb > *bestlb || (*bestlbtype < 0 &&

SCIPisGE

(

scip

, bestvlb, *bestlb))) )

2642

assert(vlbvars !=

NULL

);

2647

*bestlbtype = bestvlbidx;

2668

assert(bestub !=

NULL

);

2669

assert(bestubtype !=

NULL

);

2686

*simplebound = *bestub;

2694 if

( bestvubidx >= 0 && (bestvub < *bestub || (*bestubtype < 0 &&

SCIPisLE

(

scip

, bestvub, *bestub))) )

2703

assert(vubvars !=

NULL

);

2708

*bestubtype = bestvubidx;

2727 int

* boundsfortrans,

2747 if

( boundsfortrans !=

NULL

&& boundsfortrans[v] > -3 )

2750

assert(boundtypesfortrans !=

NULL

);

2756

*bestlbtype = boundsfortrans[v];

2757 if

( *bestlbtype == -1 )

2759 else if

( *bestlbtype == -2 )

2774

k = boundsfortrans[v];

2776

assert(vlbvars !=

NULL

);

2777

assert(vlbcoefs !=

NULL

);

2778

assert(vlbconsts !=

NULL

);

2787 SCIP_CALL

(

findBestUb

(

scip

, var, sol, fixintegralrhs ? usevbds : 0, allowlocal && fixintegralrhs, bestub, &simpleub, bestubtype) );

2794

*bestubtype = boundsfortrans[v];

2795 if

( *bestubtype == -1 )

2797 else if

( *bestubtype == -2 )

2812

k = boundsfortrans[v];

2814

assert(vubvars !=

NULL

);

2815

assert(vubcoefs !=

NULL

);

2816

assert(vubconsts !=

NULL

);

2826 SCIP_CALL

(

findBestLb

(

scip

, var, sol, fixintegralrhs ? usevbds : 0, allowlocal && fixintegralrhs, bestlb, &simplelb, bestlbtype) );

2847

*freevariable =

TRUE

;

2860 else if

(

SCIPisLT

(

scip

, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )

2862 else if

(

SCIPisGT

(

scip

, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )

2864 else if

( *bestlbtype == -1 )

2866 else if

( *bestubtype == -1 )

2868 else if

( ((*bestlbtype) >= 0 || (*bestubtype) >= 0) && !

SCIPisEQ

(

scip

, *bestlb - simplelb, simpleub - *bestub) )

2870 if

( *bestlb - simplelb > simpleub - *bestub )

2875 else if

( *bestlbtype >= 0 )

2877 else if

( *bestubtype >= 0 )

2939 if

( boundtype < 0 )

2943

*localbdsused = *localbdsused || (boundtype == -2);

2954 if

( varsign == +1 )

2969

assert(vbdvars !=

NULL

);

2970

assert(vbdcoefs !=

NULL

);

2971

assert(vbdconsts !=

NULL

);

2983

cutinds[(*nnz)++] = zidx;

2989

assert(

QUAD_HI

(zcoef) != 0.0);

3016

assert( boundtype < 0 );

3020

*localbdsused = *localbdsused || (boundtype == -2);

3060 int

* boundsfortrans,

3085 int

aggrrowintstart;

3090

assert(varsign !=

NULL

);

3091

assert(boundtype !=

NULL

);

3092

assert(freevariable !=

NULL

);

3093

assert(localbdsused !=

NULL

);

3095

*freevariable =

FALSE

;

3096

*localbdsused =

FALSE

;

3116 for

( i = 0; i < *nnz && cutinds[i] >= firstcontvar; ++i )

3119

ignoresol, boundsfortrans, boundtypesfortrans,

3120

bestlbs + i, bestubs + i, bestlbtypes + i, bestubtypes + i, selectedbounds + i, freevariable) );

3122 if

( *freevariable )

3127

aggrrowintstart = i;

3130 for

( i = 0; i < aggrrowintstart; ++i )

3139

boundtype[i] = bestlbtypes[i];

3149

boundtype[i] = bestubtypes[i];

3163

assert(cutinds[i] < firstcontvar);

3173

cutinds[i] = cutinds[*nnz];

3180

ignoresol, boundsfortrans, boundtypesfortrans,

3181

bestlbs + i, bestubs + i, bestlbtypes + i, bestubtypes + i, selectedbounds + i, freevariable) );

3186 if

( *freevariable )

3191 for

( i = aggrrowintstart; i < *nnz; ++i )

3199

assert(bestlbtypes[i] < 0);

3202

boundtype[i] = bestlbtypes[i];

3210

assert(bestubtypes[i] < 0);

3213

boundtype[i] = bestubtypes[i];

3220 if

( fixintegralrhs )

3226 if

( f0 < minfrac || f0 > maxfrac )

3234

bestviolgain = -1e+100;

3236 for

( i = 0; i < *nnz; i++ )

3242

assert(0 <= v && v < nvars);

3247 if

( boundtype[i] < 0

3248

&& ((varsign[i] == +1 && !

SCIPisInfinity

(

scip

, bestubs[i]) && bestubtypes[i] < 0)

3249

|| (varsign[i] == -1 && !

SCIPisInfinity

(

scip

, -bestlbs[i]) && bestlbtypes[i] < 0)) )

3271 if

( newf0 < minfrac || newf0 > maxfrac )

3273 if

( v >= firstcontvar )

3287

viol = f0 - fj * (varsign[i] == +1 ? solval - bestlbs[i] : bestubs[i] - solval);

3288

newviol = newf0 - newfj * (varsign[i] == -1 ? solval - bestlbs[i] : bestubs[i] - solval);

3289

violgain = newviol - viol;

3294 SCIPerrorMessage

(

"Cannot handle closest bounds with ignoring the LP solution.\n"

);

3301 if

(

SCIPisGT

(

scip

, violgain, bestviolgain) || (

SCIPisGE

(

scip

, violgain, bestviolgain) && newf0 < bestnewf0) )

3304

bestviolgain = violgain;

3313

assert(besti < *nnz);

3314

assert(boundtype[besti] < 0);

3326 if

( varsign[besti] == +1 )

3329

assert(bestubtypes[besti] < 0);

3330

boundtype[besti] = bestubtypes[besti];

3331

varsign[besti] = -1;

3336

assert(bestlbtypes[besti] < 0);

3337

boundtype[besti] = bestlbtypes[besti];

3338

varsign[besti] = +1;

3340

*localbdsused = *localbdsused || (boundtype[besti] == -2);

3427

assert(cutcoefs !=

NULL

);

3428

assert(cutinds !=

NULL

);

3429

assert(nnz !=

NULL

);

3430

assert(boundtype !=

NULL

);

3431

assert(varsign !=

NULL

);

3447 while

( i < *nnz && cutinds[i] >= firstcontvar )

3452

assert(cutinds[i] < firstcontvar);

3458 for

( i = *nnz - 1; i >= 0 && cutinds[i] < firstcontvar; --i )

3468

assert(var !=

NULL

);

3470

assert(varsign[i] == +1 || varsign[i] == -1);

3504

cutinds[i] = cutinds[*nnz];

3511

assert(boundtype[i] < 0);

3514 if

( varsign[i] == +1 )

3517 if

( boundtype[i] == -1 )

3533 if

( boundtype[i] == -1 )

3550 while

( i >= ndelcontvars )

3561

assert(var !=

NULL

);

3563

assert(varsign[i] == +1 || varsign[i] == -1);

3564

assert( v >= firstcontvar );

3582

cutinds[i] = cutinds[ndelcontvars];

3583

varsign[i] = varsign[ndelcontvars];

3584

boundtype[i] = boundtype[ndelcontvars];

3592 if

( boundtype[i] < 0 )

3597 if

( varsign[i] == +1 )

3600 if

( boundtype[i] == -1 )

3616 if

( boundtype[i] == -1 )

3640

vbidx = boundtype[i];

3643 if

( varsign[i] == +1 )

3661

assert(0 <= zidx && zidx < firstcontvar);

3671

cutinds[(*nnz)++] = zidx;

3676

assert(

QUAD_HI

(zcoef) != 0.0);

3684 if

( ndelcontvars > 0 )

3686

assert(ndelcontvars <= *nnz);

3687

*nnz -= ndelcontvars;

3688 if

( *nnz < ndelcontvars )

3738

assert(weights !=

NULL

|| nrowinds == 0);

3739

assert(slacksign !=

NULL

|| nrowinds == 0);

3740

assert(rowinds !=

NULL

|| nrowinds == 0);

3741

assert(scale > 0.0);

3742

assert(cutcoefs !=

NULL

);

3744

assert(cutinds !=

NULL

);

3745

assert(nnz !=

NULL

);

3752 for

( i = 0; i < nrowinds; i++ )

3765

assert(slacksign[i] == -1 || slacksign[i] == +1);

3769

assert(row !=

NULL

);

3823 if

( slacksign[i] == +1 )

3881 int

* boundsfortrans,

3915

assert(aggrrow !=

NULL

);

3917

assert(success !=

NULL

);

3931

tmpnnz = aggrrow->

nnz

;

3932

tmpislocal = aggrrow->

local

;

3940 for

( i = 0; i < tmpnnz; ++i )

3943 int

k = aggrrow->

inds

[i];

3951

assert(

QUAD_HI

(coef) != 0.0);

3970

boundsfortrans, boundtypesfortrans, minfrac, maxfrac, tmpcoefs,

QUAD

(&rhs), tmpinds, &tmpnnz, varsign, boundtype, &freevariable, &localbdsused) );

3971

assert(allowlocal || !localbdsused);

3972

tmpislocal = tmpislocal || localbdsused;

4049

aggrrow->

nrows

, scale, tmpcoefs,

QUAD

(&rhs), tmpinds, &tmpnnz,

QUAD

(f0)) );

4078

*cutislocal = tmpislocal;

4081 for

( i = 0; i < *cutnnz; ++i )

4093 if

( cutefficacy !=

NULL

)

4094

*cutefficacy = mirefficacy;

4096 if

( cutrank !=

NULL

)

4097

*cutrank = aggrrow->

rank

+ 1;

4111 for

( i = 0; i < tmpnnz; ++i )

4152

scale = 1.0 / delta;

4157 if

( f0 < minfrac || f0 > maxfrac )

4160

onedivoneminusf0 = 1.0 / (1.0 - f0);

4162

contscale = scale * onedivoneminusf0;

4171

rhs -= contscale * contactivity;

4172

norm =

SQR

(contscale) * contsqrnorm;

4179 for

( i = 0; i < nvars; ++i )

4182 SCIP_Real

fi = (scale * coefs[i]) - floorai;

4184 if

( fi > f0pluseps )

4185

floorai += (fi - f0) * onedivoneminusf0;

4187

rhs -= solvals[i] * floorai;

4188

norm +=

SQR

(floorai);

4193 return

- rhs /

MAX

(norm, 1e-6);

4220 int

* boundsfortrans,

4266

assert(aggrrow !=

NULL

);

4267

assert(aggrrow->

nrows

+ aggrrow->

nnz

>= 1);

4268

assert(success !=

NULL

);

4293

mksetnnz = aggrrow->

nnz

;

4298 for

( i = 0; i < mksetnnz; ++i )

4300 int

j = mksetinds[i];

4304

assert(

QUAD_HI

(coef) != 0.0);

4307

*cutislocal = aggrrow->

local

;

4325

boundsfortrans, boundtypesfortrans, minfrac, maxfrac, mksetcoefs,

QUAD

(&mksetrhs), mksetinds, &mksetnnz, varsign, boundtype, &freevariable, &localbdsused) );

4327

assert(allowlocal || !localbdsused);

4336

maxabsmksetcoef = -1.0;

4339 for

( i = mksetnnz - 1; i >= 0 && mksetinds[i] < firstcontvar; --i )

4341 SCIP_VAR

* var = vars[mksetinds[i]];

4352

bounddist[nbounddist] =

MIN

(ub - primsol, primsol - lb);

4353

bounddistpos[nbounddist] = i;

4359 if

( nbounddist == 0 )

4363

ndeltacands = nbounddist;

4373 if

( intscalesuccess )

4380

delta = 1.0 / intscale;

4381

intf0 = intscalerhs - floor(intscalerhs);

4385 if

( intf0 < minfrac || intf0 > maxfrac )

4387

intscale *=

SCIPceil

(

scip

,

MAX

(minfrac, (1.0 - maxfrac)) /

MIN

(intf0, (1.0 - intf0)));

4389

delta = 1.0 / intscale;

4390

intf0 = intscalerhs - floor(intscalerhs);

4393 if

( intf0 >= minfrac && intf0 <= maxfrac )

4396

deltacands[ndeltacands++] = delta;

4398 if

( intf0 < maxfrac )

4402

delta2 = 1.0 / (intscale *

SCIPfloor

(

scip

, maxfrac / intf0));

4405

deltacands[ndeltacands++] = delta2;

4412 for

( i = 0; i < nbounddist; ++i )

4416

absmksetcoef =

REALABS

(deltacands[i]);

4417

maxabsmksetcoef =

MAX

(absmksetcoef, maxabsmksetcoef);

4419

deltacands[i] = absmksetcoef;

4423 if

( maxabsmksetcoef != -1.0 )

4424

deltacands[ndeltacands++] = maxabsmksetcoef + 1.0;

4426

deltacands[ndeltacands++] = 1.0;

4428

maxtestdelta =

MIN

(ndeltacands, maxtestdelta);

4460 for

( i = intstart; i < mksetnnz; ++i )

4466

var = vars[mksetinds[i]];

4472 if

( boundtype[i] == -1 )

4475 if

( varsign[i] == -1 )

4482

assert(boundtype[i] == -2);

4485 if

( varsign[i] == -1 )

4491

tmpvalues[ntmpcoefs] = solval;

4493

tmpcoefs[ntmpcoefs] = varsign[i] *

QUAD_TO_DBL

(coef);

4497

assert(ntmpcoefs == mksetnnz - intstart);

4501 for

( i = 0; i < intstart; ++i )

4508 if

( varsign[i] *

QUAD_TO_DBL

(mksetcoef) >= 0.0 )

4515 switch

( boundtype[i] )

4519 if

( varsign[i] == -1 )

4526 if

( varsign[i] == -1 )

4533 if

( varsign[i] == -1 )

4543

solval = (coef * vbdsolval + constant) - solval;

4555

solval = solval - (coef * vbdsolval + constant);

4559

contactivity += solval * (

QUAD_TO_DBL

(mksetcoef) * varsign[i]);

4568 for

( i = 0; i < aggrrow->

nrows

; ++i )

4573

row = rows[aggrrow->

rowsinds

[i]];

4586

slackval = row->

rhs

- slackval;

4594

slackval = slackval - row->

lhs

;

4600

tmpvalues[ntmpcoefs] = slackval;

4609

contactivity += slackval * slackcoeff;

4610

contsqrnorm +=

SQR

(slackcoeff);

4619 for

( i = 0; i < maxtestdelta; ++i )

4626 for

( j = 0; j < i; ++j )

4630

deltaseenbefore =

TRUE

;

4636 if

( deltaseenbefore )

4638

maxtestdelta =

MIN

(maxtestdelta + 1, ndeltacands);

4644 if

( efficacy > bestefficacy )

4646

bestefficacy = efficacy;

4647

bestdelta = deltacands[i];

4658 for

( i = 2; i <= 8 ; i *= 2 )

4663

delta = basedelta / i;

4667 if

( efficacy > bestefficacy )

4669

bestefficacy = efficacy;

4678 for

( i = 0; i < nbounddist; ++i )

4691

k = bounddistpos[i];

4715

tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];

4717

oldsolval = tmpvalues[k - intstart];

4724 if

( newefficacy > bestefficacy )

4727

bestefficacy = newefficacy;

4730 if

( varsign[k] == +1 )

4733

assert(bestubtype < 0);

4734

boundtype[k] = bestubtype;

4740

assert(bestlbtype < 0);

4741

boundtype[k] = bestlbtype;

4745

localbdsused = localbdsused || (boundtype[k] == -2);

4750

tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];

4751

tmpvalues[k - intstart] = oldsolval;

4755 if

( bestefficacy > 0.0 )

4762

scale = 1.0 / bestdelta;

4771 for

( i = 0; i < mksetnnz; ++i )

4804

aggrrow->

nrows

, scale, mksetcoefs,

QUAD

(&mksetrhs), mksetinds, &mksetnnz,

QUAD

(f0)) );

4812 for

( i = 0; i < mksetnnz; ++i )

4821 SCIPdebugMsg

(

scip

,

"efficacy of cmir cut is different than expected efficacy: %f != %f\n"

, efficacy, bestefficacy);

4826

*cutislocal = *cutislocal || localbdsused;

4840 SCIPdebugMsg

(

scip

,

"post-processed cut (success = %s):\n"

, *success ?

"TRUE"

:

"FALSE"

);

4850 for

( i = 0; i < mksetnnz; ++i )

4863

*cutefficacy = mirefficacy;

4864 if

( cutrank !=

NULL

)

4865

*cutrank = aggrrow->

rank

+ 1;

4866

*cutislocal = *cutislocal || localbdsused;

4880 for

( i = 0; i < mksetnnz; ++i )

4902#define NO_EXACT_KNAPSACK 4904#ifndef NO_EXACT_KNAPSACK 4905#define MAXDNOM 1000LL 4906#define MINDELTA 1e-03 4907#define MAXDELTA 1e-09 4908#define MAXSCALE 1000.0 4909#define MAXDYNPROGSPACE 1000000 4912#define MAXABSVBCOEF 1e+5 4913#define MAXBOUND 1e+10 4979

assert(var !=

NULL

);

4983

assert(rowcoefs !=

NULL

);

4984

assert(binvarused !=

NULL

);

4985

assert(closestvlb !=

NULL

);

4986

assert(closestvlbidx !=

NULL

);

4991

*closestvlbidx = -1;

5004 for

( i = 0; i < nvlbs; i++ )

5013 if

( bestsub > vlbconsts[i] )

5028 if

( (

unsigned int

)probidxbinvar >= (

unsigned int

)nbinvars )

5049 if

( binvarused[probidxbinvar] == 1 )

5058

rowcoefsign =

COPYSIGN

(1.0, rowcoef);

5060

val2 = rowcoefsign * ((rowcoef * vlbcoefs[i]) + rowcoefbinvar);

5066

val1 = rowcoefsign * ((rowcoef * (bestsub - vlbconsts[i])) + rowcoefbinvar);

5073 if

( vlbsol > *closestvlb )

5075

*closestvlb = vlbsol;

5078

assert(*closestvlbidx >= 0);

5109

assert(var !=

NULL

);

5113

assert(rowcoefs !=

NULL

);

5114

assert(binvarused !=

NULL

);

5115

assert(closestvub !=

NULL

);

5116

assert(closestvubidx !=

NULL

);

5121

*closestvubidx = -1;

5134 for

( i = 0; i < nvubs; i++ )

5143 if

( bestslb < vubconsts[i] )

5158 if

( (

unsigned int

)probidxbinvar >= (

unsigned int

)nbinvars )

5179 if

( binvarused[probidxbinvar] == 1 )

5188

rowcoefsign =

COPYSIGN

(1.0, rowcoef);

5190

val2 = rowcoefsign * ((rowcoef * vubcoefs[i]) + rowcoefbinvar);

5196

val1 = rowcoefsign * ((rowcoef * (bestslb - vubconsts[i])) + rowcoefbinvar);

5203 if

( vubsol < *closestvub )

5205

*closestvub = vubsol;

5208

assert(*closestvubidx >= 0);

5253

bestlbtype[varposinrow] = -3;

5254

bestubtype[varposinrow] = -3;

5256

probidx = rowinds[varposinrow];

5257

var = vars[probidx];

5267 SCIP_CALL

(

findBestLb

(

scip

, var, sol, 0, allowlocal, &bestslb[varposinrow], &simplebound, &bestslbtype[varposinrow]) );

5268 SCIP_CALL

(

findBestUb

(

scip

, var, sol, 0, allowlocal, &bestsub[varposinrow], &simplebound, &bestsubtype[varposinrow]) );

5271 if

( bestslb[varposinrow] <= -

MAXBOUND

)

5274 if

( bestsub[varposinrow] >=

MAXBOUND

)

5279 SCIPdebugMsg

(

scip

,

" %d: %g <%s, idx=%d, lp=%g, [%g(%d),%g(%d)]>:\n"

, varposinrow, rowcoef,

SCIPvarGetName

(var), probidx,

5280

solval, bestslb[varposinrow], bestslbtype[varposinrow], bestsub[varposinrow], bestsubtype[varposinrow]);

5287

*freevariable =

TRUE

;

5296

bestlb[varposinrow] = bestslb[varposinrow];

5297

bestlbtype[varposinrow] = bestslbtype[varposinrow];

5307

bestlb[varposinrow] = bestvlb;

5308

bestlbtype[varposinrow] = bestvlbidx;

5318

bestub[varposinrow] = bestsub[varposinrow];

5319

bestubtype[varposinrow] = bestsubtype[varposinrow];

5329

bestub[varposinrow] = bestvub;

5330

bestubtype[varposinrow] = bestvubidx;

5334 SCIPdebugMsg

(

scip

,

" bestlb=%g(%d), bestub=%g(%d)\n"

, bestlb[varposinrow], bestlbtype[varposinrow], bestub[varposinrow], bestubtype[varposinrow]);

5341

*freevariable =

TRUE

;

5345

*freevariable =

FALSE

;

5351 if

(

SCIPisEQ

(

scip

, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) && bestlbtype[varposinrow] >= 0 )

5355 else if

(

SCIPisEQ

(

scip

, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow])

5356

&& bestubtype[varposinrow] >= 0 )

5360 else if

(

SCIPisLE

(

scip

, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) )

5366

assert(

SCIPisGT

(

scip

, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]));

5379

binvarused[vlbvarprobidx] = 1;

5381 else if

( selectedbounds[varposinrow] ==

SCIP_BOUNDTYPE_UPPER

&& bestubtype[varposinrow] >= 0 )

5390

binvarused[vubvarprobidx] = 1;

5434 SCIPdebugMsg

(

scip

,

"--------------------- construction of SNF relaxation ------------------------------------\n"

);

5455 for

( i = nnz - 1; i >= 0 && rowinds[i] < nbinvars; --i )

5456

binvarused[rowinds[i]] = -1;

5458

nnonbinvarsrow = i + 1;

5460 for

( i = 0; i < nnonbinvarsrow; ++i )

5464

assert(rowinds[i] >= nbinvars);

5467

bestlb, bestub, bestslb, bestsub, bestlbtype, bestubtype, bestslbtype, bestsubtype, selectedbounds, &freevariable) );

5474 for

( j = nnz - 1; j >= nnonbinvarsrow; --j )

5475

binvarused[rowinds[j]] = 0;

5478 for

( j = 0; j < i; ++j )

5497

*localbdsused =

FALSE

;

5512 for

( i = 0; i < nnonbinvarsrow; ++i )

5519

probidx = rowinds[i];

5520

var = vars[probidx];

5525

assert(probidx >= nbinvars);

5533

assert(bestsubtype[i] == -1 || bestsubtype[i] == -2);

5541 if

( bestlbtype[i] < 0 )

5561 if

( bestlbtype[i] == -2 || bestsubtype[i] == -2 )

5562

*localbdsused =

TRUE

;

5594 SCIPdebugMsg

(

scip

,

" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n"

,

5622

assert(binvarused[vlbvarprobidx] == 1);

5623

assert(vlbvarprobidx < nbinvars);

5642

binvarused[vlbvarprobidx] = 0;

5673 SCIPdebugMsg

(

scip

,

" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n"

,

5676

vlbconsts[bestlbtype[i]], snf->

transrhs

);

5685

assert(bestslbtype[i] == -1 || bestslbtype[i] == -2);

5693 if

( bestubtype[i] < 0 )

5713 if

( bestubtype[i] == -2 || bestslbtype[i] == -2 )

5714

*localbdsused =

TRUE

;

5746 SCIPdebugMsg

(

scip

,

" --> bestub used for trans: ... %s y'_%d + ..., Y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n"

,

5774

assert(binvarused[vubvarprobidx] == 1);

5775

assert(vubvarprobidx < nbinvars);

5781

binvarused[vubvarprobidx] = 0;

5825 SCIPdebugMsg

(

scip

,

" --> bestub used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n"

,

5828

vubconsts[bestubtype[i]],

QUAD_TO_DBL

(transrhs));

5842 for

( i = nnonbinvarsrow; i < nnz; ++i )

5851

probidx = rowinds[i];

5853

assert(probidx < nbinvars);

5856 if

( binvarused[probidx] == 0 )

5860

assert(binvarused[probidx] == -1);

5863

binvarused[probidx] = 0;

5865

var = vars[probidx];

5870 SCIPdebugMsg

(

scip

,

" %d: %g <%s, idx=%d, lp=%g, [%g, %g]>:\n"

, i,

QUAD_TO_DBL

(rowcoef),

SCIPvarGetName

(var), probidx, varsolval,

5927 SCIPdebugMsg

(

scip

,

"constraint in constructed 0-1 single node flow relaxation: "

);

6015

assert(weights !=

NULL

);

6016

assert(profits !=

NULL

);

6019

assert(items !=

NULL

);

6020

assert(nitems >= 0);

6022 if

( solitems !=

NULL

)

6027 if

( solval !=

NULL

)

6034 for

( i = nitems - 1; i >= 0; --i )

6035

tempsort[i] = profits[i] / weights[i];

6047

solitemsweight = 0.0;

6048 for

( j = 0; j < nitems &&

SCIPisFeasLT

(

scip

, solitemsweight + weights[j], capacity); j++ )

6050 if

( solitems !=

NULL

)

6052

solitems[*nsolitems] = items[j];

6055 if

( solval !=

NULL

)

6056

(*solval) += profits[j];

6057

solitemsweight += weights[j];

6061 for

( ; j < nitems; j++ )

6065 if

( solitems !=

NULL

)

6067

solitems[*nsolitems] = items[j];

6070 if

( solval !=

NULL

)

6071

(*solval) += profits[j];

6072

solitemsweight += weights[j];

6074 else if

( solitems !=

NULL

)

6076

nonsolitems[*nnonsolitems] = items[j];

6098 int

* nflowcovervars,

6099 int

* nnonflowcovervars,

6100 int

* flowcoverstatus,

6109

assert(coefs !=

NULL

);

6110

assert(vubcoefs !=

NULL

);

6111

assert(solitems !=

NULL

);

6112

assert(nonsolitems !=

NULL

);

6113

assert(nsolitems >= 0);

6114

assert(nnonsolitems >= 0);

6115

assert(nflowcovervars !=

NULL

&& *nflowcovervars >= 0);

6116

assert(nnonflowcovervars !=

NULL

&& *nnonflowcovervars >= 0);

6117

assert(flowcoverstatus !=

NULL

);

6119

assert(lambda !=

NULL

);

6122 for

( j = 0; j < nsolitems; j++ )

6125 if

( coefs[solitems[j]] == 1 )

6127

flowcoverstatus[solitems[j]] = -1;

6128

(*nnonflowcovervars)++;

6133

assert(coefs[solitems[j]] == -1);

6134

flowcoverstatus[solitems[j]] = 1;

6135

(*nflowcovervars)++;

6139 for

( j = 0; j < nnonsolitems; j++ )

6142 if

( coefs[nonsolitems[j]] == 1 )

6144

flowcoverstatus[nonsolitems[j]] = 1;

6145

(*nflowcovervars)++;

6146 SCIPquadprecSumQD

(*flowcoverweight, *flowcoverweight, vubcoefs[nonsolitems[j]]);

6151

assert(coefs[nonsolitems[j]] == -1);

6152

flowcoverstatus[nonsolitems[j]] = -1;

6153

(*nnonflowcovervars)++;

6162#ifndef NO_EXACT_KNAPSACK 6177

assert(mindelta <= 0.0);

6178

assert(maxdelta >= 0.0);

6180

sval = val * scalar;

6181

downval = floor(sval);

6202

assert(mindelta <= 0.0);

6203

assert(maxdelta >= 0.0);

6205

sval = val * scalar;

6224 int

* nflowcovervars,

6225 int

* nnonflowcovervars,

6226 int

* flowcoverstatus,

6245#if !defined(NDEBUG) || defined(SCIP_DEBUG) 6251 int

nflowcovervarsafterfix;

6254 int

nnonflowcovervarsafterfix;

6264

assert(nflowcovervars !=

NULL

);

6265

assert(nnonflowcovervars !=

NULL

);

6266

assert(flowcoverstatus !=

NULL

);

6267

assert(lambda !=

NULL

);

6268

assert(found !=

NULL

);

6270 SCIPdebugMsg

(

scip

,

"--------------------- get flow cover ----------------------------------------------------\n"

);

6284

*nflowcovervars = 0;

6285

*nnonflowcovervars = 0;

6288

nflowcovervarsafterfix = 0;

6289

nnonflowcovervarsafterfix = 0;

6291#if !defined(NDEBUG) || defined(SCIP_DEBUG) 6305

n1itemsweight = 0.0;

6316

flowcoverstatus[j] = -1;

6317

(*nnonflowcovervars)++;

6337

flowcoverstatus[j] = -1;

6338

(*nnonflowcovervars)++;

6344

flowcoverstatus[j] = 1;

6345

(*nflowcovervars)++;

6352

flowcoverstatus[j] = 1;

6353

(*nflowcovervars)++;

6361

flowcoverstatus[j] = -1;

6362

(*nnonflowcovervars)++;

6366

assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->

ntransvars

);

6367

assert(nn1items >= 0);

6400

transweightsrealintegral =

TRUE

;

6401 for

( j = 0; j < nitems; j++ )

6406

transweightsrealintegral =

FALSE

;

6411 SCIPdebugMsg

(

scip

,

" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n"

, items[j], items[j], transweightsreal[j],

6412

items[j], transprofitsreal[j],

SCIPisIntegral

(

scip

, transweightsreal[j]) ?

""

:

" ----> NOT integral"

);

6417 SCIPdebugMsg

(

scip

,

" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n"

, items[j], items[j], transweightsreal[j],

6418

items[j], transprofitsreal[j],

SCIPisIntegral

(

scip

, transweightsreal[j]) ?

""

:

" ----> NOT integral"

);

6423 SCIPdebugMsg

(

scip

,

" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n"

,

6436

assert(nitems >= 0);

6452 if

( transweightsrealintegral )

6456

scalesuccess =

TRUE

;

6460

scalesuccess =

FALSE

;

6476 for

( j = 0; j < nitems; ++j )

6478

transweightsint[j] = getIntegralVal(transweightsreal[j], scalar, -

MINDELTA

,

MAXDELTA

);

6479

transprofitsint[j] = transprofitsreal[j];

6480

itemsint[j] = items[j];

6484

transcapacityint = getIntegralVal(transcapacityreal, scalar, -

MINDELTA

,

MAXDELTA

);

6485

transcapacityint -= 1;

6488

transcapacityint = (

SCIP_Longint

) (transcapacityreal * scalar);

6489

nflowcovervarsafterfix = *nflowcovervars;

6490

nnonflowcovervarsafterfix = *nnonflowcovervars;

6494

tmp2 = (

SCIP_Real

) ((transcapacityint) + 1);

6495 if

( transcapacityint * nitems <= MAXDYNPROGSPACE && tmp1 * tmp2 <= INT_MAX / 8.0)

6501

itemsint, solitems, nonsolitems, &nsolitems, &nnonsolitems,

NULL

, &success));

6507

transcapacityreal, items, solitems, nonsolitems, &nsolitems, &nnonsolitems,

NULL

));

6509#if !defined(NDEBUG) || defined(SCIP_DEBUG) 6518

items, solitems, nonsolitems, &nsolitems, &nnonsolitems,

NULL

));

6526

items, solitems, nonsolitems, &nsolitems, &nnonsolitems,

NULL

));

6530

assert(nsolitems != -1);

6531

assert(nnonsolitems != -1);

6534

assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->

ntransvars

);

6536

nnonflowcovervars, flowcoverstatus,

QUAD

(&flowcoverweight), lambda);

6537

assert(*nflowcovervars + *nnonflowcovervars == snf->

ntransvars

);

6546

items, solitems, nonsolitems, &nsolitems, &nnonsolitems,

NULL

));

6552

*nflowcovervars = nflowcovervarsafterfix;

6553

*nnonflowcovervars = nnonflowcovervarsafterfix;

6556

assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->

ntransvars

);

6558

nnonflowcovervars, flowcoverstatus,

QUAD

(&flowcoverweight), lambda);

6559

assert(*nflowcovervars + *nnonflowcovervars == snf->

ntransvars

);

6568 SCIPdebugMsg

(

scip

,

"2. %s solution:\n"

, kpexact ?

"exact"

:

"approximate"

);

6571 if

( snf->

transvarcoefs

[j] == 1 && flowcoverstatus[j] == 1 )

6575 else if

( snf->

transvarcoefs

[j] == -1 && flowcoverstatus[j] == 1 )

6608 int

* nflowcovervars,

6609 int

* nnonflowcovervars,

6610 int

* flowcoverstatus,

6639

assert(nflowcovervars !=

NULL

);

6640

assert(nnonflowcovervars !=

NULL

);

6641

assert(flowcoverstatus !=

NULL

);

6642

assert(lambda !=

NULL

);

6643

assert(found !=

NULL

);

6645 SCIPdebugMsg

(

scip

,

"--------------------- get flow cover ----------------------------------------------------\n"

);

6658

*nflowcovervars = 0;

6659

*nnonflowcovervars = 0;

6672

n1itemsweight = 0.0;

6683

flowcoverstatus[j] = -1;

6684

(*nnonflowcovervars)++;

6706

flowcoverstatus[j] = -1;

6707

(*nnonflowcovervars)++;

6713

flowcoverstatus[j] = 1;

6714

(*nflowcovervars)++;

6721

flowcoverstatus[j] = 1;

6722

(*nflowcovervars)++;

6730

flowcoverstatus[j] = -1;

6731

(*nnonflowcovervars)++;

6735

assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->

ntransvars

);

6736

assert(nn1items >= 0);

6769 for

( j = 0; j < nitems; j++ )

6776 SCIPdebugMsg

(

scip

,

" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n"

, items[j], items[j], transweightsreal[j],

6777

items[j], transprofitsreal[j],

SCIPisIntegral

(

scip

, transweightsreal[j]) ?

""

:

" ----> NOT integral"

);

6782 SCIPdebugMsg

(

scip

,

" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n"

, items[j], items[j], transweightsreal[j],

6783

items[j], transprofitsreal[j],

SCIPisIntegral

(

scip

, transweightsreal[j]) ?

""

:

" ----> NOT integral"

);

6788 SCIPdebugMsg

(

scip

,

" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n"

,

6801

assert(nitems >= 0);

6820

items, solitems, nonsolitems, &nsolitems, &nnonsolitems,

NULL

));

6822

assert(nsolitems != -1);

6823

assert(nnonsolitems != -1);

6826

assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->

ntransvars

);

6828

nnonflowcovervars, flowcoverstatus,

QUAD

(&flowcoverweight), lambda);

6829

assert(*nflowcovervars + *nnonflowcovervars == snf->

ntransvars

);

6841 if

( snf->

transvarcoefs

[j] == 1 && flowcoverstatus[j] == 1 )

6845 else if

( snf->

transvarcoefs

[j] == -1 && flowcoverstatus[j] == 1 )

6882

assert( liftingdata !=

NULL

);

6884

xpluslambda =

x

+ liftingdata->

lambda

;

6887 while

( i < liftingdata->

r

&&

SCIPisGT

(

scip

, xpluslambda, liftingdata->

M

[i+1]) )

6890 if

( i < liftingdata->t )

6894

assert(

SCIPisLE

(

scip

, xpluslambda, liftingdata->

M

[i+1]));

6895 return

i * liftingdata->

lambda

;

6898

assert(i > 0 &&

SCIPisLE

(

scip

, liftingdata->

M

[i], xpluslambda) && x <= liftingdata->M[i]);

6907 if

( i < liftingdata->

r

)

6926 return

i * liftingdata->

lambda

;

6930 MAX

(0.0, liftingdata->

m

[i] - (liftingdata->

mp

- liftingdata->

lambda

) - liftingdata->

ml

)));

6938

assert(i == liftingdata->

r

&&

SCIPisLE

(

scip

, liftingdata->

M

[liftingdata->

r

], xpluslambda));

6967

vubcoefpluslambda = vubcoef + liftingdata->

lambda

;

6970 while

( i < liftingdata->

r

&&

SCIPisGT

(

scip

, vubcoefpluslambda, liftingdata->

M

[i+1]) )

6976

assert(liftingdata->

M

[i] < vubcoefpluslambda);

6985

assert(i == liftingdata->

r

||

SCIPisLE

(

scip

, vubcoefpluslambda, liftingdata->

M

[i+1]));

6996 int

* transvarflowcoverstatus,

7011

liftingdata->

m

=

NULL

;

7012

liftingdata->

M

=

NULL

;

7014

liftingdata->

t

= 0;

7020

liftingdata->

r

= 0;

7032 int

s = (snf->

transvarcoefs

[i] + 1) + (transvarflowcoverstatus[i] + 1)/2;

7038

assert(snf->

transvarcoefs

[i] == -1 && transvarflowcoverstatus[i] == -1);

7052

assert(snf->

transvarcoefs

[i] == -1 && transvarflowcoverstatus[i] == 1);

7057

assert(snf->

transvarcoefs

[i] == 1 && transvarflowcoverstatus[i] == 1);

7098 for

( i = 0; i < liftingdata->

r

; ++i)

7113 while

( liftingdata->

t

< liftingdata->

r

&& liftingdata->

m

[liftingdata->

t

] == liftingdata->

mp

)

7116

liftingdata->

lambda

= lambda;

7140 int

* flowcoverstatus,

7156

assert( liftingdata.

m

!=

NULL

);

7157

assert( liftingdata.

M

!=

NULL

);

7159

assert( liftingdata.

r

>= 0 );

7160

assert( liftingdata.

t

>= 0 );

7169 int

s = (snf->

transvarcoefs

[i] + 1) + (flowcoverstatus[i] + 1)/2;

7214

assert(snf->

transvarcoefs

[i] == -1 && flowcoverstatus[i] == 1);

7220 if

( liftedbincoef != 0.0 )

7235

assert(snf->

transvarcoefs

[i] == 1 && flowcoverstatus[i] == -1);

7238

assert(alpha == 0 || alpha == 1);

7297 if

( snf->

origbinvars

[i] != -1 && bincoef != 0.0 )

7325 for

( i = 0; i < aggrrow->

nrows

; ++i )

7334

assert(slackcoef != 0.0);

7337 if

( slackcoef > 0.0 )

7340

row = rows[aggrrow->

rowsinds

[i]];

7355

slackub = rowrhs - rowlhs;

7368

slackub = -aggrrow->

rowweights

[i] *

MIN

(rhsslack, slackub);

7382

slackub = aggrrow->

rowweights

[i] *

MIN

(lhsslack, slackub);

7440 int

*transvarflowcoverstatus;

7442 int

nnonflowcovervars;

7454 SCIP_CALL

(

constructSNFRelaxation

(

scip

, sol, boundswitch, allowlocal, aggrrow->

vals

,

QUAD

(aggrrow->rhs), aggrrow->

inds

, aggrrow->

nnz

, &snf, success, &localbdsused) );

7461

*cutislocal = aggrrow->

local

|| localbdsused;

7465 SCIP_CALL

(

getFlowCover

(

scip

, &snf, &nflowcovervars, &nnonflowcovervars, transvarflowcoverstatus, &lambda, success) );

7496 for

( i = 0; i < *cutnnz; ++i )

7499

assert(tmpcoefs[j] != 0.0);

7500

cutcoefs[i] = tmpcoefs[j];

7504 if

( cutefficacy !=

NULL

)

7505

*cutefficacy =

calcEfficacy

(

scip

, sol, cutcoefs, *cutrhs, cutinds, *cutnnz);

7507 if

( cutrank !=

NULL

)

7508

*cutrank = aggrrow->

rank

+ 1;

7513 for

( i = 0; i < *cutnnz; ++i )

7516

assert(tmpcoefs[j] != 0.0);

7560 int

aggrrowbinstart;

7564

assert(varsign !=

NULL

);

7565

assert(boundtype !=

NULL

);

7566

assert(success !=

NULL

);

7567

assert(localbdsused !=

NULL

);

7585 for

( i = 0; i < *nnz && cutinds[i] >= firstnonbinvar; ++i )

7623

aggrrowbinstart = i;

7626 for

( i = 0; i < aggrrowbinstart; ++i )

7638

assert(i == aggrrowbinstart);

7641 if

( aggrrowbinstart != 0 )

7643

*nnz -= aggrrowbinstart;

7663

assert(v < firstnonbinvar);

7683

*localbdsused = *localbdsused || (boundtype[i] == -2);

7711

assert(boundtype[i] == -1 || boundtype[i] == -2);

7720

cutinds[i] = cutinds[*nnz];

7765 for

( k = 0; k < cutnnz; ++k )

7773 if

( varsign[k] == -1 )

7774

solval = 1 - solval;

7779

coverpos[*coversize] = k;

7800 SCIPsortDownRealInt

(covervals + (*coversize), coverpos + (*coversize), cutnnz - (*coversize));

7805 while

( *coversize < cutnnz &&

7810

k = coverpos[*coversize];

7824

assert(*coversize > 0);

7865 for

( k = 1; k < coversize; ++k )

7911 for

( k = 0; k < coversize; ++k )

7929

coverstatus[coverpos[k]] = -1;

7934

coverstatus[coverpos[k]] = -1;

8011 while

(

h

< coversize )

8026

covervals[

h

], cutcoef);

8083

assert(aggrrow !=

NULL

);

8084

assert(cutcoefs !=

NULL

);

8085

assert(cutrhs !=

NULL

);

8086

assert(cutinds !=

NULL

);

8087

assert(cutnnz !=

NULL

);

8088

assert(cutefficacy !=

NULL

);

8089

assert(cutislocal !=

NULL

);

8090

assert(success !=

NULL

);

8094 if

( aggrrow->

nnz

== 0 )

8097 for

( k = 0; k < aggrrow->

nrows

; ++k )

8115

nnz = aggrrow->

nnz

;

8120 for

( k = 0; k < nnz; ++k )

8128

assert(

QUAD_HI

(coef) != 0.0);

8139

local = aggrrow->

local

;

8141

tmpcoefs,

QUAD

(&rhs), tmpinds, &nnz, varsign, boundtype, &local, &transformed) );

8143

assert(allowlocal || !local);

8152

coverpos, covervals, &coversize,

QUAD

(&coverweight)) )

8156

assert(coversize > 0);

8161 if

( coversize == 1 )

8166 for

( k = 0; k < nnz; ++k )

8168 if

( coverstatus[k] == 0 )

8174

tmpinds[0] = tmpinds[k];

8175

varsign[0] = varsign[k];

8180 if

( varsign[0] == -1 )

8210 QUAD

(coverweight), covervals, coverstatus,

QUAD

(&abar), &cplussize);

8214 for

( k = 0; k < nnz; )

8217 if

( coverstatus[k] == -1 )

8225 SCIPdebugMsg

(

scip

,

"load QUAD(coef) from tmpcoefs[tmpinds[k] = %d]\n"

,tmpinds[k]);

8234 if

( cutcoef == 0.0 )

8239

coverstatus[k] = coverstatus[nnz];

8240

tmpinds[k] = tmpinds[nnz];

8241

varsign[k] = varsign[nnz];

8247 if

( varsign[k] == -1 )

8266

*success = efficacy > *cutefficacy;

8274

*cutislocal = local;

8279 for

( k = 0; k < nnz; ++k )

8285

assert(

QUAD_HI

(coef) != 0.0);

8293

assert( cutefficacy !=

NULL

);

8296

*cutefficacy =

calcEfficacy

(

scip

, sol, cutcoefs, *cutrhs, cutinds, nnz);

8298 if

( cutrank !=

NULL

)

8299

*cutrank = aggrrow->

rank

+ 1;

8310 for

( k = 0; k < nnz; ++k )

8318 if

(tmpcoefs[k] != 0.0)

8393 int

aggrrowintstart;

8398

assert(varsign !=

NULL

);

8399

assert(boundtype !=

NULL

);

8400

assert(freevariable !=

NULL

);

8401

assert(localbdsused !=

NULL

);

8403

*freevariable =

FALSE

;

8404

*localbdsused =

FALSE

;

8420 for

( i = 0; i < *nnz && cutinds[i] >= firstcontvar; ++i )

8432 SCIP_CALL

(

findBestLb

(

scip

, vars[v], sol, usevbds ? 2 : 0, allowlocal, bestbds + i, &simplebound, boundtype + i) );

8437

*freevariable =

TRUE

;

8448 SCIP_CALL

(

findBestUb

(

scip

, vars[v], sol, usevbds ? 2 : 0, allowlocal, bestbds + i, &simplebound, boundtype + i) );

8453

*freevariable =

TRUE

;

8462

aggrrowintstart = i;

8465 for

( i = 0; i < aggrrowintstart; ++i )

8470

assert(i == aggrrowintstart);

8485

assert(v < firstcontvar);

8494

cutinds[i] = cutinds[*nnz];

8501 SCIP_CALL

(

determineBestBounds

(

scip

, vars[v], sol, boundswitch, 0, allowlocal,

FALSE

,

FALSE

,

NULL

,

NULL

,

8502

&bestlb, &bestub, &bestlbtype, &bestubtype, &selectedbound, freevariable) );

8505 if

( *freevariable )

8513

boundtype[i] = bestlbtype;

8521

boundtype[i] = bestubtype;

8527

assert(boundtype[i] == -1 || boundtype[i] == -2);

8614 int

aggrrowintstart;

8617

assert(cutcoefs !=

NULL

);

8618

assert(cutinds !=

NULL

);

8619

assert(nnz !=

NULL

);

8620

assert(boundtype !=

NULL

);

8621

assert(varsign !=

NULL

);

8637 while

( i < *nnz && cutinds[i] >= firstcontvar )

8644

assert(cutinds[i] < firstcontvar);

8651 for

( i = *nnz - 1; i >= 0 && cutinds[i] < firstcontvar; --i )

8666

assert(var !=

NULL

);

8668

assert(boundtype[i] == -1 || boundtype[i] == -2);

8669

assert(varsign[i] == +1 || varsign[i] == -1);

8702

cutinds[i] = cutinds[*nnz];

8709

assert(boundtype[i] < 0);

8712 if

( varsign[i] == +1 )

8715 if

( boundtype[i] == -1 )

8724 if

( boundtype[i] == -1 )

8735

aggrrowintstart = i + 1;

8739 for

( i = 0; i < aggrrowintstart; ++i )

8749

assert(var !=

NULL

);

8752

assert(varsign[i] == +1 || varsign[i] == -1);

8763 if

( aggrrowintstart > 0 )

8766

assert(aggrrowintstart <= *nnz);

8770 for

( i = 0; i < aggrrowintstart; ++i )

8777

*nnz -= aggrrowintstart;

8778 if

( *nnz < aggrrowintstart )

8829

assert(weights !=

NULL

);

8830

assert(slacksign !=

NULL

);

8831

assert(rowinds !=

NULL

);

8833

assert(cutcoefs !=

NULL

);

8835

assert(cutinds !=

NULL

);

8836

assert(nnz !=

NULL

);

8843 for

( i = 0; i < nrowinds; i++ )

8855

assert(slacksign[i] == -1 || slacksign[i] == +1);

8859

assert(row !=

NULL

);

8912 if

( slacksign[i] == +1 )

9002

assert(aggrrow !=

NULL

);

9004

assert(cutcoefs !=

NULL

);

9005

assert(cutrhs !=

NULL

);

9006

assert(cutinds !=

NULL

);

9007

assert(success !=

NULL

);

9008

assert(cutislocal !=

NULL

);

9018 for

( i = 0; i < aggrrow->

nrows

; ++i )

9030

*cutnnz = aggrrow->

nnz

;

9031

*cutislocal = aggrrow->

local

;

9040 for

( i = 0; i < *cutnnz; ++i )

9049

assert(

QUAD_HI

(coef) != 0.0);

9070

tmpcoefs,

QUAD

(&rhs), cutinds, cutnnz, varsign, boundtype, &freevariable, &localbdsused) );

9072

assert(allowlocal || !localbdsused);

9073

*cutislocal = *cutislocal || localbdsused;

9081 for

( i = *cutnnz - 1; i >= 0 && cutinds[i] < firstcontvar; --i )

9167

aggrrow->

nrows

, scale, tmpcoefs,

QUAD

(&rhs), cutinds, cutnnz,

QUAD

(f0), k) );

9188 for

( i = 0; i < *cutnnz; ++i )

9194

assert(

QUAD_HI

(coef) != 0.0);

9201 if

( cutefficacy !=

NULL

)

9202

*cutefficacy =

calcEfficacy

(

scip

, sol, cutcoefs, *cutrhs, cutinds, *cutnnz);

9204 if

( cutrank !=

NULL

)

9205

*cutrank = aggrrow->

rank

+ 1;

9215 for

( i = 0; i < *cutnnz; ++i )

static SCIP_Real computeMIREfficacy(SCIP *scip, SCIP_Real *RESTRICT coefs, SCIP_Real *RESTRICT solvals, SCIP_Real rhs, SCIP_Real contactivity, SCIP_Real contsqrnorm, SCIP_Real delta, int nvars, SCIP_Real minfrac, SCIP_Real maxfrac)

static SCIP_RETCODE cutsTransformMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, SCIP_Bool ignoresol, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)

static void performBoundSubstitutionSimple(SCIP *scip, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)

static void prepareLiftingData(SCIP *scip, SCIP_Real *cutcoefs, int *cutinds, QUAD(SCIP_Real cutrhs), int *coverpos, int coversize, QUAD(SCIP_Real coverweight), SCIP_Real *covervals, int *coverstatus, QUAD(SCIP_Real *abar), int *cplussize)

static SCIP_RETCODE cutsTransformKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *localbdsused, SCIP_Bool *success)

static SCIP_DECL_SORTINDCOMP(compareAbsCoefsQuad)

static SCIP_RETCODE findBestLb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestlb, SCIP_Real *simplebound, int *bestlbtype)

static SCIP_Real calcEfficacyDenseStorageQuad(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)

static SCIP_Bool removeZerosQuad(SCIP *scip, SCIP_Real minval, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz)

static SCIP_RETCODE cutsSubstituteStrongCG(SCIP *scip, SCIP_Real *weights, int *slacksign, int *rowinds, int nrowinds, SCIP_Real scale, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, QUAD(SCIP_Real f0), SCIP_Real k)

static SCIP_RETCODE computeLiftingData(SCIP *scip, SNF_RELAXATION *snf, int *transvarflowcoverstatus, SCIP_Real lambda, LIFTINGDATA *liftingdata, SCIP_Bool *valid)

static SCIP_RETCODE getClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *rowcoefs, int8_t *binvarused, SCIP_Real bestsub, SCIP_Real rowcoef, SCIP_Real *closestvlb, int *closestvlbidx)

static SCIP_RETCODE getFlowCover(SCIP *scip, SNF_RELAXATION *snf, int *nflowcovervars, int *nnonflowcovervars, int *flowcoverstatus, SCIP_Real *lambda, SCIP_Bool *found)

static SCIP_RETCODE determineBestBounds(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real boundswitch, int usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, SCIP_Bool ignoresol, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real *bestlb, SCIP_Real *bestub, int *bestlbtype, int *bestubtype, SCIP_BOUNDTYPE *selectedbound, SCIP_Bool *freevariable)

static SCIP_RETCODE getClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *rowcoefs, int8_t *binvarused, SCIP_Real bestslb, SCIP_Real rowcoef, SCIP_Real *closestvub, int *closestvubidx)

static SCIP_RETCODE cutsTransformStrongCG(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)

static SCIP_Real evaluateLiftingFunctionKnapsack(SCIP *scip, QUAD(SCIP_Real x), QUAD(SCIP_Real abar), SCIP_Real *covervals, int coversize, int cplussize, SCIP_Real *scale)

static SCIP_Bool chgCoeffWithBound(SCIP *scip, SCIP_VAR *var, SCIP_Real oldcoeff, SCIP_Real newcoeff, SCIP_Bool cutislocal, QUAD(SCIP_Real *cutrhs))

static SCIP_Bool chgQuadCoeffWithBound(SCIP *scip, SCIP_VAR *var, QUAD(SCIP_Real oldcoeff), SCIP_Real newcoeff, SCIP_Bool cutislocal, QUAD(SCIP_Real *cutrhs))

static SCIP_RETCODE constructSNFRelaxation(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool allowlocal, SCIP_Real *rowcoefs, QUAD(SCIP_Real rowrhs), int *rowinds, int nnz, SNF_RELAXATION *snf, SCIP_Bool *success, SCIP_Bool *localbdsused)

static SCIP_RETCODE postprocessCutQuad(SCIP *scip, SCIP_Bool cutislocal, int *cutinds, SCIP_Real *cutcoefs, int *nnz, QUAD(SCIP_Real *cutrhs), SCIP_Bool *success)

static SCIP_RETCODE cutsRoundMIR(SCIP *scip, SCIP_Real *RESTRICT cutcoefs, QUAD(SCIP_Real *RESTRICT cutrhs), int *RESTRICT cutinds, int *RESTRICT nnz, int *RESTRICT varsign, int *RESTRICT boundtype, QUAD(SCIP_Real f0))

static void performBoundSubstitution(SCIP *scip, int *cutinds, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *nnz, int varsign, int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)

static void destroyLiftingData(SCIP *scip, LIFTINGDATA *liftingdata)

static SCIP_RETCODE varVecAddScaledRowCoefsQuad(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row, SCIP_Real scale)

static SCIP_Real calcEfficacyNormQuad(SCIP *scip, SCIP_Real *vals, int *inds, int nnz)

static SCIP_RETCODE cutTightenCoefs(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz, SCIP_Bool *redundant)

static SCIP_Bool removeZeros(SCIP *scip, SCIP_Real minval, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz)

struct LiftingData LIFTINGDATA

static SCIP_RETCODE SCIPsolveKnapsackApproximatelyLT(SCIP *scip, int nitems, SCIP_Real *weights, SCIP_Real *profits, SCIP_Real capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval)

static SCIP_RETCODE determineBoundForSNF(SCIP *scip, SCIP_SOL *sol, SCIP_VAR **vars, SCIP_Real *rowcoefs, int *rowinds, int varposinrow, int8_t *binvarused, SCIP_Bool allowlocal, SCIP_Real boundswitch, SCIP_Real *bestlb, SCIP_Real *bestub, SCIP_Real *bestslb, SCIP_Real *bestsub, int *bestlbtype, int *bestubtype, int *bestslbtype, int *bestsubtype, SCIP_BOUNDTYPE *selectedbounds, SCIP_Bool *freevariable)

static SCIP_RETCODE postprocessCut(SCIP *scip, SCIP_Bool cutislocal, int *cutinds, SCIP_Real *cutcoefs, int *nnz, SCIP_Real *cutrhs, SCIP_Bool *success)

static void destroySNFRelaxation(SCIP *scip, SNF_RELAXATION *snf)

static SCIP_RETCODE allocSNFRelaxation(SCIP *scip, SNF_RELAXATION *snf, int nvars)

static SCIP_RETCODE cutsRoundStrongCG(SCIP *scip, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, QUAD(SCIP_Real f0), SCIP_Real k)

static SCIP_Real calcEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)

static void buildFlowCover(SCIP *scip, int *coefs, SCIP_Real *vubcoefs, SCIP_Real rhs, int *solitems, int *nonsolitems, int nsolitems, int nnonsolitems, int *nflowcovervars, int *nnonflowcovervars, int *flowcoverstatus, QUAD(SCIP_Real *flowcoverweight), SCIP_Real *lambda)

static SCIP_RETCODE generateLiftedFlowCoverCut(SCIP *scip, SNF_RELAXATION *snf, SCIP_AGGRROW *aggrrow, int *flowcoverstatus, SCIP_Real lambda, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *nnz, SCIP_Bool *success)

static void getAlphaAndBeta(SCIP *scip, LIFTINGDATA *liftingdata, SCIP_Real vubcoef, int *alpha, SCIP_Real *beta)

static SCIP_RETCODE cutsSubstituteMIR(SCIP *scip, SCIP_Real *weights, int *slacksign, int *rowinds, int nrowinds, SCIP_Real scale, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, QUAD(SCIP_Real f0))

static SCIP_RETCODE addOneRow(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, SCIP_Bool sidetypebasis, SCIP_Bool allowlocal, int negslack, int maxaggrlen, SCIP_Bool *rowtoolong)

static SCIP_RETCODE varVecAddScaledRowCoefsQuadScale(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row, QUAD(SCIP_Real scale))

struct SNF_Relaxation SNF_RELAXATION

static SCIP_RETCODE cutTightenCoefsQuad(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz, SCIP_Bool *redundant)

static SCIP_Real evaluateLiftingFunction(SCIP *scip, LIFTINGDATA *liftingdata, SCIP_Real x)

static SCIP_RETCODE varVecAddScaledRowCoefs(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row, SCIP_Real scale)

static SCIP_RETCODE findBestUb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestub, SCIP_Real *simplebound, int *bestubtype)

static SCIP_Bool computeInitialKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, int *cutinds, SCIP_Real cutrhs, int cutnnz, int *varsign, int *coverstatus, int *coverpos, SCIP_Real *covervals, int *coversize, QUAD(SCIP_Real *coverweight))

methods for the aggregation rows

defines macros for basic operations in double-double arithmetic giving roughly twice the precision of...

#define QUAD_ARRAY_STORE(a, idx, x)

#define SCIPquadprecProdDD(r, a, b)

#define SCIPquadprecProdQD(r, a, b)

#define SCIPquadprecProdQQ(r, a, b)

#define SCIPquadprecSumQD(r, a, b)

#define QUAD_ARRAY_SIZE(size)

#define SCIPquadprecEpsFloorQ(r, a, eps)

#define QUAD_ASSIGN(a, constant)

#define SCIPquadprecFloorQ(r, a)

#define SCIPquadprecEpsCeilQ(r, a, eps)

#define SCIPquadprecSumDD(r, a, b)

#define SCIPquadprecSumQQ(r, a, b)

#define SCIPquadprecDivDQ(r, a, b)

#define QUAD_ASSIGN_Q(a, b)

#define QUAD_ARRAY_LOAD(r, a, idx)

#define SCIPquadprecDivDD(r, a, b)

#define SCIP_CALL_ABORT(x)

SCIP_RETCODE SCIPsolveKnapsackExactly(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval, SCIP_Bool *success)

int SCIPgetNContVars(SCIP *scip)

SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)

int SCIPgetNVars(SCIP *scip)

SCIP_VAR ** SCIPgetVars(SCIP *scip)

int SCIPgetNBinVars(SCIP *scip)

#define SCIPdebugMsgPrint

SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)

SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)

SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)

void SCIPaggrRowCancelVarWithBound(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_VAR *var, int pos, SCIP_Bool *valid)

SCIP_Bool SCIPaggrRowHasRowBeenAdded(SCIP_AGGRROW *aggrrow, SCIP_ROW *row)

int SCIPaggrRowGetRank(SCIP_AGGRROW *aggrrow)

SCIP_RETCODE SCIPcutGenerationHeuristicCMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, int maxtestdelta, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)

SCIP_Bool SCIPcutsTightenCoefficients(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, int *nchgcoefs)

SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)

SCIP_RETCODE SCIPcalcStrongCG(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)

SCIP_RETCODE SCIPcalcKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)

void SCIPaggrRowClear(SCIP_AGGRROW *aggrrow)

SCIP_RETCODE SCIPaggrRowCopy(SCIP *scip, SCIP_AGGRROW **aggrrow, SCIP_AGGRROW *source)

SCIP_Bool SCIPaggrRowIsLocal(SCIP_AGGRROW *aggrrow)

SCIP_Real SCIPaggrRowGetRhs(SCIP_AGGRROW *aggrrow)

SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)

int SCIPaggrRowGetNRows(SCIP_AGGRROW *aggrrow)

SCIP_RETCODE SCIPaggrRowAddCustomCons(SCIP *scip, SCIP_AGGRROW *aggrrow, int *inds, SCIP_Real *vals, int len, SCIP_Real rhs, SCIP_Real weight, int rank, SCIP_Bool local)

void SCIPaggrRowFree(SCIP *scip, SCIP_AGGRROW **aggrrow)

int * SCIPaggrRowGetInds(SCIP_AGGRROW *aggrrow)

void SCIPaggrRowPrint(SCIP *scip, SCIP_AGGRROW *aggrrow, FILE *file)

void SCIPaggrRowRemoveZeros(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Bool useglbbounds, SCIP_Bool *valid)

SCIP_Real * SCIPaggrRowGetRowWeights(SCIP_AGGRROW *aggrrow)

int SCIPaggrRowGetNNz(SCIP_AGGRROW *aggrrow)

SCIP_RETCODE SCIPaggrRowAddRow(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, int sidetype)

int * SCIPaggrRowGetRowInds(SCIP_AGGRROW *aggrrow)

SCIP_RETCODE SCIPaggrRowSumRows(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real *weights, int *rowinds, int nrowinds, SCIP_Bool sidetypebasis, SCIP_Bool allowlocal, int negslack, int maxaggrlen, SCIP_Bool *valid)

int SCIPgetNCuts(SCIP *scip)

SCIP_RETCODE SCIPaggrRowAddObjectiveFunction(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real rhs, SCIP_Real scale)

SCIP_RETCODE SCIPcalcFlowCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool allowlocal, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)

SCIP_Real SCIPaggrRowCalcEfficacyNorm(SCIP *scip, SCIP_AGGRROW *aggrrow)

SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)

SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)

SCIP_ROW ** SCIPgetLPRows(SCIP *scip)

int SCIPgetNLPRows(SCIP *scip)

#define SCIPfreeCleanBufferArray(scip, ptr)

#define SCIPallocCleanBufferArray(scip, ptr, num)

#define SCIPfreeBlockMemoryArray(scip, ptr, num)

int SCIPcalcMemGrowSize(SCIP *scip, int num)

#define SCIPallocBufferArray(scip, ptr, num)

#define SCIPfreeBufferArray(scip, ptr)

#define SCIPallocBlockMemoryArray(scip, ptr, num)

#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)

#define SCIPfreeBlockMemory(scip, ptr)

#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)

#define SCIPfreeBufferArrayNull(scip, ptr)

#define SCIPallocBlockMemory(scip, ptr)

#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)

SCIP_Real SCIProwGetLhs(SCIP_ROW *row)

SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)

SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)

SCIP_Real SCIProwGetRhs(SCIP_ROW *row)

SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)

int SCIProwGetLPPos(SCIP_ROW *row)

SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)

SCIP_BASESTAT SCIProwGetBasisStatus(SCIP_ROW *row)

SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)

SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)

SCIP_Longint SCIPgetNLPs(SCIP *scip)

SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Real SCIPinfinity(SCIP *scip)

SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)

SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)

SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)

SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)

SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)

SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)

SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)

SCIP_Real SCIPfeastol(SCIP *scip)

SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)

SCIP_Real SCIPgetHugeValue(SCIP *scip)

SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)

SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)

SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)

SCIP_Real SCIPepsilon(SCIP *scip)

SCIP_Real SCIPsumepsilon(SCIP *scip)

SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)

int SCIPvarGetNVlbs(SCIP_VAR *var)

SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)

SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)

SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)

SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)

SCIP_Real SCIPvarGetObj(SCIP_VAR *var)

SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)

SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)

SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)

int SCIPvarGetProbindex(SCIP_VAR *var)

const char * SCIPvarGetName(SCIP_VAR *var)

SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)

int SCIPvarGetNVubs(SCIP_VAR *var)

SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)

SCIP_RETCODE SCIPgetVarClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvlb, int *closestvlbidx)

SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)

SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)

SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)

SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)

SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)

SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)

SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)

void SCIPselectWeightedDownRealRealInt(SCIP_Real *realarray1, SCIP_Real *realarray2, int *intarray, SCIP_Real *weights, SCIP_Real capacity, int len, int *medianpos)

void SCIPsortDownRealRealInt(SCIP_Real *realarray1, SCIP_Real *realarray2, int *intarray, int len)

SCIP_Bool SCIPsortedvecFindDownReal(SCIP_Real *realarray, SCIP_Real val, int len, int *pos)

void SCIPsortDownReal(SCIP_Real *realarray, int len)

void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)

void SCIPsortDownInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)

void SCIPsortDownInt(int *intarray, int len)

static SCIP_Bool isIntegralScalar(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Real *intval)

internal methods for LP management

memory allocation routines

#define BMScopyMemoryArray(ptr, source, num)

#define BMSmoveMemoryArray(ptr, source, num)

#define BMSclearMemoryArray(ptr, num)

void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)

public methods for LP management

public methods for message output

public data structures and miscellaneous methods

methods for selecting (weighted) k-medians

methods for sorting joint arrays of various types

public methods for problem variables

public methods for cuts and aggregation rows

public methods for the LP relaxation, rows and columns

public methods for memory management

public methods for message handling

public methods for numerical tolerances

public methods for global and local (sub)problems

public methods for solutions

public methods for querying solving statistics

public methods for SCIP variables

SCIP_Real * transbinvarsolvals

SCIP_Real * transcontvarsolvals

SCIP_Real * aggrconstants

SCIP_Real * aggrcoefscont

SCIP_Real * transvarvubcoefs

data structures for LP management

SCIP main data structure.

datastructures for global SCIP settings

enum SCIP_BoundType SCIP_BOUNDTYPE

enum SCIP_BaseStat SCIP_BASESTAT

enum SCIP_Retcode SCIP_RETCODE

@ SCIP_VARTYPE_CONTINUOUS


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4