assert(opbinput !=
NULL);
203 SCIPerrorMessage(
"Syntax error in line %d: %s found <%s>\n", opbinput->linenumber, msg, opbinput->token);
204 if( opbinput->linebuf[opbinput->linebufsize - 1] ==
'\n')
213opbinput->haserror =
TRUE;
222assert(opbinput !=
NULL);
224 returnopbinput->haserror;
281assert(hasdot !=
NULL);
282assert(exptype !=
NULL);
284 if( isdigit((
unsigned char)c) )
286 else if( (*exptype ==
OPB_EXP_NONE) && !(*hasdot) && (c ==
'.') )
291 else if( !firstchar && (*exptype ==
OPB_EXP_NONE) && (c ==
'e'|| c ==
'E') )
293 if( nextc ==
'+'|| nextc ==
'-')
298 else if( isdigit((
unsigned char)nextc) )
304 else if( (*exptype ==
OPB_EXP_SIGNED) && (c ==
'+'|| c ==
'-') )
324assert(opbinput !=
NULL);
327opbinput->linepos = 0;
328opbinput->linebuf[opbinput->linebufsize - 2] =
'\0';
330 if(
SCIPfgets(opbinput->linebuf, opbinput->linebufsize, opbinput->file) ==
NULL)
333opbinput->linenumber++;
336 while( opbinput->linebuf[opbinput->linebufsize - 2] !=
'\0')
343opbinput->linebuf[newsize-2] =
'\0';
344 if(
SCIPfgets(opbinput->linebuf + opbinput->linebufsize - 1, newsize - opbinput->linebufsize + 1, opbinput->file) ==
NULL)
346opbinput->linebufsize = newsize;
349opbinput->linebuf[opbinput->linebufsize - 1] =
'\0';
356commentstart = strchr(opbinput->linebuf,
commentchars[i]);
357 if( commentstart !=
NULL)
359*commentstart =
'\0';
360*(commentstart+1) =
'\0';
380*pointer1 = *pointer2;
396assert(opbinput !=
NULL);
397assert(opbinput->linepos < opbinput->linebufsize);
400 if( opbinput->npushedtokens > 0 )
402 swapPointers(&opbinput->token, &opbinput->pushedtokens[opbinput->npushedtokens-1]);
403opbinput->npushedtokens--;
404 SCIPdebugMsg(
scip,
"(line %d) read token again: '%s'\n", opbinput->linenumber, opbinput->token);
409buf = opbinput->linebuf;
412 if( buf[opbinput->linepos] ==
'\0')
419assert(opbinput->linepos == 0);
421buf = opbinput->linebuf;
426assert(opbinput->linepos < opbinput->linebufsize);
432 if(
isValueChar(buf[opbinput->linepos], buf[opbinput->linepos+1],
TRUE, &hasdot, &exptype) )
440opbinput->token[tokenlen] = buf[opbinput->linepos];
444 while(
isValueChar(buf[opbinput->linepos], buf[opbinput->linepos+1],
FALSE, &hasdot, &exptype) );
453opbinput->token[tokenlen] = buf[opbinput->linepos];
456 if( tokenlen == 1 &&
isTokenChar(opbinput->token[0]) )
466&& (opbinput->token[tokenlen-1] ==
'<'|| opbinput->token[tokenlen-1] ==
'>'|| opbinput->token[tokenlen-1] ==
'=')
467&& buf[opbinput->linepos] ==
'=')
471 else if( opbinput->token[tokenlen-1] ==
'='&& (buf[opbinput->linepos] ==
'<'|| buf[opbinput->linepos] ==
'>') )
473opbinput->token[tokenlen-1] = buf[opbinput->linepos];
478opbinput->token[tokenlen] =
'\0';
480 SCIPdebugMsg(
scip,
"(line %d) read token: '%s'\n", opbinput->linenumber, opbinput->token);
491assert(opbinput !=
NULL);
494 swapPointers(&opbinput->pushedtokens[opbinput->npushedtokens], &opbinput->token);
495opbinput->npushedtokens++;
504assert(opbinput !=
NULL);
507 swapPointers(&opbinput->pushedtokens[opbinput->npushedtokens], &opbinput->tokenbuf);
508opbinput->npushedtokens++;
517assert(opbinput !=
NULL);
528assert(opbinput !=
NULL);
530 if( *(opbinput->token) ==
';')
543assert(opbinput !=
NULL);
544assert(sign !=
NULL);
545assert(*sign == +1 || *sign == -1);
547 if( strlen(opbinput->token) == 1 )
549assert(opbinput->token[1] ==
'\0');
551 if( *opbinput->token ==
'+')
553 else if( *opbinput->token ==
'-')
571assert(opbinput !=
NULL);
572assert(value !=
NULL);
584val = strtod(opbinput->token, &endptr);
585 if( endptr != opbinput->token && *endptr ==
'\0')
588 if( strlen(opbinput->token) > 18 )
589opbinput->nproblemcoeffs++;
604assert(opbinput !=
NULL);
606 if( strcmp(opbinput->token,
"<") == 0 )
612 else if( strcmp(opbinput->token,
">") == 0 )
618 else if( strcmp(opbinput->token,
"=") == 0 )
636assert(opbinput !=
NULL);
638 if( strcmp(opbinput->token,
"[") == 0 )
652assert(opbinput !=
NULL);
654 if( strcmp(opbinput->token,
"]") == 0 )
674initial = !dynamiccols;
675removable = dynamiccols;
706assert(opbinput !=
NULL);
707assert(vars !=
NULL);
708assert(nvars !=
NULL);
709assert(varssize !=
NULL);
710assert(*varssize >= 0);
714name = opbinput->token;
715assert(name !=
NULL);
718 while(!isdigit((
unsigned char) *name ) && !
isTokenChar(*name) && !opbinput->haserror )
744 if( *nvars == *varssize )
750(*vars)[*nvars] = var;
754opbinput->haserror =
TRUE;
756name = opbinput->token;
777 int*
constnlincoefs,
783 int*
constntermcoefs,
802assert(opbinput !=
NULL);
803assert(name !=
NULL);
804assert(linvars !=
NULL);
805assert(lincoefs !=
NULL);
806assert(lincoefssize !=
NULL);
807assert(nlincoefs !=
NULL);
808assert(terms !=
NULL);
809assert(termcoefs !=
NULL);
810assert(ntermvars !=
NULL);
811assert(termcoefssize !=
NULL);
812assert(ntermcoefs !=
NULL);
813assert(newsection !=
NULL);
825*newsection =
FALSE;
826*isNonlinear =
FALSE;
827*issoftcons =
FALSE;
840 if( strcmp(opbinput->token,
":") == 0 )
846 SCIPdebugMsg(
scip,
"(line %d) read constraint name: '%s'\n", opbinput->linenumber, name);
851 syntaxError(
scip, opbinput,
"Soft top cost line needs to be the first non-comment line, and without any objective function.\n");
858 SCIPdebugMsg(
scip,
"(line %d) constraint has no name\n", opbinput->linenumber);
871assert(
SCIPfeof( opbinput->file ) );
872opbinput->eof =
TRUE;
894haveweightstart =
FALSE;
895haveweightend =
FALSE;
916 if(
isSign(opbinput, &coefsign) )
918 SCIPdebugMsg(
scip,
"(line %d) read coefficient sign: %+d\n", opbinput->linenumber, coefsign);
927 if( (*nlincoefs > 0 || *ntermcoefs > 0 || ntmpcoefs > 0) && !havesign )
933 SCIPdebugMsg(
scip,
"(line %d) read coefficient value: %g with sign %+d\n", opbinput->linenumber, coef, coefsign);
942 if( strcmp(name,
"soft") == 0 )
944assert(ntmpcoefs == 0);
946tmpcoefs[ntmpcoefs] = coefsign * coef;
954 if( *nlincoefs == 0 && *ntermcoefs == 0 && ntmpcoefs == 0 && !havesign && !havevalue && strcmp(name,
"soft") != 0 &&
isStartingSoftConstraintWeight(
scip, opbinput) )
956 if( !opbinput->wbo )
958 SCIPwarningMessage(
scip,
"Found in line %d a soft constraint, without having read a starting top-cost line.\n", opbinput->linenumber);
960haveweightstart =
TRUE;
966*weight = coefsign * coef;
967 SCIPdebugMsg(
scip,
"(line %d) found soft constraint weight: %g\n", opbinput->linenumber, *weight);
972haveweightend =
TRUE;
980 if( haveweightstart != haveweightend )
987 if( strcmp(name,
"soft") == 0 )
999*isNonlinear =
TRUE;
1001 SCIPdebugMsg(
scip,
"(line %d) found linear term: %+g", opbinput->linenumber, coefsign * coef);
1005 for( v = 0; v < ntmpvars; ++v )
1014assert(*ntermcoefs <= *termcoefssize);
1016 if( *ntermcoefs >= *termcoefssize )
1024*termcoefssize = newsize;
1026assert(*ntermcoefs < *termcoefssize);
1032(*ntermvars)[*ntermcoefs] = ntmpvars;
1035 for( --ntmpvars; ntmpvars >= 0; --ntmpvars )
1037(*terms)[*ntermcoefs][ntmpvars] = tmpvars[ntmpvars];
1040(*termcoefs)[*ntermcoefs] = coefsign * coef;
1045 SCIPwarningMessage(
scip,
"coefficient %g in line %d not integral.\n", (*termcoefs)[*ntermcoefs], opbinput->linenumber);
1060assert(ntmpvars == 1);
1065assert(*nlincoefs <= *lincoefssize);
1067 if( *nlincoefs >= *lincoefssize )
1074*lincoefssize = newsize;
1076assert(*nlincoefs < *lincoefssize);
1079(*linvars)[*nlincoefs] = tmpvars[0];
1080(*lincoefs)[*nlincoefs] = coefsign * coef;
1085 SCIPwarningMessage(
scip,
"coefficient %g in line %d not integral.\n", (*lincoefs)[*nlincoefs], opbinput->linenumber);
1101 if( !opbinput->haserror )
1104assert(ntmpvars == 0);
1107 if( ntmpcoefs > 0 )
1110assert(ntmpcoefs == 1);
1112assert(*nlincoefs == 0 && *ntermcoefs == 0);
1115(*lincoefs)[*nlincoefs] = tmpcoefs[0];
1145 int*
constntermvars,
1146 int constntermcoefs
1150assert(opbinput !=
NULL);
1152assert(ncoefs == 0 || (linvars !=
NULL&& coefs !=
NULL));
1153assert(ntermcoefs == 0 || (terms !=
NULL&& ntermvars !=
NULL&& termcoefs !=
NULL));
1161 if( strcmp(sense,
"max") == 0 )
1170 if( ntermcoefs > 0 )
1172#if (LINEAROBJECTIVE == TRUE) 1180 for( t = 0; t < ntermcoefs; ++t )
1182assert(terms !=
NULL);
1183assert(ntermvars !=
NULL);
1184assert(termcoefs !=
NULL);
1187nvars = ntermvars[t];
1188assert(vars !=
NULL);
1205#ifdef WITH_DEBUG_SOLUTION 1206 if( SCIPdebugIsMainscip(
scip) )
1210 for( v = nvars - 1; v >= 0; --v )
1243 for( v = 0; v < ntermcoefs; ++v )
1245 if( termcoefs[v] < 0 )
1251 for( v = 0; v < ncoefs; ++v )
1273#ifdef WITH_DEBUG_SOLUTION 1274 if( SCIPdebugIsMainscip(
scip) )
1279 for( t = 0; t < ntermcoefs; ++t )
1282nvars = ntermvars[t];
1283assert(vars !=
NULL);
1286 for( v = nvars - 1; v >= 0; --v )
1295artval += (((val < 0.5) ? 0.0 : 1.0) * termcoefs[t]);
1306ntermvars, termcoefs,
NULL, 0.0,
FALSE, var, 0.0, 0.0,
1320 for( v = 0; v < ncoefs; ++v )
1322assert(linvars !=
NULL);
1323assert(coefs !=
NULL);
1348 int* nNonlinearConss
1389assert(opbinput !=
NULL);
1390assert(nNonlinearConss !=
NULL);
1396 SCIP_CALL(
readCoefficients(
scip, opbinput, name, &linvars, &lincoefs, &nlincoefs, &lincoefssize, &terms, &termcoefs, &ntermvars, &termcoefssize,
1397&ntermcoefs, &newsection, &isNonlinear, &issoftcons, &weight) );
1399 if(
hasError(opbinput) || opbinput->eof )
1403 if( strcmp(name,
"min") == 0 || strcmp(name,
"max") == 0 )
1405 if( opbinput->wbo )
1407 syntaxError(
scip, opbinput,
"Cannot have an objective function when having soft constraints.\n");
1412 SCIP_CALL(
setObjective(
scip, opbinput, name, objscale, linvars, lincoefs, nlincoefs, terms, termcoefs, ntermvars, ntermcoefs) );
1414 else if( strcmp(name,
"soft") == 0 )
1417opbinput->wbo =
TRUE;
1418 if( nlincoefs == 0 )
1422assert(nlincoefs == 1);
1423assert(lincoefs !=
NULL);
1424opbinput->topcost = lincoefs[0];
1426 SCIPdebugMsg(
scip,
"Weighted Boolean Optimization problem has topcost of %g\n", opbinput->topcost);
1428 else if( nlincoefs > 0 )
1429 syntaxError(
scip, opbinput,
"expected constraint sense '=' or '>='");
1439 if( !
isSense(opbinput, &sense) )
1441 syntaxError(
scip, opbinput,
"expected constraint sense '=' or '>='.");
1452 if(
isSign(opbinput, &sidesign) )
1465sidevalue *= sidesign;
1500initial = initialconss;
1506modifiable =
FALSE;
1508removable = dynamicrows;
1514++(opbinput->nindvars);
1523 if( ntermcoefs > 0 || issoftcons )
1525#if GENCONSNAMES == TRUE 1527++(opbinput->consnumber);
1532ntermvars, termcoefs, indvar, weight, issoftcons,
NULL, lhs, rhs,
1533initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE);
1539#if GENCONSNAMES == TRUE 1541++(opbinput->consnumber);
1546initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE);
1552 SCIPdebugMsg(
scip,
"(line %d) created constraint: ", opbinput->linenumber);
1557++(*nNonlinearConss);
1562 for( t = ntermcoefs - 1; t >= 0; --t )
1564assert(terms !=
NULL);
1589 char* commentstart;
1595assert(opbinput !=
NULL);
1596assert(objoffset !=
NULL);
1599commentstart =
NULL;
1603opbinput->linebuf[opbinput->linebufsize - 2] =
'\0';
1607 if(
SCIPfgets(opbinput->linebuf, opbinput->linebufsize, opbinput->file) ==
NULL)
1609assert(
SCIPfeof(opbinput->file) );
1614 while( opbinput->linebuf[opbinput->linebufsize - 2] !=
'\0')
1621opbinput->linebuf[newsize-2] =
'\0';
1622 if(
SCIPfgets(opbinput->linebuf + opbinput->linebufsize - 1, newsize - opbinput->linebufsize + 1, opbinput->file) ==
NULL)
1624opbinput->linebufsize = newsize;
1626opbinput->linebuf[opbinput->linebufsize - 1] =
'\0';
1631commentstart = strchr(opbinput->linebuf,
commentchars[i]);
1634 if( commentstart !=
NULL)
1637nproducts = strstr(opbinput->linebuf,
"#product= ");
1638 if( nproducts !=
NULL)
1643nproducts += strlen(
"#product= ");
1649 SCIPdebugMsg(
scip,
"%d products supposed to be in file.\n", atoi(pos));
1654 if( pos !=
NULL&& strcmp(pos,
"sizeproduct=") == 0 )
1667str = strstr(opbinput->linebuf,
"Obj. scale : ");
1670str += strlen(
"Obj. scale : ");
1671*objscale = atof(str);
1676str = strstr(opbinput->linebuf,
"Obj. offset : ");
1679str += strlen(
"Obj. offset : ");
1680*objoffset = atof(str);
1685*commentstart =
'\0';
1691 while(commentstart !=
NULL&& !stop);
1701 const char* filename
1706 intnNonlinearConss;
1710assert(opbinput !=
NULL);
1713opbinput->file =
SCIPfopen(filename,
"r");
1714 if( opbinput->file ==
NULL)
1732 if( objscale < 0.0 )
1733opbinput->objsense = (
SCIP_OBJSENSE)(-1 * (
int)(opbinput->objsense));
1740nNonlinearConss = 0;
1748 if( opbinput->wbo )
1760assert(nvars > 0 || vars !=
NULL);
1766 for( i = nvars - 1; i >= 0; --i )
1770topcostvars[ntopcostvars] = vars[i];
1775topcostrhs =
SCIPceil(
scip, opbinput->topcost - 1.0);
1778-
SCIPinfinity(
scip), topcostrhs,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE) );
1811assert( vars !=
NULL);
1812assert( nvars > 0 );
1816 for( v = nvars - 1; v >= 0; --v )
1829 for( v = nvars - 1; v >= 0; --v )
1839 if( vars[v] ==
NULL)
1841 SCIPdebugMsg(
scip,
"A variable couldn't retransformed to an original variable.\n");
1852 SCIPdebugMsg(
scip,
"A variable couldn't retransformed to an original variable or a negated variable of an original variable (scalar = %g, constant = %g).\n", scalar, constant);
1877assert(vars !=
NULL);
1879assert(nvars !=
NULL);
1880assert(constant !=
NULL);
1886 if( requiredsize > *nvars )
1892assert( requiredsize <= *nvars );
1896 for( v = 0; v < *nvars; ++v )
1900 if( vars[v] ==
NULL)
1923assert(resvars !=
NULL);
1924assert(nresvars !=
NULL);
1925assert(andvars !=
NULL);
1926assert(nandvars !=
NULL);
1927assert(existandconshdlr !=
NULL);
1928assert(existands !=
NULL);
1937 if( conshdlr !=
NULL)
1941 int* shouldnotbeinand;
1951*existandconshdlr =
TRUE;
1966 for( c = norigconss - 1; c >= 0; --c )
1969assert( conshdlr !=
NULL);
1973andconss[nandconss] = origconss[c];
1984assert(andconss !=
NULL|| nandconss == 0);
1986*nresvars = nandconss;
1988 if( nandconss > 0 )
1992assert(andconss !=
NULL);
1999 for( c = nandconss - 1; c >= 0; --c )
2003assert(andconss[c] !=
NULL);
2012assert((*andvars)[c] !=
NULL&& (*nandvars)[c] > 0);
2013assert((*resvars)[c] !=
NULL);
2017 SCIPsortPtrPtrInt((
void**)(*resvars), (
void**)(*andvars), (*nandvars), SCIPvarComp, (*nresvars));
2020*existands =
FALSE;
2027assert(*nandvars !=
NULL|| *nresvars == 0);
2028 for(
r= *nresvars - 1;
r>= 0; --
r)
2031shouldnotbeinand[ncontainedands] =
r;
2035assert(*nandvars !=
NULL);
2036 while( v < (*nandvars)[
r] )
2038assert(*andvars !=
NULL);
2039assert(*resvars !=
NULL);
2040 if(
SCIPsortedvecFindPtr((
void**)(*resvars), SCIPvarComp, (*andvars)[
r][v], *nresvars, &pos) )
2054 for(
a= ncontainedands - 1;
a>= 0; --
a)
2055 if( shouldnotbeinand[
a] == pos )
2057 SCIPwarningMessage(
scip,
"This should not happen here. The and-constraint with resultant variable: ");
2074shouldnotbeinand[ncontainedands] = pos;
2080(*nandvars)[
r] = (*nandvars)[
r] + (*nandvars)[pos] - 1;
2084 for(
a= (*nandvars)[pos] - 1;
a>= 0; --
a)
2085(*andvars)[
r][(*nandvars)[
r] -
a- 1] = (*andvars)[pos][
a];
2104*existands =
FALSE;
2105*existandconshdlr =
FALSE;
2118assert( linebuffer !=
NULL);
2119assert( linecnt !=
NULL);
2122linebuffer[0] =
'\0';
2136assert( linebuffer !=
NULL);
2137assert( linecnt !=
NULL);
2140 if( (*linecnt) > 0 )
2142linebuffer[(*linecnt)] =
'\0';
2156 const char* extension
2160assert(linebuffer !=
NULL);
2161assert(linecnt !=
NULL);
2162assert(extension !=
NULL);
2168(void) strncat(linebuffer, extension,
OPB_MAX_LINELEN- (
unsigned int)(*linecnt));
2169(*linecnt) += (int) strlen(extension);
2182 int const*
constnandvars,
2187 char const*
constmultisymbol,
2202assert(file !=
NULL);
2203assert(vars !=
NULL|| nvars == 0);
2204assert(resvars !=
NULL|| nresvars == 0);
2205assert(andvars !=
NULL|| nandvars ==
NULL);
2206assert(multisymbol !=
NULL);
2215 for( v = 0; v < nvars; ++v )
2244 if( topcostcons !=
NULL)
2247assert(conshdlr !=
NULL);
2271 if( conshdlr !=
NULL)
2280assert(conss !=
NULL|| nconss == 0);
2282 for( c = 0; c < nconss; ++c )
2291assert(cons !=
NULL);
2296assert(linvars !=
NULL|| nlinvars == 0);
2297topcostfound =
FALSE;
2299 for(
w= 0;
w< nlinvars; ++
w)
2302topcostfound =
TRUE;
2305assert(!topcostfound);
2306topcostfound =
FALSE;
2326 if( conshdlr !=
NULL)
2335assert(conss !=
NULL|| nconss == 0);
2337 for( c = 0; c < nconss; ++c )
2346assert(cons !=
NULL);
2351assert(topvars !=
NULL|| ntopvars == 0);
2352topcostfound =
FALSE;
2354 for(
w= 0;
w< ntopvars; ++
w)
2357topcostfound =
TRUE;
2360assert(!topcostfound);
2361topcostfound =
FALSE;
2383 if( conshdlr !=
NULL)
2392assert(conss !=
NULL|| nconss == 0);
2394 for( c = 0; c < nconss; ++c )
2403assert(cons !=
NULL);
2408assert(topvars !=
NULL|| ntopvars == 0);
2409topcostfound =
FALSE;
2411 for(
w= 0;
w< ntopvars; ++
w)
2414topcostfound =
TRUE;
2417assert(!topcostfound);
2418topcostfound =
FALSE;
2451assert(mult * 10 > mult);
2478 for( c = nresvars - 1; c > 0; --c )
2483 for( v = 0; v < nvars; ++v )
2488assert(var !=
NULL);
2495assert( linecnt != 0 );
2507assert(andvars !=
NULL);
2508assert(nandvars !=
NULL);
2509assert(pos >= 0 && nandvars[pos] > 0 && andvars[pos] !=
NULL);
2510assert(andvars[pos][nandvars[pos] - 1] !=
NULL);
2520 for(
a= nandvars[pos] - 2;
a>= 0; --
a)
2549 char const*
consttype,
2557 int const*
constnandvars,
2560 char const*
constmultisymbol
2571assert(strcmp(type,
"=") == 0 || strcmp(type,
">=") == 0);
2572assert(mult !=
NULL);
2573assert(resvars !=
NULL);
2574assert(nresvars > 0);
2575assert(andvars !=
NULL&& nandvars !=
NULL);
2580 for( v = 0; v < nvars; ++v )
2584 if(
ABS(*mult) >
ABS(*mult * 10) )
2592 if(
ABS(*mult) >
ABS(*mult * 10) )
2598 if(
ABS(*mult) != 1 )
2603 for( v = nresvars - 1; v > 0; --v )
2615 for( v = 0; v < nvars; ++v )
2620assert( var !=
NULL);
2629assert(andvars !=
NULL);
2630assert(nandvars !=
NULL);
2631assert(pos >= 0 && nandvars[pos] > 0 && andvars[pos] !=
NULL);
2632assert(andvars[pos][nandvars[pos] - 1] !=
NULL);
2647 for(
a= nandvars[pos] - 2;
a>= 0; --
a)
2691 int const*
constnandvars,
2694 char const*
constmultisymbol
2706assert(vars !=
NULL|| nvars == 0);
2707assert(resvars !=
NULL);
2708assert(nresvars > 0);
2709assert(andvars !=
NULL&& nandvars !=
NULL);
2714nactivevars = nvars;
2717activeconstant = 0.0;
2731 for( v = 0; v < nactivevars; ++v )
2732activevals[v] = 1.0;
2742 if( activevars !=
NULL)
2750retcode =
printNLRow(
scip, file,
"=", activevars, activevals, nactivevars, rhs - activeconstant, resvars,
2751nresvars, andvars, nandvars, weight, &mult, multisymbol);
2758retcode =
printNLRow(
scip, file,
">=", activevars, activevals, nactivevars, lhs - activeconstant, resvars,
2759nresvars, andvars, nandvars, weight, &mult, multisymbol);
2767retcode =
printNLRow(
scip, file,
">=", activevars, activevals, nactivevars, rhs - activeconstant, resvars,
2768nresvars, andvars, nandvars, weight, &mult, multisymbol);
2793 const char* multisymbol
2803assert(strcmp(type,
"=") == 0 || strcmp(type,
">=") == 0);
2804assert(mult !=
NULL);
2815 for( v = 0; v < nvars; ++v )
2819 if(
ABS(*mult) >
ABS(*mult * 10) )
2827 if(
ABS(*mult) >
ABS(*mult * 10) )
2833 if(
ABS(*mult) != 1 )
2844 for( v = 0; v < nvars; ++v )
2849assert( var !=
NULL);
2888 const char* multisymbol
2900assert( vars !=
NULL|| nvars == 0 );
2905nactivevars = nvars;
2908activeconstant = 0.0;
2922 for( v = 0; v < nactivevars; ++v )
2923activevals[v] = 1.0;
2933 if( activevars !=
NULL)
2941retcode =
printRow(
scip, file,
"=", activevars, activevals, nactivevars, rhs - activeconstant, weight, &mult,
2949retcode =
printRow(
scip, file,
">=", activevars, activevals, nactivevars, lhs - activeconstant, weight, &mult,
2958retcode =
printRow(
scip, file,
">=", activevars, activevals, nactivevars, rhs - activeconstant, weight, &mult,
2977 int* nindicatorconss
2981 const char* conshdlrname;
2986assert(conss !=
NULL|| nconss == 0);
2987assert(nlinearconss !=
NULL);
2988assert(nindicatorconss !=
NULL);
2991*nindicatorconss = 0;
2994 for( c = 0; c < nconss; ++c )
3001assert(cons !=
NULL);
3003assert(conshdlr !=
NULL);
3007 if( strcmp(conshdlrname,
"and") == 0 )
3010 if( strcmp(conshdlrname,
"pseudoboolean") == 0 )
3013++(*nindicatorconss);
3018 if( strcmp(conshdlrname,
"indicator") == 0 )
3020++(*nindicatorconss);
3060 int const*
constnandvars,
3061 char const*
constmultisymbol,
3068 const char* conshdlrname;
3080assert(file !=
NULL);
3081assert(conss !=
NULL|| nconss == 0);
3082assert(vars !=
NULL|| nvars == 0);
3083assert(resvars !=
NULL|| nresvars == 0);
3084assert(andvars !=
NULL|| nandvars == 0);
3085assert(multisymbol !=
NULL);
3092 if( conshdlr !=
NULL)
3099assert(indconss !=
NULL|| nindconss == 0);
3101 if( nindconss > 0 )
3107assert(indconss !=
NULL);
3109 for( c = 0; c < nindconss; ++c )
3111assert(indconss[c] !=
NULL);
3113assert(lincons !=
NULL);
3124 if( conshdlr !=
NULL)
3131assert(pbconss !=
NULL|| npbconss == 0);
3140 for( c = 0; c < npbconss; ++c )
3142assert(pbconss[c] !=
NULL);
3144assert(lincons !=
NULL);
3162 for( c = 0; c < nconss; ++c )
3165assert(conshdlr !=
NULL);
3169 if( strcmp(conshdlrname,
"pseudoboolean") == 0 )
3171 if( !pbhashmapcreated )
3175pbhashmapcreated =
TRUE;
3179assert(lincons !=
NULL);
3184 else if( strcmp(conshdlrname,
"indicator") == 0 )
3186 if( !indhashmapcreated )
3190indhashmapcreated =
TRUE;
3194assert(lincons !=
NULL);
3203 for( c = 0; c < nconss && retcode ==
SCIP_OKAY; ++c )
3210assert(cons !=
NULL);
3213assert(conshdlr !=
NULL);
3221 if( linconssofindicatorsmap !=
NULL)
3225 if( artcons !=
NULL)
3229 if( linconssofpbsmap !=
NULL)
3233 if( artcons !=
NULL)
3237 if( indvar !=
NULL)
3243 SCIPwarningMessage(
scip,
"pseudoboolean constraint <%s> will not be printed because its indicator variable has no objective value(= weight of this soft constraint)\n",
SCIPconsGetName(artcons));
3263topcostfound =
TRUE;
3269 if( strcmp(conshdlrname,
"linear") == 0 )
3276weight, transformed, multisymbol);
3285 else if( strcmp(conshdlrname,
"setppc") == 0 )
3296andvars, nandvars, weight, transformed, multisymbol);
3301consvars,
NULL, nconsvars, 1.0, 1.0, weight, transformed, multisymbol);
3308consvars,
NULL, nconsvars, -
SCIPinfinity(
scip), 1.0, resvars, nresvars, andvars, nandvars,
3309weight, transformed, multisymbol);
3322weight, transformed, multisymbol);
3332 else if( strcmp(conshdlrname,
"logicor") == 0 )
3338resvars, nresvars, andvars, nandvars, weight, transformed, multisymbol);
3347 else if( strcmp(conshdlrname,
"knapsack") == 0 )
3357 for( v = 0; v < nconsvars; ++v )
3364weight, transformed, multisymbol);
3374 else if( strcmp(conshdlrname,
"varbound") == 0 )
3388 SCIPgetRhsVarbound(
scip, cons), resvars, nresvars, andvars, nandvars, weight, transformed, multisymbol);
3399 else if( strcmp(conshdlrname,
"indicator") == 0 )
3406assert(indvar !=
NULL);
3411assert(indvar !=
NULL);
3427assert(slackvar !=
NULL);
3438assert(lincons !=
NULL);
3452 for( v = 0; v < nconsvars; ++v )
3456 if( consvars[v] == slackvar )
3458assert(nonbinarypos == -1);
3474 if( nonbinarypos == -1 )
3496assert(0 <= nonbinarypos && nonbinarypos < nconsvars);
3500consvars[nonbinarypos] = consvars[nconsvars];
3501consvals[nonbinarypos] = consvals[nconsvars];
3507resvars, nresvars, andvars, nandvars,
3508weight, transformed, multisymbol);
3514weight, transformed, multisymbol);
3523 SCIPwarningMessage(
scip,
"indicator constraint <%s> will not be printed because the indicator variable has no objective value(= weight of this soft constraint)\n",
SCIPconsGetName(cons) );
3529 else if( strcmp(conshdlrname,
"and") == 0 )
3534assert(existandconshdlr);
3536 else if( strcmp(conshdlrname,
"pseudoboolean") == 0 )
3554assert(cons !=
NULL);
3556 SCIPerrorMessage(
"Cannot print constraint %s with non-integral coefficient or sides in opb-format\n",
3562 if( linconssofpbsmap !=
NULL)
3567 if( linconssofindicatorsmap !=
NULL)
3584 char const*
constmultisymbol,
3594assert(file !=
NULL);
3595assert(vars !=
NULL|| nvars == 0);
3596assert(printedfixing !=
NULL);
3597assert(multisymbol !=
NULL);
3602 for( v = 0; v < nvars; ++v )
3609assert( vars !=
NULL);
3623assert(lb > -0.5 && ub < 1.5);
3628 if( lb > 0.5 || ub < 0.5 )
3630 if( transformed ) {
3658 int const*
constnandvars,
3660 char const*
constmultisymbol,
3672assert(file !=
NULL);
3673assert(resvars !=
NULL|| nresvars == 0);
3674assert(nandvars !=
NULL|| nresvars == 0);
3675assert(andvars !=
NULL|| nandvars ==
NULL);
3676assert(multisymbol !=
NULL);
3682 for(
r= nresvars - 1;
r>= 0; --
r)
3689assert( resvars !=
NULL);
3690resvar = resvars[
r];
3705 if( lb > 0.5 || ub < 0.5 )
3718assert( andvars !=
NULL&& nandvars !=
NULL);
3719assert( andvars[
r] !=
NULL|| nandvars[
r] == 0 );
3722 for( v = nandvars[
r] - 1; v >= 0; --v )
3724assert( andvars[
r] !=
NULL);
3725assert( andvars[
r][v] !=
NULL);
3739 if( lb > 0.5 || ub < 0.5 )
3756 for(
r= nresvars - 1;
r>= 0; --
r)
3758assert( resvars !=
NULL);
3759resvar = resvars[
r];
3769assert( andvars !=
NULL&& nandvars !=
NULL);
3770assert( andvars[
r] !=
NULL|| nandvars[
r] == 0 );
3775 for( v = nandvars[
r] - 1; v >= 0; --v )
3777assert( andvars[
r] !=
NULL);
3778assert( andvars[
r][v] !=
NULL);
3791 else if( rhslhs == 1 )
3797assert( andvars !=
NULL&& nandvars !=
NULL);
3798assert( andvars[
r] !=
NULL|| nandvars[
r] == 0 );
3801 for( v = nandvars[
r] - 1; v >= 0; --v )
3803assert( andvars[
r] !=
NULL);
3804assert( andvars[
r][v] !=
NULL);
3827firstprinted =
FALSE;
3829assert( andvars !=
NULL&& nandvars !=
NULL);
3830assert( andvars[
r] !=
NULL|| nandvars[
r] == 0 );
3832 for( v = nandvars[
r] - 1; v >= 0; --v )
3834assert( andvars[
r] !=
NULL);
3835assert( andvars[
r][v] !=
NULL);
3842firstprinted =
TRUE;
3850assert(transformed);
3867assert(andvars !=
NULL);
3868assert(nandvars !=
NULL);
3869assert(pos >= 0 && nandvars[pos] > 0 && andvars[pos] !=
NULL);
3870assert(andvars[pos][nandvars[pos] - 1] !=
NULL);
3879 for(
a= nandvars[pos] - 2;
a>= 0; --
a)
3933 int const*
constnandvars,
3944 intnindicatorconss;
3947assert( vars !=
NULL|| nvars == 0 );
3948assert( conss !=
NULL|| nconss == 0 );
3949assert( result !=
NULL);
3961 SCIPinfoMessage(
scip, file,
"* Variables : %d\n", nvars - nresvars - nindicatorconss);
3966SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3970objsense, objscale, objoffset, multisymbol, existands, transformed) );
3973retcode =
writeOpbConstraints(
scip, file, conss, nconss, vars, nvars, resvars, nresvars, andvars, nandvars,
3974multisymbol, existandconshdlr, existands, transformed);
3976 if( existands && (retcode ==
SCIP_OKAY) )
4002 const char* filename,
4011assert(reader !=
NULL);
4014opbinput.file =
NULL;
4016opbinput.linebuf[0] =
'\0';
4019opbinput.token[0] =
'\0';
4021opbinput.tokenbuf[0] =
'\0';
4027opbinput.npushedtokens = 0;
4028opbinput.linenumber = 1;
4029opbinput.linepos = 0;
4031opbinput.eof =
FALSE;
4032opbinput.haserror =
FALSE;
4033opbinput.nproblemcoeffs = 0;
4034opbinput.wbo =
FALSE;
4036opbinput.nindvars = 0;
4037#if GENCONSNAMES == TRUE 4038opbinput.consnumber = 0;
4058 if( opbinput.nproblemcoeffs > 0 )
4060 SCIPwarningMessage(
scip,
"there might be <%d> coefficients or weight out of range!\n", opbinput.nproblemcoeffs);
4064 if( opbinput.haserror )
4115 if( nintvars > 0 || ncontvars + nimplvars > nindicatorconss + nresvars )
4129 for( v = nvars - 1; v >= 0; --v )
4141retcode =
writeOpb(
scip, file, name, transformed, objsense, objscale, objoffset, vars,
4142nvars, conss, nconss, resvars, nresvars, andvars, nandvars, existandconshdlr, existands, result);
4153 for( v = nvars - 1; v >= 0; --v )
4154 if( !existands || !
SCIPsortedvecFindPtr((
void**)resvars, SCIPvarComp, vars[v], nresvars, &pos) )
4180 for( v = nfixedvars - 1; v >= 0; --v )
4181 if( !existands || !
SCIPsortedvecFindPtr((
void**)resvars, SCIPvarComp, vars[v], nresvars, &pos) )
4209 for( v = nvars - 1; v >= 0; --v )
4220retcode =
writeOpb(
scip, file, name, transformed, objsense, objscale, objoffset, vars,
4221nvars, conss, nconss, resvars, nresvars, andvars, nandvars, existandconshdlr, existands, result);
4231assert(resvars !=
NULL);
4232assert(andvars !=
NULL);
4233assert(nandvars !=
NULL);
4235 for( v = nresvars - 1; v >= 0; --v )
4237assert(andvars[v] !=
NULL);
4261assert(reader !=
NULL);
4288nvars, nbinvars, nintvars, nimplvars, ncontvars, fixedvars, nfixedvars, conss, nconss, genericnames, result) );
4314 "reading/" READER_NAME "/dynamicconss",
"should model constraints be subject to aging?",
4317 "reading/" READER_NAME "/multisymbol",
"use '*' between coefficients and variables by writing to problem?",
Constraint handler for AND constraints, .
constraint handler for indicator constraints
Constraint handler for knapsack constraints of the form , x binary and .
Constraint handler for linear constraints in their most general form, .
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
constraint handler for pseudoboolean constraints
#define ARTIFICIALVARNAMEPREFIX
Constraint handler for the set partitioning / packing / covering constraints .
Constraint handler for variable bound constraints .
#define SCIPdebugGetSolVal(scip, var, val)
#define SCIPdebugAddSolVal(scip, var, val)
#define SCIP_CALL_ABORT(x)
#define SCIP_LONGINT_FORMAT
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfeof(SCIP_FILE *stream)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsAnd(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetResultantAnd(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetIndVarPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetBinaryVarIndicator(SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetSlackVarIndicator(SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_CONS * SCIPgetLinearConsIndicator(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_CONS * SCIPgetLinearConsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
SCIP_RETCODE SCIPcreateConsPseudoboolean(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR **linvars, int nlinvars, SCIP_Real *linvals, SCIP_VAR ***terms, int nterms, int *ntermvars, SCIP_Real *termvals, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, SCIP_VAR *intvar, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
@ SCIP_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
SCIP_RETCODE SCIPwriteOpb(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_VAR **fixedvars, int nfixedvars, SCIP_CONS **conss, int nconss, SCIP_Bool genericnames, SCIP_RESULT *result)
SCIP_RETCODE SCIPreadOpb(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
SCIP_RETCODE SCIPincludeReaderOpb(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
int SCIPgetNOrigConss(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
SCIP_CONS ** SCIPgetOrigConss(SCIP *scip)
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPdebugMsgPrint
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPreallocMemoryArray(scip, ptr, newnum)
#define SCIPallocMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateMemoryArray(scip, ptr, source, num)
#define SCIPfreeMemoryArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
SCIP_RETCODE SCIPaddVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real addobj)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
void SCIPsortPtrPtrInt(void **ptrarray1, void **ptrarray2, int *intarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
int SCIPstrcasecmp(const char *s1, const char *s2)
int SCIPsnprintf(char *t, int len, const char *s,...)
void SCIPprintSysError(const char *message)
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
static const SCIP_Real scalars[]
memory allocation routines
SCIP_Real SCIPconsGetLhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_Real SCIPconsGetRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for managing constraints
wrapper functions to map file i/o to standard or zlib file i/o
struct SCIP_File SCIP_FILE
public methods for message output
#define SCIPdebugPrintCons(x, y, z)
public data structures and miscellaneous methods
methods for sorting joint arrays of various types
public methods for input file readers
public methods for problem variables
static const char delimchars[]
static SCIP_RETCODE writeOpbRelevantAnds(SCIP *const scip, FILE *const file, SCIP_VAR **const resvars, int const nresvars, SCIP_VAR **const *const andvars, int const *const nandvars, SCIP_HASHTABLE *const printedfixing, char const *const multisymbol, SCIP_Bool const transformed)
static SCIP_RETCODE printNonLinearCons(SCIP *const scip, FILE *const file, SCIP_VAR **const vars, SCIP_Real *const vals, int const nvars, SCIP_Real const lhs, SCIP_Real const rhs, SCIP_VAR **const resvars, int const nresvars, SCIP_VAR **const *const andvars, int const *const nandvars, SCIP_Longint weight, SCIP_Bool const transformed, char const *const multisymbol)
static SCIP_RETCODE setObjective(SCIP *const scip, OPBINPUT *const opbinput, const char *sense, SCIP_Real const scale, SCIP_VAR **const linvars, SCIP_Real *const coefs, int const ncoefs, SCIP_VAR ***const terms, SCIP_Real *const termcoefs, int *const ntermvars, int const ntermcoefs)
static SCIP_RETCODE printRow(SCIP *scip, FILE *file, const char *type, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real lhs, SCIP_Longint weight, SCIP_Longint *mult, const char *multisymbol)
static void clearBuffer(char *linebuffer, int *linecnt)
static SCIP_Bool isSign(OPBINPUT *opbinput, int *sign)
static SCIP_DECL_READERREAD(readerReadOpb)
static SCIP_RETCODE getBinVarsRepresentatives(SCIP *const scip, SCIP_VAR **const vars, int const nvars, SCIP_Bool const transformed)
static SCIP_Bool getNextToken(SCIP *scip, OPBINPUT *opbinput)
static SCIP_Bool isValueChar(char c, char nextc, SCIP_Bool firstchar, SCIP_Bool *hasdot, OPBEXPTYPE *exptype)
static SCIP_RETCODE getVariableOrTerm(SCIP *scip, OPBINPUT *opbinput, SCIP_VAR ***vars, int *nvars, int *varssize)
static SCIP_RETCODE writeOpbFixedVars(SCIP *const scip, FILE *const file, SCIP_VAR **vars, int nvars, SCIP_HASHTABLE *const printedfixing, char const *const multisymbol, SCIP_Bool const transformed)
static void swapTokenBuffer(OPBINPUT *opbinput)
static SCIP_RETCODE printLinearCons(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real lhs, SCIP_Real rhs, SCIP_Longint weight, SCIP_Bool transformed, const char *multisymbol)
static const char commentchars[]
static SCIP_DECL_READERWRITE(readerWriteOpb)
static SCIP_RETCODE writeOpbObjective(SCIP *const scip, FILE *const file, SCIP_VAR **const vars, int const nvars, SCIP_VAR **const resvars, int const nresvars, SCIP_VAR **const *const andvars, int const *const nandvars, SCIP_OBJSENSE const objsense, SCIP_Real const objscale, SCIP_Real const objoffset, char const *const multisymbol, SCIP_Bool const existands, SCIP_Bool const transformed)
static SCIP_RETCODE printNLRow(SCIP *const scip, FILE *const file, char const *const type, SCIP_VAR **const vars, SCIP_Real const *const vals, int const nvars, SCIP_Real lhs, SCIP_VAR **const resvars, int const nresvars, SCIP_VAR **const *const andvars, int const *const nandvars, SCIP_Longint weight, SCIP_Longint *const mult, char const *const multisymbol)
static void writeBuffer(SCIP *scip, FILE *file, char *linebuffer, int *linecnt)
static void pushToken(OPBINPUT *opbinput)
static SCIP_RETCODE computeAndConstraintInfos(SCIP *const scip, SCIP_Bool const transformed, SCIP_VAR ***resvars, int *nresvars, SCIP_VAR ****andvars, int **nandvars, SCIP_Bool *const existandconshdlr, SCIP_Bool *const existands)
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
static SCIP_RETCODE writeOpbConstraints(SCIP *const scip, FILE *const file, SCIP_CONS **const conss, int const nconss, SCIP_VAR **const vars, int const nvars, SCIP_VAR **const resvars, int const nresvars, SCIP_VAR **const *const andvars, int const *const nandvars, char const *const multisymbol, SCIP_Bool const existandconshdlr, SCIP_Bool const existands, SCIP_Bool const transformed)
static void determineTotalNumberLinearConss(SCIP *const scip, SCIP_CONS **const conss, int const nconss, int *nlinearconss, int *nindicatorconss)
static SCIP_Bool isStartingSoftConstraintWeight(SCIP *scip, OPBINPUT *opbinput)
#define OPB_MAX_PUSHEDTOKENS
static void appendBuffer(SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *extension)
static SCIP_Bool getNextLine(SCIP *scip, OPBINPUT *opbinput)
static SCIP_Bool isEndLine(OPBINPUT *opbinput)
#define OPB_INIT_COEFSSIZE
static SCIP_RETCODE writeOpb(SCIP *scip, FILE *file, const char *name, SCIP_Bool transformed, SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, SCIP_VAR **vars, int nvars, SCIP_CONS **conss, int nconss, SCIP_VAR **const resvars, int const nresvars, SCIP_VAR **const *const andvars, int const *const nandvars, SCIP_Bool const existandconshdlr, SCIP_Bool const existands, SCIP_RESULT *result)
static SCIP_RETCODE getMaxAndConsDim(SCIP *scip, OPBINPUT *opbinput, SCIP_Real *objscale, SCIP_Real *objoffset)
static SCIP_RETCODE createVariable(SCIP *scip, SCIP_VAR **var, char *name)
static void syntaxError(SCIP *scip, OPBINPUT *opbinput, const char *msg)
static SCIP_RETCODE readOPBFile(SCIP *scip, OPBINPUT *opbinput, const char *filename)
static SCIP_DECL_READERCOPY(readerCopyOpb)
static SCIP_RETCODE readConstraints(SCIP *scip, OPBINPUT *opbinput, SCIP_Real objscale, int *nNonlinearConss)
static SCIP_Bool isValue(SCIP *scip, OPBINPUT *opbinput, SCIP_Real *value)
static SCIP_Bool isDelimChar(char c)
static void swapPointers(char **pointer1, char **pointer2)
static SCIP_Bool hasError(OPBINPUT *opbinput)
static void pushBufferToken(OPBINPUT *opbinput)
static SCIP_Bool isSense(OPBINPUT *opbinput, OPBSENSE *sense)
enum OpbExpType OPBEXPTYPE
static SCIP_RETCODE readCoefficients(SCIP *const scip, OPBINPUT *const opbinput, char *const name, SCIP_VAR ***linvars, SCIP_Real **lincoefs, int *const nlincoefs, int *lincoefssize, SCIP_VAR ****terms, SCIP_Real **termcoefs, int **ntermvars, int *termcoefssize, int *const ntermcoefs, SCIP_Bool *const newsection, SCIP_Bool *const isNonlinear, SCIP_Bool *const issoftcons, SCIP_Real *const weight)
#define INDICATORSLACKVARNAME
static SCIP_Bool isEndingSoftConstraintWeight(SCIP *scip, OPBINPUT *opbinput)
static SCIP_Bool isTokenChar(char c)
pseudo-Boolean file reader (opb format)
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for reader plugins
public methods for querying solving statistics
public methods for SCIP variables
enum SCIP_Objsense SCIP_OBJSENSE
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARSTATUS_ORIGINAL
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4