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 SCIProwprepSetCoef (SCIP_ROWPREP *rowprep, int idx, SCIP_Real newcoef)
 
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 563 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(), SCIP_DECL_NLHDLRSOLLINEARIZE(), 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 583 of file misc_rowprep.c.

References NULL, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.

Referenced by addCut(), enforceExprNlhdlr(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRSOLLINEARIZE(), 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 599 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 629 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::nvars.

Referenced by addCutPool(), reformRowprep(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRINITSEPA(), SCIPprocessRowprepNonlinear(), and sparsifyIntercut().

◆ SCIProwprepGetVars()

SCIP_VAR** SCIProwprepGetVars ( SCIP_ROWPREP rowprep)

gives variables of rowprep (feel free to modify)

Parameters
rowpreprowprep

Definition at line 639 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::vars.

Referenced by reformRowprep(), SCIP_DECL_NLHDLRENFO(), SCIPprocessRowprepNonlinear(), and sparsifyIntercut().

◆ SCIProwprepGetCoefs()

SCIP_Real* SCIProwprepGetCoefs ( SCIP_ROWPREP rowprep)

gives coefficients of rowprep (feel free to modify)

Parameters
rowpreprowprep

Definition at line 649 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, and NULL.

Referenced by estimateVertexPolyhedral(), reformRowprep(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIPprocessRowprepNonlinear(), and sparsifyIntercut().

◆ SCIProwprepGetSide()

SCIP_Real SCIProwprepGetSide ( SCIP_ROWPREP rowprep)

gives side of rowprep

Parameters
rowpreprowprep

Definition at line 659 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::side.

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

◆ SCIProwprepGetSidetype()

SCIP_SIDETYPE SCIProwprepGetSidetype ( SCIP_ROWPREP rowprep)

gives kind of inequality of rowprep

Parameters
rowpreprowprep

Definition at line 669 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::sidetype.

Referenced by enforceExprNlhdlr(), and SCIP_DECL_NLHDLRINITSEPA().

◆ SCIProwprepIsLocal()

SCIP_Bool SCIProwprepIsLocal ( SCIP_ROWPREP rowprep)

returns whether rowprep is locally valid only

Parameters
rowpreprowprep

Definition at line 679 of file misc_rowprep.c.

References SCIP_RowPrep::local, and NULL.

Referenced by addCutPool(), and SCIP_DECL_NLHDLRSOLLINEARIZE().

◆ 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 699 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 709 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 719 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().

◆ SCIProwprepSetCoef()

void SCIProwprepSetCoef ( SCIP_ROWPREP rowprep,
int  idx,
SCIP_Real  newcoef 
)

sets coefficient idx of rowprep

Parameters
rowpreprowprep
idxindex of coef to set
newcoefnew coefficient

Definition at line 734 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, and NULL.

Referenced by sparsifyIntercut().

◆ 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 746 of file misc_rowprep.c.

References NULL, and SCIP_RowPrep::side.

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

◆ SCIProwprepAddConstant()

void SCIProwprepAddConstant ( SCIP_ROWPREP rowprep,
SCIP_Real  constant 
)

◆ SCIProwprepSetSidetype()

void SCIProwprepSetSidetype ( SCIP_ROWPREP rowprep,
SCIP_SIDETYPE  sidetype 
)

sets side type of rowprep

Parameters
rowpreprowprep
sidetypenew side type

Definition at line 769 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 780 of file misc_rowprep.c.

References SCIP_RowPrep::local, and NULL.

Referenced by estimateConvexSecant(), estimateGradientInner(), 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 791 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 826 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(), and SCIP_DECL_NLHDLRSOLLINEARIZE().

◆ 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 887 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(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIPaddRowprepTerm(), and SCIPaddRowprepTerms().

◆ SCIPaddRowprepTerm()

◆ 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 938 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 972 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(), 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 1064 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 1088 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 1201 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 1376 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 addCut(), addCutPool(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRSOLLINEARIZE(), 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 1504 of file misc_rowprep.c.

References SCIP_RowPrep::coefs, FALSE, M_SQRT2, MAX, MIN, 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 1626 of file misc_rowprep.c.

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

Referenced by rowprepCleanupIntegralCoefs(), 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 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(), 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 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(), SCIPcreateEmptyRowCons(), SCIPgetDepth(), SCIPinfinity(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.

Referenced by addCut(), addCutPool(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRSOLLINEARIZE(), 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 1701 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().