Scippy

    SCIP

    Solving Constraint Integer Programs

    Detailed Description

    miscellaneous methods for linear constraints

    Author
    Jakob Witzig
    Ambros Gleixner

    Definition in file misc_linear.c.

    #include <assert.h>
    #include <string.h>
    #include "scip/def.h"
    #include "scip/scip.h"
    #include "scip/pub_misc_linear.h"
    #include "scip/cons_setppc.h"
    #include "scip/scipdefplugins.h"

    Go to the source code of this file.

    Functions

    SCIP_Real SCIPconsGetRhs (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
     
    SCIP_Real SCIPconsGetLhs (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
     
    SCIP_RATIONALSCIPconsGetRhsExact (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
     
    SCIP_RATIONALSCIPconsGetLhsExact (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
     
    SCIP_RETCODE SCIPgetConsVals (SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int varssize, SCIP_Bool *success)
     
    SCIP_RETCODE SCIPgetConsValsExact (SCIP *scip, SCIP_CONS *cons, SCIP_RATIONAL **vals, int varssize, SCIP_Bool *success)
     
    void SCIPconsGetDualfarkas (SCIP *scip, SCIP_CONS *cons, SCIP_Real *dualfarkas, SCIP_Bool *success)
     
    void SCIPconsGetDualsol (SCIP *scip, SCIP_CONS *cons, SCIP_Real *dualsol, SCIP_Bool *success)
     
    SCIP_ROWSCIPconsGetRow (SCIP *scip, SCIP_CONS *cons)
     
    SCIP_RETCODE SCIPconsCreateRow (SCIP *scip, SCIP_CONS *cons, SCIP_ROW **row)
     
    SCIP_RETCODE SCIPconsAddCoef (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
     

    Function Documentation

    ◆ SCIPconsGetRhs()

    SCIP_Real SCIPconsGetRhs ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Bool success 
    )

    returns the right-hand side of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Note
    The success pointer indicates if the individual contraint handler was able to return the involved values
    Parameters
    scipSCIP data structure
    consconstraint for which right-hand side is queried
    successpointer to store whether a valid right-hand side was returned

    Definition at line 48 of file misc_linear.c.

    References FALSE, NULL, SCIP_INVALID, SCIP_Real, SCIP_SETPPCTYPE_COVERING, SCIP_SETPPCTYPE_PACKING, SCIP_SETPPCTYPE_PARTITIONING, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetCapacityKnapsack(), SCIPgetRhsLinear(), SCIPgetRhsVarbound(), SCIPgetTypeSetppc(), SCIPinfinity(), SCIPwarningMessage(), and TRUE.

    Referenced by addSlackVars(), checkTrivialInfeas(), createBlockproblem(), determineTotalNumberLinearConss(), hasUnfixedSCIndicator(), initCurrent(), and SCIP_DECL_DIVESETGETSCORE().

    ◆ SCIPconsGetLhs()

    SCIP_Real SCIPconsGetLhs ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Bool success 
    )

    returns the left-hand side of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Note
    The success pointer indicates if the individual contraint handler was able to return the involved values
    Parameters
    scipSCIP data structure
    consconstraint to get left-hand side for
    successpointer to store whether a valid left-hand side was returned

    Definition at line 112 of file misc_linear.c.

    References FALSE, NULL, SCIP_INVALID, SCIP_Real, SCIP_SETPPCTYPE_COVERING, SCIP_SETPPCTYPE_PACKING, SCIP_SETPPCTYPE_PARTITIONING, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetLhsLinear(), SCIPgetLhsVarbound(), SCIPgetTypeSetppc(), SCIPinfinity(), SCIPwarningMessage(), and TRUE.

    Referenced by addSlackVars(), checkTrivialInfeas(), createBlockproblem(), determineTotalNumberLinearConss(), initCurrent(), and SCIP_DECL_DIVESETGETSCORE().

    ◆ SCIPconsGetRhsExact()

    SCIP_RATIONAL * SCIPconsGetRhsExact ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Bool success 
    )

    returns the exact right-hand side of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Note
    The success pointer indicates if the individual contraint handler was able to return the involved values
    Parameters
    scipSCIP data structure
    consconstraint for which right-hand side is queried
    successpointer to store whether a valid right-hand side was returned

    Definition at line 176 of file misc_linear.c.

    References FALSE, NULL, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetRhsExactLinear(), SCIPwarningMessage(), and TRUE.

    Referenced by checkProbHasContEqs(), and determineTotalNumberLinearConss().

    ◆ SCIPconsGetLhsExact()

    SCIP_RATIONAL * SCIPconsGetLhsExact ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Bool success 
    )

    returns the exact left-hand side of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Note
    The success pointer indicates if the individual contraint handler was able to return the involved values
    Parameters
    scipSCIP data structure
    consconstraint to get left-hand side for
    successpointer to store whether a valid left-hand side was returned

    Definition at line 213 of file misc_linear.c.

    References FALSE, NULL, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetLhsExactLinear(), SCIPwarningMessage(), and TRUE.

    Referenced by checkProbHasContEqs(), and determineTotalNumberLinearConss().

    ◆ SCIPgetConsVals()

    SCIP_RETCODE SCIPgetConsVals ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Real vals,
    int  varssize,
    SCIP_Bool success 
    )

    returns the value array of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Returns
    SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
    Note
    The success pointer indicates if the individual contraint handler was able to return the involved values
    Parameters
    scipSCIP data structure
    consconstraint for which the coefficients are wanted
    valsarray to store the coefficients of the constraint
    varssizeavailable slots in vals array needed to check if the array is large enough
    successpointer to store whether the coefficients are successfully copied

    Definition at line 253 of file misc_linear.c.

    References FALSE, NULL, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetConsNVars(), SCIPgetValsLinear(), SCIPgetVbdcoefVarbound(), SCIPgetWeightsKnapsack(), SCIPgetWeightsSOS1(), SCIPgetWeightsSOS2(), SCIPwarningMessage(), and TRUE.

    Referenced by createBlockproblem(), hasUnfixedSCIndicator(), initCurrent(), roundPartition(), and SCIP_DECL_DIVESETGETSCORE().

    ◆ SCIPgetConsValsExact()

    SCIP_RETCODE SCIPgetConsValsExact ( SCIP scip,
    SCIP_CONS cons,
    SCIP_RATIONAL **  vals,
    int  varssize,
    SCIP_Bool success 
    )

    returns the value array of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Returns
    SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
    Note
    The success pointer indicates if the individual contraint handler was able to return the involved values
    Parameters
    scipSCIP data structure
    consconstraint for which the coefficients are wanted
    valsarray to store the coefficients of the constraint
    varssizeavailable slots in vals array needed to check if the array is large enough
    successpointer to store whether the coefficients are successfully copied

    Definition at line 378 of file misc_linear.c.

    References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetConsNVars(), SCIPgetValsExactLinear(), SCIPrationalSetRational(), SCIPwarningMessage(), and TRUE.

    ◆ SCIPconsGetDualfarkas()

    void SCIPconsGetDualfarkas ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Real dualfarkas,
    SCIP_Bool success 
    )

    returns the dual farkas sol of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Note
    The success pointer indicates if the individual contraint handler was able to return the dual farkas solution
    Parameters
    scipSCIP data structure
    consconstraint to get the dual farkas solution for
    dualfarkaspointer to store the dual farkas solution
    successpointer to store whether the dual farkas solution is successfully returned

    Definition at line 438 of file misc_linear.c.

    References FALSE, NULL, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetDualfarkasKnapsack(), SCIPgetDualfarkasLinear(), SCIPgetDualfarkasLogicor(), SCIPgetDualfarkasSetppc(), SCIPgetDualfarkasVarbound(), SCIPwarningMessage(), and TRUE.

    ◆ SCIPconsGetDualsol()

    void SCIPconsGetDualsol ( SCIP scip,
    SCIP_CONS cons,
    SCIP_Real dualsol,
    SCIP_Bool success 
    )

    returns the dual sol of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Note
    The success pointer indicates if the individual contraint handler was able to return the dual solution
    Parameters
    scipSCIP data structure
    consconstraint to get the dual solution for
    dualsolpointer to store the dual solution
    successpointer to store whether the dual solution is successfully returned

    Definition at line 494 of file misc_linear.c.

    References FALSE, NULL, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetDualsolKnapsack(), SCIPgetDualsolLinear(), SCIPgetDualsolLogicor(), SCIPgetDualsolSetppc(), SCIPgetDualsolVarbound(), SCIPwarningMessage(), and TRUE.

    ◆ SCIPconsGetRow()

    SCIP_ROW * SCIPconsGetRow ( SCIP scip,
    SCIP_CONS cons 
    )

    returns the row of an arbitrary SCIP constraint that can be represented as a single linear constraint or NULL of no row is available

    Parameters
    scipSCIP data structure
    consconstraint for which row is queried

    Definition at line 549 of file misc_linear.c.

    References NULL, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebugMsg, SCIPgetRowExactLinear(), SCIPgetRowKnapsack(), SCIPgetRowLinear(), SCIPgetRowLogicor(), SCIPgetRowSetppc(), and SCIPgetRowVarbound().

    Referenced by getOriginalRows(), SCIP_DECL_CONSCHECK(), and SCIPconsCreateRow().

    ◆ SCIPconsCreateRow()

    SCIP_RETCODE SCIPconsCreateRow ( SCIP scip,
    SCIP_CONS cons,
    SCIP_ROW **  row 
    )

    creates and returns the row of an arbitrary SCIP constraint that can be represented as a single linear constraint

    Parameters
    scipSCIP data structure
    consconstraint for which row is queried
    rowpointer to store the created row

    Definition at line 599 of file misc_linear.c.

    References NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_INITSOLVE, SCIP_STAGE_SOLVING, SCIPconsGetHdlr(), SCIPconsGetRow(), SCIPconshdlrGetName(), SCIPcreateRowKnapsack(), SCIPcreateRowLinear(), SCIPcreateRowLogicor(), SCIPcreateRowSetppc(), SCIPcreateRowVarbound(), SCIPgetRowKnapsack(), SCIPgetRowLinear(), SCIPgetRowLogicor(), SCIPgetRowSetppc(), SCIPgetRowVarbound(), and SCIPgetStage().

    Referenced by getReasonRow(), and SCIPanalyzeConflictCons().

    ◆ SCIPconsAddCoef()

    SCIP_RETCODE SCIPconsAddCoef ( SCIP scip,
    SCIP_CONS cons,
    SCIP_VAR var,
    SCIP_Real  val 
    )

    adds the given variable to the input constraint. If the constraint is setppc or logicor the value is ignored. If the constraint is knapsack, then the value is converted to an int. A warning is passed if the SCIP_Real is not an integer. TODO: Allow val to be a pointer.

    Parameters
    scipSCIP data structure
    consconstraint for which row is queried
    varvariable of the constraint entry
    valthe coefficient of the constraint entry

    Definition at line 675 of file misc_linear.c.

    References NULL, SCIP_CALL, SCIP_ERROR, SCIP_Longint, SCIP_OKAY, SCIPaddCoefKnapsack(), SCIPaddCoefLinear(), SCIPaddCoefLogicor(), SCIPaddCoefSetppc(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, and SCIPisIntegral().

    Referenced by addSlackVars().