72#define READER_NAME "lpreader"
73#define READER_DESC "file reader for MIPs in IBM CPLEX's LP file format"
74#define READER_EXTENSION "lp"
76#define DEFAULT_LINEARIZE_ANDS TRUE
77#define DEFAULT_AGGRLINEARIZATION_ANDS TRUE
83#define LP_MAX_LINELEN 65536
84#define LP_MAX_PUSHEDTOKENS 2
85#define LP_INIT_COEFSSIZE 8192
86#define LP_INIT_QUADCOEFSSIZE 16
87#define LP_MAX_PRINTLEN 561
88#define LP_MAX_NAMELEN 256
89#define LP_PRINTLEN 100
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);
175 lpinput->section =
LP_END;
176 lpinput->haserror =
TRUE;
187 return lpinput->haserror;
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) )
291 lpinput->linepos = 0;
292 lpinput->linebuf[lpinput->linebufsize - 2] =
'\0';
294 if(
SCIPfgets(lpinput->linebuf, lpinput->linebufsize, lpinput->file) ==
NULL )
302 lpinput->linenumber++;
305 while( lpinput->linebuf[lpinput->linebufsize - 2] !=
'\0' )
312 lpinput->linebuf[newsize-2] =
'\0';
313 if (
SCIPfgets(lpinput->linebuf + lpinput->linebufsize - 1, newsize - lpinput->linebufsize + 1, lpinput->file) ==
NULL )
315 lpinput->linebufsize = newsize;
317 lpinput->linebuf[lpinput->linebufsize - 1] =
'\0';
325 if( commentstart !=
NULL )
327 *commentstart =
'\0';
328 *(commentstart+1) =
'\0';
347 *pointer1 = *pointer2;
364 assert(lpinput->linepos < lpinput->linebufsize);
367 if( lpinput->npushedtokens > 0 )
369 swapPointers(&lpinput->token, &lpinput->pushedtokens[lpinput->npushedtokens-1]);
370 lpinput->npushedtokens--;
372 SCIPdebugMsg(
scip,
"(line %d) read token again: '%s'\n", lpinput->linenumber, lpinput->token);
377 buf = lpinput->linebuf;
380 if( buf[lpinput->linepos] ==
'\0' )
384 lpinput->section =
LP_END;
388 assert(lpinput->linepos == 0);
390 buf = lpinput->linebuf;
395 assert(lpinput->linepos < lpinput->linebufsize);
401 if(
isValueChar(buf[lpinput->linepos], buf[lpinput->linepos+1],
TRUE, &hasdot, &exptype) )
409 lpinput->token[tokenlen] = buf[lpinput->linepos];
413 while(
isValueChar(buf[lpinput->linepos], buf[lpinput->linepos+1],
FALSE, &hasdot, &exptype) );
422 lpinput->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] ==
'>') )
446 lpinput->token[tokenlen-1] = buf[lpinput->linepos];
451 lpinput->token[tokenlen] =
'\0';
453 SCIPdebugMsg(
scip,
"(line %d) read token: '%s'\n", lpinput->linenumber, lpinput->token);
467 swapPointers(&lpinput->pushedtokens[lpinput->npushedtokens], &lpinput->token);
468 lpinput->npushedtokens++;
480 swapPointers(&lpinput->pushedtokens[lpinput->npushedtokens], &lpinput->tokenbuf);
481 lpinput->npushedtokens++;
514 iscolon = (*lpinput->token ==
':');
525 len = strlen(lpinput->token);
529 if( len > 1 && (len < 9 || len == 15) )
534 while( lpinput->token[
c] !=
'\0' )
536 token[
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);
572 lpinput->inlazyconstraints =
FALSE;
573 lpinput->inusercuts =
FALSE;
582 if( len == 4 && strcmp(token,
"SUCH") == 0 )
590 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS\n", lpinput->linenumber);
592 lpinput->inlazyconstraints =
FALSE;
593 lpinput->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);
608 lpinput->inlazyconstraints =
FALSE;
609 lpinput->inusercuts =
FALSE;
613 if( len == 4 && strcmp(token,
"LAZY") == 0 )
621 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS (lazy)\n", lpinput->linenumber);
623 lpinput->inlazyconstraints =
TRUE;
624 lpinput->inusercuts =
FALSE;
633 if( len == 4 && strcmp(token,
"USER") == 0 )
641 SCIPdebugMsg(
scip,
"(line %d) new section: CONSTRAINTS (user cuts)\n", lpinput->linenumber);
643 lpinput->inlazyconstraints =
FALSE;
644 lpinput->inusercuts =
TRUE;
653 if( (len == 5 && strcmp(token,
"BOUND") == 0)
654 || (len == 6 && strcmp(token,
"BOUNDS") == 0) )
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 )
691 lpinput->section =
LP_SOS;
695 if( len == 3 && strcmp(token,
"END") == 0 )
698 lpinput->section =
LP_END;
715 assert(*sign == +1 || *sign == -1);
717 if( lpinput->token[1] ==
'\0' )
719 if( *lpinput->token ==
'+' )
721 else if( *lpinput->token ==
'-' )
752 val = strtod(lpinput->token, &endptr);
753 if( endptr != lpinput->token && *endptr ==
'\0' )
772 if( strcmp(lpinput->token,
"<") == 0 )
778 else if( strcmp(lpinput->token,
">") == 0 )
784 else if( strcmp(lpinput->token,
"=") == 0 )
815 initial = !dynamiccols;
816 removable = dynamiccols;
830 if( created !=
NULL )
833 else if( created !=
NULL )
939 if( strcmp(lpinput->token,
":") == 0 )
945 SCIPdebugMsg(
scip,
"(line %d) read constraint name: '%s'\n", lpinput->linenumber, name);
982 if( lpinput->token[1] ==
'\0' && ( *lpinput->token ==
'+' || *lpinput->token ==
'-' ) )
985 if( isobjective && havevalue &&
var ==
NULL )
993 SCIPdebugMsg(
scip,
"(line %d) read objective offset %g\n", lpinput->linenumber, coefsign * coef);
994 haveobjoffset =
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");
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 ?
'+' :
'-');
1070 SCIPdebugMsg(
scip,
"(line %d) read objective offset %g\n", lpinput->linenumber, coefsign * coef);
1071 *objoffset = coefsign * coef;
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.");
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 )
1220 oldcoefssize = *coefssize;
1222 *coefssize =
MAX(*coefssize, (*ncoefs)+1);
1226 assert(*ncoefs < *coefssize);
1229 (*vars)[*ncoefs] =
var;
1230 (*coefs)[*ncoefs] = coefsign * coef;
1236 if( firstquadvar ==
NULL )
1248 if( *nquadcoefs >= *quadcoefssize )
1250 int oldquadcoefssize;
1251 oldquadcoefssize = *quadcoefssize;
1252 *quadcoefssize *= 2;
1253 *quadcoefssize =
MAX(*quadcoefssize, (*nquadcoefs)+1);
1258 assert(*nquadcoefs < *quadcoefssize);
1261 (*quadvars1)[*nquadcoefs] = firstquadvar;
1262 (*quadvars2)[*nquadcoefs] =
var;
1263 (*quadcoefs)[*nquadcoefs] = coefsign * coef;
1265 (*quadcoefs)[*nquadcoefs] /= 2.0;
1275 firstquadvar =
NULL;
1305 &quadcoefssize, &quadvars1, &quadvars2, &quadcoefs, &nquadcoefs, &objoffset, &newsection) );
1317 for(
i = 0;
i < ncoefs; ++
i )
1330 if( nquadcoefs > 0 )
1354 SCIP_CALL(
SCIPcreateConsQuadraticNonlinear(
scip, &quadobjcons,
"quadobj", 1, &quadobjvar, &minusone, nquadcoefs, quadvars1, quadvars2, quadcoefs, lhs, rhs,
1422 syntaxError(
scip, lpinput,
"value for binary variable must be '0' or '1'.");
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) )
1503 linsidevalue *= linsidesign;
1510 linrhs = -linsidevalue;
1511 for( j = 0; j < nlincoefs; ++j )
1515 linrhs = linsidevalue;
1519 linrhs = linsidevalue;
1530 initial = lpinput->initialconss && !lpinput->inlazyconstraints && !lpinput->inusercuts;
1532 enforce = !lpinput->inusercuts;
1533 check = !lpinput->inusercuts;
1536 dynamic = lpinput->dynamicconss;
1537 removable = lpinput->dynamicrows || lpinput->inusercuts;
1540 initial, separate, enforce, check,
propagate, local, dynamic, removable,
FALSE);
1546 SCIPdebugMsg(
scip,
"(line %d) created constraint%s: ", lpinput->linenumber,
1547 lpinput->inlazyconstraints ?
" (lazy)" : (lpinput->inusercuts ?
" (user cut)" :
""));
1558 for( j = 0; j < nlincoefs; ++j )
1562 initial, separate, enforce, check,
propagate, local, dynamic, removable,
FALSE);
1568 SCIPdebugMsg(
scip,
"(line %d) created constraint%s: ", lpinput->linenumber,
1569 lpinput->inlazyconstraints ?
" (lazy)" : (lpinput->inusercuts ?
" (user cut)" :
""));
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) )
1682 sidevalue *= sidesign;
1707 isIndicatorCons =
FALSE;
1711 if ( *lpinput->token ==
'<' )
1713 int linepos = lpinput->linepos-1;
1719 if ( *lpinput->token ==
'-' )
1725 if ( *lpinput->token ==
'>' )
1727 lpinput->linepos = linepos;
1730 "SCIP does not support equivalence (<->) indicator constraints; consider using the \"->\" form.");
1737 lpinput->linepos = linepos;
1742 if ( *lpinput->token ==
'-' )
1751 if ( *lpinput->token ==
'>' )
1752 isIndicatorCons =
TRUE;
1767 if( !isIndicatorCons )
1770 initial = lpinput->initialconss && !lpinput->inlazyconstraints && !lpinput->inusercuts;
1772 enforce = !lpinput->inusercuts;
1773 check = !lpinput->inusercuts;
1777 dynamic = lpinput->dynamicconss;
1778 removable = lpinput->dynamicrows || lpinput->inusercuts;
1779 if( nquadcoefs == 0 )
1782 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable,
FALSE);
1787 nquadcoefs, quadvars1, quadvars2, quadcoefs, lhs, rhs,
1788 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable);
1795 SCIPdebugMsg(
scip,
"(line %d) created constraint%s: ", lpinput->linenumber,
1796 lpinput->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.");
1811 syntaxError(
scip, lpinput,
"There cannot be a coefficient before the binary indicator variable.");
1816 syntaxError(
scip, lpinput,
"Indicator part cannot handle equations.");
1866 hassign =
isSign(lpinput, &sign);
1879 syntaxError(
scip, lpinput,
"expected bound sense '<=', '=', or '>='.");
1923 if(
isSense(lpinput, &rightsense) )
1938 hassign =
isSign(lpinput, &sign);
1953 switch( rightsense )
1981 syntaxError(
scip, lpinput,
"variable with bound is marked as 'free'.");
2158 syntaxError(
scip, lpinput,
"unknown variable in semi-continuous section.");
2219 initial = lpinput->initialconss;
2225 dynamic = lpinput->dynamicconss;
2226 removable = lpinput->dynamicrows;
2246 if( strcmp(lpinput->token,
":") == 0 )
2273 if( strcmp(lpinput->token,
":") == 0 )
2277 lpinput->token[0] =
':';
2278 lpinput->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,
2291 local, 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,
2297 local, dynamic, removable,
FALSE) );
2301 syntaxError(
scip, lpinput,
"SOS constraint type other than 1 or 2 appeared.");
2304 assert( type == 1 || type == 2 );
2311 syntaxError(
scip, lpinput,
"SOS constraint type has to be followed by two colons.");
2318 syntaxError(
scip, lpinput,
"SOS constraint type has to be followed by two colons.");
2365 if(
isSign(lpinput, &sign) )
2419 const char* filename
2425 lpinput->file =
SCIPfopen(filename,
"r");
2426 if( lpinput->file ==
NULL )
2440 switch( lpinput->section )
2542 if( requiredsize > *
nvars )
2560 for( v = 0; v < *
nvars; ++v )
2570 *constant += (*scalars)[v];
2571 (*scalars)[v] *= -1.0;
2589 linebuffer[0] =
'\0';
2606 if( (*linecnt) > 0 )
2608 linebuffer[(*linecnt)] =
'\0';
2622 const char* extension
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,
2672 assert( strcmp(type,
"=") == 0 || strcmp(type,
"<=") == 0 || strcmp(type,
">=") == 0 );
2681 if( strlen(rowname) > 0 || strlen(rownameextension) > 0 )
2688 for( v = 0; v < nlinvars; ++v )
2709 if( quadexpr !=
NULL )
2717 int nbilinexprterms;
2729 nactivevars = nlinexprs;
2731 for( v = 0; v < nlinexprs; ++v )
2742 constant += activeconstant;
2745 for( v = 0; v < nactivevars; ++v )
2752 var = activevars[v];
2774 for( v = 0; v < nquadexprs; ++v )
2788 if( lincoef == 0.0 )
2805 for( v = 0; v < nquadexprs; ++v )
2819 if( sqrcoef == 0.0 )
2833 for( v = 0; v < nbilinexprterms; ++v )
2889 const char* rowname,
2916 nactivevars = nlinvars;
2921 if( linvals !=
NULL )
2929 for( v = 0; v < nactivevars; ++v )
2930 activevals[v] = 1.0;
2944 rhs - activeconstant, transformed) );
2952 nactivevars, quadexpr, lhs - activeconstant, transformed) );
2958 nactivevars, quadexpr, rhs - activeconstant, transformed) );
2977 const char* rowname,
2993 assert( type == 1 || type == 2 );
3001 if( strlen(rowname) > 0 )
3011 for( v = 0; v <
nvars; ++v )
3015 if( weights !=
NULL )
3036 const char* consname,
3063 if( !aggrlinearizationands )
3065 vars[0] = resultant;
3070 for( v = 0; v <
nvars; ++v )
3073 vars[1] = operands[v];
3082 for( v =
nvars - 1; v >= 0; --v )
3084 vars[v] = operands[v];
3091 if( aggrlinearizationands )
3138 for( v = 0; v <
nvars; ++v )
3155 if ( *saggvars <= *naggvars )
3159 assert( newsize > *saggvars );
3161 *saggvars = newsize;
3164 (*aggvars)[*naggvars] =
var;
3167 assert( *naggvars <= *saggvars );
3181 int nAggregatedVars,
3199 for( j = 0; j < nAggregatedVars; ++j )
3204 activevars[0] = aggregatedVars[j];
3205 activevals[0] = 1.0;
3206 activeconstant = 0.0;
3211 activevals[nactivevars] = -1.0;
3212 activevars[nactivevars] = aggregatedVars[j];
3217 SCIP_CALL(
printRow(
scip, file, consname,
"",
"=", activevars, activevals, nactivevars,
NULL, - activeconstant,
3242 printwarning =
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",
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");
3260 printwarning =
FALSE;
3277 const char* conshdlrname;
3283 for(
c = 0;
c < nconss; ++
c )
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");
3325 printwarning =
FALSE;
3413 "reading/" READER_NAME "/linearize-and-constraints",
3414 "should possible \"and\" constraint be linearized when writing the lp file?",
3418 "should an aggregated linearization for and constraints be used?",
3429 const char* filename,
3441 lpinput.file =
NULL;
3443 lpinput.linebuf[0] =
'\0';
3445 lpinput.probname[0] =
'\0';
3446 lpinput.objname[0] =
'\0';
3448 lpinput.token[0] =
'\0';
3450 lpinput.tokenbuf[0] =
'\0';
3456 lpinput.npushedtokens = 0;
3457 lpinput.linenumber = 0;
3458 lpinput.linepos = 0;
3461 lpinput.inlazyconstraints =
FALSE;
3462 lpinput.inusercuts =
FALSE;
3463 lpinput.haserror =
FALSE;
3489 if( lpinput.haserror )
3538 const char* conshdlrname;
3547 int nConsIndicator = 0;
3575 if( conshdlrInd !=
NULL )
3590 for(
c = 0;
c < nConsInd; ++
c )
3603 for(
c = 0;
c < nconss; ++
c )
3612 if( strcmp(conshdlrname,
"indicator") == 0 )
3635 SCIPinfoMessage(
scip, file,
"\\ Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
3646 for( v = 0; v <
nvars; ++v )
3680 if( zeroobj &&
nvars >= 1 )
3695 if( reader !=
NULL )
3700 linearizeands = readerdata->linearizeands;
3701 aggrlinearizationands = readerdata->aggrlinearizationands;
3718 for(
c = 0;
c < nconss; ++
c )
3740 if( strcmp(conshdlrname,
"linear") == 0 )
3746 else if( strcmp(conshdlrname,
"setppc") == 0 )
3755 consvars,
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 )
3811 consSOS1[nConsSOS1++] = cons;
3813 else if( strcmp(conshdlrname,
"SOS2") == 0 )
3816 consSOS2[nConsSOS2++] = cons;
3818 else if( strcmp(conshdlrname,
"indicator") == 0 )
3857 if( strlen(consname) > 0 )
3866 for( v = 0; v < nlinvars; ++v )
3869 if(
var != slackvar )
3871 consvars[cnt] =
var;
3872 consvals[cnt++] = linvals[v];
3886 consIndicator[nConsIndicator++] = cons;
3888 else if( strcmp(conshdlrname,
"nonlinear") == 0 )
3908 consExpr[nConsExpr++] = cons;
3911 else if( strcmp(conshdlrname,
"and") == 0 )
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 )
3986 cons = consIndicator[
c];
4000 for( v = 0; v <
nvars; ++v )
4049 for( v = 0; v < naggvars; ++v )
4066 for( v = 0; v <
nvars; ++v )
4080 for( v = 0; v < naggvars; ++v )
4102 for( v = 0; v <
nvars; ++v )
4116 for( v = 0; v < naggvars; ++v )
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 SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader,)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader,)
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader,)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader,)
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)
assert(minobj< SCIPgetCutoffbound(scip))
static SCIP_Bool propagate
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
#define LP_INIT_COEFSSIZE
static SCIP_Bool hasError(LPINPUT *lpinput)
static const char commentchars[]
#define LP_MAX_PUSHEDTOKENS
static SCIP_Bool isTokenChar(char c)
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)
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 void swapTokenBuffer(LPINPUT *lpinput)
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 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_RETCODE readBounds(SCIP *scip, LPINPUT *lpinput)
#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
struct SCIP_Cons SCIP_CONS
struct SCIP_Conshdlr SCIP_CONSHDLR
struct SCIP_Expr SCIP_EXPR
enum SCIP_BoundType SCIP_BOUNDTYPE
struct SCIP_HashMap SCIP_HASHMAP
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHGETKEY(x)
#define SCIP_DECL_HASHKEYVAL(x)
struct SCIP_HashTable SCIP_HASHTABLE
enum SCIP_Objsense SCIP_OBJSENSE
#define SCIP_DECL_READERWRITE(x)
struct SCIP_ReaderData SCIP_READERDATA
struct SCIP_Reader SCIP_READER
#define SCIP_DECL_READERREAD(x)
#define SCIP_DECL_READERCOPY(x)
#define SCIP_DECL_READERFREE(x)
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