Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

type and macro definitions related to algebraic expressions

Author
Ksenia Bestuzheva
Benjamin Mueller
Felipe Serrano
Stefan Vigerske

This file defines the interface for expression handlers.

Definition in file type_expr.h.

#include "scip/def.h"
#include "scip/intervalarith.h"
#include "scip/type_scip.h"
#include "scip/type_sol.h"
#include "scip/type_var.h"
#include "scip/type_tree.h"
#include "scip/type_retcode.h"

Go to the source code of this file.

Data Structures

union  SCIP_EXPRITER_USERDATA
 

Macros

#define SCIP_DECL_EXPR_INTEVALVAR(x)
 
#define SCIP_DECL_EXPR_MAPEXPR(x)
 

Typedefs

typedef struct SCIP_ExprData SCIP_EXPRDATA
 
typedef struct SCIP_Expr SCIP_EXPR
 
typedef struct SYM_ExprData SYM_EXPRDATA
 

Enumerations

enum  SCIP_EXPRCURV {
  SCIP_EXPRCURV_UNKNOWN = 0,
  SCIP_EXPRCURV_CONVEX = 1,
  SCIP_EXPRCURV_CONCAVE = 2,
  SCIP_EXPRCURV_LINEAR = SCIP_EXPRCURV_CONVEX | SCIP_EXPRCURV_CONCAVE
}
 
enum  SCIP_MONOTONE {
  SCIP_MONOTONE_UNKNOWN = 0,
  SCIP_MONOTONE_INC = 1,
  SCIP_MONOTONE_DEC = 2,
  SCIP_MONOTONE_CONST = SCIP_MONOTONE_INC | SCIP_MONOTONE_DEC
}
 

Expression Owner

#define SCIP_DECL_EXPR_OWNERFREE(x)
 
#define SCIP_DECL_EXPR_OWNERPRINT(x)
 
#define SCIP_DECL_EXPR_OWNEREVALACTIVITY(x)
 
#define SCIP_DECL_EXPR_OWNERCREATE(x)
 
typedef struct SCIP_Expr_OwnerData SCIP_EXPR_OWNERDATA
 

Expression Handler

#define SCIP_EXPR_MAXINITESTIMATES   10
 
#define SCIP_DECL_EXPRCOPYHDLR(x)
 
#define SCIP_DECL_EXPRFREEHDLR(x)
 
#define SCIP_DECL_EXPRCOPYDATA(x)
 
#define SCIP_DECL_EXPRFREEDATA(x)
 
#define SCIP_DECL_EXPRPRINT(x)
 
#define SCIP_DECL_EXPRPARSE(x)
 
#define SCIP_DECL_EXPRCURVATURE(x)
 
#define SCIP_DECL_EXPRMONOTONICITY(x)
 
#define SCIP_DECL_EXPRINTEGRALITY(x)
 
#define SCIP_DECL_EXPRHASH(x)
 
#define SCIP_DECL_EXPRCOMPARE(x)
 
#define SCIP_DECL_EXPREVAL(x)
 
#define SCIP_DECL_EXPRBWDIFF(x)
 
#define SCIP_DECL_EXPRFWDIFF(x)
 
#define SCIP_DECL_EXPRBWFWDIFF(x)
 
#define SCIP_DECL_EXPRINTEVAL(x)
 
#define SCIP_DECL_EXPRESTIMATE(x)
 
#define SCIP_DECL_EXPRINITESTIMATES(x)
 
#define SCIP_DECL_EXPRSIMPLIFY(x)
 
#define SCIP_DECL_EXPRREVERSEPROP(x)
 
#define SCIP_DECL_EXPRGETSYMDATA(x)
 
typedef struct SCIP_Exprhdlr SCIP_EXPRHDLR
 
typedef struct SCIP_ExprhdlrData SCIP_EXPRHDLRDATA
 

Expression iterator

#define SCIP_EXPRITER_MAXNACTIVE   5
 
#define SCIP_EXPRITER_ENTEREXPR   1u
 
#define SCIP_EXPRITER_VISITINGCHILD   2u
 
#define SCIP_EXPRITER_VISITEDCHILD   4u
 
#define SCIP_EXPRITER_LEAVEEXPR   8u
 
#define SCIP_EXPRITER_ALLSTAGES   (SCIP_EXPRITER_ENTEREXPR | SCIP_EXPRITER_VISITINGCHILD | SCIP_EXPRITER_VISITEDCHILD | SCIP_EXPRITER_LEAVEEXPR)
 
enum  SCIP_EXPRITER_TYPE {
  SCIP_EXPRITER_RTOPOLOGIC,
  SCIP_EXPRITER_BFS,
  SCIP_EXPRITER_DFS
}
 
typedef unsigned int SCIP_EXPRITER_STAGE
 
typedef struct SCIP_ExprIterData SCIP_EXPRITERDATA
 
typedef struct SCIP_ExprIter SCIP_EXPRITER
 

Expression printing

#define SCIP_EXPRPRINT_EXPRSTRING   0x1u
 
#define SCIP_EXPRPRINT_EXPRHDLR   0x2u
 
#define SCIP_EXPRPRINT_NUSES   0x4u
 
#define SCIP_EXPRPRINT_EVALVALUE   0x8u
 
#define SCIP_EXPRPRINT_EVALTAG   0x18u
 
#define SCIP_EXPRPRINT_ACTIVITY   0x20u
 
#define SCIP_EXPRPRINT_ACTIVITYTAG   0x60u
 
#define SCIP_EXPRPRINT_OWNER   0x80u
 
#define SCIP_EXPRPRINT_ALL   SCIP_EXPRPRINT_EXPRSTRING | SCIP_EXPRPRINT_EXPRHDLR | SCIP_EXPRPRINT_NUSES | SCIP_EXPRPRINT_EVALTAG | SCIP_EXPRPRINT_ACTIVITYTAG | SCIP_EXPRPRINT_OWNER
 
typedef unsigned int SCIP_EXPRPRINT_WHAT
 
typedef struct SCIP_ExprPrintData SCIP_EXPRPRINTDATA
 

Macro Definition Documentation

◆ SCIP_DECL_EXPR_OWNERFREE

#define SCIP_DECL_EXPR_OWNERFREE (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_EXPR_OWNERDATA** ownerdata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
struct SCIP_Expr_OwnerData SCIP_EXPR_OWNERDATA
Definition: type_expr.h:80

callback for freeing ownerdata of expression

This callback is called while an expression is freed. The callback shall free the ownerdata, if any. That is, the callback is also called on expressions that only store this callback, but no ownerdata.

Note, that the children of the expression have already been released when this callback is called. The callback must not try to access the expressions children.

Parameters
[in]scipSCIP main data structure
[in]exprthe expression which is freed
[in]ownerdatathe ownerdata stored in the expression

Definition at line 95 of file type_expr.h.

◆ SCIP_DECL_EXPR_OWNERPRINT

#define SCIP_DECL_EXPR_OWNERPRINT (   x)
Value:
SCIP* scip, \
FILE* file, \
SCIP_EXPR* expr, \
SCIP_EXPR_OWNERDATA* ownerdata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
struct SCIP_Expr_OwnerData SCIP_EXPR_OWNERDATA
Definition: type_expr.h:80

callback for printing ownerdata of expression

This callback is called when printing details on an expression, e.g., SCIPdismantleExpr().

Parameters
[in]scipSCIP main data structure
[in]exprthe expression which is printed
[in]filefile to print to, or NULL for stdout
[in]ownerdatathe ownerdata stored in the expression

Definition at line 109 of file type_expr.h.

◆ SCIP_DECL_EXPR_OWNEREVALACTIVITY

#define SCIP_DECL_EXPR_OWNEREVALACTIVITY (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_EXPR_OWNERDATA* ownerdata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
struct SCIP_Expr_OwnerData SCIP_EXPR_OWNERDATA
Definition: type_expr.h:80

callback for owner-specific activity evaluation

This callback is called when evaluating the activity of an expression, e.g., SCIPevalActivity(). The callback should ensure that activity is updated, if required, by calling SCIPsetActivity(). The callback can use the activitytag in the expression to recognize whether it needs to become active.

Parameters
[in]scipSCIP main data structure
[in]exprthe expression for which activity should be updated
[in]ownerdatathe ownerdata stored in the expression

Definition at line 125 of file type_expr.h.

◆ SCIP_DECL_EXPR_OWNERCREATE

#define SCIP_DECL_EXPR_OWNERCREATE (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_EXPR_OWNERDATA** ownerdata, \
SCIP_DECL_EXPR_OWNERFREE((**ownerfree)), \
SCIP_DECL_EXPR_OWNERPRINT((**ownerprint)), \
SCIP_DECL_EXPR_OWNEREVALACTIVITY((**ownerevalactivity)), \
void* ownercreatedata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
struct SCIP_Expr_OwnerData SCIP_EXPR_OWNERDATA
Definition: type_expr.h:80
#define SCIP_DECL_EXPR_OWNERFREE(x)
Definition: type_expr.h:95
#define SCIP_DECL_EXPR_OWNEREVALACTIVITY(x)
Definition: type_expr.h:125
#define SCIP_DECL_EXPR_OWNERPRINT(x)
Definition: type_expr.h:109

callback for creating ownerdata of expression

This callback is called when an expression has been created. It can create data which is then stored in the expression.

Parameters
[in]scipSCIP main data structure
[in]exprthe expression that has been created
[out]ownerdatabuffer to store ownerdata that shall be stored in expression (can be NULL, initialized to NULL)
[out]ownerfreebuffer to store function to be called to free ownerdata when expression is freed (can be NULL, initialized to NULL)
[out]ownerprintbuffer to store function to be called to print ownerdata (can be NULL, initialized to NULL)
[out]ownerevalactivitybuffer to store function to be called to evaluate activity (can be NULL, initialized to NULL)
[in]ownercreatedatadata that has been passed on by future owner of expression that can be used to create ownerdata

Definition at line 143 of file type_expr.h.

Referenced by SCIP_DECL_VERTEXPOLYFUN().

◆ SCIP_DECL_EXPR_INTEVALVAR

#define SCIP_DECL_EXPR_INTEVALVAR (   x)
Value:
SCIP* scip, \
SCIP_VAR* var, \
void* intevalvardata \
)
SCIP_VAR ** x
Definition: circlepacking.c:63

callback that returns bounds for a given variable as used in interval evaluation

Implements a relaxation scheme for variable bounds and translates between different infinity values. Returns an interval that contains the current variable bounds, but might be (slightly) larger.

Parameters
[in]scipSCIP main data structure
[in]varvariable for which to obtain bounds
[in]intevalvardatadata that belongs to this callback

Definition at line 163 of file type_expr.h.

◆ SCIP_DECL_EXPR_MAPEXPR

#define SCIP_DECL_EXPR_MAPEXPR (   x)
Value:
SCIP* targetscip, \
SCIP_EXPR** targetexpr, \
SCIP* sourcescip, \
SCIP_EXPR* sourceexpr, \
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), \
void* ownercreatedata, \
void* mapexprdata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:143

expression mapping callback for expression copy callback

The method maps an expression (in a source SCIP instance) to an expression (in a target SCIP instance) and captures the target expression.

Parameters
[in]targetsciptarget SCIP main data structure
[out]targetexprpointer to store the mapped expression, or NULL if expression shall be copied; initialized to NULL
[in]sourcescipsource SCIP main data structure
[in]sourceexprexpression to be mapped
[in]ownercreatecallback to call when creating a new expression
[in]ownercreatedatadata for ownercreate callback
[in]mapexprdatadata of mapexpr callback

Definition at line 182 of file type_expr.h.

◆ SCIP_EXPR_MAXINITESTIMATES

#define SCIP_EXPR_MAXINITESTIMATES   10

the maximal number of estimates an expression handler can return in the INITESTIMATES callback

Definition at line 198 of file type_expr.h.

Referenced by SCIP_DECL_EXPRINITESTIMATES(), and SCIP_DECL_NLHDLRINITSEPA().

◆ SCIP_DECL_EXPRCOPYHDLR

#define SCIP_DECL_EXPRCOPYHDLR (   x)
Value:
SCIP* scip, \
SCIP_EXPRHDLR* sourceexprhdlr)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression handler copy callback

The method should include the expression handler into a given SCIP instance. It is usually called when doing a copy of SCIP.

Parameters
[in]sciptarget SCIP main data structure where to include expression handler
[in]sourceexprhdlrexpression handler in source SCIP

See also EXPRCOPYHDLR.

Definition at line 210 of file type_expr.h.

◆ SCIP_DECL_EXPRFREEHDLR

#define SCIP_DECL_EXPRFREEHDLR (   x)
Value:
SCIP* scip, \
SCIP_EXPRHDLR* exprhdlr, \
SCIP_EXPRHDLRDATA** exprhdlrdata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
struct SCIP_ExprhdlrData SCIP_EXPRHDLRDATA
Definition: type_expr.h:195

expression handler free callback

Frees the data of an expression handler.

Parameters
[in]scipSCIP main data structure
[in]exprhdlrexpression handler
[in]exprhdlrdataexpression handler data to be freed

See also EXPRFREEHDLR.

Definition at line 224 of file type_expr.h.

◆ SCIP_DECL_EXPRCOPYDATA

#define SCIP_DECL_EXPRCOPYDATA (   x)
Value:
SCIP* targetscip, \
SCIP_EXPRHDLR* targetexprhdlr, \
SCIP_EXPRDATA** targetexprdata, \
SCIP* sourcescip, \
SCIP_EXPR* sourceexpr)
struct SCIP_ExprData SCIP_EXPRDATA
Definition: type_expr.h:54
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression data copy callback

Copies the data of an expression.

This method is called when creating copies of an expression within the same or between different SCIP instances. It is given the source expression, which data shall be copied. It expects that *targetexprdata will be set. This data will then be used to create a new expression.

This callback must be implemented for expressions that have data.

Parameters
[in]targetsciptarget SCIP main data structure
[in]targetexprhdlrexpression handler in target SCIP
[out]targetexprdatapointer to store the copied expression data
[in]sourcescipsource SCIP main data structure
[in]sourceexprexpression in source SCIP which data is to be copied

See also EXPRCOPYDATA.

Definition at line 249 of file type_expr.h.

◆ SCIP_DECL_EXPRFREEDATA

#define SCIP_DECL_EXPRFREEDATA (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression data free callback

Frees the data of an expression. Shall call SCIPexprSetData(expr, NULL).

This callback must be implemented for expressions that have data.

Parameters
[in]scipSCIP main data structure
[in]exprthe expression which data to be freed

See also EXPRFREEDATA.

Definition at line 268 of file type_expr.h.

◆ SCIP_DECL_EXPRPRINT

#define SCIP_DECL_EXPRPRINT (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
int currentchild, \
unsigned int parentprecedence, \
FILE* file)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
unsigned int SCIP_EXPRITER_STAGE
Definition: type_expr.h:699

expression print callback

Prints an expression. It is called while DFS-iterating over the expression at different stages, that is, when the expression is visited the first time, before each child of the expression is visited, after each child of the expression has been visited, and when the iterator leaves the expression for its parent. See also expression iteration docu.

Parameters
[in]scipSCIP main data structure
[in]exprexpression which data is to be printed
[in]stagestage of expression iteration
[in]currentchildindex of current child if in stage visitingchild or visitedchild
[in]parentprecedenceprecedence of parent
[in]filethe file to print to

See also EXPRPRINT.

Definition at line 289 of file type_expr.h.

◆ SCIP_DECL_EXPRPARSE

#define SCIP_DECL_EXPRPARSE (   x)
Value:
SCIP* scip, \
SCIP_EXPRHDLR* exprhdlr, \
const char* string, \
const char** endstring, \
SCIP_EXPR** expr, \
SCIP_Bool* success, \
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), \
void* ownercreatedata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Bool
Definition: def.h:91
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:143

expression parse callback

Parses an expression. It is called when parsing an expression and an operator with the expr handler name is found.

Parameters
[in]scipSCIP main data structure
[in]stringstring containing expression to be parse
[in]ownercreatefunction to call to create ownerdata
[in]ownercreatedatadata to pass to ownercreate
[out]endstringbuffer to store the position of string after parsing
[out]exprbuffer to store the parsed expression
[out]successbuffer to store whether the parsing was successful or not

See also EXPRPARSE.

Definition at line 312 of file type_expr.h.

◆ SCIP_DECL_EXPRCURVATURE

#define SCIP_DECL_EXPRCURVATURE (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_EXPRCURV exprcurvature, \
SCIP_Bool* success, \
SCIP_EXPRCURV* childcurv)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Bool
Definition: def.h:91
SCIP_EXPRCURV
Definition: type_expr.h:60

expression curvature detection callback

The method returns whether an expression can have a desired curvature under conditions on the curvature of the children. That is, the method shall return TRUE in success and requirements on the curvature for each child which will suffice for this expression to be convex (or concave, or linear, as specified by caller) w.r.t. the current activities of all children. It can return "unknown" for a child's curvature if its curvature does not matter (though that's rarely the case).

Parameters
[in]scipSCIP main data structure
[in]exprexpression to check the curvature for
[in]exprcurvaturedesired curvature of this expression
[out]successbuffer to store whether the desired curvature was obtained
[out]childcurvarray to store required curvature for each child

See also EXPRCURVATURE.

Definition at line 340 of file type_expr.h.

◆ SCIP_DECL_EXPRMONOTONICITY

#define SCIP_DECL_EXPRMONOTONICITY (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
int childidx, \
SCIP_MONOTONE* result)
SCIP_MONOTONE
Definition: type_expr.h:69
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression monotonicity detection callback

The method computes the monotonicity of an expression with respect to a given child.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to check the monotonicity for
[in]childidxindex of the considered child expression
[out]resultbuffer to store the monotonicity

See also EXPRMONOTONICITY.

Definition at line 358 of file type_expr.h.

◆ SCIP_DECL_EXPRINTEGRALITY

#define SCIP_DECL_EXPRINTEGRALITY (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_Bool* isintegral)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Bool
Definition: def.h:91

expression integrality detection callback

The method checks whether an expression evaluates always to an integral value in a feasible solution. Usually uses SCIPexprIsIntegral() to check whether children evaluate to an integral value.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to check the integrality for
[out]isintegralbuffer to store whether expr is integral

See also EXPRINTEGRALITY.

Definition at line 375 of file type_expr.h.

◆ SCIP_DECL_EXPRHASH

#define SCIP_DECL_EXPRHASH (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
unsigned int* hashkey, \
unsigned int* childrenhashes)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression hash callback

The method hashes an expression by taking the hashes of its children into account.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to be hashed
[out]hashkeybuffer to store the hash value
[in]childrenhashesarray with hash values of children

See also EXPRHASH.

Definition at line 391 of file type_expr.h.

◆ SCIP_DECL_EXPRCOMPARE

#define SCIP_DECL_EXPRCOMPARE (   x)
Value:
int x (\
SCIP* scip, \
SCIP_EXPR* expr1, \
SCIP_EXPR* expr2)
SCIP_VAR ** x
Definition: circlepacking.c:63

expression compare callback

the method receives two expressions, expr1 and expr2. Must return -1 if expr1 < expr2, or 0 if expr1 = expr2, or 1 if expr1 > expr2.

Parameters
[in]scipSCIP main data structure
[in]expr1first expression in comparison
[in]expr2second expression in comparison

See also EXPRCOMPARE.

Definition at line 410 of file type_expr.h.

◆ SCIP_DECL_EXPREVAL

#define SCIP_DECL_EXPREVAL (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_Real* val, \
SCIP_SOL* sol)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Real
Definition: def.h:173

expression (point-) evaluation callback

The method evaluates an expression by taking the values of its children into account.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to be evaluated
[out]valbuffer where to store value
[in]solsolution that is evaluated (can be NULL)

See also EXPREVAL.

Definition at line 426 of file type_expr.h.

◆ SCIP_DECL_EXPRBWDIFF

#define SCIP_DECL_EXPRBWDIFF (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
int childidx, \
SCIP_Real* val)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Real
Definition: def.h:173

backward derivative evaluation callback

The method should compute the partial derivative of expr w.r.t. its child at childidx. That is, it should return

\[ \frac{\partial \text{expr}}{\partial \text{child}_{\text{childidx}}} \]

See Differentiation methods in scip_expr.h for more details.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to be differentiated
[in]childidxindex of the child
[out]valbuffer to store the partial derivative w.r.t. the childidx-th children

See also EXPRBWDIFF.

Definition at line 449 of file type_expr.h.

◆ SCIP_DECL_EXPRFWDIFF

#define SCIP_DECL_EXPRFWDIFF (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_Real* dot, \
SCIP_SOL* direction)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Real
Definition: def.h:173

forward derivative evaluation callback

The method should evaluate the directional derivative of expr. The expr should be interpreted as an operator \( \text{expr}(c_1, \ldots, c_n) \), where \( c_1, \ldots, c_n \) are the children of the expr. The directional derivative is evaluated at the point SCIPexprGetEvalValue \((c_1)\), ..., SCIPexprGetEvalValue \((c_n)\) in the direction given by direction.

This method should return

\[ \sum_{i = 1}^n \frac{\partial \text{expr}}{\partial c_i} D_u c_i, \]

where \( u \) is the direction and \( D_u c_i \) is the directional derivative of the i-th child, which can be accessed via SCIPexprGetDot().

See Differentiation methods in scip_expr.h for more details.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to be differentiated
[out]dotbuffer to store derivative value
[in]directiondirection of the derivative (useful only for var expressions)

See also EXPRFWDIFF.

Definition at line 480 of file type_expr.h.

◆ SCIP_DECL_EXPRBWFWDIFF

#define SCIP_DECL_EXPRBWFWDIFF (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
int childidx, \
SCIP_Real* bardot, \
SCIP_SOL* direction)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Real
Definition: def.h:173

derivative evaluation callback for Hessian directions (backward over forward)

The method computes the total derivative, w.r.t. its children, of the partial derivative of expr w.r.t. childidx. Equivalently, it computes the partial derivative w.r.t. childidx of the total derivative.

The expr should be interpreted as an operator \( \text{expr}(c_1, \ldots, c_n) \), where \( c_1, \ldots, c_n \) are the children of the expr. The directional derivative is evaluated at the point SCIPexprGetEvalValue \((c_1)\), ..., SCIPexprGetEvalValue \((c_n)\) in the direction given by direction.

This method should return

\[ \sum_{i = 1}^n \frac{\partial^2 \text{expr}}{\partial c_i} \partial c_{\text{childidx}} D_u c_i, \]

where \( u \) is the direction and \( D_u c_i \) is the directional derivative of the i-th child, which can be accessed via SCIPexprGetDot().

Thus, if \( n = 1 \) (i.e. if expr represents an univariate operator), the method should return

\[ \text{expr}^{\prime \prime}(\text{SCIPexprGetEvalValue}(c)) D_u c. \]

See Differentiation methods in scip_expr.h for more details.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to be evaluated
[in]childidxindex of the child
[out]bardotbuffer to store derivative value
[in]directiondirection of the derivative (useful only for var expressions)

See also EXPRBWFWDIFF.

Definition at line 520 of file type_expr.h.

◆ SCIP_DECL_EXPRINTEVAL

#define SCIP_DECL_EXPRINTEVAL (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_INTERVAL* interval, \
SCIP_DECL_EXPR_INTEVALVAR((*intevalvar)), \
void* intevalvardata)
#define SCIP_DECL_EXPR_INTEVALVAR(x)
Definition: type_expr.h:163
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression (interval-) evaluation callback

The method evaluates an expression by taking the intervals of its children into account.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to be evaluated
[out]intervalbuffer where to store interval
[in]intevalvarcallback to be called when interval evaluating a variable
[in]intevalvardatadata to be passed to intevalvar callback

See also EXPRINTEVAL.

Definition at line 539 of file type_expr.h.

◆ SCIP_DECL_EXPRESTIMATE

#define SCIP_DECL_EXPRESTIMATE (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_INTERVAL* localbounds, \
SCIP_INTERVAL* globalbounds, \
SCIP_Real* refpoint, \
SCIP_Bool overestimate, \
SCIP_Real targetvalue, \
SCIP_Real* coefs, \
SCIP_Real* constant, \
SCIP_Bool* islocal, \
SCIP_Bool* success, \
SCIP_Bool* branchcand)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173

expression under/overestimation callback

The method tries to compute a linear under- or overestimator that is as tight as possible at a given point. The estimator must be valid w.r.t. the bounds given by localbounds. If the value of the estimator in the reference point is smaller (larger) than targetvalue when underestimating (overestimating), then no estimator needs to be computed. Note, that targetvalue can be infinite if any estimator will be accepted. If successful, it shall store the coefficient of the i-th child in entry coefs[i] and the constant part in constant. If the estimator is also valid w.r.t. the bounds given by globalbounds, then *islocal shall be set to FALSE. The callback shall indicate in branchcand[i] whether branching on the i-th child would improve the estimator. It can be assumed that branchcand[i] has been initialized to TRUE for all children.

Parameters
[in]scipSCIP main data structure
[in]exprexpression
[in]localboundscurrent bounds for children
[in]globalboundsglobal bounds for children
[in]refpointvalues for children in the reference point where to estimate
[in]overestimatewhether the expression needs to be over- or underestimated
[in]targetvaluea value that the estimator shall exceed, can be +/-infinity
[out]coefsarray to store coefficients of estimator
[out]constantbuffer to store constant part of estimator
[out]islocalbuffer to store whether estimator is valid locally only
[out]successbuffer to indicate whether an estimator could be computed
[out]branchcandarray to indicate which children to consider for branching

See also EXPRESTIMATE.

Definition at line 575 of file type_expr.h.

◆ SCIP_DECL_EXPRINITESTIMATES

#define SCIP_DECL_EXPRINITESTIMATES (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_INTERVAL* bounds, \
SCIP_Bool overestimate, \
SCIP_Real constant[SCIP_EXPR_MAXINITESTIMATES], \
int* nreturned)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173
#define SCIP_EXPR_MAXINITESTIMATES
Definition: type_expr.h:198

expression initial under/overestimation callback

The method tries to compute a few linear under- or overestimator that approximate the behavior of the expression. The estimator must be valid w.r.t. the bounds given by bounds. These estimators may be used to initialize a linear relaxation. The callback shall return the number of computed estimators in nreturned, store the coefficient of the i-th child for the j-th estimator in entry coefs[j][i], and store the constant part for the j-th estimator in constant[j].

Parameters
[in]scipSCIP main data structure
[in]exprexpression
[in]boundsbounds for children
[in]overestimatewhether the expression shall be overestimated or underestimated
[out]coefsbuffer to store coefficients of computed estimators
[out]constantbuffer to store constant of computed estimators
[out]nreturnedbuffer to store number of estimators that have been computed

See also EXPRINITESTIMATES.

Definition at line 608 of file type_expr.h.

◆ SCIP_DECL_EXPRSIMPLIFY

#define SCIP_DECL_EXPRSIMPLIFY (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_EXPR** simplifiedexpr, \
SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), \
void* ownercreatedata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:143

expression simplify callback

The method shall try to simplify an expression by applying algebraic transformations and return the simplified expression. It can assume that children have been simplified. If no simplification is possible, then shall set *simplifiedexpr to expr and capture *simplifiedexpr.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to simplify
[in]ownercreatefunction to call to create ownerdata
[in]ownercreatedatadata to pass to ownercreate
[out]simplifiedexprbuffer to store the simplified expression

See also EXPRSIMPLIFY and SCIPsimplifyExpr().

Definition at line 632 of file type_expr.h.

◆ SCIP_DECL_EXPRREVERSEPROP

#define SCIP_DECL_EXPRREVERSEPROP (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SCIP_INTERVAL bounds, \
SCIP_INTERVAL* childrenbounds, \
SCIP_Bool* infeasible)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63
#define SCIP_Bool
Definition: def.h:91

expression callback for reverse propagation

The method propagates given bounds over the children of an expression. Shall compute an interval overestimate on

\[ \{ x_i : \text{expr}(c_1,\ldots,c_{i-1},x_i,c_{i+1},\ldots,c_n) \in \text{bounds} \} \]

for each child i and store it in childrenbounds[i]. The initial intervals \(c_i, i=1,\ldots,n,\) are given by childrenbounds, too.

Parameters
[in]scipSCIP main data structure
[in]exprexpression
[in]boundsthe bounds on the expression that should be propagated
[in,out]childrenboundsarray to store computed bounds for children, initialized with current activity
[out]infeasiblebuffer to store whether a children bounds were propagated to an empty interval

See also EXPRREVERSEPROP.

Definition at line 657 of file type_expr.h.

◆ SCIP_DECL_EXPRGETSYMDATA

#define SCIP_DECL_EXPRGETSYMDATA (   x)
Value:
SCIP* scip, \
SCIP_EXPR* expr, \
SYM_EXPRDATA** symdata)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_VAR ** x
Definition: circlepacking.c:63

expression callback to get information for symmetry detection

The method returns information regarding constants and coefficients used in an expression.

Parameters
[in]scipSCIP main data structure
[in]exprexpression to retrieve information from
[out]exprdatabuffer to store retrieved data

Definition at line 672 of file type_expr.h.

◆ SCIP_EXPRITER_MAXNACTIVE

#define SCIP_EXPRITER_MAXNACTIVE   5

maximal number of iterators that can be active on an expression graph concurrently

How often an expression graph iteration can be started within an active iteration, plus one.

Definition at line 689 of file type_expr.h.

Referenced by doBfsNext(), SCIPexpriterGetNext(), and SCIPexpriterInit().

◆ SCIP_EXPRITER_ENTEREXPR

#define SCIP_EXPRITER_ENTEREXPR   1u

◆ SCIP_EXPRITER_VISITINGCHILD

◆ SCIP_EXPRITER_VISITEDCHILD

◆ SCIP_EXPRITER_LEAVEEXPR

◆ SCIP_EXPRITER_ALLSTAGES

Definition at line 696 of file type_expr.h.

Referenced by printExpr(), and SCIPexprPrint().

◆ SCIP_EXPRPRINT_EXPRSTRING

#define SCIP_EXPRPRINT_EXPRSTRING   0x1u

print the math. function that the expression represents (e.g., "c0+c1")

Definition at line 728 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_EXPRHDLR

#define SCIP_EXPRPRINT_EXPRHDLR   0x2u

print expression handler name

Definition at line 729 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_NUSES

#define SCIP_EXPRPRINT_NUSES   0x4u

print number of uses (reference counting)

Definition at line 730 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_EVALVALUE

#define SCIP_EXPRPRINT_EVALVALUE   0x8u

print evaluation value

Definition at line 731 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_EVALTAG

#define SCIP_EXPRPRINT_EVALTAG   0x18u

print evaluation value and tag

Definition at line 732 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_ACTIVITY

#define SCIP_EXPRPRINT_ACTIVITY   0x20u

print activity value

Definition at line 733 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_ACTIVITYTAG

#define SCIP_EXPRPRINT_ACTIVITYTAG   0x60u

print activity value and corresponding tag

Definition at line 734 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_OWNER

#define SCIP_EXPRPRINT_OWNER   0x80u

print ownerdata

Definition at line 735 of file type_expr.h.

Referenced by SCIPexprPrintDot().

◆ SCIP_EXPRPRINT_ALL

print everything

Definition at line 738 of file type_expr.h.

Referenced by SCIPshowExpr().

Typedef Documentation

◆ SCIP_EXPRDATA

typedef struct SCIP_ExprData SCIP_EXPRDATA

expression data, e.g., coefficients

Definition at line 54 of file type_expr.h.

◆ SCIP_EXPR

typedef struct SCIP_Expr SCIP_EXPR

expression

Definition at line 55 of file type_expr.h.

◆ SYM_EXPRDATA

typedef struct SYM_ExprData SYM_EXPRDATA

(additional) data used to encode an expression, which is not encoded as another expression

Definition at line 56 of file type_expr.h.

◆ SCIP_EXPR_OWNERDATA

typedef struct SCIP_Expr_OwnerData SCIP_EXPR_OWNERDATA

data stored by expression owner (e.g., conshdlr, nlp) in expression

Definition at line 80 of file type_expr.h.

◆ SCIP_EXPRHDLR

typedef struct SCIP_Exprhdlr SCIP_EXPRHDLR

expression handler

Definition at line 194 of file type_expr.h.

◆ SCIP_EXPRHDLRDATA

typedef struct SCIP_ExprhdlrData SCIP_EXPRHDLRDATA

expression handler data, e.g., SCIP parameter values

Definition at line 195 of file type_expr.h.

◆ SCIP_EXPRITER_STAGE

typedef unsigned int SCIP_EXPRITER_STAGE

stage of DFS iterator

Definition at line 699 of file type_expr.h.

◆ SCIP_EXPRITERDATA

typedef struct SCIP_ExprIterData SCIP_EXPRITERDATA

expression iterator data of a specific expression

Definition at line 719 of file type_expr.h.

◆ SCIP_EXPRITER

typedef struct SCIP_ExprIter SCIP_EXPRITER

expression iterator

Definition at line 720 of file type_expr.h.

◆ SCIP_EXPRPRINT_WHAT

typedef unsigned int SCIP_EXPRPRINT_WHAT

exprprint bitflags

Definition at line 740 of file type_expr.h.

◆ SCIP_EXPRPRINTDATA

typedef struct SCIP_ExprPrintData SCIP_EXPRPRINTDATA

data when printing an expression

Definition at line 741 of file type_expr.h.

Enumeration Type Documentation

◆ SCIP_EXPRCURV

curvature types

Enumerator
SCIP_EXPRCURV_UNKNOWN 

unknown or indefinite curvature

SCIP_EXPRCURV_CONVEX 

convex

SCIP_EXPRCURV_CONCAVE 

concave

SCIP_EXPRCURV_LINEAR 

linear = convex and concave

Definition at line 60 of file type_expr.h.

◆ SCIP_MONOTONE

monotonicity

Enumerator
SCIP_MONOTONE_UNKNOWN 

unknown or non-monotone

SCIP_MONOTONE_INC 

increasing

SCIP_MONOTONE_DEC 

decreasing

SCIP_MONOTONE_CONST 

constant = increasing and decreasing

Definition at line 69 of file type_expr.h.

◆ SCIP_EXPRITER_TYPE

mode for expression iterator

Enumerator
SCIP_EXPRITER_RTOPOLOGIC 

reverse topological order

SCIP_EXPRITER_BFS 

breadth-first search

SCIP_EXPRITER_DFS 

depth-first search

Definition at line 712 of file type_expr.h.