54 #define READER_NAME "mpsreader" 55 #define READER_DESC "file reader for MIQPs in IBM's Mathematical Programming System format" 56 #define READER_EXTENSION "mps" 58 #define DEFAULT_LINEARIZE_ANDS TRUE 59 #define DEFAULT_AGGRLINEARIZATION_ANDS TRUE 65 #define MPS_MAX_LINELEN 1024 66 #define MPS_MAX_NAMELEN 256 67 #define MPS_MAX_VALUELEN 26 68 #define MPS_MAX_FIELDLEN 20 70 #define PATCH_CHAR '_' 74 struct SCIP_ReaderData
147 assert(mpsi !=
NULL);
156 (*mpsi)->haserror =
FALSE;
157 (*mpsi)->isinteger =
FALSE;
158 (*mpsi)->isnewformat =
FALSE;
159 (*mpsi)->buf [0] =
'\0';
160 (*mpsi)->probname[0] =
'\0';
161 (*mpsi)->objname [0] =
'\0';
193 assert(mpsi !=
NULL);
195 return mpsi->section;
204 assert(mpsi !=
NULL);
215 assert(mpsi !=
NULL);
226 assert(mpsi !=
NULL);
237 assert(mpsi !=
NULL);
248 assert(mpsi !=
NULL);
259 assert(mpsi !=
NULL);
267 const char* mpsinputProbname(
271 assert(mpsi !=
NULL);
273 return mpsi->probname;
283 assert(mpsi !=
NULL);
285 return mpsi->objname;
294 assert(mpsi !=
NULL);
296 return mpsi->objsense;
305 assert(mpsi !=
NULL);
307 return mpsi->haserror;
316 assert(mpsi !=
NULL);
318 return mpsi->isinteger;
328 assert(mpsi !=
NULL);
330 mpsi->section = section;
340 assert(mpsi !=
NULL);
341 assert(probname !=
NULL);
342 assert(strlen(probname) <
sizeof(mpsi->probname));
354 assert(mpsi !=
NULL);
355 assert(objname !=
NULL);
356 assert(strlen(objname) <
sizeof(mpsi->objname));
368 assert(mpsi !=
NULL);
370 mpsi->objsense = sense;
378 assert(mpsi !=
NULL);
382 mpsi->haserror =
TRUE;
391 const char* what_name,
393 const char* entity_name,
397 assert(mpsi !=
NULL);
398 assert(what !=
NULL);
399 assert(what_name !=
NULL);
400 assert(entity !=
NULL);
401 assert(entity_name !=
NULL);
404 "Warning line %d: %s \"%s\" for %s \"%s\" ignored\n", mpsi->lineno, what, what_name, entity, entity_name);
416 for(i = pos; i < 80; i++)
431 while( (beg <= end) && (buf[end] ==
BLANK) )
434 while( (beg <= end) && (buf[beg] ==
BLANK) )
437 for( i = beg; i <= end; i++ )
438 if( buf[i] ==
BLANK )
458 mpsi->f0 = mpsi->f1 = mpsi->f2 = mpsi->f3 = mpsi->f4 = mpsi->f5 = 0;
465 if(
NULL ==
SCIPfgets(mpsi->buf, (
int)
sizeof(mpsi->buf), mpsi->fp) )
469 while( *mpsi->buf ==
'*' );
472 len = (
unsigned int) strlen(mpsi->buf);
474 for( i = 0; i < len; i++ )
475 if( (mpsi->buf[i] ==
'\t') || (mpsi->buf[i] ==
'\n') || (mpsi->buf[i] ==
'\r') )
476 mpsi->buf[i] =
BLANK;
483 assert(strlen(mpsi->buf) >= 80);
486 if( *mpsi->buf !=
BLANK )
488 mpsi->f0 =
SCIPstrtok(&mpsi->buf[0],
" ", &nexttok);
490 assert(mpsi->f0 != 0);
498 if( !mpsi->isnewformat )
501 if( (mpsi->buf[14] ==
'$') && (mpsi->buf[13] ==
' ') )
503 else if( (mpsi->buf[39] ==
'$') && (mpsi->buf[38] ==
' ') )
507 space = mpsi->buf[12] | mpsi->buf[13]
508 | mpsi->buf[22] | mpsi->buf[23]
509 | mpsi->buf[36] | mpsi->buf[37] | mpsi->buf[38]
510 | mpsi->buf[47] | mpsi->buf[48]
511 | mpsi->buf[61] | mpsi->buf[62] | mpsi->buf[63];
521 number = isdigit((
unsigned char)mpsi->buf[24]) || isdigit((
unsigned char)mpsi->buf[25])
522 || isdigit((
unsigned char)mpsi->buf[26]) || isdigit((
unsigned char)mpsi->buf[27])
523 || isdigit((
unsigned char)mpsi->buf[28]) || isdigit((
unsigned char)mpsi->buf[29])
524 || isdigit((
unsigned char)mpsi->buf[30]) || isdigit((
unsigned char)mpsi->buf[31])
525 || isdigit((
unsigned char)mpsi->buf[32]) || isdigit((
unsigned char)mpsi->buf[33])
526 || isdigit((
unsigned char)mpsi->buf[34]) || isdigit((
unsigned char)mpsi->buf[35]);
531 if( number || len < 14 )
542 mpsi->isnewformat =
TRUE;
547 mpsi->isnewformat =
TRUE;
571 if( !strcmp(mpsi->f2,
"'MARKER'") )
581 if( !strcmp(mpsi->f3,
"'INTORG'") )
582 mpsi->isinteger =
TRUE;
583 else if( !strcmp(mpsi->f3,
"'INTEND'") )
584 mpsi->isinteger =
FALSE;
588 if( !strcmp(mpsi->f3,
"'MARKER'") )
598 if( !strcmp(mpsi->f4,
"'INTORG'") )
599 mpsi->isinteger =
TRUE;
600 else if( !strcmp(mpsi->f4,
"'INTEND'") )
601 mpsi->isinteger =
FALSE;
611 is_empty = (mpsi->f0 ==
NULL && mpsi->f1 ==
NULL);
613 while( is_marker || is_empty );
625 assert(mpsi !=
NULL);
640 assert(mpsi !=
NULL);
641 assert(name !=
NULL);
663 assert(mpsi !=
NULL);
710 assert(mpsi !=
NULL);
762 assert(mpsi !=
NULL);
851 dynamic = mpsi->dynamicconss;
858 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE) );
862 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE) );
866 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE) );
1030 SCIPwarningMessage(scip,
"reading rhs section, a field is missing, assuming that the vector name is the missing one(, row identfier <%s>)\n",
mpsinputField2(mpsi));
1038 if( *rhsname ==
'\0' )
1175 SCIPwarningMessage(scip,
"reading ranged section, a field is missing, assuming that the vector name is the missing one(, row identfier <%s>)\n",
mpsinputField2(mpsi));
1183 if( *rngname ==
'\0' )
1318 goto READBOUNDS_FINISH;
1383 if( *bndname ==
'\0' )
1407 assert(var !=
NULL);
1425 assert(!infeasible);
1457 SCIPwarningMessage(scip,
"variable <%s> declared as integral has a non-integral lower bound (%.14g) -> if feasible, bounds will be adjusted\n",
SCIPvarGetName(var), val);
1466 SCIPwarningMessage(scip,
"variable <%s> declared as integral has a non-integral lower bound (%.14g) -> if feasible, bounds will be adjusted\n",
SCIPvarGetName(var), val);
1482 SCIPwarningMessage(scip,
"variable <%s> declared as integral has a non-integral upper bound (%.14g) -> if feasible, bounds will be adjusted\n",
SCIPvarGetName(var), val);
1492 SCIPwarningMessage(scip,
"variable <%s> declared as integral has a non-integral upper bound (%.14g) -> if feasible, bounds will be adjusted\n",
SCIPvarGetName(var), val);
1499 if( semicontsize <= nsemicont )
1502 if( semicont ==
NULL )
1511 assert(semicont !=
NULL);
1512 semicont[nsemicont] = var;
1570 assert(*bndname !=
'\0');
1594 assert(semicont !=
NULL);
1597 for( i = 0; i < nsemicont; ++i )
1603 assert(oldlb >= 0.0);
1675 initial = mpsi->initialconss;
1682 dynamic = mpsi->dynamicconss;
1683 removable = mpsi->dynamicrows;
1721 assert( type == 1 || type == 2 );
1744 SCIP_CALL(
SCIPcreateConsSOS1(scip, &cons, name, 0,
NULL,
NULL, initial, separate, enforce, check, propagate,
1745 local, modifiable, dynamic, removable) );
1749 assert( type == 2 );
1750 SCIP_CALL(
SCIPcreateConsSOS2(scip, &cons, name, 0,
NULL,
NULL, initial, separate, enforce, check, propagate,
1751 local, modifiable, dynamic, removable) );
1754 SCIPdebugMsg(scip,
"created constraint <%s> of type %d.\n", name, type);
1764 if( consType != 1 && consType != 2 )
1790 assert( consType == 1 || consType == 2 );
1854 SCIPdebugMsg(scip,
"read %s objective\n", isQuadObj ?
"QUADOBJ" :
"QMATRIX");
1902 for( k = 1; k <= 2; ++k )
1918 coef = strtod(field, &endptr);
1919 if( endptr == field || *endptr !=
'\0' )
1933 assert(newsize > size);
1940 quadvars1[cnt] = var1;
1941 quadvars2[cnt] = var2;
1942 quadcoefs[cnt] = coef;
1947 if( var1 == var2 || !isQuadObj )
1948 quadcoefs[cnt] /= 2.0;
1970 SCIP_Bool initial, separate, enforce, check, propagate;
1971 SCIP_Bool local, modifiable, dynamic, removable;
2007 retcode =
SCIPcreateConsQuadratic(scip, &cons,
"qmatrix", 1, &qmatrixvar, &minusone, cnt, quadvars1, quadvars2, quadcoefs, lhs, rhs,
2008 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable);
2022 SCIPwarningMessage(scip,
"%s section has no entries.\n", isQuadObj ?
"QUADOBJ" :
"QMATRIX");
2068 if( lincons ==
NULL )
2144 assert(newsize > size);
2151 quadvars1[cnt] = var1;
2152 quadvars2[cnt] = var2;
2153 quadcoefs[cnt] = coef;
2237 initial = mpsi->initialconss;
2243 dynamic = mpsi->dynamicconss;
2244 removable = mpsi->dynamicrows;
2245 stickingatnode =
FALSE;
2281 SCIPerrorMessage(
"Indicator constraints need to be introduced by 'IF' in column 1.\n");
2288 if( lincons ==
NULL )
2306 if( binvar ==
NULL )
2329 assert( binvar !=
NULL );
2363 for( i = 0; i < nlinvars; ++i )
2365 vars[i] = linvars[i];
2366 vals[i] = -linvals[i];
2374 initial, separate, enforce, check, propagate, local, dynamic, removable, stickingatnode);
2393 for (i = 0; i < nlinvars; ++i)
2426 initial, separate, enforce, check, propagate, local, dynamic, removable, stickingatnode) );
2456 const char* filename
2464 assert(scip !=
NULL);
2465 assert(filename !=
NULL);
2479 SCIP_CALL_TERMINATE( retcode,
SCIPcreateProb(scip, mpsi->probname,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL), TERMINATE );
2592 width =
MAX(8u, width);
2604 unsigned int maxnamelen
2607 unsigned int fieldwidth;
2610 assert( scip !=
NULL );
2611 assert( col1 !=
NULL );
2612 assert( col2 !=
NULL );
2615 assert( maxnamelen > 0 );
2633 unsigned int fieldwidth;
2636 assert( scip !=
NULL );
2637 assert( col1 !=
NULL );
2638 assert( col2 !=
NULL );
2639 assert( strlen(col1) <= 2 );
2641 assert( maxnamelen == -1 || maxnamelen > 0 );
2643 if( maxnamelen < 0 )
2651 (void)
SCIPsnprintf(format, 32,
" %%-2.2s %%-%ds ", fieldwidth);
2662 const char* varname,
2663 const char* consname,
2666 unsigned int maxnamelen
2671 assert( scip !=
NULL );
2672 assert( recordcnt !=
NULL );
2673 assert( *recordcnt >= 0 && *recordcnt < 2 );
2677 if( *recordcnt == 0 )
2680 printStart(scip, file,
"", varname, (
int) maxnamelen);
2684 printRecord(scip, file, consname, valuestr, maxnamelen);
2687 if( *recordcnt == 2 )
2707 assert( scip !=
NULL );
2710 assert( name !=
NULL );
2742 (*matrix)->nentries = 0;
2743 (*matrix)->sentries = slots;
2759 if( matrix->nentries + capacity >= matrix->sentries )
2761 matrix->sentries = matrix->sentries * 2 + capacity;
2788 const char* consname,
2805 assert( scip !=
NULL );
2806 assert( nvars == 0 || vars !=
NULL );
2808 assert( matrix !=
NULL );
2817 nactivevars = nvars;
2828 for( v = 0; v < nactivevars; ++v )
2829 activevals[v] = 1.0;
2837 if( requiredsize > nactivevars )
2843 assert( requiredsize <= nactivevars );
2848 for( v = 0; v < nactivevars; ++v )
2858 activevals[v] *= -1.0;
2859 activeconstant += 1.0;
2866 assert( matrix->nentries + nactivevars < matrix->sentries );
2868 for( v = 0; v < nactivevars; ++v )
2870 matrix->values[matrix->nentries] = activevals[v];
2871 matrix->columns[matrix->nentries] = activevars[v];
2872 matrix->rows[matrix->nentries] = consname;
2877 (*rhs) -= activeconstant;
2901 assert( scip !=
NULL );
2902 assert( aggvars !=
NULL );
2903 assert( naggvars !=
NULL );
2904 assert( saggvars !=
NULL );
2907 for( v = 0; v < nvars; ++v )
2919 assert( varAggregated !=
NULL );
2924 if ( *saggvars <= *naggvars )
2928 assert( newsize > *saggvars );
2930 *saggvars = newsize;
2933 (*aggvars)[*naggvars] = var;
2936 assert( *naggvars <= *saggvars );
2950 unsigned int* maxnamelen,
2951 const char*** varnames,
2960 assert( scip !=
NULL );
2961 assert( vars !=
NULL );
2962 assert( maxnamelen !=
NULL );
2971 for( v = 0; v < nvars; ++v )
2976 assert( var !=
NULL );
2987 (*maxnamelen) =
MAX(*maxnamelen, (
unsigned int) l);
2997 (*varnames)[v] = varname;
3002 SCIPwarningMessage(scip,
"there are %d variable names which have to be cut down to %d characters; LP might be corrupted\n",
3015 unsigned int* maxnamelen,
3016 const char*** consnames,
3025 assert(scip !=
NULL);
3026 assert(maxnamelen !=
NULL);
3034 for( i = 0; i < nconss; ++i )
3039 assert( cons !=
NULL );
3054 SCIPwarningMessage(scip,
"At least one name of a constraint is empty, so file will be written with generic names.\n");
3068 (*maxnamelen) =
MAX(*maxnamelen, (
unsigned int) l);
3073 (*consnames)[i] = consname;
3078 SCIPwarningMessage(scip,
"there are %d constraint names which have to be cut down to %d characters; MPS file might be corrupted\n",
3094 unsigned int maxnamelen
3099 const char* varname;
3105 SCIPsortPtrPtrReal((
void**) matrix->columns, (
void**) matrix->rows, matrix->values, SCIPvarComp, matrix->nentries);
3112 for( v = 0; v < matrix->nentries; )
3114 var = matrix->columns[v];
3115 assert( var !=
NULL );
3127 printStart(scip, file,
"",
"INTEND", (
int) maxnamelen);
3128 printRecord(scip, file,
"'MARKER'",
"", maxnamelen);
3129 printRecord(scip, file,
"'INTEND'",
"", maxnamelen);
3136 printStart(scip, file,
"",
"INTSTART", (
int) maxnamelen);
3137 printRecord(scip, file,
"'MARKER'",
"", maxnamelen);
3138 printRecord(scip, file,
"'INTORG'",
"", maxnamelen);
3155 value = matrix->values[v];
3158 printEntry(scip, file, varname, matrix->rows[v], value, &recordcnt, maxnamelen);
3161 while( v < matrix->nentries && var == matrix->columns[v] );
3163 if( recordcnt == 1 )
3170 printStart(scip, file,
"",
"INTEND", (
int) maxnamelen);
3171 printRecord(scip, file,
"'MARKER'",
"", maxnamelen);
3172 printRecord(scip, file,
"'INTEND'",
"", maxnamelen);
3184 const char** consnames,
3186 unsigned int maxnamelen
3192 assert( rhss !=
NULL );
3198 for( c = 0; c < nconss; ++c )
3204 assert(consnames[c] !=
NULL);
3206 printEntry(scip, file,
"RHS", consnames[c], rhss[c], &recordcnt, maxnamelen);
3209 if( recordcnt == 1 )
3221 const char** consnames,
3223 unsigned int maxnamelen
3230 const char* conshdlrname;
3239 for( c = 0; c < nconss; ++c )
3242 assert( cons !=
NULL);
3249 assert( consnames[c] !=
NULL );
3252 assert( conshdlr !=
NULL );
3256 if( strcmp(conshdlrname,
"linear") == 0 )
3261 else if( strcmp(conshdlrname,
"varbound") == 0 )
3271 assert(
SCIPisGT(scip, rhs, lhs) );
3272 printEntry(scip, file,
"RANGE", consnames[c], rhs - lhs, &recordcnt, maxnamelen);
3302 const char** varnames,
3304 unsigned int maxnamelen
3312 const char* varname;
3315 assert( scip !=
NULL );
3316 assert( vars !=
NULL );
3318 sectionName =
FALSE;
3321 for( v = 0; v < nvars; ++v )
3324 assert( var !=
NULL );
3331 varname = varnames[v];
3359 printStart(scip, file,
"LO",
"Bound", (
int) maxnamelen);
3360 printRecord(scip, file, varname, valuestr, maxnamelen);
3364 printStart(scip, file,
"UP",
"Bound", (
int) maxnamelen);
3365 printRecord(scip, file, varname, valuestr, maxnamelen);
3369 printStart(scip, file,
"BV",
"Bound", (
int) maxnamelen);
3387 printStart(scip, file,
"FR",
"Bound", (
int) maxnamelen);
3404 printStart(scip, file,
"FX",
"Bound", (
int) maxnamelen);
3405 printRecord(scip, file, varname, valuestr, maxnamelen);
3421 printStart(scip, file,
"MI",
"Bound", (
int) maxnamelen);
3440 printStart(scip, file,
"LO",
"Bound", (
int) maxnamelen);
3441 printRecord(scip, file, varname, valuestr, maxnamelen);
3459 printStart(scip, file,
"PL",
"Bound", (
int) maxnamelen);
3472 printStart(scip, file,
"UP",
"Bound", (
int) maxnamelen);
3473 printRecord(scip, file, varname, valuestr, maxnamelen);
3479 for( v = 0; v < naggvars; ++v )
3488 assert( var !=
NULL );
3491 varname = varnames[nvars + v];
3497 printStart(scip, file,
"BV",
"Bound", (
int) maxnamelen);
3504 printStart(scip, file,
"FR",
"Bound", (
int) maxnamelen);
3511 for( v = 0; v < nfixvars; ++v )
3514 assert(transformed);
3518 assert(var !=
NULL);
3522 varname = varnames[nvars + naggvars + v];
3538 printStart(scip, file,
"FX",
"Bound", (
int) maxnamelen);
3539 printRecord(scip, file, varname, valuestr, maxnamelen);
3555 assert(reader !=
NULL);
3574 assert(readerdata !=
NULL);
3587 assert(reader !=
NULL);
3590 assert(result !=
NULL);
3621 const char* consname;
3622 const char** consnames;
3625 const char* conshdlrname;
3633 const char* varname;
3634 const char** varnames;
3667 unsigned int maxnamelen;
3671 assert(reader !=
NULL);
3674 assert(result !=
NULL);
3715 saggvars = nfixedvars;
3719 if( nfixedvars > 0 )
3724 varFixedHash =
NULL;
3731 indicatorSlackHash =
NULL;
3735 assert( matrix->sentries >= nvars );
3738 assert(readerdata !=
NULL);
3743 if( readerdata->linearizeands )
3747 if( andconshdlr !=
NULL )
3751 for( c = nconss - 1; c >= 0; --c )
3754 assert(conshdlr !=
NULL);
3758 if( strcmp(conshdlrname,
"and") == 0 )
3760 if( readerdata->aggrlinearizationands )
3766 assert(naddrows >= 0);
3782 SCIPinfoMessage(
scip, file,
"* Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
3783 nvars, nbinvars, nintvars, nimplvars, ncontvars);
3799 for( v = 0; v < nvars; ++v )
3815 assert( matrix->nentries < matrix->sentries );
3817 matrix->values[matrix->nentries] = value;
3818 matrix->columns[matrix->nentries] = var;
3819 matrix->rows[matrix->nentries] =
"Obj";
3826 for( c = 0; c < nconss; ++c )
3829 assert( cons !=
NULL);
3837 assert( conshdlr !=
NULL );
3842 consname = consnames[c];
3845 if( strcmp(conshdlrname,
"linear") == 0 )
3871 else if( strcmp(conshdlrname,
"setppc") == 0 )
3892 else if( strcmp(conshdlrname,
"logicor") == 0 )
3902 else if( strcmp(conshdlrname,
"knapsack") == 0 )
3914 for( i = 0; i < nconsvars; ++i )
3924 else if( strcmp(conshdlrname,
"varbound") == 0 )
3962 else if( strcmp(conshdlrname,
"indicator") == 0 )
3969 assert( slackvar !=
NULL );
3970 assert( indicatorSlackHash !=
NULL );
3984 assert( binvar !=
NULL );
3991 consIndicator[nConsIndicator++] = cons;
3994 else if( strcmp(conshdlrname,
"SOS1") == 0 )
3997 consSOS1[nConsSOS1++] = cons;
4009 else if( strcmp(conshdlrname,
"SOS2") == 0 )
4012 consSOS2[nConsSOS2++] = cons;
4023 else if( strcmp(conshdlrname,
"quadratic") == 0 )
4030 consQuadratic[nConsQuadratic++] = cons;
4066 transformed, matrix, &rhss[c]) );
4071 consvars = quadvars;
4079 else if( strcmp(conshdlrname,
"soc") == 0 )
4087 consSOC[nConsSOC++] = cons;
4097 for( v = 0; v < nconsvars; ++v )
4102 lincoefs[v] = 2 * offset * coef * coef;
4103 rhs -= offset * offset * coef * coef;
4119 lincoef = -2 * offset * coef * coef;
4120 rhs += offset * offset * coef * coef;
4137 else if( strcmp(conshdlrname,
"and") == 0 )
4139 if( readerdata->linearizeands )
4159 l = (int) strlen(consname);
4162 if( !readerdata->aggrlinearizationands )
4164 rowvars[0] = resultant;
4169 n = (int) log10((
double)nrowvars) + 1 + l;
4176 maxnamelen =
MAX(maxnamelen, (
unsigned int) n);
4179 for( v = 0; v < nrowvars; ++v )
4185 n = (int) log10((
double)v) + 2;
4198 assert(k < nconss + naddrows);
4199 consnames[k] = rowname;
4201 (void)
SCIPsnprintf(rowname, n + 1,
"%s_%d", consname, v);
4202 rowvars[1] = operands[v];
4216 for( v = nrowvars - 1; v >= 0; --v )
4218 rowvars[v] = operands[v];
4222 rowvars[nrowvars] = resultant;
4225 if( readerdata->aggrlinearizationands )
4238 maxnamelen =
MAX(maxnamelen, (
unsigned int) n);
4243 assert(k < nconss + naddrows);
4244 consnames[k] = rowname;
4247 (void)
SCIPsnprintf(rowname, n + 1,
"%s_op", consname);
4249 rowvals[nrowvars] = (
SCIP_Real) nrowvars;
4263 rowvals[nrowvars] = 1.0;
4268 rhss[c] = -nrowvars + 1.0;
4296 SCIPwarningMessage(
scip,
"there are %d and-constraint-rownames which have to be cut down to %d characters; MPS file might be corrupted\n",
4301 if( varFixedHash !=
NULL )
4304 if( indicatorSlackHash !=
NULL && nConsIndicator == 0 )
4307 assert( indicatorSlackHash ==
NULL );
4319 for( c = 0; c < naggvars; ++c )
4330 maxnamelen =
MAX(maxnamelen, (
unsigned int) l);
4336 varnames[nvars + c] = namestr;
4345 l = strlen(namestr);
4346 maxnamelen =
MAX(maxnamelen, (
unsigned int) l);
4347 consnames[nconss + naddrows + c] = namestr;
4348 rhss[nconss + naddrows + c] = 0.0;
4355 matrix->values[matrix->nentries] = -1.0;
4356 matrix->columns[matrix->nentries] = aggvars[c];
4357 matrix->rows[matrix->nentries] = namestr;
4364 if( nfixedvars > 0 )
4366 int startpos = nvars + naggvars;
4375 for( v = nfixedvars - 1; v >= 0; --v )
4387 maxnamelen =
MAX(maxnamelen, (
unsigned int) l);
4392 varnames[startpos + nfixvars] = namestr;
4393 fixvars[nfixvars] = var;
4402 matrix->values[matrix->nentries] = 0.0;
4403 matrix->columns[matrix->nentries] = var;
4404 matrix->rows[matrix->nentries] =
"Obj";
4421 printBoundSection(
scip, file, vars, nvars, aggvars, naggvars, fixvars, nfixvars, transformed, varnames, indicatorSlackHash, maxnamelen);
4423 if( nfixedvars > 0 )
4426 assert(fixvars !=
NULL);
4431 if( nConsSOS1 > 0 || nConsSOS2 > 0 )
4441 for( c = 0; c < nConsSOS1; ++c )
4452 for( v = 0; v < nconsvars; ++v )
4460 if( sosweights !=
NULL )
4470 for( c = 0; c < nConsSOS2; ++c )
4481 for( v = 0; v < nconsvars; ++v )
4489 if( sosweights !=
NULL )
4503 if( nConsQuadratic > 0 )
4507 const char* varname2;
4510 SCIPdebugMsg(
scip,
"start printing QCMATRIX sections for quadratic constraints\n");
4513 for( c = 0; c < nConsQuadratic; ++c )
4515 cons = consQuadratic[c];
4526 for( v = 0; v < nconsvars; ++v )
4528 if( quadvarterms[v].sqrcoef == 0.0 )
4546 for( v = 0; v < nbilin; ++v )
4548 if( bilinterms[v].coef == 0.0 )
4582 SCIPdebugMsg(
scip,
"start printing QCMATRIX sections for soc constraints\n");
4585 for( c = 0; c < nConsSOC; ++c )
4596 for( v = 0; v < nconsvars; ++v )
4598 if( coefs[v] == 0.0 )
4634 if( nConsIndicator > 0 )
4642 for( c = 0; c < nConsIndicator; ++c )
4648 cons = consIndicator[c];
4691 if( indicatorSlackHash !=
NULL )
4708 for( v = nvars + naggvars + nfixvars - 1; v >= 0; --v )
4712 for( c = nconss + naddrows + naggvars - 1; c >= 0; --c )
4751 "reading/" READER_NAME "/linearize-and-constraints",
4752 "should possible \"and\" constraint be linearized when writing the mps file?",
4756 "should an aggregated linearization for and constraints be used?",
static SCIP_RETCODE collectAggregatedVars(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_VAR ***aggvars, int *naggvars, int *saggvars, SCIP_HASHTABLE *varAggregated)
SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
static void mpsinputSetObjsense(MPSINPUT *mpsi, SCIP_OBJSENSE sense)
enum SCIP_BoundType SCIP_BOUNDTYPE
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE readMps(SCIP *scip, const char *filename)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_VAR ** SCIPgetLhsVarsSOC(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_READERCOPY(readerCopyMps)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
static void printRangeSection(SCIP *scip, FILE *file, SCIP_CONS **conss, int nconss, const char **consnames, SCIP_Bool transformed, unsigned int maxnamelen)
Constraint handler for variable bound constraints .
static void mpsinputSyntaxerror(MPSINPUT *mpsi)
SCIP_VAR ** SCIPgetVarsSOS1(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
static SCIP_RETCODE readQMatrix(MPSINPUT *mpsi, SCIP_Bool isQuadObj, SCIP *scip)
SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
static void printBoundSection(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_VAR **aggvars, int naggvars, SCIP_VAR **fixvars, int nfixvars, SCIP_Bool transformed, const char **varnames, SCIP_HASHTABLE *indicatorSlackHash, unsigned int maxnamelen)
void SCIPsortPtrPtrReal(void **ptrarray1, void **ptrarray2, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_Real * SCIPgetLhsOffsetsSOC(SCIP *scip, SCIP_CONS *cons)
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)
static void mpsinputSetObjname(MPSINPUT *mpsi, const char *objname)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_RETCODE SCIPaddVarSOS2(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real weight)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
static SCIP_RETCODE checkSparseMatrixCapacity(SCIP *scip, SPARSEMATRIX *matrix, int capacity)
SCIP_Real * SCIPgetWeightsSOS1(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_READERFREE(readerFreeMps)
SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
constraint handler for indicator constraints
static SCIP_DECL_HASHKEYVAL(hashKeyValVar)
static void printColumnSection(SCIP *scip, FILE *file, SPARSEMATRIX *matrix, SCIP_HASHMAP *varnameHashmap, SCIP_HASHTABLE *indicatorSlackHash, unsigned int maxnamelen)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
static void mpsinputEntryIgnored(SCIP *scip, MPSINPUT *mpsi, const char *what, const char *what_name, const char *entity, const char *entity_name, SCIP_VERBLEVEL verblevel)
enum SCIP_Varstatus SCIP_VARSTATUS
static void mpsinputInsertName(MPSINPUT *mpsi, const char *name, SCIP_Bool second)
enum SCIP_VerbLevel SCIP_VERBLEVEL
static void mpsinputInsertField4(MPSINPUT *mpsi, const char *str)
static const char * mpsinputField4(const MPSINPUT *mpsi)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBlockMemory(scip, ptr)
Constraint handler for AND constraints, .
#define SCIPduplicateBufferArray(scip, ptr, source, num)
int SCIPgetNVarsSOS2(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_HASHKEYEQ(hashKeyEqVar)
constraint handler for second order cone constraints
#define SCIPfreeBufferArray(scip, ptr)
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
static SCIP_RETCODE readRows(MPSINPUT *mpsi, SCIP *scip)
SCIP_RETCODE SCIPcreateConsQuadratic(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)
static SCIP_Bool mpsinputReadLine(MPSINPUT *mpsi)
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)
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
int SCIPgetNBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetSlackVarIndicator(SCIP_CONS *cons)
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Constraint handler for knapsack constraints of the form , x binary and .
SCIP_VAR ** SCIPgetVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
static void printEntry(SCIP *scip, FILE *file, const char *varname, const char *consname, SCIP_Real value, int *recordcnt, unsigned int maxnamelen)
static const char * mpsinputObjname(const MPSINPUT *mpsi)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
SCIP_VAR * SCIPgetResultantAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_Bool mpsinputIsInteger(const MPSINPUT *mpsi)
static SCIP_OBJSENSE mpsinputObjsense(const MPSINPUT *mpsi)
static SCIP_RETCODE readRhs(MPSINPUT *mpsi, SCIP *scip)
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsSOS2(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarSOS1(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real weight)
static SCIP_RETCODE readCols(MPSINPUT *mpsi, SCIP *scip)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
#define SCIPallocBuffer(scip, ptr)
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBufferArrayNull(scip, ptr)
static SCIP_RETCODE readBounds(MPSINPUT *mpsi, SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
struct SCIP_File SCIP_FILE
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIPInterval sign(const SCIPInterval &x)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
struct SparseMatrix SPARSEMATRIX
const char * SCIPvarGetName(SCIP_VAR *var)
#define DEFAULT_LINEARIZE_ANDS
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
constraint handler for quadratic constraints
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
static void patchField(char *buf, int beg, int end)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
SCIP_BILINTERM * SCIPgetBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsOffsetSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIPallocBufferArray(scip, ptr, num)
struct SCIP_ReaderData SCIP_READERDATA
public data structures and miscellaneous methods
int SCIPgetNLhsVarsSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsIndicatorLinCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, SCIP_CONS *lincons, SCIP_VAR *slackvar, 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)
static SCIP_RETCODE readSOS(MPSINPUT *mpsi, SCIP *scip)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
void SCIPprintSysError(const char *message)
enum SCIP_Objsense SCIP_OBJSENSE
SCIP_VAR * SCIPgetRhsVarSOC(SCIP *scip, SCIP_CONS *cons)
static void printRecord(SCIP *scip, FILE *file, const char *col1, const char *col2, unsigned int maxnamelen)
static const char * mpsinputField5(const MPSINPUT *mpsi)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetWeightsSOS2(SCIP *scip, SCIP_CONS *cons)
static MPSSECTION mpsinputSection(const MPSINPUT *mpsi)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
static SCIP_RETCODE readObjsen(SCIP *scip, MPSINPUT *mpsi)
int SCIPgetNVarsSOS1(SCIP *scip, SCIP_CONS *cons)
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)
static const char * mpsinputField1(const MPSINPUT *mpsi)
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
static void printRowType(SCIP *scip, FILE *file, SCIP_Real lhs, SCIP_Real rhs, const char *name)
static SCIP_RETCODE readIndicators(MPSINPUT *mpsi, SCIP *scip)
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_VAR * SCIPgetBinaryVarIndicator(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
static SCIP_Bool mpsinputHasError(const MPSINPUT *mpsi)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
static unsigned int computeFieldWidth(unsigned int width)
static const char * mpsinputField0(const MPSINPUT *mpsi)
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)
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)
static void mpsinputSetSection(MPSINPUT *mpsi, MPSSECTION section)
static void clearFrom(char *buf, unsigned int pos)
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBuffer(scip, ptr)
static void mpsinputSetProbname(MPSINPUT *mpsi, const char *probname)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE checkVarnames(SCIP *scip, SCIP_VAR **vars, int nvars, unsigned int *maxnamelen, const char ***varnames, SCIP_HASHMAP **varnameHashmap)
static const char * mpsinputField3(const MPSINPUT *mpsi)
static SCIP_DECL_HASHGETKEY(hashGetKeyVar)
static SCIP_DECL_READERWRITE(readerWriteMps)
static void freeMatrix(SCIP *scip, SPARSEMATRIX *matrix)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_Real SCIPgetLhsConstantSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsCoefSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
static SCIP_RETCODE mpsinputCreate(SCIP *scip, MPSINPUT **mpsi, SCIP_FILE *fp)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
static void mpsinputFree(SCIP *scip, MPSINPUT **mpsi)
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
constraint handler for SOS type 1 constraints
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE initializeMatrix(SCIP *scip, SPARSEMATRIX **matrix, int slots)
static SCIP_RETCODE readRanges(MPSINPUT *mpsi, SCIP *scip)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
int SCIPvarGetIndex(SCIP_VAR *var)
static void printBoundSectionName(SCIP *scip, FILE *file)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
enum MpsSection MPSSECTION
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)
static SCIP_RETCODE checkConsnames(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool transformed, unsigned int *maxnamelen, const char ***consnames, SCIP_Bool *error)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
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)
enum SCIP_Vartype SCIP_VARTYPE
constraint handler for SOS type 2 constraints
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 SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
static const char * mpsinputField2(const MPSINPUT *mpsi)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
#define DEFAULT_AGGRLINEARIZATION_ANDS
static void printRhsSection(SCIP *scip, FILE *file, int nconss, const char **consnames, SCIP_Real *rhss, unsigned int maxnamelen)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_QUADVARTERM * SCIPgetQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
int SCIPfclose(SCIP_FILE *fp)
static SCIP_RETCODE readObjname(SCIP *scip, MPSINPUT *mpsi)
constraint handler for bound disjunction constraints
static void printStart(SCIP *scip, FILE *file, const char *col1, const char *col2, int maxnamelen)
SCIP_CONS * SCIPgetLinearConsIndicator(SCIP_CONS *cons)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetLhsCoefsSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
static SCIP_DECL_READERREAD(readerReadMps)
SCIP_RETCODE SCIPincludeReaderMps(SCIP *scip)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
static SCIP_RETCODE getLinearCoeffs(SCIP *scip, const char *consname, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool transformed, SPARSEMATRIX *matrix, SCIP_Real *rhs)
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)
(extended) MPS file reader
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
#define SCIPreallocBufferArray(scip, ptr, num)
static SCIP_RETCODE readQCMatrix(MPSINPUT *mpsi, SCIP *scip)
static SCIP_RETCODE readName(SCIP *scip, MPSINPUT *mpsi)