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)
1604 if( constant != 0.0 )
1639 if( constant != 0.0 )
1646 if( lincoefs !=
NULL )
1660 if( quadelems[i].idx1 == quadelems[i].idx2 )
1696 assert(monomdata !=
NULL);
1706 if( exponent == 1.0 )
1710 else if( exponent == 2.0 )
1716 else if( exponent == 0.5 )
1722 else if( ((
SCIP_Real)((
int)exponent)) == exponent )
1755 const char* rowname,
1756 const char* rownameextension,
1777 assert( scip !=
NULL );
1778 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
1779 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
1784 appendLine(scip, file, linebuffer, &linecnt,
" ");
1790 appendLine(scip, file, linebuffer, &linecnt, consname);
1794 for( i = 0; i < nexprtrees; ++i )
1796 assert(exprtrees[i] !=
NULL);
1797 if( exprtreecoefs[i] != 0.0 )
1815 appendLine(scip, file, linebuffer, &linecnt,
" ");
1822 appendLine(scip, file, linebuffer, &linecnt, buffer);
1824 endLine(scip, file, linebuffer, &linecnt);
1835 const char* rowname,
1848 assert( scip !=
NULL );
1849 assert( strlen(rowname) > 0 );
1858 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, rhs, transformed, nsmooth) );
1866 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, lhs, transformed, nsmooth) );
1872 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, rhs, transformed, nsmooth) );
1890 const char* badchar;
1892 assert( scip !=
NULL );
1893 assert( vars !=
NULL );
1898 for( badchar =
badchars; *badchar; ++badchar )
1900 for( v = 0; v < nvars; ++v )
1903 assert( var !=
NULL );
1907 if( replaceforbiddenchars )
1909 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);
1913 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);
1922 for( v = 0; v < nvars; ++v )
1925 assert( var !=
NULL );
1929 SCIPwarningMessage(scip,
"there is a variable name which has to be cut down to %d characters; GAMS model might be corrupted.\n",
1950 const char* conshdlrname;
1952 const char* badchar;
1954 assert( scip !=
NULL );
1955 assert( conss !=
NULL );
1960 for( badchar =
badchars; *badchar; ++badchar )
1962 for( c = 0; c < nconss; ++c )
1965 assert( cons !=
NULL );
1969 if( replaceforbiddenchars )
1971 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);
1975 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);
1984 for( c = 0; c < nconss; ++c )
1987 assert( cons !=
NULL );
1993 assert( conshdlr !=
NULL );
1998 if( strcmp(conshdlrname,
"linear") == 0 || strcmp(conshdlrname,
"quadratic") == 0 )
2005 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2011 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2018 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2036 assert(reader !=
NULL);
2053 char buffer[GMS_SSSIZE];
2055 gmoHandle_t gmo =
NULL;
2056 gevHandle_t gev =
NULL;
2059 assert(reader !=
NULL);
2060 assert(filename !=
NULL);
2061 assert(result !=
NULL);
2067 mkdir(
"loadgms.tmp", S_IRWXU);
2070 convertdopt = fopen(
"loadgms.tmp/convertd.opt",
"w");
2071 if( convertdopt ==
NULL )
2073 SCIPerrorMessage(
"Could not create convertd options file. Do you have write permissions in execution directory?\n");
2076 fputs(
" ", convertdopt);
2077 fclose(convertdopt);
2080 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",
2083 rc = system(gamscall);
2086 SCIPerrorMessage(
"GAMS call returned with code %d, check loadgms.tmp/listing for details.\n", rc);
2093 if( !gevCreateDD(&gev, WITH_GAMS, buffer,
sizeof(buffer)) )
2100 if( !gmoCreateDD(&gmo, WITH_GAMS, buffer,
sizeof(buffer)) )
2107 if( gevInitEnvironmentLegacy(gev,
"loadgms.tmp/gamscntr.dat") )
2109 SCIPerrorMessage(
"Could not load control file loadgms.tmp/gamscntr.dat\n");
2114 if( gmoRegisterEnvironment(gmo, gev, buffer) )
2121 if( gmoLoadDataLegacy(gmo, buffer) )
2141 system(
"rm loadgms.tmp/* && rmdir loadgms.tmp");
2152 nvars, nbinvars, nintvars, nimplvars, ncontvars, conss, nconss, result) );
2162 if( gmoLibraryLoaded() )
2164 if( gevLibraryLoaded() )
2195 "reading/gmsreader/freeints",
"have integer variables no upper bound by default (depending on GAMS version)?",
2199 "reading/gmsreader/replaceforbiddenchars",
"shall characters '#', '*', '+', '/', and '-' in variable and constraint names be replaced by '_'?",
2203 "reading/gmsreader/bigmdefault",
"default M value for big-M reformulation of indicator constraints in case no bound on slack variable is given",
2207 "reading/gmsreader/indicatorreform",
"which reformulation to use for indicator constraints: 'b'ig-M, 's'os1",
2211 "reading/gmsreader/signpower",
"is it allowed to use the gams function signpower(x,a)?",
2250 const char* conshdlrname;
2274 assert( scip !=
NULL );
2275 assert( vars !=
NULL || nvars == 0 );
2288 if( objscale == 1.0 && objoffset == 0.0 )
2290 for( v = 0; v < nvars; ++v )
2295 if( objvar ==
NULL )
2319 SCIPinfoMessage(scip, file,
"* Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
2320 nvars, nbinvars, nintvars, nimplvars, ncontvars);
2331 if( objvar ==
NULL )
2338 for( v = 0; v < nvars; ++v )
2341 assert( var !=
NULL );
2345 appendLine(scip, file, linebuffer, &linecnt, buffer);
2347 if( (linecnt > 0 && (v == nbinvars - 1 || v == nbinvars + nintvars - 1 ||
2348 v == nbinvars + nintvars + nimplvars - 1)) || v == nvars - 1 )
2350 endLine(scip, file, linebuffer, &linecnt);
2363 for( v = 0; v < nbinvars; ++v )
2370 appendLine(scip, file, linebuffer, &linecnt, buffer);
2373 endLine(scip, file, linebuffer, &linecnt);
2383 for( v = 0; v < nintvars; ++v )
2385 var = vars[nbinvars + v];
2390 appendLine(scip, file, linebuffer, &linecnt, buffer);
2392 endLine(scip, file, linebuffer, &linecnt);
2399 nondefbounds =
FALSE;
2401 for( v = 0; v < nvars; ++v )
2404 assert( var !=
NULL );
2428 nondefbounds =
TRUE;
2435 if( v < nbinvars + nintvars )
2446 nondefbounds =
TRUE;
2449 else if( v >= nbinvars + nintvars && !
SCIPisInfinity(scip, -lb) )
2453 nondefbounds =
TRUE;
2462 nondefbounds =
TRUE;
2465 else if( v < nbinvars + nintvars && !freeints )
2474 nondefbounds =
TRUE;
2481 nondefbounds =
TRUE;
2487 nondefbounds =
TRUE;
2492 SCIPinfoMessage(scip, file,
"* (All other bounds at default value: binary [0,1], integer [%s], continuous [-inf,+inf].)\n", freeints ?
"0,+inf" :
"0,100");
2496 if( nconss > 0 || objvar ==
NULL )
2503 if( objvar ==
NULL )
2510 for( c = 0; c < nconss; ++c )
2513 assert( cons !=
NULL );
2516 assert( conshdlr !=
NULL );
2522 rangedrow = strcmp(conshdlrname,
"linear") == 0
2525 rangedrow = rangedrow || (strcmp(conshdlrname,
"quadratic") == 0
2528 rangedrow = rangedrow || (strcmp(conshdlrname,
"nonlinear") == 0
2531 rangedrow = rangedrow || (strcmp(conshdlrname,
"abspower") == 0
2534 rangedrow = rangedrow || (strcmp(conshdlrname,
"bivariate") == 0
2537 rangedrow = rangedrow || (strcmp(conshdlrname,
"varbound") == 0
2542 if( strcmp(conshdlrname,
"knapsack") != 0 && strcmp(conshdlrname,
"logicor") != 0 && strcmp(conshdlrname,
"setppc") != 0
2543 && strcmp(conshdlrname,
"linear") != 0 && strcmp(conshdlrname,
"quadratic") != 0 && strcmp(conshdlrname,
"varbound") != 0
2544 && strcmp(conshdlrname,
"soc") != 0 && strcmp(conshdlrname,
"abspower") != 0 && strcmp(conshdlrname,
"bivariate") != 0
2545 && strcmp(conshdlrname,
"nonlinear") != 0 && strcmp(conshdlrname,
"SOS1") != 0 && strcmp(conshdlrname,
"SOS2") != 0
2546 && strcmp(conshdlrname,
"indicator") != 0 )
2553 appendLine(scip, file, linebuffer, &linecnt,
",");
2559 appendLine(scip, file, linebuffer, &linecnt, buffer);
2564 appendLine(scip, file, linebuffer, &linecnt, buffer);
2569 if( nconss > 0 || objvar ==
NULL )
2572 appendLine(scip, file, linebuffer, &linecnt, buffer);
2574 endLine(scip, file, linebuffer, &linecnt);
2578 if( objvar ==
NULL )
2582 if( objoffset != 0.0 )
2586 appendLine(scip, file, linebuffer, &linecnt, buffer);
2590 for( v = 0; v < nvars; ++v )
2593 assert( var !=
NULL );
2604 endLine(scip, file, linebuffer, &linecnt);
2612 discrete = nbinvars > 0 || nintvars > 0;
2613 indicatorsosdef =
FALSE;
2614 for( c = 0; c < nconss; ++c )
2617 assert( cons !=
NULL );
2623 assert( conshdlr !=
NULL );
2629 if( strcmp(conshdlrname,
"knapsack") == 0 )
2639 for( v = 0; v < nconsvars; ++v )
2647 else if( strcmp(conshdlrname,
"linear") == 0 )
2653 else if( strcmp(conshdlrname,
"logicor") == 0 )
2659 else if( strcmp(conshdlrname,
"quadratic") == 0 )
2669 else if( strcmp(conshdlrname,
"nonlinear") == 0 )
2682 1, &exprtree, &coef,
2697 else if( strcmp(conshdlrname,
"bivariate") == 0 )
2706 assert(exprtree !=
NULL);
2712 linvar ==
NULL ? 0 : 1, &linvar, &lincoef,
2717 if( exprdegree > 1 )
2722 else if( strcmp(conshdlrname,
"setppc") == 0 )
2731 nconsvars, consvars,
NULL, 1.0, 1.0, transformed) );
2743 else if( strcmp(conshdlrname,
"varbound") == 0 )
2755 2, consvars, consvals,
2761 else if( strcmp(conshdlrname,
"soc") == 0 )
2764 SCIPgetNLhsVarsSOC(scip, cons),
SCIPgetLhsVarsSOC(scip, cons),
SCIPgetLhsCoefsSOC(scip, cons),
SCIPgetLhsOffsetsSOC(scip, cons),
SCIPgetLhsConstantSOC(scip, cons),
2767 nlcons = nlcons || !
isGAMSprintableSOC(
SCIPgetNLhsVarsSOC(scip, cons),
SCIPgetLhsVarsSOC(scip, cons),
SCIPgetLhsCoefsSOC(scip, cons),
SCIPgetLhsOffsetsSOC(scip, cons),
SCIPgetLhsConstantSOC(scip, cons),
2770 else if( strcmp(conshdlrname,
"indicator") == 0 )
2776 else if( strcmp(conshdlrname,
"abspower") == 0 )
2786 else if( strcmp(conshdlrname,
"SOS1") == 0 )
2793 else if( strcmp(conshdlrname,
"SOS2") == 0 )
2802 SCIPwarningMessage(scip,
"constraint handler <%s> cannot print requested format\n", conshdlrname );
2811 assert(nlcons || !nsmooth);
2822 discrete ?
"MI" :
"", nlcons ? (nqcons ? ((nsmooth && !discrete) ?
"DNLP" :
"NLP") :
"QCP") : (discrete > 0 ?
"P" :
"LP"));
2824 if( objvar !=
NULL )
2829 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)