36 #include "reader_gmo.h" 55 #define READER_NAME "gmsreader" 57 #define READER_DESC "file writer for MI(NL)(SOC)Ps in GAMS file format" 59 #define READER_DESC "file reader and writer for MI(NL)(SOC)Ps in GAMS file format" 61 #define READER_EXTENSION "gms" 64 #define GMS_MAX_LINELEN 256 65 #define GMS_MAX_PRINTLEN 256 66 #define GMS_MAX_NAMELEN 64 67 #define GMS_PRINTLEN 100 68 #define GMS_DEFAULT_BIGM 1e+6 69 #define GMS_DEFAULT_INDICATORREFORM 's' 70 #define GMS_DEFAULT_SIGNPOWER FALSE 76 static const char badchars[] =
"#*+/-@$[](){}";
92 assert( scip != NULL );
93 assert( vars != NULL );
94 assert( scalars != NULL );
95 assert( nvars != NULL );
96 assert( constant != NULL );
102 if( requiredsize > *nvars )
108 assert( requiredsize <= *nvars );
113 for( v = 0; v < *nvars; ++v )
128 assert( linebuffer != NULL );
129 assert( linecnt != NULL );
132 linebuffer[0] =
'\0';
144 assert( scip != NULL );
145 assert( linebuffer != NULL );
146 assert( linecnt != NULL );
150 linebuffer[(*linecnt)] =
'\0';
164 const char* extension
168 assert( scip != NULL );
169 assert( linebuffer != NULL );
170 assert( linecnt != NULL );
171 assert( extension != NULL );
178 len = strlen(linebuffer);
181 (*linecnt) += (int) strlen(extension);
183 SCIPdebugMsg(scip,
"linebuffer <%s>, length = %lu\n", linebuffer, (
unsigned long)len);
186 endLine(scip, file, linebuffer, linecnt);
198 const char* extension
203 appendLine(scip, file, linebuffer, linecnt,
" ");
205 appendLine(scip, file, linebuffer, linecnt, extension);
216 assert( name != NULL );
218 for( badchar =
badchars; *badchar; ++badchar )
220 char* c = strchr(name, *badchar);
224 assert( *c == *badchar );
227 c = strchr(c, *badchar);
250 if( replaceforbiddenchars )
285 assert( scip != NULL );
286 assert( vars != NULL || nvars == 0 );
291 appendLine(scip, file, linebuffer, linecnt,
" ");
297 appendLine(scip, file, linebuffer, linecnt, buffer);
313 for( v = 0; v < nactivevars; ++v )
320 assert( nactivevars == 0 || activevals != NULL );
322 if( nactivevars == 0 &&
SCIPisZero(scip, activeconstant) )
326 appendLine(scip, file, linebuffer, linecnt,
" ");
330 appendLine(scip, file, linebuffer, linecnt, buffer);
338 closingbracket = nactivevars;
343 while(
SCIPisZero(scip, activevals[closingbracket]) && closingbracket > 0 );
347 for( v = 0; v < nactivevars; ++v )
350 assert( var != NULL );
356 appendLine(scip, file, linebuffer, linecnt,
" ");
360 if(
SCIPisEQ(scip, activevals[v], 1.0) )
362 varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
363 else if(
SCIPisEQ(scip, activevals[v], -1.0) )
365 varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
366 else if( strchr(ext,
'(') != NULL )
368 activevals[v], varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
371 activevals[v], varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
373 appendLine(scip, file, linebuffer, linecnt, buffer);
384 appendLine(scip, file, linebuffer, linecnt,
" ");
388 appendLine(scip, file, linebuffer, linecnt, buffer);
391 else if( strchr(ext,
'(') != NULL )
395 appendLine(scip, file, linebuffer, linecnt,
" ");
399 appendLine(scip, file, linebuffer, linecnt, buffer);
418 const char* rownameextension,
435 assert( scip != NULL );
436 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0);
437 assert( nvars == 0 || (vars != NULL && vals != NULL) );
442 appendLine(scip, file, linebuffer, &linecnt,
" ");
445 if( strlen(rowname) > 0 || strlen(rownameextension) > 0 )
449 appendLine(scip, file, linebuffer, &linecnt, consname);
457 appendLine(scip, file, linebuffer, &linecnt,
" ");
461 appendLine(scip, file, linebuffer, &linecnt, buffer);
464 for( v = 0; v < nvars; ++v )
467 assert( var != NULL );
471 appendLine(scip, file, linebuffer, &linecnt,
" ");
476 appendLine(scip, file, linebuffer, &linecnt, buffer);
487 appendLine(scip, file, linebuffer, &linecnt,
" ");
488 appendLine(scip, file, linebuffer, &linecnt, buffer);
490 endLine(scip, file, linebuffer, &linecnt);
516 assert( scip != NULL );
517 assert( rowname != NULL );
520 assert( nvars == 0 || vars != NULL );
522 assert( lhs <= rhs );
540 for( v = 0; v < nactivevars; ++v )
555 nactivevars, activevars, activevals, rhs - activeconstant) );
563 nactivevars, activevars, activevals, lhs - activeconstant) );
569 nactivevars, activevars, activevals, rhs - activeconstant) );
590 const char* rownameextension,
611 assert( scip != NULL );
612 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
613 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
614 assert( nlinvars == 0 || (linvars != NULL && lincoeffs != NULL) );
615 assert( nquadvarterms == 0 || quadvarterms != NULL );
616 assert( nbilinterms == 0 || bilinterms != NULL );
617 assert( nquadvarterms > 0 || nbilinterms == 0 );
622 appendLine(scip, file, linebuffer, &linecnt,
" ");
628 appendLine(scip, file, linebuffer, &linecnt, consname);
637 for( t = 0; t < nquadvarterms; ++t )
639 var = quadvarterms[t].
var;
640 assert( var != NULL );
642 if( !
SCIPisZero(scip, quadvarterms[t].lincoef) )
651 for( t = 0; t < nquadvarterms; ++t )
653 var = quadvarterms[t].
var;
654 assert( var != NULL );
656 if( !
SCIPisZero(scip, quadvarterms[t].sqrcoef) )
665 for( t = 0; t < nbilinterms; ++t )
672 var = bilinterms[t].
var1;
673 assert( var != NULL );
678 var = bilinterms[t].
var2;
679 assert( var != NULL );
688 appendLine(scip, file, linebuffer, &linecnt,
" ");
695 appendLine(scip, file, linebuffer, &linecnt, buffer);
697 endLine(scip, file, linebuffer, &linecnt);
721 assert( scip != NULL );
722 assert( rowname != NULL );
723 assert( nlinvars == 0 || (linvars != NULL && lincoeffs != NULL) );
724 assert( nquadvarterms == 0 || quadvarterms != NULL );
725 assert( nbilinterms == 0 || bilinterms != NULL );
726 assert( nquadvarterms > 0 || nbilinterms == 0 );
727 assert( lhs <= rhs );
739 nlinvars, linvars, lincoeffs,
740 nquadvarterms, quadvarterms,
741 nbilinterms, bilinterms, rhs, transformed) );
749 nlinvars, linvars, lincoeffs,
750 nquadvarterms, quadvarterms,
751 nbilinterms, bilinterms, lhs, transformed) );
757 nlinvars, linvars, lincoeffs,
758 nquadvarterms, quadvarterms,
759 nbilinterms, bilinterms, rhs, transformed) );
783 assert(nlhsvars == 0 || lhsvars != NULL);
788 if( rhsoffset != 0.0 )
797 if( lhsconstant != 0.0 )
803 for( i = 0; i < nlhsvars; ++i )
805 if( lhscoeffs [i] != 1.0 )
808 if( lhsoffsets[i] != 0.0 )
846 assert( scip != NULL );
847 assert( strlen(rowname) > 0 );
848 assert( nlhsvars == 0 || lhsvars != NULL );
853 appendLine(scip, file, linebuffer, &linecnt,
" ");
859 appendLine(scip, file, linebuffer, &linecnt, consname);
861 if( !
isGAMSprintableSOC(nlhsvars, lhsvars, lhscoeffs, lhsoffsets, lhsconstant, rhsvar, rhscoef, rhsoffset) )
870 appendLine(scip, file, linebuffer, &linecnt,
" =g= ");
874 if( lhsconstant != 0.0 )
878 appendLine(scip, file, linebuffer, &linecnt, buffer);
881 for( t = 0; t < nlhsvars; ++t )
883 assert( lhsvars[t] != NULL );
885 (void)
SCIPsnprintf(buffer,
GMS_MAX_PRINTLEN,
"+ sqr(%.15g * (%.15g + ", lhscoeffs ? lhscoeffs[t] : 1.0, lhsoffsets ? lhsoffsets[t] : 0.0);
895 appendLine(scip, file, linebuffer, &linecnt,
" =c= ");
901 appendLine(scip, file, linebuffer, &linecnt,
";");
903 endLine(scip, file, linebuffer, &linecnt);
933 assert( scip != NULL );
934 assert( strlen(rowname) > 0 );
938 assert( sossetdeclr != NULL );
943 appendLine(scip, file, linebuffer, &linecnt,
" ");
947 switch( indicatorform )
955 appendLine(scip, file, linebuffer, &linecnt, consname);
966 SCIPwarningMessage(scip,
"do not have upper bound on slack variable <%s> in indicator constraint <%s>, will use M = %g.\n",
1003 appendLine(scip, file, linebuffer, &linecnt, buffer);
1004 endLine(scip, file, linebuffer, &linecnt);
1007 appendLine(scip, file, linebuffer, &linecnt, buffer);
1008 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt, NULL,
"$sameas(sosset,'slack')", 1, &s, &coef, transformed) );
1012 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
" + (1-(",
"))$sameas(sosset,'bin');", 1, &z, &coef, transformed) );
1016 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
" + ",
"$sameas(sosset,'bin');", 1, &z, &coef, transformed) );
1018 endLine(scip, file, linebuffer, &linecnt);
1024 SCIPerrorMessage(
"wrong value '%c' for parameter reading/gmsreader/indicatorreform\n", indicatorform);
1028 endLine(scip, file, linebuffer, &linecnt);
1046 const char* rowname,
1061 assert( scip != NULL );
1062 assert( strlen(rowname) > 0 );
1063 assert( vars != NULL || nvars == 0 );
1064 assert( sostype == 1 || sostype == 2 );
1069 appendLine(scip, file, linebuffer, &linecnt,
" ");
1074 appendLine(scip, file, linebuffer, &linecnt, buffer);
1075 endLine(scip, file, linebuffer, &linecnt);
1078 (void)
SCIPsnprintf(buffer,
GMS_MAX_PRINTLEN,
" SOS%d Variable %s_sosvar(%s_sosset); %s_sosvar.lo(%s_sosset) = -inf;", sostype, consname, consname, consname, consname);
1079 appendLine(scip, file, linebuffer, &linecnt, buffer);
1080 endLine(scip, file, linebuffer, &linecnt);
1083 appendLine(scip, file, linebuffer, &linecnt, buffer);
1084 endLine(scip, file, linebuffer, &linecnt);
1087 for( v = 0; v < nvars; ++v )
1092 appendLine(scip, file, linebuffer, &linecnt,
";");
1093 endLine(scip, file, linebuffer, &linecnt);
1103 const char* rowname,
1104 const char* rownameextension,
1125 assert( scip != NULL );
1126 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
1127 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
1128 assert( nonlinvar != NULL );
1129 assert( exponent > 1.0 );
1130 assert( nsmooth != NULL );
1135 appendLine(scip, file, linebuffer, &linecnt,
" ");
1141 appendLine(scip, file, linebuffer, &linecnt, consname);
1149 if( !nisoddint && !fixedsign )
1151 if( signpowerallowed )
1156 appendLine(scip, file, linebuffer, &linecnt, buffer);
1157 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"+",
",", 1, &nonlinvar, NULL, transformed) );
1161 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"signpower(",
",", 1, &nonlinvar, NULL, transformed) );
1164 appendLine(scip, file, linebuffer, &linecnt, buffer);
1171 appendLine(scip, file, linebuffer, &linecnt, buffer);
1179 if( exponent == 2.0)
1184 appendLine(scip, file, linebuffer, &linecnt, buffer);
1197 appendLine(scip, file, linebuffer, &linecnt, buffer);
1205 appendLine(scip, file, linebuffer, &linecnt, buffer);
1212 if( exponent == 2.0 )
1217 appendLine(scip, file, linebuffer, &linecnt, buffer);
1230 appendLine(scip, file, linebuffer, &linecnt, buffer);
1231 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"+",
",", 1, &nonlinvar, NULL, transformed) );
1235 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"power(",
",", 1, &nonlinvar, NULL, transformed) );
1238 appendLine(scip, file, linebuffer, &linecnt, buffer);
1244 if( exponent == 2.0 )
1249 appendLine(scip, file, linebuffer, &linecnt, buffer);
1262 appendLine(scip, file, linebuffer, &linecnt, buffer);
1263 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"-",
",", 1, &nonlinvar, NULL, transformed) );
1265 appendLine(scip, file, linebuffer, &linecnt, buffer);
1269 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"-power(-",
",", 1, &nonlinvar, NULL, transformed) );
1271 appendLine(scip, file, linebuffer, &linecnt, buffer);
1277 if( linvar != NULL )
1286 appendLine(scip, file, linebuffer, &linecnt,
" ");
1294 appendLine(scip, file, linebuffer, &linecnt, buffer);
1296 endLine(scip, file, linebuffer, &linecnt);
1307 const char* rowname,
1320 assert( scip != NULL );
1321 assert( strlen(rowname) > 0 );
1330 nonlinvar, linvar, exponent, offset, coeflinear, rhs, transformed, signpowerallowed, nsmooth) );
1338 nonlinvar, linvar, exponent, offset, coeflinear, lhs, transformed, signpowerallowed, nsmooth) );
1344 nonlinvar, linvar, exponent, offset, coeflinear, rhs, transformed, signpowerallowed, nsmooth) );
1366 assert(scip != NULL);
1367 assert(linebuffer != NULL);
1368 assert(linecnt != NULL);
1369 assert(expr != NULL);
1370 assert(nsmooth != NULL);
1378 assert(exprvars != NULL);
1388 SCIPwarningMessage(scip,
"parameterized expression in GAMS writer. GAMS file will not compile.\n");
1474 nisoddint = (((
SCIP_Real)((
int)exponent)) == exponent) && (((
int)exponent)%2 == 1);
1482 if( signpowerallowed )
1495 if( exponent == 2.0)
1605 if( constant != 0.0 )
1640 if( constant != 0.0 )
1647 if( lincoefs != NULL )
1661 if( quadelems[i].idx1 == quadelems[i].idx2 )
1697 assert(monomdata != NULL);
1707 if( exponent == 1.0 )
1711 else if( exponent == 2.0 )
1717 else if( exponent == 0.5 )
1723 else if( ((
SCIP_Real)((
int)exponent)) == exponent )
1756 const char* rowname,
1757 const char* rownameextension,
1778 assert( scip != NULL );
1779 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
1780 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
1785 appendLine(scip, file, linebuffer, &linecnt,
" ");
1791 appendLine(scip, file, linebuffer, &linecnt, consname);
1795 for( i = 0; i < nexprtrees; ++i )
1797 assert(exprtrees[i] != NULL);
1798 if( exprtreecoefs[i] != 0.0 )
1816 appendLine(scip, file, linebuffer, &linecnt,
" ");
1823 appendLine(scip, file, linebuffer, &linecnt, buffer);
1825 endLine(scip, file, linebuffer, &linecnt);
1836 const char* rowname,
1849 assert( scip != NULL );
1850 assert( strlen(rowname) > 0 );
1859 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, rhs, transformed, nsmooth) );
1867 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, lhs, transformed, nsmooth) );
1873 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, rhs, transformed, nsmooth) );
1891 const char* badchar;
1893 assert( scip != NULL );
1894 assert( vars != NULL );
1899 for( badchar =
badchars; *badchar; ++badchar )
1901 for( v = 0; v < nvars; ++v )
1904 assert( var != NULL );
1908 if( replaceforbiddenchars )
1910 SCIPinfoMessage(scip, NULL,
"there is a variable name with symbol '%c', not allowed in GAMS format; all '%c' replaced by '_' (consider using 'write genproblem'/'write gentransproblem').\n", *badchar, *badchar);
1914 SCIPwarningMessage(scip,
"there is a variable name with symbol '%c', not allowed in GAMS format; use 'write genproblem'/'write gentransproblem', or set 'reading/gmsreader/replaceforbiddenchars' to TRUE and risk duplicate variable names.\n", *badchar);
1923 for( v = 0; v < nvars; ++v )
1926 assert( var != NULL );
1930 SCIPwarningMessage(scip,
"there is a variable name which has to be cut down to %d characters; GAMS model might be corrupted.\n",
1951 const char* conshdlrname;
1953 const char* badchar;
1955 assert( scip != NULL );
1956 assert( conss != NULL );
1961 for( badchar =
badchars; *badchar; ++badchar )
1963 for( c = 0; c < nconss; ++c )
1966 assert( cons != NULL );
1970 if( replaceforbiddenchars )
1972 SCIPinfoMessage(scip, NULL,
"there is a constraint name with symbol '%c', not allowed in GAMS format; all '%c' replaced by '_' (consider using 'write genproblem'/'write gentransproblem').\n", *badchar, *badchar);
1976 SCIPwarningMessage(scip,
"there is a constraint name with symbol '%c', not allowed in GAMS format; use 'write genproblem'/'write gentransproblem', or set 'reading/gmsreader/replaceforbiddenchars' to TRUE and risk duplicate variable names.\n", *badchar);
1985 for( c = 0; c < nconss; ++c )
1988 assert( cons != NULL );
1994 assert( conshdlr != NULL );
1999 if( strcmp(conshdlrname,
"linear") == 0 || strcmp(conshdlrname,
"quadratic") == 0 )
2006 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2012 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2019 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2036 assert(
scip != NULL);
2037 assert(reader != NULL);
2054 char buffer[GMS_SSSIZE];
2056 gmoHandle_t gmo = NULL;
2057 gevHandle_t gev = NULL;
2059 assert(
scip != NULL);
2060 assert(reader != NULL);
2061 assert(filename != NULL);
2062 assert(result != NULL);
2068 mkdir(
"loadgms.tmp", S_IRWXU);
2071 convertdopt = fopen(
"loadgms.tmp/convertd.opt",
"w");
2072 if( convertdopt == NULL )
2074 SCIPerrorMessage(
"Could not create convertd options file. Do you have write permissions in execution directory?\n");
2077 fputs(
" ", convertdopt);
2078 fclose(convertdopt);
2081 SCIPsnprintf(gamscall,
SCIP_MAXSTRLEN, WITH_GAMS
"/gams %s LP=CONVERTD RMIP=CONVERTD QCP=CONVERTD RMIQCP=CONVERTD NLP=CONVERTD DNLP=CONVERTD RMINLP=CONVERTD CNS=CONVERTD MIP=CONVERTD MIQCP=CONVERTD MINLP=CONVERTD MCP=CONVERTD MPEC=CONVERTD RMPEC=CONVERTD SCRDIR=loadgms.tmp output=loadgms.tmp/listing optdir=loadgms.tmp optfile=1 pf4=0 solprint=0 limcol=0 limrow=0 pc=2 lo=%d",
2084 rc = system(gamscall);
2087 SCIPerrorMessage(
"GAMS call returned with code %d, check loadgms.tmp/listing for details.\n", rc);
2094 if( !gevCreateDD(&gev, WITH_GAMS, buffer,
sizeof(buffer)) )
2101 if( !gmoCreateDD(&gmo, WITH_GAMS, buffer,
sizeof(buffer)) )
2108 if( gevInitEnvironmentLegacy(gev,
"loadgms.tmp/gamscntr.dat") )
2110 SCIPerrorMessage(
"Could not load control file loadgms.tmp/gamscntr.dat\n");
2115 if( gmoRegisterEnvironment(gmo, gev, buffer) )
2122 if( gmoLoadDataLegacy(gmo, buffer) )
2142 system(
"rm loadgms.tmp/* && rmdir loadgms.tmp");
2153 nvars, nbinvars, nintvars, nimplvars, ncontvars, conss, nconss, result) );
2163 if( gmoLibraryLoaded() )
2165 if( gevLibraryLoaded() )
2196 "reading/gmsreader/freeints",
"have integer variables no upper bound by default (depending on GAMS version)?",
2200 "reading/gmsreader/replaceforbiddenchars",
"shall characters '#', '*', '+', '/', and '-' in variable and constraint names be replaced by '_'?",
2204 "reading/gmsreader/bigmdefault",
"default M value for big-M reformulation of indicator constraints in case no bound on slack variable is given",
2208 "reading/gmsreader/indicatorreform",
"which reformulation to use for indicator constraints: 'b'ig-M, 's'os1",
2212 "reading/gmsreader/signpower",
"is it allowed to use the gams function signpower(x,a)?",
2251 const char* conshdlrname;
2275 assert( scip != NULL );
2276 assert( vars != NULL || nvars == 0 );
2289 if( objscale == 1.0 && objoffset == 0.0 )
2291 for( v = 0; v < nvars; ++v )
2296 if( objvar == NULL )
2320 SCIPinfoMessage(scip, file,
"* Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
2321 nvars, nbinvars, nintvars, nimplvars, ncontvars);
2332 if( objvar == NULL )
2339 for( v = 0; v < nvars; ++v )
2342 assert( var != NULL );
2346 appendLine(scip, file, linebuffer, &linecnt, buffer);
2348 if( (linecnt > 0 && (v == nbinvars - 1 || v == nbinvars + nintvars - 1 ||
2349 v == nbinvars + nintvars + nimplvars - 1)) || v == nvars - 1 )
2351 endLine(scip, file, linebuffer, &linecnt);
2364 for( v = 0; v < nbinvars; ++v )
2371 appendLine(scip, file, linebuffer, &linecnt, buffer);
2374 endLine(scip, file, linebuffer, &linecnt);
2384 for( v = 0; v < nintvars; ++v )
2386 var = vars[nbinvars + v];
2391 appendLine(scip, file, linebuffer, &linecnt, buffer);
2393 endLine(scip, file, linebuffer, &linecnt);
2400 nondefbounds =
FALSE;
2402 for( v = 0; v < nvars; ++v )
2405 assert( var != NULL );
2429 nondefbounds =
TRUE;
2436 if( v < nbinvars + nintvars )
2447 nondefbounds =
TRUE;
2450 else if( v >= nbinvars + nintvars && !
SCIPisInfinity(scip, -lb) )
2454 nondefbounds =
TRUE;
2463 nondefbounds =
TRUE;
2466 else if( v < nbinvars + nintvars && !freeints )
2475 nondefbounds =
TRUE;
2482 nondefbounds =
TRUE;
2488 nondefbounds =
TRUE;
2493 SCIPinfoMessage(scip, file,
"* (All other bounds at default value: binary [0,1], integer [%s], continuous [-inf,+inf].)\n", freeints ?
"0,+inf" :
"0,100");
2497 if( nconss > 0 || objvar == NULL )
2504 if( objvar == NULL )
2511 for( c = 0; c < nconss; ++c )
2514 assert( cons != NULL );
2517 assert( conshdlr != NULL );
2523 rangedrow = strcmp(conshdlrname,
"linear") == 0
2526 rangedrow = rangedrow || (strcmp(conshdlrname,
"quadratic") == 0
2529 rangedrow = rangedrow || (strcmp(conshdlrname,
"nonlinear") == 0
2532 rangedrow = rangedrow || (strcmp(conshdlrname,
"abspower") == 0
2535 rangedrow = rangedrow || (strcmp(conshdlrname,
"bivariate") == 0
2538 rangedrow = rangedrow || (strcmp(conshdlrname,
"varbound") == 0
2543 if( strcmp(conshdlrname,
"knapsack") != 0 && strcmp(conshdlrname,
"logicor") != 0 && strcmp(conshdlrname,
"setppc") != 0
2544 && strcmp(conshdlrname,
"linear") != 0 && strcmp(conshdlrname,
"quadratic") != 0 && strcmp(conshdlrname,
"varbound") != 0
2545 && strcmp(conshdlrname,
"soc") != 0 && strcmp(conshdlrname,
"abspower") != 0 && strcmp(conshdlrname,
"bivariate") != 0
2546 && strcmp(conshdlrname,
"nonlinear") != 0 && strcmp(conshdlrname,
"SOS1") != 0 && strcmp(conshdlrname,
"SOS2") != 0
2547 && strcmp(conshdlrname,
"indicator") != 0 )
2554 appendLine(scip, file, linebuffer, &linecnt,
",");
2560 appendLine(scip, file, linebuffer, &linecnt, buffer);
2565 appendLine(scip, file, linebuffer, &linecnt, buffer);
2570 if( nconss > 0 || objvar == NULL )
2573 appendLine(scip, file, linebuffer, &linecnt, buffer);
2575 endLine(scip, file, linebuffer, &linecnt);
2579 if( objvar == NULL )
2583 if( objoffset != 0.0 )
2587 appendLine(scip, file, linebuffer, &linecnt, buffer);
2591 for( v = 0; v < nvars; ++v )
2594 assert( var != NULL );
2605 endLine(scip, file, linebuffer, &linecnt);
2613 discrete = nbinvars > 0 || nintvars > 0;
2614 indicatorsosdef =
FALSE;
2615 for( c = 0; c < nconss; ++c )
2618 assert( cons != NULL );
2624 assert( conshdlr != NULL );
2630 if( strcmp(conshdlrname,
"knapsack") == 0 )
2640 for( v = 0; v < nconsvars; ++v )
2648 else if( strcmp(conshdlrname,
"linear") == 0 )
2654 else if( strcmp(conshdlrname,
"logicor") == 0 )
2660 else if( strcmp(conshdlrname,
"quadratic") == 0 )
2670 else if( strcmp(conshdlrname,
"nonlinear") == 0 )
2683 1, &exprtree, &coef,
2698 else if( strcmp(conshdlrname,
"bivariate") == 0 )
2707 assert(exprtree != NULL);
2713 linvar == NULL ? 0 : 1, &linvar, &lincoef,
2718 if( exprdegree > 1 )
2723 else if( strcmp(conshdlrname,
"setppc") == 0 )
2732 nconsvars, consvars, NULL, 1.0, 1.0, transformed) );
2736 nconsvars, consvars, NULL, -
SCIPinfinity(scip), 1.0, transformed) );
2740 nconsvars, consvars, NULL, 1.0,
SCIPinfinity(scip), transformed) );
2744 else if( strcmp(conshdlrname,
"varbound") == 0 )
2756 2, consvars, consvals,
2762 else if( strcmp(conshdlrname,
"soc") == 0 )
2765 SCIPgetNLhsVarsSOC(scip, cons),
SCIPgetLhsVarsSOC(scip, cons),
SCIPgetLhsCoefsSOC(scip, cons),
SCIPgetLhsOffsetsSOC(scip, cons),
SCIPgetLhsConstantSOC(scip, cons),
2768 nlcons = nlcons || !
isGAMSprintableSOC(
SCIPgetNLhsVarsSOC(scip, cons),
SCIPgetLhsVarsSOC(scip, cons),
SCIPgetLhsCoefsSOC(scip, cons),
SCIPgetLhsOffsetsSOC(scip, cons),
SCIPgetLhsConstantSOC(scip, cons),
2771 else if( strcmp(conshdlrname,
"indicator") == 0 )
2777 else if( strcmp(conshdlrname,
"abspower") == 0 )
2787 else if( strcmp(conshdlrname,
"SOS1") == 0 )
2794 else if( strcmp(conshdlrname,
"SOS2") == 0 )
2803 SCIPwarningMessage(scip,
"constraint handler <%s> cannot print requested format\n", conshdlrname );
2812 assert(nlcons || !nsmooth);
2823 discrete ?
"MI" :
"", nlcons ? (nqcons ? ((nsmooth && !discrete) ?
"DNLP" :
"NLP") :
"QCP") : (discrete > 0 ?
"P" :
"LP"));
2825 if( objvar != NULL )
2830 SCIPinfoMessage(scip, file,
"$if not set %s $set %s %s\n", buffer, buffer, buffer);
SCIP_Real SCIPgetCoefLinearAbspower(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Result SCIP_RESULT
SCIP_VAR * SCIPgetNonlinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLinearCoefBivariate(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetCharParam(SCIP *scip, const char *name, char *value)
SCIP_VAR ** SCIPgetLhsVarsSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_EXPRGRAPH * SCIPgetExprgraphNonlinear(SCIP *scip, SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_READERWRITE(readerWriteGms)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
static SCIP_RETCODE printNonlinearRow(SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoeffs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs, SCIP_Real rhs, SCIP_Bool transformed, SCIP_Bool *nsmooth)
static SCIP_RETCODE printSignpowerCons(SCIP *scip, FILE *file, const char *rowname, SCIP_VAR *nonlinvar, SCIP_VAR *linvar, SCIP_Real exponent, SCIP_Real offset, SCIP_Real coeflinear, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed, SCIP_Bool signpowerallowed, SCIP_Bool *nsmooth)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int * SCIPexprGetMonomialChildIndices(SCIP_EXPRDATA_MONOMIAL *monomial)
Constraint handler for variable bound constraints .
SCIP_VAR ** SCIPgetVarsSOS1(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsBivariate(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetOffsetAbspower(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE printExpr(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, SCIP_Bool *nsmooth, SCIP_Bool transformed, SCIP_EXPR *expr, SCIP_VAR **exprvars)
SCIP_EXPROP SCIPexprGetOperator(SCIP_EXPR *expr)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_VAR * SCIPgetLinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetLhsOffsetsSOC(SCIP *scip, SCIP_CONS *cons)
static SCIP_Bool isGAMSprintableSOC(int nlhsvars, SCIP_VAR **lhsvars, SCIP_Real *lhscoeffs, SCIP_Real *lhsoffsets, SCIP_Real lhsconstant, SCIP_VAR *rhsvar, SCIP_Real rhscoef, SCIP_Real rhsoffset)
const char * SCIPexpropGetName(SCIP_EXPROP op)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPexprtreeGetMaxDegree(SCIP_EXPRTREE *tree, int *maxdegree)
SCIP_DECL_READERFREE(ReaderTSP::scip_free)
static void clearLine(char *linebuffer, int *linecnt)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
constraint handler for indicator constraints
SCIP_Real SCIPexprGetRealPowerExponent(SCIP_EXPR *expr)
int SCIPexprGetOpIndex(SCIP_EXPR *expr)
SCIP_Real SCIPexprGetPolynomialConstant(SCIP_EXPR *expr)
SCIP_Real * SCIPgetLinearCoefsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_VERBLEVEL SCIPgetVerbLevel(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
enum SCIP_Retcode SCIP_RETCODE
#define GMS_DEFAULT_INDICATORREFORM
static SCIP_RETCODE printConformName(SCIP *scip, char *t, int len, const char *name)
SCIP_Real SCIPgetRhsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPwriteGms(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)
static SCIP_RETCODE printSignpowerRow(SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, SCIP_VAR *nonlinvar, SCIP_VAR *linvar, SCIP_Real exponent, SCIP_Real offset, SCIP_Real coeflinear, SCIP_Real rhs, SCIP_Bool transformed, SCIP_Bool signpowerallowed, SCIP_Bool *nsmooth)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
int SCIPgetNVarsSOS2(SCIP *scip, SCIP_CONS *cons)
SCIP_EXPRTREE ** SCIPgetExprtreesNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
constraint handler for second order cone constraints
#define SCIPfreeBufferArray(scip, ptr)
Constraint handler for the set partitioning / packing / covering constraints .
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_VAR ** SCIPexprtreeGetVars(SCIP_EXPRTREE *tree)
static SCIP_RETCODE checkVarnames(SCIP *scip, SCIP_VAR **vars, int nvars)
int SCIPgetNExprtreesNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_EXPRDATA_MONOMIAL ** SCIPexprGetMonomials(SCIP_EXPR *expr)
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
static void appendLineWithIndent(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *extension)
int SCIPexprGetMonomialNFactors(SCIP_EXPRDATA_MONOMIAL *monomial)
int SCIPexprGetIntPowerExponent(SCIP_EXPR *expr)
SCIP_EXPRTREE * SCIPgetExprtreeBivariate(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetSlackVarIndicator(SCIP_CONS *cons)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Constraint handler for knapsack constraints of the form , x binary and .
static SCIP_RETCODE checkConsnames(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool transformed)
static void conformName(char *name)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPincludeReaderGms(SCIP *scip)
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
SCIP_Real * SCIPexprGetQuadLinearCoefs(SCIP_EXPR *expr)
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsSOS2(SCIP *scip, SCIP_CONS *cons)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPexprGetQuadConstant(SCIP_EXPR *expr)
static SCIP_RETCODE printQuadraticRow(SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoeffs, int nquadvarterms, SCIP_QUADVARTERM *quadvarterms, int nbilinterms, SCIP_BILINTERM *bilinterms, SCIP_Real rhs, SCIP_Bool transformed)
static SCIP_DECL_READERCOPY(readerCopyGms)
constraint handler for quadratic constraints
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_Real * SCIPgetExprtreeCoefsNonlinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE printActiveVariables(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *prefix, const char *suffix, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Bool transformed)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
static SCIP_RETCODE printNonlinearCons(SCIP *scip, FILE *file, const char *rowname, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoeffs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed, SCIP_Bool *nsmooth)
SCIP_BILINTERM * SCIPgetBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_EXPR * SCIPexprtreeGetRoot(SCIP_EXPRTREE *tree)
SCIP_Real SCIPgetRhsOffsetSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_Real SCIPexprGetSignPowerExponent(SCIP_EXPR *expr)
int SCIPgetNLhsVarsSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
#define GMS_DEFAULT_SIGNPOWER
SCIP_Real SCIPgetLhsBivariate(SCIP *scip, SCIP_CONS *cons)
static void endLine(SCIP *scip, FILE *file, char *linebuffer, int *linecnt)
enum SCIP_Objsense SCIP_OBJSENSE
SCIP_VAR * SCIPgetRhsVarSOC(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
constraint handler for nonlinear constraints
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPexprtreeFree(SCIP_EXPRTREE **tree)
int SCIPgetNVarsSOS1(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
constraint handler for bivariate nonlinear constraints
Constraint handler for linear constraints in their most general form, .
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPexprGetMonomialCoef(SCIP_EXPRDATA_MONOMIAL *monomial)
Constraint handler for absolute power constraints .
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_RETCODE printIndicatorCons(SCIP *scip, FILE *file, const char *rowname, SCIP_VAR *z, SCIP_VAR *s, SCIP_Bool *sossetdeclr, SCIP_Bool transformed)
static void appendLine(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *extension)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetLinearVarBivariate(SCIP *scip, SCIP_CONS *cons)
static const char badchars[]
GAMS file reader and writer.
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real * SCIPexprGetLinearCoefs(SCIP_EXPR *expr)
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPgetNLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsAbspower(SCIP *scip, SCIP_CONS *cons)
static const SCIP_Real scalars[]
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPexprGetOpReal(SCIP_EXPR *expr)
static SCIP_RETCODE printSOSCons(SCIP *scip, FILE *file, const char *rowname, int nvars, SCIP_VAR **vars, int sostype, SCIP_Bool transformed)
SCIP_QUADELEM * SCIPexprGetQuadElements(SCIP_EXPR *expr)
SCIP_Real SCIPgetLhsConstantSOC(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE printLinearCons(SCIP *scip, FILE *file, const char *rowname, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed)
int SCIPexprGetNMonomials(SCIP_EXPR *expr)
SCIP_Real SCIPgetRhsCoefSOC(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE printQuadraticCons(SCIP *scip, FILE *file, const char *rowname, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoeffs, int nquadvarterms, SCIP_QUADVARTERM *quadvarterms, int nbilinterms, SCIP_BILINTERM *bilinterms, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_RETCODE SCIPexprgraphGetTree(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *rootnode, SCIP_EXPRTREE **exprtree)
SCIP_VAR ** SCIPgetLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
constraint handler for SOS type 1 constraints
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_DECL_READERREAD(ReaderTSP::scip_read)
SCIP_Real SCIPgetExponentAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPexprGetMonomialExponents(SCIP_EXPRDATA_MONOMIAL *monomial)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE printSOCCons(SCIP *scip, FILE *file, const char *rowname, int nlhsvars, SCIP_VAR **lhsvars, SCIP_Real *lhscoeffs, SCIP_Real *lhsoffsets, SCIP_Real lhsconstant, SCIP_VAR *rhsvar, SCIP_Real rhscoef, SCIP_Real rhsoffset, SCIP_Bool transformed)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
constraint handler for SOS type 2 constraints
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Real SCIPgetLhsAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_QUADVARTERM * SCIPgetQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_EXPRGRAPHNODE * SCIPgetExprgraphNodeNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPexprGetLinearConstant(SCIP_EXPR *expr)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
int SCIPexprGetNQuadElements(SCIP_EXPR *expr)
static SCIP_RETCODE printLinearRow(SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real rhs)
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 SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
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)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
#define SCIPreallocBufferArray(scip, ptr, num)