Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods and files provided by the default expressions handlers of SCIP

Modules

 Inclusion methods
 methods to include specific expression handlers into SCIP
 

Files

file  expr_abs.h
 absolute expression handler
 
file  expr_entropy.h
 handler for -x*log(x) expressions
 
file  expr_exp.h
 exponential expression handler
 
file  expr_log.h
 logarithm expression handler
 
file  expr_pow.h
 power and signed power expression handlers
 
file  expr_product.h
 product expression handler
 
file  expr_sum.h
 sum expression handler
 
file  expr_trig.h
 handler for sin expressions
 
file  expr_value.h
 constant value expression handler
 
file  expr_var.h
 variable expression handler
 
file  expr_varidx.h
 handler for variable index expressions
 

Absolute value expression

This expression handler provides the absolute-value function, that is,

\[ x \mapsto |x|. \]

SCIP_RETCODE SCIPcreateExprAbs (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprAbs (SCIP *scip, SCIP_EXPR *expr)
 

Entropy value expression

This expression handler provides the entropy function, that is,

\[ x \mapsto \begin{cases} -x\log(x), & \mathrm{if} x > 0,\\ 0, & \mathrm{if} x = 0, \\ \mathrm{undefined}, & \mathrm{else}. \end{cases} \]

SCIP_RETCODE SCIPcreateExprEntropy (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprEntropy (SCIP *scip, SCIP_EXPR *expr)
 

Exponential value expression

This expression handler provides the exponential function, that is,

\[ x \mapsto \exp(x). \]

SCIP_RETCODE SCIPcreateExprExp (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprExp (SCIP *scip, SCIP_EXPR *expr)
 

Logarithm expression

This expression handler provides the natural logarithm function, that is,

\[ x \mapsto \ln(x). \]

SCIP_RETCODE SCIPcreateExprLog (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprLog (SCIP *scip, SCIP_EXPR *expr)
 

Power and signed power expression

These expression handler provide the power function, that is,

\[ x \mapsto \begin{cases} x^e & \textrm{if}\; x \geq 0\; \textrm{or}\; e\in\mathbb{Z}, \\ \textrm{undefined}, & \textrm{otherwise}. \end{cases} \]

and the signed power function, that is,

\[ x \mapsto \textrm{sign}(e) |x|^e \]

for some exponent \(e\).

SCIP_RETCODE SCIPcreateExprPow (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_RETCODE SCIPcreateExprSignpower (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprSignpower (SCIP *scip, SCIP_EXPR *expr)
 

Product expression

This expression handler provides the product function, that is,

\[ x \mapsto c\,\prod_{i=1}^n x_i \]

for some constant coefficient c.

SCIP_RETCODE SCIPcreateExprProduct (SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real coefficient, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 

Sum expression

This expression handler provides the sum function, that is,

\[ x \mapsto c + \sum_{i=1}^n a_i x_i \]

for some constant c and constant coefficients \(a_i\).

SCIP_RETCODE SCIPcreateExprSum (SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real *coefficients, SCIP_Real constant, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
void SCIPsetConstantExprSum (SCIP_EXPR *expr, SCIP_Real constant)
 
SCIP_RETCODE SCIPappendExprSumExpr (SCIP *scip, SCIP_EXPR *expr, SCIP_EXPR *child, SCIP_Real childcoef)
 
void SCIPmultiplyByConstantExprSum (SCIP_EXPR *expr, SCIP_Real constant)
 

Sine and Cosine expression

These expression handler provide the sine and cosine functions, that is,

\[ x \mapsto \sin(x) \]

and

\[ x \mapsto \cos(x). \]

SCIP_RETCODE SCIPcreateExprSin (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_RETCODE SCIPcreateExprCos (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprSin (SCIP *scip, SCIP_EXPR *expr)
 
SCIP_Bool SCIPisExprCos (SCIP *scip, SCIP_EXPR *expr)
 

Constant value expression

This expression handler handles a constant value. It cannot have children.

SCIP_RETCODE SCIPcreateExprValue (SCIP *scip, SCIP_EXPR **expr, SCIP_Real value, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 

SCIP variable expression

This expression handler handles a SCIP variables. It cannot have children.

SCIP_RETCODE SCIPcreateExprVar (SCIP *scip, SCIP_EXPR **expr, SCIP_VAR *var, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 

Index variable expression

This expression handler handles a variable that is given by a variable index. It cannot have children.

This expression handler is used for expressions that are passed to a NLP solver via the NLPI.

SCIP_RETCODE SCIPcreateExprVaridx (SCIP *scip, SCIP_EXPR **expr, int varidx, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprVaridx (SCIP *scip, SCIP_EXPR *expr)
 
int SCIPgetIndexExprVaridx (SCIP_EXPR *expr)
 
void SCIPsetIndexExprVaridx (SCIP_EXPR *expr, int newindex)
 

Function Documentation

◆ SCIPcreateExprAbs()

SCIP_RETCODE SCIPcreateExprAbs ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates an absolute value expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childsingle child
ownercreatedatadata to pass to ownercreate

Definition at line 519 of file expr_abs.c.

References EXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), and SCIPfindExprhdlr().

Referenced by mergeProductExprlist(), AMPLProblemHandler::OnUnary(), readExpression(), SCIP_DECL_EXPRPARSE(), and SCIP_DECL_EXPRSIMPLIFY().

◆ SCIPisExprAbs()

SCIP_Bool SCIPisExprAbs ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of abs-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 537 of file expr_abs.c.

References EXPRHDLR_NAME, NULL, SCIPexprGetHdlr(), and SCIPexprhdlrGetName().

Referenced by printExpr().

◆ SCIPcreateExprEntropy()

SCIP_RETCODE SCIPcreateExprEntropy ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates an entropy expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childchild expression
ownercreatedatadata to pass to ownercreate

Definition at line 674 of file expr_entropy.c.

References EXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), and SCIPfindExprhdlr().

Referenced by enforceSP11(), and SCIP_DECL_EXPRPARSE().

◆ SCIPisExprEntropy()

SCIP_Bool SCIPisExprEntropy ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of entropy-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 701 of file expr_entropy.c.

References EXPRHDLR_NAME, NULL, SCIPexprGetHdlr(), and SCIPexprhdlrGetName().

◆ SCIPcreateExprExp()

SCIP_RETCODE SCIPcreateExprExp ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates an exponential expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childsingle child
ownercreatedatadata to pass to ownercreate

Definition at line 500 of file expr_exp.c.

References EXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), and SCIPfindExprhdlr().

Referenced by mergeProductExprlist(), AMPLProblemHandler::OnBinary(), AMPLProblemHandler::OnUnary(), readExpression(), SCIP_DECL_EXPRPARSE(), SCIP_DECL_EXPRSIMPLIFY(), and simplifyTerm().

◆ SCIPisExprExp()

SCIP_Bool SCIPisExprExp ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of exp-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 518 of file expr_exp.c.

References EXPRHDLR_NAME, NULL, SCIPexprGetHdlr(), and SCIPexprhdlrGetName().

Referenced by eval(), mergeProductExprlist(), SCIP_DECL_EXPRSIMPLIFY(), SCIPexprintCompile(), and simplifyTerm().

◆ SCIPcreateExprLog()

SCIP_RETCODE SCIPcreateExprLog ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates a logarithmic expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childsingle child
ownercreatedatadata to pass to ownercreate

Definition at line 620 of file expr_log.c.

References EXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), and SCIPfindExprhdlr().

Referenced by AMPLProblemHandler::OnBinary(), AMPLProblemHandler::OnUnary(), readExpression(), and SCIP_DECL_EXPRPARSE().

◆ SCIPisExprLog()

SCIP_Bool SCIPisExprLog ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of log-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 638 of file expr_log.c.

References EXPRHDLR_NAME, NULL, SCIPexprGetHdlr(), and SCIPexprhdlrGetName().

Referenced by eval(), and SCIPexprintCompile().

◆ SCIPcreateExprPow()

SCIP_RETCODE SCIPcreateExprPow ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_Real  exponent,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

◆ SCIPcreateExprSignpower()

SCIP_RETCODE SCIPcreateExprSignpower ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_Real  exponent,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates a signpower expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childsingle child
exponentexponent of the power expression
ownercreatedatadata to pass to ownercreate

Definition at line 3190 of file expr_pow.c.

References createData(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), SCIPfindExprhdlr(), SCIPisExprSignpower(), and SIGNPOWEXPRHDLR_NAME.

Referenced by mergeProductExprlist(), readExpression(), SCIP_DECL_EXPRPARSE(), SCIP_DECL_EXPRSIMPLIFY(), SCIPcreateConsBasicSignpowerNonlinear(), SCIPcreateExprPow(), and setupProblem().

◆ SCIPisExprSignpower()

SCIP_Bool SCIPisExprSignpower ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of signpower-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 3215 of file expr_pow.c.

References NULL, SCIPaddSquareLinearization(), SCIPexprGetHdlr(), SCIPexprhdlrGetName(), and SIGNPOWEXPRHDLR_NAME.

Referenced by eval(), exprIsNonSmooth(), mergeProductExprlist(), SCIPcreateExprSignpower(), and SCIPexprintCompile().

◆ SCIPcreateExprProduct()

SCIP_RETCODE SCIPcreateExprProduct ( SCIP scip,
SCIP_EXPR **  expr,
int  nchildren,
SCIP_EXPR **  children,
SCIP_Real  coefficient,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates a product expression

! [SnippetCreateExprProduct]

! [SnippetCreateExprProduct]

Parameters
scipSCIP data structure
exprpointer where to store expression
nchildrennumber of children
childrenchildren
coefficientconstant coefficient of product
ownercreatedatadata to pass to ownercreate

Definition at line 2112 of file expr_product.c.

References SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPcreateExpr(), and SCIPgetExprhdlrProduct().

Referenced by addNlrow(), createExprProductFromExprlist(), AMPLProblemHandler::OnBinary(), parseTerm(), readExpression(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_EXPRSIMPLIFY(), SCIPaddBilinTermQuadratic(), SCIPcreateExprMonomial(), SCIPcreateExprQuadratic(), setupProblem(), and simplifyTerm().

◆ SCIPcreateExprSum()

SCIP_RETCODE SCIPcreateExprSum ( SCIP scip,
SCIP_EXPR **  expr,
int  nchildren,
SCIP_EXPR **  children,
SCIP_Real coefficients,
SCIP_Real  constant,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

◆ SCIPsetConstantExprSum()

void SCIPsetConstantExprSum ( SCIP_EXPR expr,
SCIP_Real  constant 
)

sets the constant of a summation expression

Parameters
exprsum expression
constantconstant

Definition at line 1091 of file expr_sum.c.

References NULL, and SCIPexprGetData().

Referenced by readObjective(), and simplifyTerm().

◆ SCIPappendExprSumExpr()

SCIP_RETCODE SCIPappendExprSumExpr ( SCIP scip,
SCIP_EXPR expr,
SCIP_EXPR child,
SCIP_Real  childcoef 
)

◆ SCIPmultiplyByConstantExprSum()

void SCIPmultiplyByConstantExprSum ( SCIP_EXPR expr,
SCIP_Real  constant 
)

multiplies given sum expression by a constant

Parameters
exprsum expression
constantconstant that multiplies sum expression

Definition at line 1136 of file expr_sum.c.

References NULL, SCIPexprGetData(), and SCIPexprGetNChildren().

◆ SCIPcreateExprSin()

SCIP_RETCODE SCIPcreateExprSin ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates a sin expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childsingle child
ownercreatedatadata to pass to ownercreate

Definition at line 1421 of file expr_trig.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), SCIPfindExprhdlr(), and SINEXPRHDLR_NAME.

Referenced by AMPLProblemHandler::OnUnary(), readExpression(), and SCIP_DECL_EXPRPARSE().

◆ SCIPcreateExprCos()

SCIP_RETCODE SCIPcreateExprCos ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_EXPR child,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates a cos expression

Parameters
scipSCIP data structure
exprpointer where to store expression
childsingle child
ownercreatedatadata to pass to ownercreate

Definition at line 1441 of file expr_trig.c.

References COSEXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExpr(), and SCIPfindExprhdlr().

Referenced by AMPLProblemHandler::OnUnary(), readExpression(), and SCIP_DECL_EXPRPARSE().

◆ SCIPisExprSin()

SCIP_Bool SCIPisExprSin ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of sine-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 1460 of file expr_trig.c.

References NULL, SCIPexprGetHdlr(), SCIPexprhdlrGetName(), and SINEXPRHDLR_NAME.

◆ SCIPisExprCos()

SCIP_Bool SCIPisExprCos ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is of cosine-type

Parameters
scipSCIP data structure
exprexpression

Definition at line 1471 of file expr_trig.c.

References COSEXPRHDLR_NAME, NULL, SCIPexprGetHdlr(), and SCIPexprhdlrGetName().

◆ SCIPcreateExprValue()

SCIP_RETCODE SCIPcreateExprValue ( SCIP scip,
SCIP_EXPR **  expr,
SCIP_Real  value,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates constant value expression

Parameters
scipSCIP data structure
exprpointer where to store expression
valuevalue to be stored
ownercreatedatadata to pass to ownercreate

Definition at line 261 of file expr_value.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPcreateExpr(), SCIPgetExprhdlrValue(), and SCIPisFinite.

Referenced by enforceSP10(), getBinaryProductExpr(), AMPLProblemHandler::OnHeader(), AMPLProblemHandler::OnNumber(), parseBase(), readExpression(), SCIP_DECL_EXPRSIMPLIFY(), and SCIPcreateExprMonomial().

◆ SCIPcreateExprVar()

◆ SCIPcreateExprVaridx()

SCIP_RETCODE SCIPcreateExprVaridx ( SCIP scip,
SCIP_EXPR **  expr,
int  varidx,
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate))  ,
void *  ownercreatedata 
)

creates a variable index expression

Parameters
scipSCIP data structure
exprpointer where to store expression
varidxvariable index to represent
ownercreatedatadata to pass to ownercreate

Definition at line 210 of file expr_varidx.c.

References EXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPABORT, SCIPcreateExpr(), SCIPerrorMessage, and SCIPfindExprhdlr().

Referenced by SCIP_DECL_EXPR_MAPEXPR(), and setQuadraticObj().

◆ SCIPisExprVaridx()

SCIP_Bool SCIPisExprVaridx ( SCIP scip,
SCIP_EXPR expr 
)

indicates whether expression is varidx expression

Parameters
scipSCIP data structure
exprexpression

Definition at line 242 of file expr_varidx.c.

References EXPRHDLR_NAME, FALSE, NULL, SCIPexprGetHdlr(), SCIPexprGetNChildren(), and SCIPexprhdlrGetName().

Referenced by eval(), SCIPcreateNlpiProblemFromNlRows(), SCIPexprintCompile(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleGetJacobianSparsity(), and updateVariableCounts().

◆ SCIPgetIndexExprVaridx()

int SCIPgetIndexExprVaridx ( SCIP_EXPR expr)

◆ SCIPsetIndexExprVaridx()

void SCIPsetIndexExprVaridx ( SCIP_EXPR expr,
int  newindex 
)

sets the index stored in a varidx expression

Parameters
exprvarindex expression
newindexnew index

Definition at line 268 of file expr_varidx.c.

References EXPRHDLR_NAME, NULL, SCIPexprGetHdlr(), SCIPexprhdlrGetName(), and SCIPexprSetData().

Referenced by SCIPnlpiOracleDelVarSet().