xminval = (xmin == 0.0) ? 0.0 : -xmin * log(xmin);
70 SCIP_Realxmaxval = (xmax == 0.0) ? 0.0 : -xmax * log(xmax);
74assert(increasing ? xminval <= xmaxval : xminval >= xmaxval);
78 returnincreasing ? xmin : xmax;
80 returnincreasing ? xmax : xmin;
83 for( i = 0; i < 1000; ++i )
129assert(interval !=
NULL);
160extremum = exp(-1.0);
183assert(boundinf ==
SCIP_INVALID|| boundinf > childinf);
209assert(boundsup ==
SCIP_INVALID|| boundsup < childsup);
213childinf =
MAX(childinf, boundinf);
219assert(childinf <= childsup);
247assert(expr !=
NULL);
248assert(simplifiedexpr !=
NULL);
252assert(child !=
NULL);
260assert(childvalue >= 0.0);
262 if( childvalue == 0.0 || childvalue == 1.0 )
274*simplifiedexpr = expr;
289assert(targetexprdata !=
NULL);
290assert(sourceexpr !=
NULL);
293*targetexprdata =
NULL;
301assert(expr !=
NULL);
313assert(expr !=
NULL);
317assert(childexpr !=
NULL);
321assert(*expr !=
NULL);
338assert(expr !=
NULL);
345 if( childvalue < 0.0 )
350 else if( childvalue == 0.0 || childvalue == 1.0 )
357*val = -childvalue * log(childvalue);
370assert(expr !=
NULL);
371assert(childidx == 0);
376assert(child !=
NULL);
382 if( childvalue <= 0.0 )
385*val = -1.0 - log(childvalue);
396assert(expr !=
NULL);
415assert(expr !=
NULL);
416assert(localbounds !=
NULL);
417assert(globalbounds !=
NULL);
419assert(refpoint !=
NULL);
420assert(coefs !=
NULL);
421assert(constant !=
NULL);
422assert(islocal !=
NULL);
423assert(branchcand !=
NULL);
424assert(*branchcand ==
TRUE);
425assert(success !=
NULL);
437lb = localbounds[0].inf;
438ub = localbounds[0].sup;
443assert(lb >= 0.0 && ub >= 0.0);
444assert(ub - lb != 0.0);
446vallb = (lb == 0.0) ? 0.0 : -lb * log(lb);
447valub = (ub == 0.0) ? 0.0 : -ub * log(ub);
449coefs[0] = (valub - vallb) / (ub - lb);
450*constant = valub - coefs[0] * ub;
451assert(
SCIPisEQ(
scip, *constant, vallb - coefs[0] * lb));
468coefs[0] = -(1.0 + log(refpoint[0]));
469*constant = refpoint[0];
472*branchcand =
FALSE;
495assert(expr !=
NULL);
510refpointsover[0] = lb;
517 for( i = 0; i < 4; ++i )
519 if( (overest[i] && !overestimate) || (!overest[i] && (overestimate ||
SCIPisInfinity(
scip, ub))) )
529coefs[*nreturned][0] = -(1.0 + log(refpointsover[i]));
531constant[*nreturned] = refpointsover[i];
535assert(lb > 0.0 && ub >= 0.0);
536assert(ub - lb != 0.0);
538coefs[*nreturned][0] = (-ub * log(ub) + lb * log(lb)) / (ub - lb);
539constant[*nreturned] = -ub * log(ub) - coefs[*nreturned][0] * ub;
540assert(
SCIPisEQ(
scip, constant[*nreturned], -lb * log(lb) - coefs[*nreturned][0] * lb));
556assert(expr !=
NULL);
558assert(childrenbounds !=
NULL);
559assert(infeasible !=
NULL);
565childrenbounds[0] = newinterval;
574assert(expr !=
NULL);
576assert(hashkey !=
NULL);
577assert(childrenhashes !=
NULL);
580*hashkey ^= childrenhashes[0];
590assert(expr !=
NULL);
591assert(childcurv !=
NULL);
592assert(success !=
NULL);
616assert(expr !=
NULL);
617assert(result !=
NULL);
618assert(childidx == 0);
621assert(child !=
NULL);
626 if( childbounds.
sup<= brpoint )
628 else if( childbounds.
inf>= brpoint )
641assert(expr !=
NULL);
642assert(isintegral !=
NULL);
647*isintegral =
FALSE;
661exprhdlrdata =
NULL;
665evalEntropy, exprhdlrdata) );
666assert(exprhdlr !=
NULL);
690 void* ownercreatedata
696assert(expr !=
NULL);
697assert(child !=
NULL);
700assert(exprhdlr !=
NULL);
717assert(expr !=
NULL);
#define SCIP_INTERVAL_INFINITY
private functions to work with algebraic expressions
static SCIP_DECL_EXPRFREEDATA(freedataEntropy)
static SCIP_DECL_EXPRBWDIFF(bwdiffEntropy)
static SCIP_DECL_EXPRSIMPLIFY(simplifyEntropy)
static SCIP_DECL_EXPRREVERSEPROP(reversepropEntropy)
static SCIP_DECL_EXPRESTIMATE(estimateEntropy)
static SCIP_DECL_EXPRCOPYHDLR(copyhdlrEntropy)
static SCIP_DECL_EXPRHASH(hashEntropy)
static SCIP_DECL_EXPRINITESTIMATES(initestimatesEntropy)
static SCIP_DECL_EXPRINTEVAL(intevalEntropy)
static SCIP_DECL_EXPRCOPYDATA(copydataEntropy)
static SCIP_DECL_EXPRCURVATURE(curvatureEntropy)
static SCIP_RETCODE reverseProp(SCIP *scip, SCIP_INTERVAL exprinterval, SCIP_INTERVAL childinterval, SCIP_INTERVAL *interval)
static SCIP_DECL_EXPRMONOTONICITY(monotonicityEntropy)
static SCIP_DECL_EXPRINTEGRALITY(integralityEntropy)
static SCIP_Real reversePropBinarySearch(SCIP *scip, SCIP_Real xmin, SCIP_Real xmax, SCIP_Bool increasing, SCIP_Real targetval)
#define EXPRHDLR_PRECEDENCE
static SCIP_DECL_EXPREVAL(evalEntropy)
static SCIP_DECL_EXPRPARSE(parseEntropy)
handler for -x*log(x) expressions
constant value expression handler
SCIP_Bool SCIPisExprEntropy(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExprValue(SCIP *scip, SCIP_EXPR **expr, SCIP_Real value, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprEntropy(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPincludeExprhdlrEntropy(SCIP *scip)
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
void SCIPexprhdlrSetIntegrality(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINTEGRALITY((*integrality)))
void SCIPexprhdlrSetCopyFreeData(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYDATA((*copydata)), SCIP_DECL_EXPRFREEDATA((*freedata)))
void SCIPexprhdlrSetHash(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRHASH((*hash)))
void SCIPexprhdlrSetCopyFreeHdlr(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYHDLR((*copyhdlr)), SCIP_DECL_EXPRFREEHDLR((*freehdlr)))
void SCIPexprhdlrSetDiff(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRBWDIFF((*bwdiff)), SCIP_DECL_EXPRFWDIFF((*fwdiff)), SCIP_DECL_EXPRBWFWDIFF((*bwfwdiff)))
void SCIPexprhdlrSetReverseProp(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRREVERSEPROP((*reverseprop)))
void SCIPexprhdlrSetParse(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRPARSE((*parse)))
void SCIPexprhdlrSetEstimate(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINITESTIMATES((*initestimates)), SCIP_DECL_EXPRESTIMATE((*estimate)))
void SCIPexprhdlrSetMonotonicity(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRMONOTONICITY((*monotonicity)))
void SCIPexprhdlrSetIntEval(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINTEVAL((*inteval)))
void SCIPexprhdlrSetCurvature(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCURVATURE((*curvature)))
SCIP_RETCODE SCIPincludeExprhdlr(SCIP *scip, SCIP_EXPRHDLR **exprhdlr, const char *name, const char *desc, unsigned int precedence, SCIP_DECL_EXPREVAL((*eval)), SCIP_EXPRHDLRDATA *data)
SCIP_EXPRHDLR * SCIPfindExprhdlr(SCIP *scip, const char *name)
void SCIPexprhdlrSetSimplify(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRSIMPLIFY((*simplify)))
SCIP_RETCODE SCIPcreateExpr(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPRHDLR *exprhdlr, SCIP_EXPRDATA *exprdata, int nchildren, SCIP_EXPR **children, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
void SCIPexprSetData(SCIP_EXPR *expr, SCIP_EXPRDATA *exprdata)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_EXPRDATA * SCIPexprGetData(SCIP_EXPR *expr)
SCIP_RETCODE SCIPparseExpr(SCIP *scip, SCIP_EXPR **expr, const char *exprstr, const char **finalpos, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_Real SCIPgetValueExprValue(SCIP_EXPR *expr)
SCIP_Real SCIPexprGetEvalValue(SCIP_EXPR *expr)
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_INTERVAL SCIPexprGetActivity(SCIP_EXPR *expr)
void SCIPcaptureExpr(SCIP_EXPR *expr)
SCIP_RETCODE SCIPevalExprActivity(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPRHDLR * SCIPexprGetHdlr(SCIP_EXPR *expr)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
void SCIPintervalIntersect(SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
SCIP_Bool SCIPintervalIsSubsetEQ(SCIP_Real infinity, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
void SCIPintervalEntropy(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIP_DECL_EXPR_OWNERCREATE(x)
struct SCIP_ExprhdlrData SCIP_EXPRHDLRDATA
struct SCIP_ExprData SCIP_EXPRDATA
enum SCIP_Retcode SCIP_RETCODE
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4