A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://scip.zib.de/doc/html/expr__trig_8c_source.php below:

SCIP Doxygen Documentation: expr_trig.c Source File

51#define _USE_MATH_DEFINES 59#define SINEXPRHDLR_NAME "sin" 60#define SINEXPRHDLR_DESC "sine expression" 61#define SINEXPRHDLR_PRECEDENCE 91000 62#define SINEXPRHDLR_HASHKEY SCIPcalcFibHash(82457.0) 64#define COSEXPRHDLR_NAME "cos" 65#define COSEXPRHDLR_DESC "cosine expression" 66#define COSEXPRHDLR_PRECEDENCE 92000 67#define COSEXPRHDLR_HASHKEY SCIPcalcFibHash(82463.0) 69#define MAXCHILDABSVAL 1e+6 70#define NEWTON_NITERATIONS 100 71#define NEWTON_PRECISION 1e-12 84

assert(params !=

NULL

);

87 return

params[0]*point + params[1] - sin(point);

97

assert(params !=

NULL

);

100 return

params[0] - cos(point);

110

assert(params !=

NULL

);

111

assert(nparams == 1);

113 return

sin(point) + (params[0] - point) * cos(point) - sin(params[0]);

123

assert(params !=

NULL

);

124

assert(nparams == 1);

126 return

(point - params[0]) * sin(point);

143

assert(lincoef !=

NULL

);

144

assert(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;

174

assert(lincoef !=

NULL

);

175

assert(linconst !=

NULL

);

181 if

( sin(lb) > 0.0 || cos(lb) >= 0.0 )

185

*linconst = sin(lb) - (*lincoef) * lb;

207

assert(lincoef !=

NULL

);

208

assert(linconst !=

NULL

);

214 if

( sin(ub) > 0.0 || cos(ub) <= 0.0 )

218

*linconst = sin(ub) - (*lincoef) * ub;

244

assert(lincoef !=

NULL

);

245

assert(linconst !=

NULL

);

248 if

( sin(solpoint) > 0.0 )

252

solpointmodpi = fmod(solpoint,

M_PI

);

253 if

( solpoint < 0.0 )

254

solpointmodpi +=

M_PI

;

261

params[0] = cos(solpoint);

262

params[1] = sin(solpoint) - params[0] * solpoint;

267

startingpoints[0] = solpoint + (

M_PI

- solpointmodpi) + M_PI_2;

268

startingpoints[1] = startingpoints[0] + M_PI_2;

269

startingpoints[2] = startingpoints[1] + M_PI_2;

273

startingpoints[0] = solpoint - solpointmodpi - M_PI_2;

274

startingpoints[1] = startingpoints[0] - M_PI_2;

275

startingpoints[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];

316

assert(lincoef !=

NULL

);

317

assert(linconst !=

NULL

);

324

lbmodpi = fmod(lb,

M_PI

);

335

startingpoint = lb + 1.25*

M_PI

- lbmodpi;

344

startingpoint = lb + 1.25*

M_PI

;

345 else if

( sin(lb) < 0.0 )

346

startingpoint = lb + 2.25*

M_PI

- lbmodpi;

348

startingpoint = 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);

403

assert(lincoef !=

NULL

);

404

assert(linconst !=

NULL

);

411

ubmodpi = fmod(ub,

M_PI

);

422

startingpoint = ub - M_PI_4 - ubmodpi;

431

startingpoint = ub - 1.25*

M_PI

;

432 else if

( sin(ub) < 0.0 )

433

startingpoint = ub - 1.25*

M_PI

- ubmodpi;

435

startingpoint = 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 int

k = (int) ceil((newinf -

a

) / (2.0*

M_PI

));

502

newinf =

a

+ 2.0*

M_PI

* k;

511 int

k = (int) ceil((newinf +

a

) / (2.0*

M_PI

) - 0.5);

512

newinf =

M_PI

* (2.0*k + 1.0) -

a

;

515

assert(newinf >= childbounds.

inf

);

528 int

k = (int) ceil((newsup -

a

) / (2.0*

M_PI

)) - 1;

529

newsup =

a

+ 2.0*

M_PI

* k;

538 int

k = (int) ceil((newsup +

a

) / (2.0*

M_PI

) - 0.5) - 1;

539

newsup =

M_PI

* (2.0*k + 1.0) -

a

;

542

assert(newsup <= childbounds.

sup

);

548 if

( newinf <= newsup )

583

assert(expr !=

NULL

);

603 if

( !underestimate )

630 if

( !underestimate )

635

(*linconst) += (*lincoef) * M_PI_2;

663

assert(expr !=

NULL

);

690 if

( ! underestimate )

717 for

( i = 0; i < *nreturned; ++i )

719 if

( ! underestimate )

724

constant[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 )

807

assert(expr !=

NULL

);

808

assert(simplifiedexpr !=

NULL

);

812

assert(child !=

NULL

);

822

*simplifiedexpr = expr;

837

assert(expr !=

NULL

);

841

assert(childexpr !=

NULL

);

845

assert(*expr !=

NULL

);

859

assert(expr !=

NULL

);

874

assert(expr !=

NULL

);

875

assert(childidx == 0);

879

assert(child !=

NULL

);

896

assert(expr !=

NULL

);

900

assert(child !=

NULL

);

918

assert(expr !=

NULL

);

920

assert(childidx == 0);

923

assert(child !=

NULL

);

938

assert(expr !=

NULL

);

958

childlb = bounds[0].inf;

959

childub = bounds[0].sup;

976

assert(expr !=

NULL

);

979

assert(coefs !=

NULL

);

980

assert(constant !=

NULL

);

981

assert(islocal !=

NULL

);

982

assert(branchcand !=

NULL

);

983

assert(*branchcand ==

TRUE

);

984

assert(success !=

NULL

);

987

localbounds[0].sup, ! overestimate);

998

assert(expr !=

NULL

);

1014

assert(expr !=

NULL

);

1016

assert(hashkey !=

NULL

);

1017

assert(childrenhashes !=

NULL

);

1020

*hashkey ^= childrenhashes[0];

1033

assert(expr !=

NULL

);

1034

assert(childcurv !=

NULL

);

1035

assert(success !=

NULL

);

1039

assert(child !=

NULL

);

1067

assert(expr !=

NULL

);

1068

assert(result !=

NULL

);

1069

assert(childidx == 0);

1084

k = (int)floor(inf/

M_PI

- 0.5);

1117

assert(expr !=

NULL

);

1118

assert(simplifiedexpr !=

NULL

);

1122

assert(child !=

NULL

);

1132

*simplifiedexpr = expr;

1147

assert(expr !=

NULL

);

1151

assert(childexpr !=

NULL

);

1155

assert(*expr !=

NULL

);

1169

assert(expr !=

NULL

);

1184

assert(expr !=

NULL

);

1185

assert(childidx == 0);

1189

assert(child !=

NULL

);

1203

assert(expr !=

NULL

);

1223

childlb = bounds[0].inf;

1224

childub = bounds[0].sup;

1241

assert(expr !=

NULL

);

1244

assert(coefs !=

NULL

);

1245

assert(constant !=

NULL

);

1246

assert(islocal !=

NULL

);

1247

assert(branchcand !=

NULL

);

1248

assert(*branchcand ==

TRUE

);

1249

assert(success !=

NULL

);

1252

localbounds[0].sup, ! overestimate);

1265

assert(expr !=

NULL

);

1272

newbounds = childrenbounds[0];

1282

*infeasible =

TRUE

;

1297

assert(expr !=

NULL

);

1299

assert(hashkey !=

NULL

);

1300

assert(childrenhashes !=

NULL

);

1303

*hashkey ^= childrenhashes[0];

1316

assert(expr !=

NULL

);

1318

assert(childcurv !=

NULL

);

1319

assert(success !=

NULL

);

1323

assert(child !=

NULL

);

1351

assert(expr !=

NULL

);

1352

assert(result !=

NULL

);

1353

assert(childidx == 0);

1368

k = (int)floor(inf/

M_PI

);

1388

assert(exprhdlr !=

NULL

);

1413

assert(exprhdlr !=

NULL

);

1435 void

* ownercreatedata

1438

assert(expr !=

NULL

);

1439

assert(child !=

NULL

);

1455 void

* ownercreatedata

1458

assert(expr !=

NULL

);

1459

assert(child !=

NULL

);

1474

assert(expr !=

NULL

);

1485

assert(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