assert(lpinput !=
NULL);
164 SCIPerrorMessage(
"Syntax error in line %d ('%s'): %s \n", lpinput->linenumber, lpinput->token, msg);
165 if( lpinput->linebuf[lpinput->linebufsize - 1] ==
'\n')
173(void)
SCIPsnprintf(formatstr, 256,
" %%%ds\n", lpinput->linepos);
175lpinput->section =
LP_END;
176lpinput->haserror =
TRUE;
185assert(lpinput !=
NULL);
187 returnlpinput->haserror;
245assert(hasdot !=
NULL);
246assert(exptype !=
NULL);
248 if( isdigit((
unsigned char)c) )
250 else if( (*exptype ==
LP_EXP_NONE) && !(*hasdot) && (c ==
'.') && ( isdigit((
unsigned char)nextc) || isspace((
unsigned char)nextc) || nextc ==
'e'|| nextc ==
'E') )
255 else if( !firstchar && (*exptype ==
LP_EXP_NONE) && (c ==
'e'|| c ==
'E') )
257 if( nextc ==
'+'|| nextc ==
'-')
262 else if( isdigit((
unsigned char)nextc) )
268 else if( (*exptype ==
LP_EXP_SIGNED) && (c ==
'+'|| c ==
'-') )
288assert(lpinput !=
NULL);
291lpinput->linepos = 0;
292lpinput->linebuf[lpinput->linebufsize - 2] =
'\0';
294 if(
SCIPfgets(lpinput->linebuf, lpinput->linebufsize, lpinput->file) ==
NULL)
302lpinput->linenumber++;
305 while( lpinput->linebuf[lpinput->linebufsize - 2] !=
'\0')
312lpinput->linebuf[newsize-2] =
'\0';
313 if(
SCIPfgets(lpinput->linebuf + lpinput->linebufsize - 1, newsize - lpinput->linebufsize + 1, lpinput->file) ==
NULL)
315lpinput->linebufsize = newsize;
317lpinput->linebuf[lpinput->linebufsize - 1] =
'\0';
324commentstart = strchr(lpinput->linebuf,
commentchars[i]);
325 if( commentstart !=
NULL)
327*commentstart =
'\0';
328*(commentstart+1) =
'\0';
347*pointer1 = *pointer2;
363assert(lpinput !=
NULL);
364assert(lpinput->linepos < lpinput->linebufsize);
367 if( lpinput->npushedtokens > 0 )
369 swapPointers(&lpinput->token, &lpinput->pushedtokens[lpinput->npushedtokens-1]);
370lpinput->npushedtokens--;
372 SCIPdebugMsg(
scip,
"(line %d) read token again: '%s'\n", lpinput->linenumber, lpinput->token);
377buf = lpinput->linebuf;
380 if( buf[lpinput->linepos] ==
'\0')
384lpinput->section =
LP_END;
388assert(lpinput->linepos == 0);
390buf = lpinput->linebuf;
395assert(lpinput->linepos < lpinput->linebufsize);
401 if(
isValueChar(buf[lpinput->linepos], buf[lpinput->linepos+1],
TRUE, &hasdot, &exptype) )
409lpinput->token[tokenlen] = buf[lpinput->linepos];
413 while(
isValueChar(buf[lpinput->linepos], buf[lpinput->linepos+1],
FALSE, &hasdot, &exptype) );
422lpinput->token[tokenlen] = buf[lpinput->linepos];
425 if( tokenlen == 1 &&
isTokenChar(lpinput->token[0]) )
434 if( tokenlen >= 1 && lpinput->token[tokenlen-1] ==
'^'&& buf[lpinput->linepos] ==
'2')
439&& (lpinput->token[tokenlen-1] ==
'<'|| lpinput->token[tokenlen-1] ==
'>'|| lpinput->token[tokenlen-1] ==
'=')
440&& buf[lpinput->linepos] ==
'=')
444 else if( lpinput->token[tokenlen-1] ==
'='&& (buf[lpinput->linepos] ==
'<'|| buf[lpinput->linepos] ==
'>') )
446lpinput->token[tokenlen-1] = buf[lpinput->linepos];
451lpinput->token[tokenlen] =
'\0';
453 SCIPdebugMsg(
scip,
"(line %d) read token: '%s'\n", lpinput->linenumber, lpinput->token);
464assert(lpinput !=
NULL);
467 swapPointers(&lpinput->pushedtokens[lpinput->npushedtokens], &lpinput->token);
468lpinput->npushedtokens++;
477assert(lpinput !=
NULL);
480 swapPointers(&lpinput->pushedtokens[lpinput->npushedtokens], &lpinput->tokenbuf);
481lpinput->npushedtokens++;
490assert(lpinput !=
NULL);
505assert(lpinput !=
NULL);
514iscolon = (*lpinput->token ==
':');
525len = strlen(lpinput->token);
529 if( len > 1 && (len < 9 || len == 15) )
534 while( lpinput->token[c] !=
'\0')
536token[c] = toupper(lpinput->token[c]);
542 if( (len == 3 && strcmp(token,
"MIN") == 0)
543|| (len == 7 && strcmp(token,
"MINIMUM") == 0)
544|| (len == 8 && strcmp(token,
"MINIMIZE") == 0) )
546 SCIPdebugMsg(
scip,
"(line %d) new section: OBJECTIVE\n", lpinput->linenumber);
552 if( (len == 3 && strcmp(token,
"MAX") == 0)
553|| (len == 7 && strcmp(token,
"MAXIMUM") == 0)
554|| (len == 8 && strcmp(token,
"MAXIMIZE") == 0) )
556 SCIPdebugMsg(
scip,
"(line %d) new section: OBJECTIVE\n", lpinput->linenumber);
562 if( len == 7 && strcmp(token,
"SUBJECT") == 0 )
570 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", lpinput->linenumber);
572lpinput->inlazyconstraints =
FALSE;
573lpinput->inusercuts =
FALSE;
582 if( len == 4 && strcmp(token,
"SUCH") == 0 )
590 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", lpinput->linenumber);
592lpinput->inlazyconstraints =
FALSE;
593lpinput->inusercuts =
FALSE;
602 if( (len == 2 && strcmp(token,
"ST") == 0)
603|| (len == 3 && strcmp(token,
"ST.") == 0)
604|| (len == 4 && strcmp(token,
"S.T.") == 0) )
606 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", lpinput->linenumber);
608lpinput->inlazyconstraints =
FALSE;
609lpinput->inusercuts =
FALSE;
613 if( len == 4 && strcmp(token,
"LAZY") == 0 )
621 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS (lazy)\n", lpinput->linenumber);
623lpinput->inlazyconstraints =
TRUE;
624lpinput->inusercuts =
FALSE;
633 if( len == 4 && strcmp(token,
"USER") == 0 )
641 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS (user cuts)\n", lpinput->linenumber);
643lpinput->inlazyconstraints =
FALSE;
644lpinput->inusercuts =
TRUE;
653 if( (len == 5 && strcmp(token,
"BOUND") == 0)
654|| (len == 6 && strcmp(token,
"BOUNDS") == 0) )
656 SCIPdebugMsg(
scip,
"(line %d) new section: BOUNDS\n", lpinput->linenumber);
661 if( (len == 3 && (strcmp(token,
"GEN") == 0 || strcmp(token,
"INT") == 0))
662|| (len == 7 && (strcmp(token,
"GENERAL") == 0 || strcmp(token,
"INTEGER") == 0))
663|| (len == 8 && (strcmp(token,
"GENERALS") == 0 || strcmp(token,
"INTEGERS") == 0)) )
665 SCIPdebugMsg(
scip,
"(line %d) new section: GENERALS\n", lpinput->linenumber);
670 if( (len == 3 && strcmp(token,
"BIN") == 0)
671|| (len == 6 && strcmp(token,
"BINARY") == 0)
672|| (len == 8 && strcmp(token,
"BINARIES") == 0) )
674 SCIPdebugMsg(
scip,
"(line %d) new section: BINARIES\n", lpinput->linenumber);
679 if( (len == 4 && strcmp(token,
"SEMI") == 0)
680|| (len == 5 && strcmp(token,
"SEMIS") == 0)
681|| (len == 15 && strcmp(token,
"SEMI-CONTINUOUS") == 0) )
683 SCIPdebugMsg(
scip,
"(line %d) new section: SEMICONTINUOUS\n", lpinput->linenumber);
688 if( len == 3 && strcmp(token,
"SOS") == 0 )
690 SCIPdebugMsg(
scip,
"(line %d) new section: SOS\n", lpinput->linenumber);
691lpinput->section =
LP_SOS;
695 if( len == 3 && strcmp(token,
"END") == 0 )
697 SCIPdebugMsg(
scip,
"(line %d) new section: END\n", lpinput->linenumber);
698lpinput->section =
LP_END;
713assert(lpinput !=
NULL);
714assert(sign !=
NULL);
715assert(*sign == +1 || *sign == -1);
717 if( lpinput->token[1] ==
'\0')
719 if( *lpinput->token ==
'+')
721 else if( *lpinput->token ==
'-')
739assert(lpinput !=
NULL);
740assert(value !=
NULL);
752val = strtod(lpinput->token, &endptr);
753 if( endptr != lpinput->token && *endptr ==
'\0')
770assert(lpinput !=
NULL);
772 if( strcmp(lpinput->token,
"<") == 0 )
778 else if( strcmp(lpinput->token,
">") == 0 )
784 else if( strcmp(lpinput->token,
"=") == 0 )
803assert(name !=
NULL);
804assert(var !=
NULL);
815initial = !dynamiccols;
816removable = dynamiccols;
830 if( created !=
NULL)
833 else if( created !=
NULL)
846assert(lpinput !=
NULL);
890assert(lpinput !=
NULL);
891assert(name !=
NULL);
892assert(coefssize !=
NULL);
893assert(vars !=
NULL);
894assert(coefs !=
NULL);
895assert(ncoefs !=
NULL);
896assert(quadcoefssize !=
NULL);
897assert(quadvars1 !=
NULL);
898assert(quadvars2 !=
NULL);
899assert(quadcoefs !=
NULL);
900assert(nquadcoefs !=
NULL);
901assert(!isobjective || objoffset !=
NULL);
902assert(newsection !=
NULL);
914*newsection =
FALSE;
919assert(objoffset !=
NULL);
939 if( strcmp(lpinput->token,
":") == 0 )
945 SCIPdebugMsg(
scip,
"(line %d) read constraint name: '%s'\n", lpinput->linenumber, name);
976firstquadvar =
NULL;
982 if( lpinput->token[1] ==
'\0'&& ( *lpinput->token ==
'+'|| *lpinput->token ==
'-') )
985 if( isobjective && havevalue && var ==
NULL)
987assert( objoffset !=
NULL);
993 SCIPdebugMsg(
scip,
"(line %d) read objective offset %g\n", lpinput->linenumber, coefsign * coef);
994haveobjoffset =
TRUE;
995*objoffset = coefsign * coef;
1000 if(
isSign(lpinput, &coefsign) )
1008 SCIPdebugMsg(
scip,
"(line %d) read coefficient sign: %+d\n", lpinput->linenumber, coefsign);
1016 SCIPdebugMsg(
scip,
"(line %d) read coefficient value: %g with sign %+d\n", lpinput->linenumber, coef, coefsign);
1037 syntaxError(
scip, lpinput,
"no constant values allowed for constraints in lp file format");
1043 syntaxError(
scip, lpinput,
"constaint has sign without a variable");
1055 if( (isobjective || (!havevalue && !havesign)) && !inquadpart &&
isNewSection(
scip, lpinput) )
1057 if( havesign && !havevalue )
1059 SCIPwarningMessage(
scip,
"skipped single sign %c without value or variable in objective\n", coefsign == 1 ?
'+':
'-');
1061 else if( isobjective && havevalue && !
SCIPisZero(
scip, coef) )
1063assert( objoffset !=
NULL);
1065 if( haveobjoffset )
1070 SCIPdebugMsg(
scip,
"(line %d) read objective offset %g\n", lpinput->linenumber, coefsign * coef);
1071*objoffset = coefsign * coef;
1074*newsection =
TRUE;
1079 if( *lpinput->token ==
'[')
1083 syntaxError(
scip, lpinput,
"cannot start quadratic part while already in quadratic part.");
1086 if( havesign && coefsign != +1 )
1088 syntaxError(
scip, lpinput,
"cannot have '-' in front of quadratic part.");
1093 syntaxError(
scip, lpinput,
"cannot have value in front of quadratic part.");
1097 SCIPdebugMsg(
scip,
"(line %d) start quadratic part\n", lpinput->linenumber);
1103 if( *lpinput->token ==
']')
1107 syntaxError(
scip, lpinput,
"cannot end quadratic part before starting one.");
1110 if( havesign || havevalue || firstquadvar !=
NULL)
1112 if( firstquadvar ==
NULL)
1114 syntaxError(
scip, lpinput,
"expected value or first quadratic variable.");
1118 syntaxError(
scip, lpinput,
"expected second quadratic variable.");
1123 SCIPdebugMsg(
scip,
"(line %d) end quadratic part\n", lpinput->linenumber);
1124inquadpart =
FALSE;
1131 syntaxError(
scip, lpinput,
"expected '/2' or '/ 2' after end of quadratic part in objective.");
1134 if( strcmp(lpinput->token,
"/2") == 0 )
1136 SCIPdebugMsg(
scip,
"(line %d) saw '/2' or '/ 2' after quadratic part in objective\n", lpinput->linenumber);
1138 else if( *lpinput->token ==
'/')
1143 syntaxError(
scip, lpinput,
"expected '/2' or '/ 2' after end of quadratic part in objective.");
1146 SCIPdebugMsg(
scip,
"(line %d) saw '/ 2' after quadratic part in objective\n", lpinput->linenumber);
1150 syntaxError(
scip, lpinput,
"expected '/2' or '/ 2' after end of quadratic part in objective.");
1159 if( *lpinput->token ==
'*')
1163 syntaxError(
scip, lpinput,
"cannot have '*' outside of quadratic part.");
1166 if( firstquadvar ==
NULL)
1168 syntaxError(
scip, lpinput,
"cannot have '*' before first variable in quadratic term.");
1176 if( !inquadpart && *ncoefs > 0 && !havesign )
1178 syntaxError(
scip, lpinput,
"expected sign ('+' or '-') or sense ('<' or '>').");
1181 if( inquadpart && *nquadcoefs > 0 && !havesign )
1189 if( *lpinput->token ==
'^')
1193 syntaxError(
scip, lpinput,
"cannot have squares ('^2') outside of quadratic part.");
1196 if( firstquadvar ==
NULL)
1198 syntaxError(
scip, lpinput,
"cannot have square '^2' before variable.");
1217 if( *ncoefs >= *coefssize )
1220oldcoefssize = *coefssize;
1222*coefssize =
MAX(*coefssize, (*ncoefs)+1);
1226assert(*ncoefs < *coefssize);
1229(*vars)[*ncoefs] = var;
1230(*coefs)[*ncoefs] = coefsign * coef;
1236 if( firstquadvar ==
NULL)
1248 if( *nquadcoefs >= *quadcoefssize )
1250 intoldquadcoefssize;
1251oldquadcoefssize = *quadcoefssize;
1252*quadcoefssize *= 2;
1253*quadcoefssize =
MAX(*quadcoefssize, (*nquadcoefs)+1);
1258assert(*nquadcoefs < *quadcoefssize);
1261(*quadvars1)[*nquadcoefs] = firstquadvar;
1262(*quadvars2)[*nquadcoefs] = var;
1263(*quadcoefs)[*nquadcoefs] = coefsign * coef;
1265(*quadcoefs)[*nquadcoefs] /= 2.0;
1275firstquadvar =
NULL;
1301assert(lpinput !=
NULL);
1305&quadcoefssize, &quadvars1, &quadvars2, &quadcoefs, &nquadcoefs, &objoffset, &newsection) );
1317 for( i = 0; i < ncoefs; ++i )
1319assert(vars !=
NULL);
1320assert(coefs !=
NULL);
1330 if( nquadcoefs > 0 )
1354 SCIP_CALL(
SCIPcreateConsQuadraticNonlinear(
scip, &quadobjcons,
"quadobj", 1, &quadobjvar, &minusone, nquadcoefs, quadvars1, quadvars2, quadcoefs, lhs, rhs,
1414assert( lpinput !=
NULL);
1415assert( binvar !=
NULL);
1422 syntaxError(
scip, lpinput,
"value for binary variable must be '0' or '1'.");
1444assert( binvar !=
NULL);
1449&quadcoefssize, &quadvars1, &quadvars2, &quadcoefs, &nquadcoefs,
NULL, &newsection) );
1458 if( nquadcoefs > 0 )
1461 syntaxError(
scip, lpinput,
"quadratic indicator constraints not supported.");
1464 if( name2[0] !=
'\0')
1466 syntaxError(
scip, lpinput,
"did not expect name for linear constraint.");
1476 if( !
isSense(lpinput, &linsense) )
1478 syntaxError(
scip, lpinput,
"expected constraint sense '<=', '=', or '>='.");
1490 if(
isSign(lpinput, &linsidesign) )
1500 syntaxError(
scip, lpinput,
"expected value for right hand side.");
1503linsidevalue *= linsidesign;
1510linrhs = -linsidevalue;
1511 for( j = 0; j < nlincoefs; ++j )
1515linrhs = linsidevalue;
1519linrhs = linsidevalue;
1527assert(lincoefs !=
NULL);
1530initial = lpinput->initialconss && !lpinput->inlazyconstraints && !lpinput->inusercuts;
1532enforce = !lpinput->inusercuts;
1533check = !lpinput->inusercuts;
1536dynamic = lpinput->dynamicconss;
1537removable = lpinput->dynamicrows || lpinput->inusercuts;
1540initial, separate, enforce, check, propagate, local, dynamic, removable,
FALSE);
1546 SCIPdebugMsg(
scip,
"(line %d) created constraint%s: ", lpinput->linenumber,
1547lpinput->inlazyconstraints ?
" (lazy)": (lpinput->inusercuts ?
" (user cut)":
""));
1558 for( j = 0; j < nlincoefs; ++j )
1562initial, separate, enforce, check, propagate, local, dynamic, removable,
FALSE);
1568 SCIPdebugMsg(
scip,
"(line %d) created constraint%s: ", lpinput->linenumber,
1569lpinput->inlazyconstraints ?
" (lazy)": (lpinput->inusercuts ?
" (user cut)":
""));
1632assert(lpinput !=
NULL);
1638&quadcoefssize, &quadvars1, &quadvars2, &quadcoefs, &nquadcoefs,
NULL, &newsection) );
1644 if( ncoefs > 0 || nquadcoefs > 0 )
1645 syntaxError(
scip, lpinput,
"expected constraint sense '<=', '=', or '>='.");
1655 if( !
isSense(lpinput, &sense) )
1657 syntaxError(
scip, lpinput,
"expected constraint sense '<=', '=', or '>='.");
1669 if(
isSign(lpinput, &sidesign) )
1682sidevalue *= sidesign;
1707isIndicatorCons =
FALSE;
1711 if( *lpinput->token ==
'<')
1713 intlinepos = lpinput->linepos-1;
1719 if( *lpinput->token ==
'-')
1725 if( *lpinput->token ==
'>')
1727lpinput->linepos = linepos;
1730 "SCIP does not support equivalence (<->) indicator constraints; consider using the \"->\" form.");
1737lpinput->linepos = linepos;
1742 if( *lpinput->token ==
'-')
1751 if( *lpinput->token ==
'>')
1752isIndicatorCons =
TRUE;
1767 if( !isIndicatorCons )
1770initial = lpinput->initialconss && !lpinput->inlazyconstraints && !lpinput->inusercuts;
1772enforce = !lpinput->inusercuts;
1773check = !lpinput->inusercuts;
1776modifiable =
FALSE;
1777dynamic = lpinput->dynamicconss;
1778removable = lpinput->dynamicrows || lpinput->inusercuts;
1779 if( nquadcoefs == 0 )
1782initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE);
1787nquadcoefs, quadvars1, quadvars2, quadcoefs, lhs, rhs,
1788initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable);
1795 SCIPdebugMsg(
scip,
"(line %d) created constraint%s: ", lpinput->linenumber,
1796lpinput->inlazyconstraints ?
" (lazy)": (lpinput->inusercuts ?
" (user cut)":
""));
1803 if( ncoefs != 1 || nquadcoefs > 0 )
1805 syntaxError(
scip, lpinput,
"Indicator part can only consist of one binary variable.");
1808assert(coefs !=
NULL);
1811 syntaxError(
scip, lpinput,
"There cannot be a coefficient before the binary indicator variable.");
1816 syntaxError(
scip, lpinput,
"Indicator part cannot handle equations.");
1819assert(vars !=
NULL);
1843assert(lpinput !=
NULL);
1866hassign =
isSign(lpinput, &sign);
1879 syntaxError(
scip, lpinput,
"expected bound sense '<=', '=', or '>='.");
1884 switch( leftsense )
1923 if(
isSense(lpinput, &rightsense) )
1938hassign =
isSign(lpinput, &sign);
1953 switch( rightsense )
1981 syntaxError(
scip, lpinput,
"variable with bound is marked as 'free'.");
2014assert(lpinput !=
NULL);
2032 syntaxError(
scip, lpinput,
"unknown variable in generals section.");
2041 SCIPwarningMessage(
scip,
"variable <%s> declared as integer has non-integral bounds[%.14g, %.14g] -> if feasible, bounds will be adjusted\n",
SCIPvarGetName(var), lb, ub);
2059assert(lpinput !=
NULL);
2077 syntaxError(
scip, lpinput,
"unknown variable in binaries section.");
2123assert(lpinput !=
NULL);
2138 syntaxError(
scip, lpinput,
"expected 'CONTINUOUS' after 'SEMI-'.");
2158 syntaxError(
scip, lpinput,
"unknown variable in semi-continuous section.");
2211 SCIP_Boolinitial, separate, enforce, check, propagate;
2216assert(lpinput !=
NULL);
2219initial = lpinput->initialconss;
2225dynamic = lpinput->dynamicconss;
2226removable = lpinput->dynamicrows;
2246 if( strcmp(lpinput->token,
":") == 0 )
2269 syntaxError(
scip, lpinput,
"expected SOS type: 'S1::' or 'S2::'.");
2273 if( strcmp(lpinput->token,
":") == 0 )
2277lpinput->token[0] =
':';
2278lpinput->token[1] =
'\0';
2287 if( strcmp(lpinput->token,
"S1") == 0 )
2290 SCIP_CALL(
SCIPcreateConsSOS1(
scip, &cons, name, 0,
NULL,
NULL, initial, separate, enforce, check, propagate,
2291local, dynamic, removable,
FALSE) );
2293 else if( strcmp(lpinput->token,
"S2") == 0 )
2296 SCIP_CALL(
SCIPcreateConsSOS2(
scip, &cons, name, 0,
NULL,
NULL, initial, separate, enforce, check, propagate,
2297local, dynamic, removable,
FALSE) );
2301 syntaxError(
scip, lpinput,
"SOS constraint type other than 1 or 2 appeared.");
2304assert( type == 1 || type == 2 );
2309 if( !
getNextToken(
scip, lpinput) || strcmp(lpinput->token,
":") != 0 )
2311 syntaxError(
scip, lpinput,
"SOS constraint type has to be followed by two colons.");
2316 if( !
getNextToken(
scip, lpinput) || strcmp(lpinput->token,
":") != 0 )
2318 syntaxError(
scip, lpinput,
"SOS constraint type has to be followed by two colons.");
2347 if( !
getNextToken(
scip, lpinput) || strcmp(lpinput->token,
":") != 0 )
2365 if(
isSign(lpinput, &sign) )
2419 const char* filename
2422assert(lpinput !=
NULL);
2425lpinput->file =
SCIPfopen(filename,
"r");
2426 if( lpinput->file ==
NULL)
2440 switch( lpinput->section )
2531assert(vars !=
NULL);
2533assert(nvars !=
NULL);
2534assert(*vars !=
NULL|| *nvars == 0);
2536assert(constant !=
NULL);
2542 if( requiredsize > *nvars )
2548assert( requiredsize <= *nvars );
2560 for( v = 0; v < *nvars; ++v )
2570*constant += (*scalars)[v];
2571(*scalars)[v] *= -1.0;
2585assert( linebuffer !=
NULL);
2586assert( linecnt !=
NULL);
2589linebuffer[0] =
'\0';
2602assert( linebuffer !=
NULL);
2603assert( linecnt !=
NULL);
2606 if( (*linecnt) > 0 )
2608linebuffer[(*linecnt)] =
'\0';
2622 const char* extension
2626assert( linebuffer !=
NULL);
2627assert( linecnt !=
NULL);
2628assert( extension !=
NULL);
2635(void) strncat(linebuffer, extension,
LP_MAX_PRINTLEN- strlen(linebuffer));
2637(*linecnt) += (int) strlen(extension);
2639 SCIPdebugMsg(
scip,
"linebuffer <%s>, length = %lu\n", linebuffer, (
unsigned long)strlen(linebuffer));
2651 const char* rowname,
2652 const char* rownameextension,
2672assert( strcmp(type,
"=") == 0 || strcmp(type,
"<=") == 0 || strcmp(type,
">=") == 0 );
2673assert( nlinvars == 0 || (linvars !=
NULL&& linvals !=
NULL) );
2681 if( strlen(rowname) > 0 || strlen(rownameextension) > 0 )
2688 for( v = 0; v < nlinvars; ++v )
2692assert(linvars !=
NULL);
2693assert(linvals !=
NULL);
2696assert( var !=
NULL);
2709 if( quadexpr !=
NULL)
2717 intnbilinexprterms;
2729nactivevars = nlinexprs;
2731 for( v = 0; v < nlinexprs; ++v )
2733assert(linexprs !=
NULL&& linexprs[v] !=
NULL);
2737assert(activevars[v] !=
NULL);
2742constant += activeconstant;
2745 for( v = 0; v < nactivevars; ++v )
2749assert(activevars !=
NULL);
2750assert(activevals !=
NULL);
2752var = activevars[v];
2753assert( var !=
NULL);
2774 for( v = 0; v < nquadexprs; ++v )
2782assert(expr !=
NULL);
2786assert(var !=
NULL);
2788 if( lincoef == 0.0 )
2805 for( v = 0; v < nquadexprs; ++v )
2813assert(expr !=
NULL);
2817assert(var !=
NULL);
2819 if( sqrcoef == 0.0 )
2833 for( v = 0; v < nbilinexprterms; ++v )
2843assert(expr1 !=
NULL);
2845assert(expr2 !=
NULL);
2849assert(var1 !=
NULL);
2851assert(var2 !=
NULL);
2889 const char* rowname,
2906assert( rowname !=
NULL);
2907assert( quadexpr ==
NULL|| nlinvars == 0);
2910assert( nlinvars == 0 || linvars !=
NULL);
2911assert( lhs <= rhs );
2916nactivevars = nlinvars;
2921 if( linvals !=
NULL)
2929 for( v = 0; v < nactivevars; ++v )
2930activevals[v] = 1.0;
2943 SCIP_CALL(
printRow(
scip, file, rowname,
"",
"=", activevars, activevals, nactivevars, quadexpr,
2944rhs - activeconstant, transformed) );
2952nactivevars, quadexpr, lhs - activeconstant, transformed) );
2958nactivevars, quadexpr, rhs - activeconstant, transformed) );
2977 const char* rowname,
2992assert( file !=
NULL);
2993assert( type == 1 || type == 2 );
3001 if( strlen(rowname) > 0 )
3011 for( v = 0; v < nvars; ++v )
3015 if( weights !=
NULL)
3036 const char* consname,
3051assert(consname !=
NULL);
3052assert(cons !=
NULL);
3063 if( !aggrlinearizationands )
3065vars[0] = resultant;
3070 for( v = 0; v < nvars; ++v )
3073vars[1] = operands[v];
3082 for( v = nvars - 1; v >= 0; --v )
3084vars[v] = operands[v];
3088vars[nvars] = resultant;
3091 if( aggrlinearizationands )
3133assert( aggvars !=
NULL);
3134assert( naggvars !=
NULL);
3135assert( saggvars !=
NULL);
3138 for( v = 0; v < nvars; ++v )
3150assert( varAggregated !=
NULL);
3155 if( *saggvars <= *naggvars )
3159assert( newsize > *saggvars );
3161*saggvars = newsize;
3164(*aggvars)[*naggvars] = var;
3167assert( *naggvars <= *saggvars );
3181 intnAggregatedVars,
3199 for( j = 0; j < nAggregatedVars; ++j )
3204activevars[0] = aggregatedVars[j];
3205activevals[0] = 1.0;
3206activeconstant = 0.0;
3211activevals[nactivevars] = -1.0;
3212activevars[nactivevars] = aggregatedVars[j];
3217 SCIP_CALL(
printRow(
scip, file, consname,
"",
"=", activevars, activevals, nactivevars,
NULL, - activeconstant,
3240assert(vars !=
NULL|| nvars == 0);
3242printwarning =
TRUE;
3245 for( v = 0; v < nvars; ++v )
3249 SCIPwarningMessage(
scip,
"there is a variable name which has to be cut down to %d characters; LP might be corrupted\n",
3255 if( printwarning && isdigit((
unsigned char)
SCIPvarGetName(vars[v])[0]) )
3258 "it is not possible to read the generated LP file with SCIP; "\
3259 "use write/genproblem or write/gentransproblem for generic variable names\n");
3260printwarning =
FALSE;
3277 const char* conshdlrname;
3281assert( conss !=
NULL|| nconss == 0 );
3283 for( c = 0; c < nconss; ++c )
3287assert(conss !=
NULL);
3289assert(cons !=
NULL);
3295assert( conshdlr !=
NULL);
3302 if( strcmp(conshdlrname,
"linear") == 0 )
3320 if( printwarning && isdigit((
unsigned char)
SCIPconsGetName(cons)[0]) )
3323 "it is not possible to read the generated LP file with SCIP; "\
3324 "use write/genproblem or write/gentransproblem for generic variable names\n");
3325printwarning =
FALSE;
3339assert(reader !=
NULL);
3356assert(readerdata !=
NULL);
3377assert(reader !=
NULL);
3381nvars, nbinvars, nintvars, nimplvars, ncontvars, conss, nconss, result) );
3413 "reading/" READER_NAME "/linearize-and-constraints",
3414 "should possible \"and\" constraint be linearized when writing the lp file?",
3417 "reading/" READER_NAME "/aggrlinearization-ands",
3418 "should an aggregated linearization for and constraints be used?",
3429 const char* filename,
3438assert(reader !=
NULL);
3441lpinput.file =
NULL;
3443lpinput.linebuf[0] =
'\0';
3445lpinput.probname[0] =
'\0';
3446lpinput.objname[0] =
'\0';
3448lpinput.token[0] =
'\0';
3450lpinput.tokenbuf[0] =
'\0';
3456lpinput.npushedtokens = 0;
3457lpinput.linenumber = 0;
3458lpinput.linepos = 0;
3461lpinput.inlazyconstraints =
FALSE;
3462lpinput.inusercuts =
FALSE;
3463lpinput.haserror =
FALSE;
3489 if( lpinput.haserror )
3538 const char* conshdlrname;
3547 intnConsIndicator = 0;
3575 if( conshdlrInd !=
NULL)
3590 for( c = 0; c < nConsInd; ++c )
3592assert( consInd[c] !=
NULL);
3603 for( c = 0; c < nconss; ++c )
3606assert( cons !=
NULL);
3609assert( conshdlr !=
NULL);
3612 if( strcmp(conshdlrname,
"indicator") == 0 )
3617assert( lincons !=
NULL);
3635 SCIPinfoMessage(
scip, file,
"\\ Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
3636nvars, nbinvars, nintvars, nimplvars, ncontvars);
3646 for( v = 0; v < nvars; ++v )
3652 if( ! transformed )
3680 if( zeroobj && nvars >= 1 )
3695 if( reader !=
NULL)
3698assert(readerdata !=
NULL);
3700linearizeands = readerdata->linearizeands;
3701aggrlinearizationands = readerdata->aggrlinearizationands;
3718 for( c = 0; c < nconss; ++c )
3721assert( cons !=
NULL);
3734assert( conshdlr !=
NULL);
3740 if( strcmp(conshdlrname,
"linear") == 0 )
3746 else if( strcmp(conshdlrname,
"setppc") == 0 )
3755consvars,
NULL, nconsvars,
NULL, 1.0, 1.0, transformed) );
3767 else if( strcmp(conshdlrname,
"logicor") == 0 )
3773 else if( strcmp(conshdlrname,
"knapsack") == 0 )
3783 for( v = 0; v < nconsvars; ++v )
3791 else if( strcmp(conshdlrname,
"varbound") == 0 )
3808 else if( strcmp(conshdlrname,
"SOS1") == 0 )
3811consSOS1[nConsSOS1++] = cons;
3813 else if( strcmp(conshdlrname,
"SOS2") == 0 )
3816consSOS2[nConsSOS2++] = cons;
3818 else if( strcmp(conshdlrname,
"indicator") == 0 )
3829assert( conshdlrInd !=
NULL);
3835assert( lincons !=
NULL);
3836assert( binvar !=
NULL);
3837assert( slackvar !=
NULL);
3850assert( linvars !=
NULL);
3851assert( linvals !=
NULL);
3857 if( strlen(consname) > 0 )
3866 for( v = 0; v < nlinvars; ++v )
3869 if( var != slackvar )
3871consvars[cnt] = var;
3872consvals[cnt++] = linvals[v];
3886consIndicator[nConsIndicator++] = cons;
3888 else if( strcmp(conshdlrname,
"nonlinear") == 0 )
3908consExpr[nConsExpr++] = cons;
3911 else if( strcmp(conshdlrname,
"and") == 0 )
3913 if( linearizeands )
3935saggvars =
MAX(10, nvars);
3942 for( c = 0; c < nConsSOS1; ++c )
3952 for( c = 0; c < nConsSOS2; ++c )
3962 for( c = 0; c < nConsExpr; ++c )
3970 if( ntmpvars > tmpvarssize )
3982 for( c = 0; c < nConsIndicator; ++c )
3986cons = consIndicator[c];
4000 for( v = 0; v < nvars; ++v )
4003assert( var !=
NULL);
4049 for( v = 0; v < naggvars; ++v )
4052assert( var !=
NULL);
4066 for( v = 0; v < nvars; ++v )
4069assert( var !=
NULL);
4080 for( v = 0; v < naggvars; ++v )
4083assert( var !=
NULL);
4102 for( v = 0; v < nvars; ++v )
4105assert( var !=
NULL);
4116 for( v = 0; v < naggvars; ++v )
4119assert( var !=
NULL);
4135 if( conshdlrInd !=
NULL)
4139 if( nConsSOS1 > 0 || nConsSOS2 > 0 )
4145 for( c = 0; c < nConsSOS1; ++c )
4157 for( c = 0; c < nConsSOS2; ++c )
Constraint handler for AND constraints, .
constraint handler for bound disjunction constraints
constraint handler for indicator 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 SOS type 1 constraints
constraint handler for SOS type 2 constraints
Constraint handler for variable bound constraints .
#define SCIP_CALL_ABORT(x)
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
SCIP_RETCODE SCIPcheckQuadraticNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *isquadratic)
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 * SCIPgetWeightsSOS2(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsSOS2(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)
SCIP_RETCODE SCIPaddVarSOS1(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real weight)
SCIP_RETCODE SCIPcreateConsBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, 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_RETCODE SCIPcreateConsIndicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsSOS1(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *weights, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsSOS2(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetWeightsSOS1(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_VAR * SCIPgetBinaryVarIndicator(SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetSlackVarIndicator(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_CONS * SCIPgetLinearConsIndicator(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsSOS2(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *weights, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
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 ** SCIPgetVarsSOS1(SCIP *scip, SCIP_CONS *cons)
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_RETCODE SCIPcreateConsQuadraticNonlinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, 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)
int SCIPgetNVarsSOS1(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsNonlinear(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarSOS2(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real weight)
@ SCIP_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
SCIP_RETCODE SCIPreadLp(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
SCIP_RETCODE SCIPwriteLp(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 SCIPincludeReaderLp(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 SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
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 SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_RETCODE SCIPhashmapSetImage(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
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)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_CONS ** SCIPconshdlrGetConss(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 SCIPconsIsDeleted(SCIP_CONS *cons)
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)
void SCIPexprGetQuadraticBilinTerm(SCIP_EXPR *expr, int termidx, SCIP_EXPR **expr1, SCIP_EXPR **expr2, SCIP_Real *coef, int *pos2, SCIP_EXPR **prodexpr)
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_Bool SCIPisExprVar(SCIP *scip, 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)
#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)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPallocBlockMemory(scip, ptr)
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)))
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
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 SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(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_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(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 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 SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
static const SCIP_Real scalars[]
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for managing constraints
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 input file readers
public methods for problem variables
static SCIP_DECL_READERWRITE(readerWriteLp)
static SCIP_RETCODE printAndCons(SCIP *scip, FILE *file, const char *consname, SCIP_CONS *cons, SCIP_Bool aggrlinearizationands, SCIP_Bool transformed)
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR ***vars, SCIP_Real **scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
#define LP_INIT_COEFSSIZE
static SCIP_DECL_READERCOPY(readerCopyLp)
static SCIP_Bool isSign(LPINPUT *lpinput, int *sign)
static SCIP_Bool isNewSection(SCIP *scip, LPINPUT *lpinput)
#define LP_INIT_QUADCOEFSSIZE
static void clearLine(char *linebuffer, int *linecnt)
static SCIP_Bool hasError(LPINPUT *lpinput)
static void pushToken(LPINPUT *lpinput)
static SCIP_Bool getNextLine(SCIP *scip, LPINPUT *lpinput)
static SCIP_DECL_READERREAD(readerReadLp)
static void swapTokenBuffer(LPINPUT *lpinput)
static SCIP_DECL_HASHGETKEY(hashGetKeyVar)
static SCIP_RETCODE readConstraints(SCIP *scip, LPINPUT *lpinput)
static SCIP_RETCODE readBinaries(SCIP *scip, LPINPUT *lpinput)
static SCIP_RETCODE readSemicontinuous(SCIP *scip, LPINPUT *lpinput)
static SCIP_Bool getNextToken(SCIP *scip, LPINPUT *lpinput)
static void printSosCons(SCIP *scip, FILE *file, const char *rowname, SCIP_VAR **vars, SCIP_Real *weights, int nvars, int type)
static const char commentchars[]
static void checkVarnames(SCIP *scip, SCIP_VAR **vars, int nvars)
static SCIP_Bool isValueChar(char c, char nextc, SCIP_Bool firstchar, SCIP_Bool *hasdot, LPEXPTYPE *exptype)
static SCIP_RETCODE printAggregatedCons(SCIP *scip, FILE *file, SCIP_Bool transformed, int nvars, int nAggregatedVars, SCIP_VAR **aggregatedVars)
static SCIP_RETCODE readGenerals(SCIP *scip, LPINPUT *lpinput)
#define LP_MAX_PUSHEDTOKENS
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 readObjective(SCIP *scip, LPINPUT *lpinput)
static SCIP_Bool isValue(SCIP *scip, LPINPUT *lpinput, SCIP_Real *value)
static SCIP_RETCODE readSos(SCIP *scip, LPINPUT *lpinput)
static SCIP_RETCODE createIndicatorConstraint(SCIP *scip, LPINPUT *lpinput, const char *name, SCIP_VAR *binvar, SCIP_Real binvalue)
static void syntaxError(SCIP *scip, LPINPUT *lpinput, const char *msg)
static void pushBufferToken(LPINPUT *lpinput)
static void endLine(SCIP *scip, FILE *file, char *linebuffer, int *linecnt)
static SCIP_RETCODE readCoefficients(SCIP *scip, LPINPUT *lpinput, SCIP_Bool isobjective, char *name, int *coefssize, SCIP_VAR ***vars, SCIP_Real **coefs, int *ncoefs, int *quadcoefssize, SCIP_VAR ***quadvars1, SCIP_VAR ***quadvars2, SCIP_Real **quadcoefs, int *nquadcoefs, SCIP_Real *objoffset, SCIP_Bool *newsection)
static SCIP_Bool isSense(LPINPUT *lpinput, LPSENSE *sense)
static SCIP_Bool isDelimChar(char c)
static void swapPointers(char **pointer1, char **pointer2)
static SCIP_DECL_HASHKEYEQ(hashKeyEqVar)
static SCIP_DECL_HASHKEYVAL(hashKeyValVar)
static SCIP_RETCODE readBounds(SCIP *scip, LPINPUT *lpinput)
static SCIP_DECL_READERFREE(readerFreeLp)
#define DEFAULT_AGGRLINEARIZATION_ANDS
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 readStart(SCIP *scip, LPINPUT *lpinput)
static SCIP_RETCODE collectAggregatedVars(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_VAR ***aggvars, int *naggvars, int *saggvars, SCIP_HASHTABLE *varAggregated)
static SCIP_RETCODE readLPFile(SCIP *scip, LPINPUT *lpinput, const char *filename)
static void checkConsnames(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool transformed)
static void appendLine(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *extension)
static SCIP_RETCODE getVariable(SCIP *scip, char *name, SCIP_VAR **var, SCIP_Bool *created)
#define DEFAULT_LINEARIZE_ANDS
static SCIP_Bool isTokenChar(char c)
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_BoundType SCIP_BOUNDTYPE
enum SCIP_Objsense SCIP_OBJSENSE
struct SCIP_ReaderData SCIP_READERDATA
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