assert(params !=
NULL);
87 returnparams[0]*point + params[1] - sin(point);
97assert(params !=
NULL);
100 returnparams[0] - cos(point);
110assert(params !=
NULL);
111assert(nparams == 1);
113 returnsin(point) + (params[0] - point) * cos(point) - sin(params[0]);
123assert(params !=
NULL);
124assert(nparams == 1);
126 return(point - params[0]) * sin(point);
143assert(lincoef !=
NULL);
144assert(linconst !=
NULL);
148 if( ub - lb >=
M_PI)
152 if( sin(lb) < 0.0 || sin(ub) < 0.0 || (sin(lb) == 0.0 && cos(lb) < 0.0) )
155*lincoef = (sin(ub) - sin(lb)) / (ub - lb);
156*linconst = sin(ub) - (*lincoef) * ub;
174assert(lincoef !=
NULL);
175assert(linconst !=
NULL);
181 if( sin(lb) > 0.0 || cos(lb) >= 0.0 )
185*linconst = sin(lb) - (*lincoef) * lb;
207assert(lincoef !=
NULL);
208assert(linconst !=
NULL);
214 if( sin(ub) > 0.0 || cos(ub) <= 0.0 )
218*linconst = sin(ub) - (*lincoef) * ub;
244assert(lincoef !=
NULL);
245assert(linconst !=
NULL);
248 if( sin(solpoint) > 0.0 )
252solpointmodpi = fmod(solpoint,
M_PI);
253 if( solpoint < 0.0 )
254solpointmodpi +=
M_PI;
261params[0] = cos(solpoint);
262params[1] = sin(solpoint) - params[0] * solpoint;
267startingpoints[0] = solpoint + (
M_PI- solpointmodpi) + M_PI_2;
268startingpoints[1] = startingpoints[0] + M_PI_2;
269startingpoints[2] = startingpoints[1] + M_PI_2;
273startingpoints[0] = solpoint - solpointmodpi - M_PI_2;
274startingpoints[1] = startingpoints[0] - M_PI_2;
275startingpoints[2] = startingpoints[1] - M_PI_2;
279 for( i = 0; i < 3; ++i )
289 if( intersection ==
SCIP_INVALID|| (intersection >= lb && intersection <= ub) )
292*lincoef = params[0];
293*linconst = params[1];
316assert(lincoef !=
NULL);
317assert(linconst !=
NULL);
324lbmodpi = fmod(lb,
M_PI);
335startingpoint = lb + 1.25*
M_PI- lbmodpi;
344startingpoint = lb + 1.25*
M_PI;
345 else if( sin(lb) < 0.0 )
346startingpoint = lb + 2.25*
M_PI- lbmodpi;
348startingpoint = lb + 1.25*
M_PI- lbmodpi;
365 if(
SCIPisLE(
scip, sin(0.5 * (ub + lb)), sin(lb) + 0.5*(sin(ub) - sin(lb))) )
373*lincoef = (sin(tangentpoint) - sin(lb)) / (tangentpoint - lb);
374*linconst = sin(lb) - (*lincoef) * lb;
377 if( *lincoef >= cos(lb) )
380 SCIPdebugMsg(
scip,
"left secant: %g + %g*x <= sin(x) on [%g,%g]\n", *linconst, *lincoef, lb, ub);
403assert(lincoef !=
NULL);
404assert(linconst !=
NULL);
411ubmodpi = fmod(ub,
M_PI);
422startingpoint = ub - M_PI_4 - ubmodpi;
431startingpoint = ub - 1.25*
M_PI;
432 else if( sin(ub) < 0.0 )
433startingpoint = ub - 1.25*
M_PI- ubmodpi;
435startingpoint = ub - M_PI_4 - ubmodpi;
452 if(
SCIPisLE(
scip, sin(0.5 * (ub + lb)), sin(lb) + 0.5*(sin(ub) - sin(lb))) )
460*lincoef = (sin(tangentpoint) - sin(ub)) / (tangentpoint - ub);
461*linconst = sin(ub) - (*lincoef) * ub;
464 if( *lincoef <= cos(lb) )
501 intk = (int) ceil((newinf -
a) / (2.0*
M_PI));
502newinf =
a+ 2.0*
M_PI* k;
511 intk = (int) ceil((newinf +
a) / (2.0*
M_PI) - 0.5);
512newinf =
M_PI* (2.0*k + 1.0) -
a;
515assert(newinf >= childbounds.
inf);
528 intk = (int) ceil((newsup -
a) / (2.0*
M_PI)) - 1;
529newsup =
a+ 2.0*
M_PI* k;
538 intk = (int) ceil((newsup +
a) / (2.0*
M_PI) - 0.5) - 1;
539newsup =
M_PI* (2.0*k + 1.0) -
a;
542assert(newsup <= childbounds.
sup);
548 if( newinf <= newsup )
583assert(expr !=
NULL);
603 if( !underestimate )
630 if( !underestimate )
635(*linconst) += (*lincoef) * M_PI_2;
663assert(expr !=
NULL);
690 if( ! underestimate )
717 for( i = 0; i < *nreturned; ++i )
719 if( ! underestimate )
724constant[i] += coefs[i][0] * M_PI_2;
745 if( (ub - lb <=
M_PI) && (lbsin * ubsin >= 0.0) )
748 if( lbsin == 0.0 && ubsin == 0.0 )
755 else if( lbcos * ubcos >= 0.0 )
807assert(expr !=
NULL);
808assert(simplifiedexpr !=
NULL);
812assert(child !=
NULL);
822*simplifiedexpr = expr;
837assert(expr !=
NULL);
841assert(childexpr !=
NULL);
845assert(*expr !=
NULL);
859assert(expr !=
NULL);
874assert(expr !=
NULL);
875assert(childidx == 0);
879assert(child !=
NULL);
896assert(expr !=
NULL);
900assert(child !=
NULL);
918assert(expr !=
NULL);
920assert(childidx == 0);
923assert(child !=
NULL);
938assert(expr !=
NULL);
958childlb = bounds[0].inf;
959childub = bounds[0].sup;
976assert(expr !=
NULL);
979assert(coefs !=
NULL);
980assert(constant !=
NULL);
981assert(islocal !=
NULL);
982assert(branchcand !=
NULL);
983assert(*branchcand ==
TRUE);
984assert(success !=
NULL);
987localbounds[0].sup, ! overestimate);
998assert(expr !=
NULL);
1014assert(expr !=
NULL);
1016assert(hashkey !=
NULL);
1017assert(childrenhashes !=
NULL);
1020*hashkey ^= childrenhashes[0];
1033assert(expr !=
NULL);
1034assert(childcurv !=
NULL);
1035assert(success !=
NULL);
1039assert(child !=
NULL);
1067assert(expr !=
NULL);
1068assert(result !=
NULL);
1069assert(childidx == 0);
1084k = (int)floor(inf/
M_PI- 0.5);
1117assert(expr !=
NULL);
1118assert(simplifiedexpr !=
NULL);
1122assert(child !=
NULL);
1132*simplifiedexpr = expr;
1147assert(expr !=
NULL);
1151assert(childexpr !=
NULL);
1155assert(*expr !=
NULL);
1169assert(expr !=
NULL);
1184assert(expr !=
NULL);
1185assert(childidx == 0);
1189assert(child !=
NULL);
1203assert(expr !=
NULL);
1223childlb = bounds[0].inf;
1224childub = bounds[0].sup;
1241assert(expr !=
NULL);
1244assert(coefs !=
NULL);
1245assert(constant !=
NULL);
1246assert(islocal !=
NULL);
1247assert(branchcand !=
NULL);
1248assert(*branchcand ==
TRUE);
1249assert(success !=
NULL);
1252localbounds[0].sup, ! overestimate);
1265assert(expr !=
NULL);
1272newbounds = childrenbounds[0];
1282*infeasible =
TRUE;
1297assert(expr !=
NULL);
1299assert(hashkey !=
NULL);
1300assert(childrenhashes !=
NULL);
1303*hashkey ^= childrenhashes[0];
1316assert(expr !=
NULL);
1318assert(childcurv !=
NULL);
1319assert(success !=
NULL);
1323assert(child !=
NULL);
1351assert(expr !=
NULL);
1352assert(result !=
NULL);
1353assert(childidx == 0);
1368k = (int)floor(inf/
M_PI);
1388assert(exprhdlr !=
NULL);
1413assert(exprhdlr !=
NULL);
1435 void* ownercreatedata
1438assert(expr !=
NULL);
1439assert(child !=
NULL);
1455 void* ownercreatedata
1458assert(expr !=
NULL);
1459assert(child !=
NULL);
1474assert(expr !=
NULL);
1485assert(expr !=
NULL);
#define SCIP_INTERVAL_INFINITY
static SCIP_Bool computeEstimatorsTrig(SCIP *scip, SCIP_EXPR *expr, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real refpoint, SCIP_Real childlb, SCIP_Real childub, SCIP_Bool underestimate)
static SCIP_DECL_EXPRINITESTIMATES(initEstimatesSin)
static SCIP_Bool computeRightSecantSin(SCIP *scip, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real lb, SCIP_Real ub)
#define SINEXPRHDLR_PRECEDENCE
static SCIP_DECL_EXPRBWFWDIFF(bwfwdiffSin)
static SCIP_RETCODE computeRevPropIntervalSin(SCIP *scip, SCIP_INTERVAL parentbounds, SCIP_INTERVAL childbounds, SCIP_INTERVAL *newbounds)
#define SINEXPRHDLR_HASHKEY
static SCIP_DECL_EXPRBWDIFF(bwdiffSin)
static SCIP_EXPRCURV computeCurvatureSin(SCIP_EXPRCURV childcurvature, SCIP_Real lb, SCIP_Real ub)
#define COSEXPRHDLR_HASHKEY
static SCIP_DECL_EXPRHASH(hashSin)
static SCIP_DECL_EXPREVAL(evalSin)
static SCIP_DECL_EXPRESTIMATE(estimateSin)
static SCIP_DECL_EXPRCOPYHDLR(copyhdlrSin)
static SCIP_DECL_NEWTONEVAL(function1)
#define NEWTON_NITERATIONS
static SCIP_DECL_EXPRSIMPLIFY(simplifySin)
static SCIP_Bool computeLeftSecantSin(SCIP *scip, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real lb, SCIP_Real ub)
static SCIP_DECL_EXPRMONOTONICITY(monotonicitySin)
static SCIP_RETCODE computeInitialCutsTrig(SCIP *scip, SCIP_EXPR *expr, SCIP_Real childlb, SCIP_Real childub, SCIP_Bool underestimate, SCIP_Real **coefs, SCIP_Real *constant, int *nreturned)
static SCIP_Bool computeSecantSin(SCIP *scip, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real lb, SCIP_Real ub)
#define COSEXPRHDLR_PRECEDENCE
static SCIP_Bool computeRightTangentSin(SCIP *scip, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real ub)
static SCIP_DECL_EXPRFWDIFF(fwdiffSin)
static SCIP_Bool computeLeftTangentSin(SCIP *scip, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real lb)
static SCIP_DECL_EXPRPARSE(parseSin)
static SCIP_DECL_EXPRREVERSEPROP(reversepropSin)
static SCIP_DECL_EXPRCURVATURE(curvatureSin)
static SCIP_DECL_EXPRINTEVAL(intevalSin)
static SCIP_Bool computeSolTangentSin(SCIP *scip, SCIP_Real *lincoef, SCIP_Real *linconst, SCIP_Real lb, SCIP_Real ub, SCIP_Real solpoint)
handler for sin expressions
constant value expression handler
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 SCIPisExprCos(SCIP *scip, SCIP_EXPR *expr)
SCIP_Bool SCIPisExprSin(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 SCIPincludeExprhdlrCos(SCIP *scip)
SCIP_RETCODE SCIPincludeExprhdlrSin(SCIP *scip)
SCIP_Real SCIPcalcRootNewton(SCIP_DECL_NEWTONEVAL((*function)), SCIP_DECL_NEWTONEVAL((*derivative)), SCIP_Real *params, int nparams, SCIP_Real x, SCIP_Real eps, int k)
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
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)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_Real SCIPexprGetDot(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 SCIPintervalCos(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSin(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
void SCIPintervalAddScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIP_DECL_EXPR_OWNERCREATE(x)
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