36 #include "reader_gmo.h" 55 #define READER_NAME "gmsreader" 56 #define READER_DESC "file writer for MI(NL)(SOC)Ps in GAMS file format" 57 #define READER_EXTENSION "gms" 60 #define GMS_MAX_LINELEN 256 61 #define GMS_MAX_PRINTLEN 256 62 #define GMS_MAX_NAMELEN 64 63 #define GMS_PRINTLEN 100 64 #define GMS_DEFAULT_BIGM 1e+6 65 #define GMS_DEFAULT_INDICATORREFORM 's' 66 #define GMS_DEFAULT_SIGNPOWER FALSE 88 assert( scip !=
NULL );
89 assert( vars !=
NULL );
90 assert( scalars !=
NULL );
91 assert( nvars !=
NULL );
92 assert( constant !=
NULL );
98 if( requiredsize > *nvars )
104 assert( requiredsize <= *nvars );
109 for( v = 0; v < *nvars; ++v )
124 assert( linebuffer !=
NULL );
125 assert( linecnt !=
NULL );
128 linebuffer[0] =
'\0';
140 assert( scip !=
NULL );
141 assert( linebuffer !=
NULL );
142 assert( linecnt !=
NULL );
146 linebuffer[(*linecnt)] =
'\0';
160 const char* extension
164 assert( scip !=
NULL );
165 assert( linebuffer !=
NULL );
166 assert( linecnt !=
NULL );
167 assert( extension !=
NULL );
174 len = strlen(linebuffer);
177 (*linecnt) += (int) strlen(extension);
179 SCIPdebugMsg(scip,
"linebuffer <%s>, length = %lu\n", linebuffer, (
unsigned long)len);
182 endLine(scip, file, linebuffer, linecnt);
194 const char* extension
199 appendLine(scip, file, linebuffer, linecnt,
" ");
201 appendLine(scip, file, linebuffer, linecnt, extension);
212 assert( name !=
NULL );
214 for( badchar =
badchars; *badchar; ++badchar )
216 char* c = strchr(name, *badchar);
220 assert( *c == *badchar );
223 c = strchr(c, *badchar);
246 if( replaceforbiddenchars )
281 assert( scip !=
NULL );
282 assert( vars !=
NULL || nvars == 0 );
287 appendLine(scip, file, linebuffer, linecnt,
" ");
293 appendLine(scip, file, linebuffer, linecnt, buffer);
309 for( v = 0; v < nactivevars; ++v )
316 assert( nactivevars == 0 || activevals !=
NULL );
318 if( nactivevars == 0 &&
SCIPisZero(scip, activeconstant) )
322 appendLine(scip, file, linebuffer, linecnt,
" ");
326 appendLine(scip, file, linebuffer, linecnt, buffer);
334 closingbracket = nactivevars;
339 while(
SCIPisZero(scip, activevals[closingbracket]) && closingbracket > 0 );
343 for( v = 0; v < nactivevars; ++v )
346 assert( var !=
NULL );
352 appendLine(scip, file, linebuffer, linecnt,
" ");
356 if(
SCIPisEQ(scip, activevals[v], 1.0) )
358 varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
359 else if(
SCIPisEQ(scip, activevals[v], -1.0) )
361 varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
362 else if( strchr(ext,
'(') !=
NULL )
364 activevals[v], varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
367 activevals[v], varname, (v == closingbracket) ?
")" :
"", (v == closingbracket && suffix) ? suffix :
"");
369 appendLine(scip, file, linebuffer, linecnt, buffer);
380 appendLine(scip, file, linebuffer, linecnt,
" ");
384 appendLine(scip, file, linebuffer, linecnt, buffer);
387 else if( strchr(ext,
'(') !=
NULL )
391 appendLine(scip, file, linebuffer, linecnt,
" ");
395 appendLine(scip, file, linebuffer, linecnt, buffer);
414 const char* rownameextension,
431 assert( scip !=
NULL );
432 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0);
433 assert( nvars == 0 || (vars !=
NULL && vals !=
NULL) );
438 appendLine(scip, file, linebuffer, &linecnt,
" ");
441 if( strlen(rowname) > 0 || strlen(rownameextension) > 0 )
445 appendLine(scip, file, linebuffer, &linecnt, consname);
453 appendLine(scip, file, linebuffer, &linecnt,
" ");
457 appendLine(scip, file, linebuffer, &linecnt, buffer);
460 for( v = 0; v < nvars; ++v )
463 assert( var !=
NULL );
467 appendLine(scip, file, linebuffer, &linecnt,
" ");
472 appendLine(scip, file, linebuffer, &linecnt, buffer);
483 appendLine(scip, file, linebuffer, &linecnt,
" ");
484 appendLine(scip, file, linebuffer, &linecnt, buffer);
486 endLine(scip, file, linebuffer, &linecnt);
512 assert( scip !=
NULL );
513 assert( rowname !=
NULL );
516 assert( nvars == 0 || vars !=
NULL );
518 assert( lhs <= rhs );
536 for( v = 0; v < nactivevars; ++v )
551 nactivevars, activevars, activevals, rhs - activeconstant) );
559 nactivevars, activevars, activevals, lhs - activeconstant) );
565 nactivevars, activevars, activevals, rhs - activeconstant) );
586 const char* rownameextension,
607 assert( scip !=
NULL );
608 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
609 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
610 assert( nlinvars == 0 || (linvars !=
NULL && lincoeffs !=
NULL) );
611 assert( nquadvarterms == 0 || quadvarterms !=
NULL );
612 assert( nbilinterms == 0 || bilinterms !=
NULL );
613 assert( nquadvarterms > 0 || nbilinterms == 0 );
618 appendLine(scip, file, linebuffer, &linecnt,
" ");
624 appendLine(scip, file, linebuffer, &linecnt, consname);
633 for( t = 0; t < nquadvarterms; ++t )
635 var = quadvarterms[t].
var;
636 assert( var !=
NULL );
638 if( !
SCIPisZero(scip, quadvarterms[t].lincoef) )
647 for( t = 0; t < nquadvarterms; ++t )
649 var = quadvarterms[t].
var;
650 assert( var !=
NULL );
652 if( !
SCIPisZero(scip, quadvarterms[t].sqrcoef) )
661 for( t = 0; t < nbilinterms; ++t )
668 var = bilinterms[t].
var1;
669 assert( var !=
NULL );
674 var = bilinterms[t].
var2;
675 assert( var !=
NULL );
684 appendLine(scip, file, linebuffer, &linecnt,
" ");
691 appendLine(scip, file, linebuffer, &linecnt, buffer);
693 endLine(scip, file, linebuffer, &linecnt);
717 assert( scip !=
NULL );
718 assert( rowname !=
NULL );
719 assert( nlinvars == 0 || (linvars !=
NULL && lincoeffs !=
NULL) );
720 assert( nquadvarterms == 0 || quadvarterms !=
NULL );
721 assert( nbilinterms == 0 || bilinterms !=
NULL );
722 assert( nquadvarterms > 0 || nbilinterms == 0 );
723 assert( lhs <= rhs );
735 nlinvars, linvars, lincoeffs,
736 nquadvarterms, quadvarterms,
737 nbilinterms, bilinterms, rhs, transformed) );
745 nlinvars, linvars, lincoeffs,
746 nquadvarterms, quadvarterms,
747 nbilinterms, bilinterms, lhs, transformed) );
753 nlinvars, linvars, lincoeffs,
754 nquadvarterms, quadvarterms,
755 nbilinterms, bilinterms, rhs, transformed) );
779 assert(nlhsvars == 0 || lhsvars !=
NULL);
784 if( rhsoffset != 0.0 )
793 if( lhsconstant != 0.0 )
799 for( i = 0; i < nlhsvars; ++i )
801 if( lhscoeffs [i] != 1.0 )
804 if( lhsoffsets[i] != 0.0 )
842 assert( scip !=
NULL );
843 assert( strlen(rowname) > 0 );
844 assert( nlhsvars == 0 || lhsvars !=
NULL );
849 appendLine(scip, file, linebuffer, &linecnt,
" ");
855 appendLine(scip, file, linebuffer, &linecnt, consname);
857 if( !
isGAMSprintableSOC(nlhsvars, lhsvars, lhscoeffs, lhsoffsets, lhsconstant, rhsvar, rhscoef, rhsoffset) )
866 appendLine(scip, file, linebuffer, &linecnt,
" =g= ");
870 if( lhsconstant != 0.0 )
874 appendLine(scip, file, linebuffer, &linecnt, buffer);
877 for( t = 0; t < nlhsvars; ++t )
879 assert( lhsvars[t] !=
NULL );
881 (void)
SCIPsnprintf(buffer,
GMS_MAX_PRINTLEN,
"+ sqr(%.15g * (%.15g + ", lhscoeffs ? lhscoeffs[t] : 1.0, lhsoffsets ? lhsoffsets[t] : 0.0);
891 appendLine(scip, file, linebuffer, &linecnt,
" =c= ");
897 appendLine(scip, file, linebuffer, &linecnt,
";");
899 endLine(scip, file, linebuffer, &linecnt);
929 assert( scip !=
NULL );
930 assert( strlen(rowname) > 0 );
934 assert( sossetdeclr !=
NULL );
939 appendLine(scip, file, linebuffer, &linecnt,
" ");
943 switch( indicatorform )
951 appendLine(scip, file, linebuffer, &linecnt, consname);
962 SCIPwarningMessage(scip,
"do not have upper bound on slack variable <%s> in indicator constraint <%s>, will use M = %g.\n",
999 appendLine(scip, file, linebuffer, &linecnt, buffer);
1000 endLine(scip, file, linebuffer, &linecnt);
1003 appendLine(scip, file, linebuffer, &linecnt, buffer);
1004 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
NULL,
"$sameas(sosset,'slack')", 1, &s, &coef, transformed) );
1008 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
" + (1-(",
"))$sameas(sosset,'bin');", 1, &z, &coef, transformed) );
1012 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
" + ",
"$sameas(sosset,'bin');", 1, &z, &coef, transformed) );
1014 endLine(scip, file, linebuffer, &linecnt);
1020 SCIPerrorMessage(
"wrong value '%c' for parameter reading/gmsreader/indicatorreform\n", indicatorform);
1024 endLine(scip, file, linebuffer, &linecnt);
1042 const char* rowname,
1057 assert( scip !=
NULL );
1058 assert( strlen(rowname) > 0 );
1059 assert( vars !=
NULL || nvars == 0 );
1060 assert( sostype == 1 || sostype == 2 );
1065 appendLine(scip, file, linebuffer, &linecnt,
" ");
1070 appendLine(scip, file, linebuffer, &linecnt, buffer);
1071 endLine(scip, file, linebuffer, &linecnt);
1074 (void)
SCIPsnprintf(buffer,
GMS_MAX_PRINTLEN,
" SOS%d Variable %s_sosvar(%s_sosset); %s_sosvar.lo(%s_sosset) = -inf;", sostype, consname, consname, consname, consname);
1075 appendLine(scip, file, linebuffer, &linecnt, buffer);
1076 endLine(scip, file, linebuffer, &linecnt);
1079 appendLine(scip, file, linebuffer, &linecnt, buffer);
1080 endLine(scip, file, linebuffer, &linecnt);
1083 for( v = 0; v < nvars; ++v )
1088 appendLine(scip, file, linebuffer, &linecnt,
";");
1089 endLine(scip, file, linebuffer, &linecnt);
1099 const char* rowname,
1100 const char* rownameextension,
1121 assert( scip !=
NULL );
1122 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
1123 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
1124 assert( nonlinvar !=
NULL );
1125 assert( exponent > 1.0 );
1126 assert( nsmooth !=
NULL );
1131 appendLine(scip, file, linebuffer, &linecnt,
" ");
1137 appendLine(scip, file, linebuffer, &linecnt, consname);
1145 if( !nisoddint && !fixedsign )
1147 if( signpowerallowed )
1152 appendLine(scip, file, linebuffer, &linecnt, buffer);
1153 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"+",
",", 1, &nonlinvar,
NULL, transformed) );
1157 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"signpower(",
",", 1, &nonlinvar,
NULL, transformed) );
1160 appendLine(scip, file, linebuffer, &linecnt, buffer);
1167 appendLine(scip, file, linebuffer, &linecnt, buffer);
1175 if( exponent == 2.0)
1180 appendLine(scip, file, linebuffer, &linecnt, buffer);
1193 appendLine(scip, file, linebuffer, &linecnt, buffer);
1201 appendLine(scip, file, linebuffer, &linecnt, buffer);
1208 if( exponent == 2.0 )
1213 appendLine(scip, file, linebuffer, &linecnt, buffer);
1226 appendLine(scip, file, linebuffer, &linecnt, buffer);
1227 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"+",
",", 1, &nonlinvar,
NULL, transformed) );
1231 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"power(",
",", 1, &nonlinvar,
NULL, transformed) );
1234 appendLine(scip, file, linebuffer, &linecnt, buffer);
1240 if( exponent == 2.0 )
1245 appendLine(scip, file, linebuffer, &linecnt, buffer);
1258 appendLine(scip, file, linebuffer, &linecnt, buffer);
1259 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"-",
",", 1, &nonlinvar,
NULL, transformed) );
1261 appendLine(scip, file, linebuffer, &linecnt, buffer);
1265 SCIP_CALL(
printActiveVariables(scip, file, linebuffer, &linecnt,
"-power(-",
",", 1, &nonlinvar,
NULL, transformed) );
1267 appendLine(scip, file, linebuffer, &linecnt, buffer);
1273 if( linvar !=
NULL )
1282 appendLine(scip, file, linebuffer, &linecnt,
" ");
1290 appendLine(scip, file, linebuffer, &linecnt, buffer);
1292 endLine(scip, file, linebuffer, &linecnt);
1303 const char* rowname,
1316 assert( scip !=
NULL );
1317 assert( strlen(rowname) > 0 );
1326 nonlinvar, linvar, exponent, offset, coeflinear, rhs, transformed, signpowerallowed, nsmooth) );
1334 nonlinvar, linvar, exponent, offset, coeflinear, lhs, transformed, signpowerallowed, nsmooth) );
1340 nonlinvar, linvar, exponent, offset, coeflinear, rhs, transformed, signpowerallowed, nsmooth) );
1362 assert(scip !=
NULL);
1363 assert(linebuffer !=
NULL);
1364 assert(linecnt !=
NULL);
1365 assert(expr !=
NULL);
1366 assert(nsmooth !=
NULL);
1374 assert(exprvars !=
NULL);
1384 SCIPwarningMessage(scip,
"parameterized expression in GAMS writer. GAMS file will not compile.\n");
1470 nisoddint = (((
SCIP_Real)((
int)exponent)) == exponent) && (((
int)exponent)%2 == 1);
1478 if( signpowerallowed )
1491 if( exponent == 2.0)
1600 if( constant != 0.0 )
1635 if( constant != 0.0 )
1642 if( lincoefs !=
NULL )
1656 if( quadelems[i].idx1 == quadelems[i].idx2 )
1692 assert(monomdata !=
NULL);
1702 if( exponent == 1.0 )
1706 else if( exponent == 2.0 )
1712 else if( exponent == 0.5 )
1718 else if( ((
SCIP_Real)((
int)exponent)) == exponent )
1751 const char* rowname,
1752 const char* rownameextension,
1773 assert( scip !=
NULL );
1774 assert( strlen(rowname) > 0 || strlen(rownameextension) > 0 );
1775 assert( strcmp(type,
"=e=") == 0 || strcmp(type,
"=l=") == 0 || strcmp(type,
"=g=") == 0 );
1780 appendLine(scip, file, linebuffer, &linecnt,
" ");
1786 appendLine(scip, file, linebuffer, &linecnt, consname);
1790 for( i = 0; i < nexprtrees; ++i )
1792 assert(exprtrees[i] !=
NULL);
1793 if( exprtreecoefs[i] != 0.0 )
1811 appendLine(scip, file, linebuffer, &linecnt,
" ");
1818 appendLine(scip, file, linebuffer, &linecnt, buffer);
1820 endLine(scip, file, linebuffer, &linecnt);
1831 const char* rowname,
1844 assert( scip !=
NULL );
1845 assert( strlen(rowname) > 0 );
1854 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, rhs, transformed, nsmooth) );
1862 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, lhs, transformed, nsmooth) );
1868 nlinvars, linvars, lincoeffs, nexprtrees, exprtrees, exprtreecoefs, rhs, transformed, nsmooth) );
1886 const char* badchar;
1888 assert( scip !=
NULL );
1889 assert( vars !=
NULL );
1894 for( badchar =
badchars; *badchar; ++badchar )
1896 for( v = 0; v < nvars; ++v )
1899 assert( var !=
NULL );
1903 if( replaceforbiddenchars )
1905 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);
1909 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);
1918 for( v = 0; v < nvars; ++v )
1921 assert( var !=
NULL );
1925 SCIPwarningMessage(scip,
"there is a variable name which has to be cut down to %d characters; GAMS model might be corrupted.\n",
1946 const char* conshdlrname;
1948 const char* badchar;
1950 assert( scip !=
NULL );
1951 assert( conss !=
NULL );
1956 for( badchar =
badchars; *badchar; ++badchar )
1958 for( c = 0; c < nconss; ++c )
1961 assert( cons !=
NULL );
1965 if( replaceforbiddenchars )
1967 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);
1971 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);
1980 for( c = 0; c < nconss; ++c )
1983 assert( cons !=
NULL );
1989 assert( conshdlr !=
NULL );
1994 if( strcmp(conshdlrname,
"linear") == 0 || strcmp(conshdlrname,
"quadratic") == 0 )
2001 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2007 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2014 SCIPwarningMessage(scip,
"there is a constraint name which has to be cut down to %d characters;\n",
2032 assert(reader !=
NULL);
2049 char buffer[GMS_SSSIZE];
2051 gmoHandle_t gmo =
NULL;
2052 gevHandle_t gev =
NULL;
2055 assert(reader !=
NULL);
2056 assert(filename !=
NULL);
2057 assert(result !=
NULL);
2063 mkdir(
"loadgms.tmp", S_IRWXU);
2066 convertdopt = fopen(
"loadgms.tmp/convertd.opt",
"w");
2067 if( convertdopt ==
NULL )
2069 SCIPerrorMessage(
"Could not create convertd options file. Do you have write permissions in execution directory?\n");
2072 fputs(
" ", convertdopt);
2073 fclose(convertdopt);
2076 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",
2079 rc = system(gamscall);
2082 SCIPerrorMessage(
"GAMS call returned with code %d, check loadgms.tmp/listing for details.\n", rc);
2089 if( !gevCreateDD(&gev, WITH_GAMS, buffer,
sizeof(buffer)) )
2096 if( !gmoCreateDD(&gmo, WITH_GAMS, buffer,
sizeof(buffer)) )
2103 if( gevInitEnvironmentLegacy(gev,
"loadgms.tmp/gamscntr.dat") )
2105 SCIPerrorMessage(
"Could not load control file loadgms.tmp/gamscntr.dat\n");
2110 if( gmoRegisterEnvironment(gmo, gev, buffer) )
2117 if( gmoLoadDataLegacy(gmo, buffer) )
2137 system(
"rm loadgms.tmp/* && rmdir loadgms.tmp");
2148 nvars, nbinvars, nintvars, nimplvars, ncontvars, conss, nconss, result) );
2158 if( gmoLibraryLoaded() )
2160 if( gevLibraryLoaded() )
2191 "reading/gmsreader/freeints",
"have integer variables no upper bound by default (depending on GAMS version)?",
2195 "reading/gmsreader/replaceforbiddenchars",
"shall characters '#', '*', '+', '/', and '-' in variable and constraint names be replaced by '_'?",
2199 "reading/gmsreader/bigmdefault",
"default M value for big-M reformulation of indicator constraints in case no bound on slack variable is given",
2203 "reading/gmsreader/indicatorreform",
"which reformulation to use for indicator constraints: 'b'ig-M, 's'os1",
2207 "reading/gmsreader/signpower",
"is it allowed to use the gams function signpower(x,a)?",
2246 const char* conshdlrname;
2270 assert( scip !=
NULL );
2271 assert( vars !=
NULL || nvars == 0 );
2284 if( objscale == 1.0 && objoffset == 0.0 )
2286 for( v = 0; v < nvars; ++v )
2291 if( objvar ==
NULL )
2315 SCIPinfoMessage(scip, file,
"* Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
2316 nvars, nbinvars, nintvars, nimplvars, ncontvars);
2327 if( objvar ==
NULL )
2334 for( v = 0; v < nvars; ++v )
2337 assert( var !=
NULL );
2341 appendLine(scip, file, linebuffer, &linecnt, buffer);
2343 if( (linecnt > 0 && (v == nbinvars - 1 || v == nbinvars + nintvars - 1 ||
2344 v == nbinvars + nintvars + nimplvars - 1)) || v == nvars - 1 )
2346 endLine(scip, file, linebuffer, &linecnt);
2359 for( v = 0; v < nbinvars; ++v )
2366 appendLine(scip, file, linebuffer, &linecnt, buffer);
2369 endLine(scip, file, linebuffer, &linecnt);
2379 for( v = 0; v < nintvars; ++v )
2381 var = vars[nbinvars + v];
2386 appendLine(scip, file, linebuffer, &linecnt, buffer);
2388 endLine(scip, file, linebuffer, &linecnt);
2395 nondefbounds =
FALSE;
2397 for( v = 0; v < nvars; ++v )
2400 assert( var !=
NULL );
2424 nondefbounds =
TRUE;
2431 if( v < nbinvars + nintvars )
2442 nondefbounds =
TRUE;
2445 else if( v >= nbinvars + nintvars && !
SCIPisInfinity(scip, -lb) )
2449 nondefbounds =
TRUE;
2458 nondefbounds =
TRUE;
2461 else if( v < nbinvars + nintvars && !freeints )
2470 nondefbounds =
TRUE;
2477 nondefbounds =
TRUE;
2483 nondefbounds =
TRUE;
2488 SCIPinfoMessage(scip, file,
"* (All other bounds at default value: binary [0,1], integer [%s], continuous [-inf,+inf].)\n", freeints ?
"0,+inf" :
"0,100");
2492 if( nconss > 0 || objvar ==
NULL )
2499 if( objvar ==
NULL )
2506 for( c = 0; c < nconss; ++c )
2509 assert( cons !=
NULL );
2512 assert( conshdlr !=
NULL );
2518 rangedrow = strcmp(conshdlrname,
"linear") == 0
2521 rangedrow = rangedrow || (strcmp(conshdlrname,
"quadratic") == 0
2524 rangedrow = rangedrow || (strcmp(conshdlrname,
"nonlinear") == 0
2527 rangedrow = rangedrow || (strcmp(conshdlrname,
"abspower") == 0
2530 rangedrow = rangedrow || (strcmp(conshdlrname,
"bivariate") == 0
2533 rangedrow = rangedrow || (strcmp(conshdlrname,
"varbound") == 0
2538 if( strcmp(conshdlrname,
"knapsack") != 0 && strcmp(conshdlrname,
"logicor") != 0 && strcmp(conshdlrname,
"setppc") != 0
2539 && strcmp(conshdlrname,
"linear") != 0 && strcmp(conshdlrname,
"quadratic") != 0 && strcmp(conshdlrname,
"varbound") != 0
2540 && strcmp(conshdlrname,
"soc") != 0 && strcmp(conshdlrname,
"abspower") != 0 && strcmp(conshdlrname,
"bivariate") != 0
2541 && strcmp(conshdlrname,
"nonlinear") != 0 && strcmp(conshdlrname,
"SOS1") != 0 && strcmp(conshdlrname,
"SOS2") != 0
2542 && strcmp(conshdlrname,
"indicator") != 0 )
2549 appendLine(scip, file, linebuffer, &linecnt,
",");
2555 appendLine(scip, file, linebuffer, &linecnt, buffer);
2560 appendLine(scip, file, linebuffer, &linecnt, buffer);
2565 if( nconss > 0 || objvar ==
NULL )
2568 appendLine(scip, file, linebuffer, &linecnt, buffer);
2570 endLine(scip, file, linebuffer, &linecnt);
2574 if( objvar ==
NULL )
2578 if( objoffset != 0.0 )
2582 appendLine(scip, file, linebuffer, &linecnt, buffer);
2586 for( v = 0; v < nvars; ++v )
2589 assert( var !=
NULL );
2600 endLine(scip, file, linebuffer, &linecnt);
2608 discrete = nbinvars > 0 || nintvars > 0;
2609 indicatorsosdef =
FALSE;
2610 for( c = 0; c < nconss; ++c )
2613 assert( cons !=
NULL );
2619 assert( conshdlr !=
NULL );
2625 if( strcmp(conshdlrname,
"knapsack") == 0 )
2635 for( v = 0; v < nconsvars; ++v )
2643 else if( strcmp(conshdlrname,
"linear") == 0 )
2649 else if( strcmp(conshdlrname,
"logicor") == 0 )
2655 else if( strcmp(conshdlrname,
"quadratic") == 0 )
2665 else if( strcmp(conshdlrname,
"nonlinear") == 0 )
2678 1, &exprtree, &coef,
2693 else if( strcmp(conshdlrname,
"bivariate") == 0 )
2702 assert(exprtree !=
NULL);
2708 linvar ==
NULL ? 0 : 1, &linvar, &lincoef,
2713 if( exprdegree > 1 )
2718 else if( strcmp(conshdlrname,
"setppc") == 0 )
2727 nconsvars, consvars,
NULL, 1.0, 1.0, transformed) );
2739 else if( strcmp(conshdlrname,
"varbound") == 0 )
2751 2, consvars, consvals,
2757 else if( strcmp(conshdlrname,
"soc") == 0 )
2760 SCIPgetNLhsVarsSOC(scip, cons),
SCIPgetLhsVarsSOC(scip, cons),
SCIPgetLhsCoefsSOC(scip, cons),
SCIPgetLhsOffsetsSOC(scip, cons),
SCIPgetLhsConstantSOC(scip, cons),
2763 nlcons = nlcons || !
isGAMSprintableSOC(
SCIPgetNLhsVarsSOC(scip, cons),
SCIPgetLhsVarsSOC(scip, cons),
SCIPgetLhsCoefsSOC(scip, cons),
SCIPgetLhsOffsetsSOC(scip, cons),
SCIPgetLhsConstantSOC(scip, cons),
2766 else if( strcmp(conshdlrname,
"indicator") == 0 )
2772 else if( strcmp(conshdlrname,
"abspower") == 0 )
2782 else if( strcmp(conshdlrname,
"SOS1") == 0 )
2789 else if( strcmp(conshdlrname,
"SOS2") == 0 )
2798 SCIPwarningMessage(scip,
"constraint handler <%s> cannot print requested format\n", conshdlrname );
2807 assert(nlcons || !nsmooth);
2818 discrete ?
"MI" :
"", nlcons ? (nqcons ? ((nsmooth && !discrete) ?
"DNLP" :
"NLP") :
"QCP") : (discrete > 0 ?
"P" :
"LP"));
2820 if( objvar !=
NULL )
2825 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)