Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

a linear inequality that is prepared to become a SCIP_ROW

This data structure helps to work around some limitations of SCIP_ROW's, in particular, that it rounds coefficients or sides close to integral values without the appropriate care. On the other hand, a SCIP_ROWPREP is limited to inequalities.

Functions

SCIP_RETCODE SCIPcreateRowprep (SCIP *scip, SCIP_ROWPREP **rowprep, SCIP_SIDETYPE sidetype, SCIP_Bool local)
 
void SCIPfreeRowprep (SCIP *scip, SCIP_ROWPREP **rowprep)
 
SCIP_RETCODE SCIPcopyRowprep (SCIP *scip, SCIP_ROWPREP **target, SCIP_ROWPREP *source)
 
int SCIProwprepGetNVars (SCIP_ROWPREP *rowprep)
 
SCIP_VAR ** SCIProwprepGetVars (SCIP_ROWPREP *rowprep)
 
SCIP_RealSCIProwprepGetCoefs (SCIP_ROWPREP *rowprep)
 
SCIP_Real SCIProwprepGetSide (SCIP_ROWPREP *rowprep)
 
SCIP_SIDETYPE SCIProwprepGetSidetype (SCIP_ROWPREP *rowprep)
 
SCIP_Bool SCIProwprepIsLocal (SCIP_ROWPREP *rowprep)
 
char * SCIProwprepGetName (SCIP_ROWPREP *rowprep)
 
int SCIProwprepGetNModifiedVars (SCIP_ROWPREP *rowprep)
 
SCIP_VAR ** SCIProwprepGetModifiedVars (SCIP_ROWPREP *rowprep)
 
void SCIProwprepReset (SCIP_ROWPREP *rowprep)
 
void SCIProwprepAddSide (SCIP_ROWPREP *rowprep, SCIP_Real side)
 
void SCIProwprepAddConstant (SCIP_ROWPREP *rowprep, SCIP_Real constant)
 
void SCIProwprepSetSidetype (SCIP_ROWPREP *rowprep, SCIP_SIDETYPE sidetype)
 
void SCIProwprepSetLocal (SCIP_ROWPREP *rowprep, SCIP_Bool islocal)
 
void SCIProwprepRecordModifications (SCIP_ROWPREP *rowprep)
 
void SCIPprintRowprep (SCIP *scip, SCIP_ROWPREP *rowprep, FILE *file)
 
void SCIPprintRowprepSol (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, FILE *file)
 
SCIP_RETCODE SCIPensureRowprepSize (SCIP *scip, SCIP_ROWPREP *rowprep, int size)
 
SCIP_RETCODE SCIPaddRowprepTerm (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var, SCIP_Real coef)
 
SCIP_RETCODE SCIPaddRowprepTerms (SCIP *scip, SCIP_ROWPREP *rowprep, int nvars, SCIP_VAR **vars, SCIP_Real *coefs)
 
SCIP_Real SCIPgetRowprepViolation (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Bool *reliable)
 
SCIP_Bool SCIPisRowprepViolationReliable (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol)
 
void SCIPmergeRowprepTerms (SCIP *scip, SCIP_ROWPREP *rowprep)
 
SCIP_RETCODE SCIPcleanupRowprep (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real minviol, SCIP_Real *viol, SCIP_Bool *success)
 
SCIP_RETCODE SCIPcleanupRowprep2 (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real maxcoefbound, SCIP_Bool *success)
 
SCIP_Real SCIPscaleupRowprep (SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real minscaleup, SCIP_Bool *success)
 
int SCIPscaleRowprep (SCIP_ROWPREP *rowprep, SCIP_Real factor)
 
SCIP_RETCODE SCIPgetRowprepRowConshdlr (SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONSHDLR *conshdlr)
 
SCIP_RETCODE SCIPgetRowprepRowCons (SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONS *cons)
 
SCIP_RETCODE SCIPgetRowprepRowSepa (SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_SEPA *sepa)
 

Function Documentation

◆ SCIPcreateRowprep()

SCIP_RETCODE SCIPcreateRowprep ( SCIP scip,
SCIP_ROWPREP **  rowprep,
SCIP_SIDETYPE  sidetype,
SCIP_Bool  local 
)

creates a SCIP_ROWPREP datastructure

Initial row represents 0 ≤ 0.

Parameters
scipSCIP data structure
rowprepbuffer to store pointer to rowprep
sidetypewhether cut will be or lower-equal or larger-equal type
localwhether cut will be valid only locally

Definition at line 547 of file misc_rowprep.c.

References BMSclearMemory, NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocBlockMemory.

Referenced by addCut(), generateCutSolDisagg(), generateCutSolSOC(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), and separateDeterminant().

◆ SCIPfreeRowprep()

void SCIPfreeRowprep ( SCIP scip,
SCIP_ROWPREP **  rowprep 
)

frees a SCIP_ROWPREP datastructure

Parameters
scipSCIP data structure
rowpreppointer that stores pointer to rowprep

Definition at line 567 of file misc_rowprep.c.

References NULL, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.

Referenced by addCut(), addTightEstimatorCut(), enforceExprNlhdlr(), generateCutSolDisagg(), generateCutSolSOC(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), and separateDeterminant().

◆ SCIPcopyRowprep()

SCIP_RETCODE SCIPcopyRowprep ( SCIP scip,
SCIP_ROWPREP **  target,
SCIP_ROWPREP source 
)

creates a copy of a SCIP_ROWPREP datastructure

Parameters
scipSCIP data structure
targetbuffer to store pointer of rowprep copy
sourcerowprep to copy

Definition at line 583 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPduplicateBlockMemory, SCIPduplicateBlockMemoryArray, SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.

◆ SCIProwprepGetNVars()

int SCIProwprepGetNVars ( SCIP_ROWPREP rowprep)

gives number of terms in rowprep

Parameters
rowpreprowprep

Definition at line 613 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::nvars.

Referenced by addTightEstimatorCut(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRINITSEPA(), and SCIPprocessRowprepNonlinear().

◆ SCIProwprepGetVars()

SCIP_VAR** SCIProwprepGetVars ( SCIP_ROWPREP rowprep)

gives variables of rowprep (feel free to modify)

Parameters
rowpreprowprep

Definition at line 623 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::vars.

Referenced by addTightEstimatorCut(), SCIP_DECL_NLHDLRENFO(), and SCIPprocessRowprepNonlinear().

◆ SCIProwprepGetCoefs()

SCIP_Real* SCIProwprepGetCoefs ( SCIP_ROWPREP rowprep)

gives coefficients of rowprep (feel free to modify)

Parameters
rowpreprowprep

Definition at line 633 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, and NULL.

Referenced by addTightEstimatorCut(), estimateVertexPolyhedral(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), and SCIPprocessRowprepNonlinear().

◆ SCIProwprepGetSide()

SCIP_Real SCIProwprepGetSide ( SCIP_ROWPREP rowprep)

gives side of rowprep

Parameters
rowpreprowprep

Definition at line 643 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::side.

Referenced by addTightEstimatorCut(), generateIntercut(), and SCIP_DECL_NLHDLRENFO().

◆ SCIProwprepGetSidetype()

SCIP_SIDETYPE SCIProwprepGetSidetype ( SCIP_ROWPREP rowprep)

gives kind of inequality of rowprep

Parameters
rowpreprowprep

Definition at line 653 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::sidetype.

Referenced by addTightEstimatorCut(), enforceExprNlhdlr(), and SCIP_DECL_NLHDLRINITSEPA().

◆ SCIProwprepIsLocal()

SCIP_Bool SCIProwprepIsLocal ( SCIP_ROWPREP rowprep)

returns whether rowprep is locally valid only

Parameters
rowpreprowprep

Definition at line 663 of file misc_rowprep.c.

References SCIP_RowPrep::local, and NULL.

Referenced by addTightEstimatorCut().

◆ SCIProwprepGetName()

char* SCIProwprepGetName ( SCIP_ROWPREP rowprep)

◆ SCIProwprepGetNModifiedVars()

int SCIProwprepGetNModifiedVars ( SCIP_ROWPREP rowprep)

returns number of variables which coefficients were modified in cleanup

Parameters
rowpreprowprep

Definition at line 683 of file misc_rowprep.c.

References SCIP_RowPrep::nmodifiedvars, and NULL.

Referenced by SCIPprocessRowprepNonlinear().

◆ SCIProwprepGetModifiedVars()

SCIP_VAR** SCIProwprepGetModifiedVars ( SCIP_ROWPREP rowprep)

returns variables which coefficients were modified in cleanup

Parameters
rowpreprowprep

Definition at line 693 of file misc_rowprep.c.

References SCIP_RowPrep::modifiedvars, and NULL.

Referenced by SCIPprocessRowprepNonlinear().

◆ SCIProwprepReset()

void SCIProwprepReset ( SCIP_ROWPREP rowprep)

resets rowprep to have 0 terms and side 0.0

Parameters
rowpreprowprep

Definition at line 703 of file misc_rowprep.c.

References FALSE, SCIP_RowPrep::modifiedside, SCIP_RowPrep::nmodifiedvars, NULL, SCIP_RowPrep::nvars, SCIP_RowPrep::recordmodifications, and SCIP_RowPrep::side.

Referenced by SCIP_DECL_NLHDLRINITSEPA().

◆ SCIProwprepAddSide()

void SCIProwprepAddSide ( SCIP_ROWPREP rowprep,
SCIP_Real  side 
)

adds constant value to side of rowprep

Parameters
rowpreprowprep
sideconstant value to be added to side

Definition at line 723 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::side.

Referenced by createRowprep(), generateCutSolDisagg(), generateCutSolSOC(), generateIntercut(), SCIProwprepAddConstant(), and separateDeterminant().

◆ SCIProwprepAddConstant()

void SCIProwprepAddConstant ( SCIP_ROWPREP rowprep,
SCIP_Real  constant 
)

adds constant term to rowprep

Substracts constant from side.

Parameters
rowpreprowprep
constantconstant value to be added

Definition at line 737 of file misc_rowprep.c.

References SCIProwprepAddSide().

Referenced by addColToCut(), addCut(), addRowToCut(), estimateConvexSecant(), estimateGradient(), estimateVertexPolyhedral(), rowprepCleanupImproveCoefrange(), rowprepCleanupIntegralCoefs(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), and SCIP_DECL_NLHDLRINITSEPA().

◆ SCIProwprepSetSidetype()

void SCIProwprepSetSidetype ( SCIP_ROWPREP rowprep,
SCIP_SIDETYPE  sidetype 
)

sets side type of rowprep

Parameters
rowpreprowprep
sidetypenew side type

Definition at line 746 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::sidetype.

Referenced by generateIntercut(), and SCIP_DECL_NLHDLRINITSEPA().

◆ SCIProwprepSetLocal()

void SCIProwprepSetLocal ( SCIP_ROWPREP rowprep,
SCIP_Bool  islocal 
)

sets whether rowprep is local

Parameters
rowpreprowprep
islocalwhether rowprep is local

Definition at line 757 of file misc_rowprep.c.

References SCIP_RowPrep::local, and NULL.

Referenced by estimateConvexSecant(), estimateGradient(), estimateUnivariateQuotient(), estimateVertexPolyhedral(), and SCIP_DECL_NLHDLRESTIMATE().

◆ SCIProwprepRecordModifications()

void SCIProwprepRecordModifications ( SCIP_ROWPREP rowprep)

enables recording for where modifications were done in cleanup

Parameters
rowpreprowprep

Definition at line 768 of file misc_rowprep.c.

References NULL, SCIP_RowPrep::recordmodifications, and TRUE.

Referenced by SCIPprocessRowprepNonlinear().

◆ SCIPprintRowprep()

void SCIPprintRowprep ( SCIP scip,
SCIP_ROWPREP rowprep,
FILE *  file 
)

◆ SCIPprintRowprepSol()

void SCIPprintRowprepSol ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_SOL sol,
FILE *  file 
)

prints a rowprep and values in solution

Parameters
scipSCIP data structure
rowpreprowprep to be printed
solsolution for activity
filefile to print to, or NULL for stdout

Definition at line 803 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, SCIP_RowPrep::local, SCIP_RowPrep::name, NULL, SCIP_RowPrep::nvars, REALABS, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPgetSolVal(), SCIPinfoMessage(), SCIPvarGetName(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, and SCIP_RowPrep::vars.

Referenced by SCIP_DECL_NLHDLRESTIMATE().

◆ SCIPensureRowprepSize()

SCIP_RETCODE SCIPensureRowprepSize ( SCIP scip,
SCIP_ROWPREP rowprep,
int  size 
)

ensures that rowprep has space for at least given number of additional terms

Useful when knowing in advance how many terms will be added.

Parameters
scipSCIP data structure
rowpreprowprep
sizenumber of additional terms for which to alloc space in rowprep

Definition at line 864 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, NULL, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPreallocBlockMemoryArray, SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.

Referenced by createRowprep(), estimateVertexPolyhedral(), generateCutSolDisagg(), generateCutSolSOC(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIPaddRowprepTerm(), and SCIPaddRowprepTerms().

◆ SCIPaddRowprepTerm()

SCIP_RETCODE SCIPaddRowprepTerm ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_VAR var,
SCIP_Real  coef 
)

◆ SCIPaddRowprepTerms()

SCIP_RETCODE SCIPaddRowprepTerms ( SCIP scip,
SCIP_ROWPREP rowprep,
int  nvars,
SCIP_VAR **  vars,
SCIP_Real coefs 
)

adds several terms coef*var to a rowprep

Parameters
scipSCIP data structure
rowpreprowprep
nvarsnumber of terms to add
varsvariables to add
coefscoefficients to add

Definition at line 915 of file misc_rowprep.c.

References BMScopyMemoryArray, SCIP_RowPrep::coefs, NULL, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIPensureRowprepSize(), SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.

Referenced by addCut(), and createRowprep().

◆ SCIPgetRowprepViolation()

SCIP_Real SCIPgetRowprepViolation ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_SOL sol,
SCIP_Bool reliable 
)

computes violation of rowprep in a given solution

Can return whether the violation value is reliable from a floating-point accuracy point of view. The value will not be deemed reliable when its calculation involved the subtraction of large numbers. To be precise, the violation of an inequality \( \sum_i a_ix_i \leq b \) in a solution \(x^*\) is deemed reliable if \( |\sum_i a_ix^*_i - b| \geq 2^{-50} \max (|b|, \max_i |a_ix^*_i|) \).

Parameters
scipSCIP data structure
rowpreprowprep
solsolution or NULL for LP solution
reliablebuffer to store whether computed violation is reliable (numerically), or NULL if not of interest

Definition at line 949 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, MAX, NULL, SCIP_RowPrep::nvars, REALABS, SCIP_Real, SCIP_SIDETYPE_RIGHT, SCIP_VARSTATUS_LOOSE, SCIPgetSolVal(), SCIPinfinity(), SCIPisInfinity(), SCIPvarGetStatus(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.

Referenced by addCut(), generateCutSolDisagg(), generateCutSolSOC(), SCIPcleanupRowprep(), SCIPisRowprepViolationReliable(), and SCIPprocessRowprepNonlinear().

◆ SCIPisRowprepViolationReliable()

SCIP_Bool SCIPisRowprepViolationReliable ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_SOL sol 
)

computes violation of rowprep in a given solution and reports whether that value seem numerically reliable

See also
SCIPgetRowprepViolation()
Parameters
scipSCIP data structure
rowpreprowprep
solsolution or NULL for LP solution

Definition at line 1041 of file misc_rowprep.c.

References NULL, SCIP_Bool, and SCIPgetRowprepViolation().

◆ SCIPmergeRowprepTerms()

void SCIPmergeRowprepTerms ( SCIP scip,
SCIP_ROWPREP rowprep 
)

Merge terms that use same variable and eliminate zero coefficients.

Removes a variable if its bounds have a relative difference of below epsilon. Local bounds are checked for local rows, otherwise global bounds are used. If the bounds are not absolute equal, the bound that relaxes the row is used.

Terms are sorted by variable (see SCIPvarComp()) after return.

Parameters
scipSCIP data structure
rowpreprowprep to be cleaned up

Definition at line 1065 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, SCIP_RowPrep::local, NULL, SCIP_RowPrep::nvars, SCIP_SIDETYPE_RIGHT, SCIPisRelEQ(), SCIPsortPtrReal(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, and SCIP_RowPrep::vars.

Referenced by SCIP_DECL_NLHDLRENFO(), and separateDeterminant().

◆ SCIPcleanupRowprep()

SCIP_RETCODE SCIPcleanupRowprep ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_SOL sol,
SCIP_Real  minviol,
SCIP_Real viol,
SCIP_Bool success 
)

Cleans up and attempts to improve rowprep

Drops small or large coefficients if their ratio is beyond separating/maxcoefratiofacrowprep / numerics/feastol, if this can be done by relaxing the row. Scales coefficients up to reach minimal violation, if possible. Scaling is omitted if violation is very small (ROWPREP_SCALEUP_VIOLNONZERO) or maximal coefficient would become huge (ROWPREP_SCALEUP_MAXMAXCOEF). Scales coefficients and side down if they are large and if the minimal violation is still reached. Rounds coefficients close to integral values to integrals, if this can be done by relaxing the row. Rounds side within epsilon of 0 to 0.0 or +/-1.1*epsilon, whichever relaxes the row least.

After return, the terms in the rowprep will be sorted by absolute value of coefficient, in decreasing order. Thus, the coefratio can be obtained via REALABS(rowprep->coefs[0]) / REALABS(rowprep->coefs[rowprep->nvars-1]) (if nvars>0).

success is set to TRUE if and only if the rowprep satisfies the following:

  • the coefratio is below separating/maxcoefratiofacrowprep / numerics/feastol
  • the violation is at least minviol
  • the violation is reliable or minviol = 0
  • the absolute value of coefficients are below SCIPinfinity()
  • the absolute value of the side is below SCIPinfinity()

    Cleans up and attempts to improve rowprep

Drops small or large coefficients if coefrange is too large, if this can be done by relaxing the row. Scales coefficients up to reach minimal violation, if possible. Scaling is omitted if violation is very small (ROWPREP_SCALEUP_VIOLNONZERO) or maximal coefficient would become huge (ROWPREP_SCALEUP_MAXMAXCOEF). Scales coefficients and side down if they are large and if the minimal violation is still reached. Rounds coefficients close to integral values to integrals, if this can be done by relaxing the row. Rounds side within epsilon of 0 to 0.0 or +/-1.1*epsilon, whichever relaxes the row least.

After return, the terms in the rowprep will be sorted by absolute value of coefficient, in decreasing order. Thus, the coefrange can be obtained via REALABS(rowprep->coefs[0]) / REALABS(rowprep->coefs[rowprep->nvars-1]) (if nvars>0).

success is set to TRUE if and only if the rowprep satisfies the following:

  • the coefrange is below maxcoefrange
  • the violation is at least minviol
  • the violation is reliable or minviol = 0
  • the absolute value of coefficients are below SCIPinfinity()
  • the absolute value of the side is below SCIPinfinity()
Parameters
scipSCIP data structure
rowpreprowprep to be cleaned
solsolution that we try to cut off, or NULL for LP solution
minviolminimal absolute violation the row should achieve (w.r.t. sol)
violbuffer to store absolute violation of cleaned up cut in sol, or NULL if not of interest
successbuffer to store whether cut cleanup was successful, or NULL if not of interest

Definition at line 1178 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, MAX, SCIP_RowPrep::modifiedside, SCIP_RowPrep::nmodifiedvars, NULL, SCIP_RowPrep::nvars, REALABS, SCIP_RowPrep::recordmodifications, rowprepCleanupImproveCoefrange(), rowprepCleanupIntegralCoefs(), rowprepCleanupScaledown(), rowprepCleanupScaleup(), rowprepCleanupSide(), rowprepCleanupSortTerms(), SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPgetRowprepViolation(), SCIPgetSepaMinEfficacy(), SCIPinfoMessage(), SCIPisInfinity(), SCIPprintRowprep(), SCIPsetGetSepaMaxCoefRatioRowprep(), Scip::set, SCIP_RowPrep::side, and TRUE.

Referenced by addCut(), SCIP_DECL_NLHDLRENFO(), SCIPprocessRowprepNonlinear(), and separateDeterminant().

◆ SCIPcleanupRowprep2()

SCIP_RETCODE SCIPcleanupRowprep2 ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_SOL sol,
SCIP_Real  maxcoefbound,
SCIP_Bool success 
)

Cleans up and attempts to improve rowprep without regard for violation

Drops small or large coefficients if their ratio is beyond separating/maxcoefratiofacrowprep / numerics/feastol, if this can be done by relaxing the row. Scales coefficients and side to have maximal coefficient in [1/maxcoefbound,maxcoefbound]. Rounds coefficients close to integral values to integrals, if this can be done by relaxing the row. Rounds side within epsilon of 0 to 0.0 or +/-1.1*epsilon, whichever relaxes the row least.

After return, the terms in the rowprep will be sorted by absolute value of coefficient, in decreasing order. Thus, the coefratio can be obtained via REALABS(rowprep->coefs[0]) / REALABS(rowprep->coefs[rowprep->nvars-1]) (if nvars>0).

success is set to TRUE if and only if the rowprep satisfies the following:

  • the coefratio is below separating/maxcoefratiofacrowprep / numerics/feastol
  • the absolute value of coefficients are below SCIPinfinity()
  • the absolute value of the side is below SCIPinfinity()

In difference to SCIPcleanupRowprep(), this function does not scale up the row to increase the absolute violation.

Parameters
scipSCIP data structure
rowpreprowprep to be cleaned
solsolution that we try to cut off, or NULL for LP solution
maxcoefboundbound on absolute value of largest coefficient
successbuffer to store whether cut cleanup was successful, or NULL if not of interest

Definition at line 1353 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, SCIP_RowPrep::modifiedside, SCIP_RowPrep::nmodifiedvars, NULL, SCIP_RowPrep::nvars, REALABS, SCIP_RowPrep::recordmodifications, rowprepCleanupImproveCoefrange(), rowprepCleanupIntegralCoefs(), rowprepCleanupSide(), rowprepCleanupSortTerms(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPinfoMessage(), SCIPisInfinity(), SCIPprintRowprep(), SCIPscaleRowprep(), SCIPsetGetSepaMaxCoefRatioRowprep(), Scip::set, SCIP_RowPrep::side, and TRUE.

Referenced by addTightEstimatorCut(), generateCutSolDisagg(), generateCutSolSOC(), SCIP_DECL_NLHDLRINITSEPA(), and SCIPprocessRowprepNonlinear().

◆ SCIPscaleupRowprep()

SCIP_Real SCIPscaleupRowprep ( SCIP scip,
SCIP_ROWPREP rowprep,
SCIP_Real  minscaleup,
SCIP_Bool success 
)

Scales up a rowprep to increase coefficients/sides that are within epsilon to an integer value, if possible.

Computes the minimal fractionality of all fractional coefficients and the side of the rowprep. If this fractionality is below epsilon, the rowprep is scaled up such that the fractionality exceeds epsilon, if this will not put any coefficient or side above SCIPhugeValue().

This function does not relax the rowprep.

success is set to TRUE if the resulting rowprep can be turned into a SCIP_ROW, that is, all coefs and the side is below SCIPinfinity() and fractionalities are above epsilon. If success is set to FALSE, then the rowprep will not have been modified.

Returns
The applied scaling factor, if success is set to TRUE.
Parameters
scipSCIP data structure
rowpreprowprep to be cleaned
minscaleupminimal factor by which to scale up row, or <= 1.0 if to be ignored
successbuffer to store whether rowprep could be turned into SCIP_ROW without loss, or NULL if not of interest

Definition at line 1481 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, M_SQRT2, MAX, NULL, SCIP_RowPrep::nvars, REALABS, SCIP_Bool, SCIP_Real, SCIPdebugMsg, SCIPepsilon(), SCIPinfoMessage(), SCIPisHugeValue(), SCIPisInfinity(), SCIPprintRowprep(), SCIPscaleRowprep(), SCIP_RowPrep::side, and TRUE.

Referenced by SCIP_DECL_NLHDLRINITSEPA().

◆ SCIPscaleRowprep()

int SCIPscaleRowprep ( SCIP_ROWPREP rowprep,
SCIP_Real  factor 
)

scales a rowprep by given factor (after some rounding)

Returns
Exponent of actually applied scaling factor, if written as \(2^x\).
Parameters
rowpreprowprep to be scaled
factorsuggested scale factor

Definition at line 1603 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, NULL, SCIP_RowPrep::nvars, and SCIP_RowPrep::side.

Referenced by rowprepCleanupScaledown(), rowprepCleanupScaleup(), SCIPcleanupRowprep2(), and SCIPscaleupRowprep().

◆ SCIPgetRowprepRowConshdlr()

SCIP_RETCODE SCIPgetRowprepRowConshdlr ( SCIP scip,
SCIP_ROW **  row,
SCIP_ROWPREP rowprep,
SCIP_CONSHDLR conshdlr 
)

generates a SCIP_ROW from a rowprep, setting its origin to given constraint handler

Parameters
scipSCIP data structure
rowbuffer to store pointer to new row
rowpreprowprep to be turned into a row
conshdlrconstraint handler

Definition at line 1632 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, SCIP_RowPrep::local, SCIP_RowPrep::name, NULL, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddVarsToRow(), SCIPcreateEmptyRowConshdlr(), SCIPgetDepth(), SCIPinfinity(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.

◆ SCIPgetRowprepRowCons()

SCIP_RETCODE SCIPgetRowprepRowCons ( SCIP scip,
SCIP_ROW **  row,
SCIP_ROWPREP rowprep,
SCIP_CONS cons 
)

generates a SCIP_ROW from a rowprep, setting its origin to given constraint

Parameters
scipSCIP data structure
rowbuffer to store pointer to new row
rowpreprowprep to be turned into a row
consconstraint

Definition at line 1655 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, SCIP_RowPrep::local, SCIP_RowPrep::name, NULL, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddVarsToRow(), SCIPcreateEmptyRowCons(), SCIPgetDepth(), SCIPinfinity(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.

Referenced by addTightEstimatorCut(), generateCutSolDisagg(), generateCutSolSOC(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRINITSEPA(), and SCIPprocessRowprepNonlinear().

◆ SCIPgetRowprepRowSepa()

SCIP_RETCODE SCIPgetRowprepRowSepa ( SCIP scip,
SCIP_ROW **  row,
SCIP_ROWPREP rowprep,
SCIP_SEPA sepa 
)

generates a SCIP_ROW from a rowprep, setting its origin to given separator

Parameters
scipSCIP data structure
rowbuffer to store pointer to new row
rowpreprowprep to be turned into a row
sepaseparator

Definition at line 1678 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, SCIP_RowPrep::local, SCIP_RowPrep::name, NULL, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddVarsToRow(), SCIPcreateEmptyRowSepa(), SCIPgetDepth(), SCIPinfinity(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.

Referenced by addCut(), and separateDeterminant().