assert(pipinput !=
NULL);
159 SCIPerrorMessage(
"Syntax error in line %d: %s ('%s')\n", pipinput->linenumber, msg, pipinput->token);
160 if( pipinput->linebuf[strlen(pipinput->linebuf)-1] ==
'\n')
168(void)
SCIPsnprintf(formatstr, 256,
" %%%ds\n", pipinput->linepos);
171pipinput->haserror =
TRUE;
180assert(pipinput !=
NULL);
182 returnpipinput->haserror;
213assert(hasdot !=
NULL);
214assert(exptype !=
NULL);
216 if( isdigit((
unsigned char)c) )
218 else if( (*exptype ==
PIP_EXP_NONE) && !(*hasdot) && (c ==
'.') && isdigit((
unsigned char)nextc) )
223 else if( !firstchar && (*exptype ==
PIP_EXP_NONE) && (c ==
'e'|| c ==
'E') )
225 if( nextc ==
'+'|| nextc ==
'-')
230 else if( isdigit((
unsigned char)nextc) )
236 else if( (*exptype ==
PIP_EXP_SIGNED) && (c ==
'+'|| c ==
'-') )
257assert(pipinput !=
NULL);
263pipinput->linepos = 0;
265 if(
SCIPfgets(pipinput->linebuf, (
int)
sizeof(pipinput->linebuf), pipinput->file) ==
NULL)
267pipinput->linenumber++;
271pipinput->haserror =
TRUE;
281commentstart = strchr(pipinput->linebuf,
commentchars[i]);
282 if( commentstart !=
NULL)
284*commentstart =
'\0';
285*(commentstart+1) =
'\0';
302*pointer1 = *pointer2;
318assert(pipinput !=
NULL);
322 if( pipinput->npushedtokens > 0 )
324 swapPointers(&pipinput->token, &pipinput->pushedtokens[pipinput->npushedtokens-1]);
325pipinput->npushedtokens--;
326 SCIPdebugMsg(
scip,
"(line %d) read token again: '%s'\n", pipinput->linenumber, pipinput->token);
331buf = pipinput->linebuf;
334 if( buf[pipinput->linepos] ==
'\0')
342assert(pipinput->linepos == 0);
353 if(
isValueChar(buf[pipinput->linepos], buf[pipinput->linepos+1],
TRUE, &hasdot, &exptype) )
361pipinput->token[tokenlen] = buf[pipinput->linepos];
365 while(
isValueChar(buf[pipinput->linepos], buf[pipinput->linepos+1],
FALSE, &hasdot, &exptype) );
374pipinput->token[tokenlen] = buf[pipinput->linepos];
377 if( tokenlen == 1 &&
isTokenChar(pipinput->token[0]) )
386&& (pipinput->token[tokenlen-1] ==
'<'|| pipinput->token[tokenlen-1] ==
'>'|| pipinput->token[tokenlen-1] ==
'=')
387&& buf[pipinput->linepos] ==
'=')
391 else if( pipinput->token[tokenlen-1] ==
'='&& (buf[pipinput->linepos] ==
'<'|| buf[pipinput->linepos] ==
'>') )
393pipinput->token[tokenlen-1] = buf[pipinput->linepos];
398pipinput->token[tokenlen] =
'\0';
400 SCIPdebugMsg(
scip,
"(line %d) read token: '%s'\n", pipinput->linenumber, pipinput->token);
411assert(pipinput !=
NULL);
414 swapPointers(&pipinput->pushedtokens[pipinput->npushedtokens], &pipinput->token);
415pipinput->npushedtokens++;
424assert(pipinput !=
NULL);
427 swapPointers(&pipinput->pushedtokens[pipinput->npushedtokens], &pipinput->tokenbuf);
428pipinput->npushedtokens++;
437assert(pipinput !=
NULL);
451assert(pipinput !=
NULL);
460iscolon = (strcmp(pipinput->token,
":") == 0);
475 SCIPdebugMsg(
scip,
"(line %d) new section: OBJECTIVE\n", pipinput->linenumber);
485 SCIPdebugMsg(
scip,
"(line %d) new section: OBJECTIVE\n", pipinput->linenumber);
499 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", pipinput->linenumber);
517 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", pipinput->linenumber);
531 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", pipinput->linenumber);
539 SCIPdebugMsg(
scip,
"(line %d) new section: BOUNDS\n", pipinput->linenumber);
551 SCIPdebugMsg(
scip,
"(line %d) new section: GENERALS\n", pipinput->linenumber);
560 SCIPdebugMsg(
scip,
"(line %d) new section: BINARIES\n", pipinput->linenumber);
567 SCIPdebugMsg(
scip,
"(line %d) new section: END\n", pipinput->linenumber);
582assert(pipinput !=
NULL);
583assert(sign !=
NULL);
584assert(*sign == +1 || *sign == -1);
586 if( pipinput->token[1] ==
'\0')
588 if( *pipinput->token ==
'+')
590 else if( *pipinput->token ==
'-')
608assert(pipinput !=
NULL);
609assert(value !=
NULL);
621val = strtod(pipinput->token, &endptr);
622 if( endptr != pipinput->token && *endptr ==
'\0')
639assert(pipinput !=
NULL);
641 if( strcmp(pipinput->token,
"<") == 0 )
647 else if( strcmp(pipinput->token,
">") == 0 )
653 else if( strcmp(pipinput->token,
"=") == 0 )
673assert(name !=
NULL);
674assert(var !=
NULL);
693 if( created !=
NULL)
696 else if( created !=
NULL)
709assert(pipinput !=
NULL);
736assert(monomials !=
NULL);
737assert(monomialscoef !=
NULL);
738assert(monomialssize !=
NULL);
739assert(*monomials !=
NULL|| *monomialssize == 0);
741 if( minnmonomials <= *monomialssize )
746 if( *monomials !=
NULL)
754 if( *monomialscoef !=
NULL)
762*monomialssize = newsize;
780assert(vars !=
NULL);
781assert(exponents !=
NULL);
782assert(factorssize !=
NULL);
783assert(*exponents !=
NULL|| *factorssize == 0);
784assert(*vars !=
NULL|| *factorssize == 0);
786 if( minnfactors <= *factorssize )
791 if( *exponents !=
NULL)
801*factorssize = newsize;
839assert(pipinput !=
NULL);
840assert(name !=
NULL);
841assert(expr !=
NULL);
842assert(islinear !=
NULL);
843assert(newsection !=
NULL);
848*newsection =
FALSE;
866 if( strcmp(pipinput->token,
":") == 0 )
870 SCIPdebugMsg(
scip,
"(line %d) read constraint name: '%s'\n", pipinput->linenumber, name);
918((nfactors > 0 || havevalue) && (issign =
isSign(pipinput, &nextcoefsign))) )
923 if( coefsign * coef != 0.0 )
927monomialscoef[nmonomials] = coefsign * coef;
931 else if( havevalue )
933constant += coefsign * coef;
936 if( monomialdegree > 1 )
962coefsign = nextcoefsign;
963 SCIPdebugMsg(
scip,
"(line %d) read coefficient sign: %+d\n", pipinput->linenumber, coefsign);
971 if(
isSign(pipinput, &coefsign) )
973 SCIPdebugMsg(
scip,
"(line %d) read coefficient sign: %+d\n", pipinput->linenumber, coefsign);
975 if( nfactors > 0 || havevalue )
977 syntaxError(
scip, pipinput,
"sign can only be at beginning of monomial");
978 gotoTERMINATE_READPOLYNOMIAL;
986 if( strcmp(pipinput->token,
"*") == 0 )
990 syntaxError(
scip, pipinput,
"cannot have '*' before first variable in monomial");
991 gotoTERMINATE_READPOLYNOMIAL;
998 if( nmonomials > 0 && !havesign )
1000 syntaxError(
scip, pipinput,
"expected sign ('+' or '-') or sense ('<' or '>')");
1001 gotoTERMINATE_READPOLYNOMIAL;
1005 if( strcmp(pipinput->token,
"^") == 0 )
1010 gotoTERMINATE_READPOLYNOMIAL;
1012 if( nfactors == 0 )
1014 syntaxError(
scip, pipinput,
"cannot have '^' before first variable in monomial");
1015 gotoTERMINATE_READPOLYNOMIAL;
1017exponents[nfactors-1] = exponent;
1019monomialdegree += (int)exponent - 1;
1023 SCIPdebugMsg(
scip,
"(line %d) read exponent value %g for variable %s\n", pipinput->linenumber, exponent,
1031 SCIPdebugMsg(
scip,
"(line %d) read coefficient value: %g with sign %+d\n", pipinput->linenumber, coef, coefsign);
1036 gotoTERMINATE_READPOLYNOMIAL;
1041 syntaxError(
scip, pipinput,
"coefficients can only be at the beginning of a monomial");
1042 gotoTERMINATE_READPOLYNOMIAL;
1056vars[nfactors] = var;
1057exponents[nfactors] = 1.0;
1064 syntaxError(
scip, pipinput,
"string ended before monomial has finished");
1065 gotoTERMINATE_READPOLYNOMIAL;
1072 for( i = 0; i < nmonomials; ++i )
1074assert(monomials[i] !=
NULL);
1084TERMINATE_READPOLYNOMIAL:
1114assert(pipinput !=
NULL);
1127modifiable =
FALSE;
1140 if( constant != 0.0 )
1163assert(child !=
NULL);
1168assert(var !=
NULL);
1204 SCIP_CALL(
SCIPcreateConsNonlinear(
scip, &nonlinobjcons,
"nonlinobj", expr, lhs, rhs, initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable) );
1252assert(pipinput !=
NULL);
1261 syntaxError(
scip, pipinput,
"expected constraint sense '<=', '=', or '>='");
1271 if( !
isSense(pipinput, &sense) )
1273 syntaxError(
scip, pipinput,
"expected constraint sense '<=', '=', or '>='");
1284 if(
isSign(pipinput, &sidesign) )
1297sidevalue *= sidesign;
1300initial = pipinput->initialconss;
1306modifiable =
FALSE;
1307dynamic = pipinput->dynamicconss;
1308removable = pipinput->dynamicrows;
1348 for( i = 0; i < nchildren; ++i )
1351assert(child !=
NULL);
1355assert(vars[i] !=
NULL);
1365 SCIP_CALL(
SCIPcreateConsLinear(
scip, &cons, name, nchildren, vars, coefs, lhs, rhs, initial, separate, enforce,
1366check, propagate, local, modifiable, dynamic, removable,
FALSE) );
1373 SCIP_CALL(
SCIPcreateConsNonlinear(
scip, &cons, name, expr, lhs, rhs, initial, separate, enforce, check, propagate,
1374local, modifiable, dynamic, removable) );
1378assert(cons !=
NULL);
1380 SCIPdebugMsg(
scip,
"(line %d) created constraint: ", pipinput->linenumber);
1400assert(pipinput !=
NULL);
1423hassign =
isSign(pipinput, &sign);
1436 syntaxError(
scip, pipinput,
"expected bound sense '<=', '=', or '>='");
1441 switch( leftsense )
1480 if(
isSense(pipinput, &rightsense) )
1495hassign =
isSign(pipinput, &sign);
1510 switch( rightsense )
1538 syntaxError(
scip, pipinput,
"variable with bound is marked as 'free'");
1571assert(pipinput !=
NULL);
1587 syntaxError(
scip, pipinput,
"unknown variable in generals section");
1606assert(pipinput !=
NULL);
1622 syntaxError(
scip, pipinput,
"unknown variable in binaries section");
1648 const char* filename
1651assert(pipinput !=
NULL);
1654pipinput->file =
SCIPfopen(filename,
"r");
1655 if( pipinput->file ==
NULL)
1669 switch( pipinput->section )
1752assert(vars !=
NULL);
1754assert(nvars !=
NULL);
1755assert(*vars !=
NULL|| *nvars == 0);
1757assert(constant !=
NULL);
1763 if( requiredsize > *nvars )
1769assert( requiredsize <= *nvars );
1781 for( v = 0; v < *nvars; ++v )
1791*constant += (*scalars)[v];
1792(*scalars)[v] *= -1.0;
1810assert(expr !=
NULL);
1859assert(expr !=
NULL);
1879assert( linebuffer !=
NULL);
1880assert( linecnt !=
NULL);
1883linebuffer[0] =
'\0';
1896assert( linebuffer !=
NULL);
1897assert( linecnt !=
NULL);
1900 if( (*linecnt) > 0 )
1902linebuffer[(*linecnt)] =
'\0';
1916 const char* extension
1920assert( linebuffer !=
NULL);
1921assert( linecnt !=
NULL);
1922assert( extension !=
NULL);
1929(void) strncat(linebuffer, extension,
PIP_MAX_PRINTLEN- strlen(linebuffer));
1931(*linecnt) += (int) strlen(extension);
1933 SCIPdebugMsg(
scip,
"linebuffer <%s>, length = %lu\n", linebuffer, (
unsigned long)strlen(linebuffer));
1945 const char* rowname,
1946 const char* rownameextension,
1966assert( strcmp(type,
"=") == 0 || strcmp(type,
"<=") == 0 || strcmp(type,
">=") == 0 );
1967assert( nlinvars == 0 || (linvars !=
NULL&& linvals !=
NULL) );
1975 if( strlen(rowname) > 0 || strlen(rownameextension) > 0 )
1982 for( v = 0; v < nlinvars; ++v )
1986assert(linvars !=
NULL);
1987assert(linvals !=
NULL);
1990assert( var !=
NULL);
2003 if( quadexpr !=
NULL)
2011 intnbilinexprterms;
2023nactivevars = nlinexprs;
2025 for( v = 0; v < nlinexprs; ++v )
2027assert(linexprs !=
NULL&& linexprs[v] !=
NULL);
2031assert(activevars[v] !=
NULL);
2036constant += activeconstant;
2039 for( v = 0; v < nactivevars; ++v )
2043assert(activevars !=
NULL);
2044assert(activevals !=
NULL);
2046var = activevars[v];
2047assert( var !=
NULL);
2068 for( v = 0; v < nquadexprs; ++v )
2076assert(expr !=
NULL);
2080assert(var !=
NULL);
2082 if( lincoef == 0.0 )
2096 for( v = 0; v < nquadexprs; ++v )
2104assert(expr !=
NULL);
2108assert(var !=
NULL);
2110 if( sqrcoef == 0.0 )
2124 for( v = 0; v < nbilinexprterms; ++v )
2134assert(expr1 !=
NULL);
2136assert(expr2 !=
NULL);
2140assert(var1 !=
NULL);
2142assert(var2 !=
NULL);
2201 else if( coef == 1.0 && needsign )
2205 else if( coef == -1.0 )
2267 const char* rowname,
2268 const char* rownameextension,
2280assert(strcmp(type,
"=") == 0 || strcmp(type,
"<=") == 0 || strcmp(type,
">=") == 0);
2281assert(expr !=
NULL);
2289 if( strlen(rowname) > 0 || strlen(rownameextension) > 0 )
2335 const char* rowname,
2344assert(rowname !=
NULL);
2345assert(cons !=
NULL);
2353 if( strlen(rowname) > 0 )
2383 const char* rowname,
2400assert( rowname !=
NULL);
2402assert( nlinvars == 0 || linvars !=
NULL);
2403assert( quadexpr ==
NULL|| nlinvars == 0);
2404assert( lhs <= rhs );
2409nactivevars = nlinvars;
2414 if( linvals !=
NULL)
2422 for( v = 0; v < nactivevars; ++v )
2423activevals[v] = 1.0;
2436 SCIP_CALL(
printRow(
scip, file, rowname,
"",
"=", activevars, activevals, nactivevars, quadexpr,
2437rhs - activeconstant, transformed) );
2445activevals, nactivevars, quadexpr, lhs - activeconstant, transformed) );
2451activevals, nactivevars, quadexpr, rhs - activeconstant, transformed) );
2470 const char* rowname,
2477assert(rowname !=
NULL);
2478assert(expr !=
NULL);
2514 int* nAggregatedVars,
2522 for(j = 0; j < nvars; ++j)
2539(*aggregatedVars)[(*nAggregatedVars)++] = var;
2556 intnAggregatedVars,
2574 for(j = 0; j < nAggregatedVars; ++j)
2579activevars[0] = aggregatedVars[j];
2580activevals[0] = 1.0;
2581activeconstant = 0.0;
2586activevals[nactivevars] = -1.0;
2587activevars[nactivevars] = aggregatedVars[j];
2592 SCIP_CALL(
printRow(
scip, file, consname,
"",
"=", activevars, activevals, nactivevars,
NULL, - activeconstant,
2619assert(name !=
NULL);
2626 if( isdigit(name[0]) )
2629 for( i = 0; i < len; ++i )
2632 if( isalnum(name[i]) )
2657assert(vars !=
NULL|| nvars == 0);
2660 for( v = 0; v < nvars; ++v )
2682 const char* conshdlrname;
2685assert( conss !=
NULL|| nconss == 0 );
2687 for( c = 0; c < nconss; ++c )
2689assert(conss !=
NULL);
2691assert(cons !=
NULL);
2697assert( conshdlr !=
NULL);
2708 if( strcmp(conshdlrname,
"linear") == 0 )
2757 const char* conshdlrname;
2766 intnAggregatedVars;
2782nAggregatedVars = 0;
2795 SCIPinfoMessage(
scip, file,
"\\ Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
2796nvars, nbinvars, nintvars, nimplvars, ncontvars);
2805 for(v = 0; v < nvars; ++v)
2846 for(c = 0; c < nconss; ++c)
2849assert( cons !=
NULL);
2855assert( conshdlr !=
NULL);
2861 if( strcmp(conshdlrname,
"linear") == 0 )
2867 else if( strcmp(conshdlrname,
"setppc") == 0 )
2876consvars,
NULL, nconsvars,
NULL, 1.0, 1.0, transformed) );
2888 else if( strcmp(conshdlrname,
"logicor") == 0 )
2894 else if( strcmp(conshdlrname,
"knapsack") == 0 )
2904 for( v = 0; v < nconsvars; ++v )
2912 else if( strcmp(conshdlrname,
"varbound") == 0 )
2929 else if( strcmp(conshdlrname,
"nonlinear") == 0 )
2936 if( !ispolynomial )
2953 if( !ispolynomial )
2979consNonlinear[nConsNonlinear++] = cons;
2982 if( simplifiedexpr !=
NULL)
2987 else if( strcmp(conshdlrname,
"and") == 0 )
2991consAnd[nConsAnd++] = cons;
3007 for( c = 0; c < nConsNonlinear; ++c )
3015 if( ntmpvars > tmpvarssize )
3027 for(c = 0; c < nConsAnd; ++c)
3044 for(v = 0; v < nvars; ++v)
3047assert( var !=
NULL);
3093 for(v = 0; v < nAggregatedVars; ++v)
3095var = aggregatedVars[v];
3096assert( var !=
NULL);
3113 for(v = 0; v < nvars; ++v)
3116assert( var !=
NULL);
3134 for(v = 0; v < nvars; ++v)
3137assert( var !=
NULL);
3171assert(reader !=
NULL);
3197nvars, nbinvars, nintvars, nimplvars, ncontvars, conss, nconss, result) );
3230 const char* filename,
3239assert(reader !=
NULL);
3242pipinput.file =
NULL;
3243pipinput.linebuf[0] =
'\0';
3244pipinput.probname[0] =
'\0';
3245pipinput.objname[0] =
'\0';
3247pipinput.token[0] =
'\0';
3249pipinput.tokenbuf[0] =
'\0';
3255pipinput.npushedtokens = 0;
3256pipinput.linenumber = 0;
3257pipinput.linepos = 0;
3260pipinput.haserror =
FALSE;
3282 if( pipinput.haserror )
Constraint handler for AND constraints, .
Constraint handler for knapsack constraints of the form , x binary and .
Constraint handler for linear constraints in their most general form, .
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
constraint handler for nonlinear constraints specified by algebraic expressions
Constraint handler for the set partitioning / packing / covering constraints .
Constraint handler for variable bound constraints .
variable expression handler
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetResultantAnd(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_EXPR * SCIPgetExprNonlinear(SCIP_CONS *cons)
SCIP_Real SCIPgetRhsNonlinear(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsNonlinear(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsNonlinear(SCIP_CONS *cons)
@ SCIP_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
SCIP_RETCODE SCIPcreateExprVar(SCIP *scip, SCIP_EXPR **expr, SCIP_VAR *var, 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)
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)
SCIP_RETCODE SCIPwritePip(SCIP *scip, FILE *file, const char *name, SCIP_Bool transformed, SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, SCIP_VAR **vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
SCIP_RETCODE SCIPreadPip(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
SCIP_RETCODE SCIPincludeReaderPip(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
int SCIPgetNTotalVars(SCIP *scip)
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPcreateExprMonomial(SCIP *scip, SCIP_EXPR **expr, int nfactors, SCIP_VAR **vars, SCIP_Real *exponents, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
void SCIPexprGetQuadraticBilinTerm(SCIP_EXPR *expr, int termidx, SCIP_EXPR **expr1, SCIP_EXPR **expr2, SCIP_Real *coef, int *pos2, SCIP_EXPR **prodexpr)
SCIP_Real SCIPgetExponentExprPow(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprProduct(SCIP *scip, SCIP_EXPR *expr)
SCIP_Bool SCIPisExprSum(SCIP *scip, SCIP_EXPR *expr)
SCIP_Bool SCIPexprAreQuadraticExprsVariables(SCIP_EXPR *expr)
void SCIPexprGetQuadraticData(SCIP_EXPR *expr, SCIP_Real *constant, int *nlinexprs, SCIP_EXPR ***linexprs, SCIP_Real **lincoefs, int *nquadexprs, int *nbilinexprs, SCIP_Real **eigenvalues, SCIP_Real **eigenvectors)
SCIP_Real * SCIPgetCoefsExprSum(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
SCIP_Real SCIPgetCoefExprProduct(SCIP_EXPR *expr)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_Bool SCIPisExprVar(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPprintExpr(SCIP *scip, SCIP_EXPR *expr, FILE *file)
SCIP_Real SCIPgetValueExprValue(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprPower(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcheckExprQuadratic(SCIP *scip, SCIP_EXPR *expr, SCIP_Bool *isquadratic)
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_Real SCIPgetConstantExprSum(SCIP_EXPR *expr)
SCIP_VAR * SCIPgetVarExprVar(SCIP_EXPR *expr)
void SCIPexprGetQuadraticQuadTerm(SCIP_EXPR *quadexpr, int termidx, SCIP_EXPR **expr, SCIP_Real *lincoef, SCIP_Real *sqrcoef, int *nadjbilin, int **adjbilin, SCIP_EXPR **sqrexpr)
SCIP_RETCODE SCIPduplicateExpr(SCIP *scip, SCIP_EXPR *expr, SCIP_EXPR **copyexpr, SCIP_DECL_EXPR_MAPEXPR((*mapexpr)), void *mapexprdata, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPsimplifyExpr(SCIP *scip, SCIP_EXPR *rootexpr, SCIP_EXPR **simplified, SCIP_Bool *changed, SCIP_Bool *infeasible, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
int SCIPstrcasecmp(const char *s1, const char *s2)
int SCIPsnprintf(char *t, int len, const char *s,...)
void SCIPprintSysError(const char *message)
int SCIPstrncpy(char *t, const char *s, int size)
static const SCIP_Real scalars[]
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for managing constraints
public functions to work with algebraic expressions
wrapper functions to map file i/o to standard or zlib file i/o
struct SCIP_File SCIP_FILE
public methods for message output
#define SCIPdebugPrintCons(x, y, z)
public data structures and miscellaneous methods
public methods for NLP management
public methods for input file readers
public methods for problem variables
static SCIP_Bool isExprSignomial(SCIP *scip, SCIP_EXPR *expr)
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR ***vars, SCIP_Real **scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
static SCIP_RETCODE readPolynomial(SCIP *scip, PIPINPUT *pipinput, char *name, SCIP_EXPR **expr, SCIP_Bool *islinear, SCIP_Bool *newsection)
#define PIP_MAX_PUSHEDTOKENS
static SCIP_RETCODE getVariable(SCIP *scip, char *name, SCIP_Bool dynamiccols, SCIP_VAR **var, SCIP_Bool *created)
static void clearLine(char *linebuffer, int *linecnt)
static SCIP_Bool hasError(PIPINPUT *pipinput)
static SCIP_Bool isNewSection(SCIP *scip, PIPINPUT *pipinput)
static SCIP_Bool getNextToken(SCIP *scip, PIPINPUT *pipinput)
static SCIP_RETCODE readGenerals(SCIP *scip, PIPINPUT *pipinput)
static SCIP_RETCODE readStart(SCIP *scip, PIPINPUT *pipinput)
static SCIP_DECL_HASHGETKEY(hashGetKeyVar)
static SCIP_Bool isExprPolynomial(SCIP *scip, SCIP_EXPR *expr)
static const char tokenchars[]
static SCIP_Bool isSign(PIPINPUT *pipinput, int *sign)
static SCIP_Bool getNextLine(SCIP *scip, PIPINPUT *pipinput)
static const char commentchars[]
static void checkVarnames(SCIP *scip, SCIP_VAR **vars, int nvars)
static SCIP_RETCODE ensureMonomialsSize(SCIP *scip, SCIP_EXPR ***monomials, SCIP_Real **monomialscoef, int *monomialssize, int minnmonomials)
static void printSignomial(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, SCIP_EXPR *expr, SCIP_Real coef, SCIP_Bool needsign)
static const char namechars[]
static SCIP_RETCODE printAggregatedCons(SCIP *scip, FILE *file, SCIP_Bool transformed, int nvars, int nAggregatedVars, SCIP_VAR **aggregatedVars)
static SCIP_Bool isNameValid(const char *name)
static void swapTokenBuffer(PIPINPUT *pipinput)
static SCIP_DECL_READERREAD(readerReadPip)
static SCIP_Bool isValueChar(char c, char nextc, SCIP_Bool firstchar, SCIP_Bool *hasdot, PIPEXPTYPE *exptype)
static SCIP_RETCODE printNonlinearCons(SCIP *scip, FILE *file, const char *rowname, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs)
static SCIP_RETCODE collectAggregatedVars(int nvars, SCIP_VAR **vars, int *nAggregatedVars, SCIP_VAR ***aggregatedVars, SCIP_HASHTABLE **varAggregated)
static SCIP_RETCODE printQuadraticCons(SCIP *scip, FILE *file, const char *rowname, SCIP_VAR **linvars, SCIP_Real *linvals, int nlinvars, SCIP_EXPR *quadexpr, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed)
static SCIP_RETCODE readBinaries(SCIP *scip, PIPINPUT *pipinput)
enum PipSection PIPSECTION
#define PIP_INIT_MONOMIALSSIZE
static SCIP_Bool isSense(PIPINPUT *pipinput, PIPSENSE *sense)
static void pushBufferToken(PIPINPUT *pipinput)
static void endLine(SCIP *scip, FILE *file, char *linebuffer, int *linecnt)
static void pushToken(PIPINPUT *pipinput)
static SCIP_DECL_READERCOPY(readerCopyPip)
static void syntaxError(SCIP *scip, PIPINPUT *pipinput, const char *msg)
static void printRowAnd(SCIP *scip, FILE *file, const char *rowname, SCIP_CONS *cons)
#define PIP_INIT_FACTORSSIZE
static SCIP_Bool isDelimChar(char c)
static SCIP_RETCODE readConstraints(SCIP *scip, PIPINPUT *pipinput)
static void swapPointers(char **pointer1, char **pointer2)
static SCIP_DECL_HASHKEYEQ(hashKeyEqVar)
static void printRowNl(SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, SCIP_EXPR *expr, SCIP_Real rhs)
static SCIP_DECL_HASHKEYVAL(hashKeyValVar)
enum PipExpType PIPEXPTYPE
static SCIP_RETCODE printRow(SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, SCIP_VAR **linvars, SCIP_Real *linvals, int nlinvars, SCIP_EXPR *quadexpr, SCIP_Real rhs, SCIP_Bool transformed)
static SCIP_RETCODE readObjective(SCIP *scip, PIPINPUT *pipinput)
static SCIP_RETCODE ensureFactorsSize(SCIP *scip, SCIP_VAR ***vars, SCIP_Real **exponents, int *factorssize, int minnfactors)
static SCIP_DECL_READERWRITE(readerWritePip)
static SCIP_Bool isValue(SCIP *scip, PIPINPUT *pipinput, SCIP_Real *value)
static void checkConsnames(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool transformed)
static SCIP_RETCODE readPIPFile(SCIP *scip, PIPINPUT *pipinput, const char *filename)
static const char delimchars[]
static void appendLine(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *extension)
static SCIP_RETCODE readBounds(SCIP *scip, PIPINPUT *pipinput)
static SCIP_Bool isTokenChar(char c)
file reader for polynomial mixed-integer programs in PIP format
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for reader plugins
public methods for SCIP variables
enum SCIP_Objsense SCIP_OBJSENSE
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS
@ SCIP_VARSTATUS_ORIGINAL
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED
enum SCIP_Varstatus SCIP_VARSTATUS
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