assert(vars !=
NULL);
94assert(nvars !=
NULL);
95assert(constant !=
NULL);
101 if( requiredsize > *nvars )
107assert(requiredsize <= *nvars);
112 for( v = 0; v < *nvars; ++v )
134assert(vars !=
NULL);
135assert(nvars !=
NULL);
141 if( requiredsize > *nvars )
146assert(requiredsize <= *nvars);
153 for( v = 0; v < *nvars; ++v )
171assert(linebuffer !=
NULL);
172assert(linecnt !=
NULL);
175linebuffer[0] =
'\0';
184 unsigned char* bitcnt,
185 unsigned char* bitbuffer
193assert(bitbuffer !=
NULL);
194assert(*bitcnt > 0 && *bitcnt <= 8);
196(*bitbuffer) <<= (8 - *bitcnt);
198fputc(*bitbuffer, file);
211 unsigned char* bitcnt,
212 unsigned char* bitbuffer
217assert(bitbuffer !=
NULL);
219(*bitbuffer) = ((*bitbuffer)<<1)|(bit&1);
238assert(readerdata->maxrows != 0 && readerdata->maxcols != 0);
240 if( readerdata->maxrows > nconss )
241readerdata->maxrows = nconss;
243 if( readerdata->maxcols > nvars )
244readerdata->maxcols = nvars;
246sizev = (nconss + readerdata->maxrows - 1) / readerdata->maxrows;
247sizeh = (nvars + readerdata->maxcols - 1) / readerdata->maxcols;
250 if( readerdata->maxrows == -1 && readerdata->maxcols == -1 )
254 else if( readerdata->maxrows == -1 && readerdata->maxcols > 0 )
258 else if( readerdata->maxrows > 0 && readerdata->maxcols == -1 )
262 else if( sizev > sizeh )
267readerdata->maxrows = (nconss + res - 1) / res;
268readerdata->maxcols = (nvars + res - 1) / res;
288 const int y= conscnt / submatrixsize;
293assert(readerdata !=
NULL);
295 for( i = 0; i < nvars; ++i )
297assert(vars !=
NULL);
302 x= v / submatrixsize;
303++(scaledimage[
y* readerdata->maxcols +
x]);
331assert(vars !=
NULL);
333assert(conscnt >= 0);
334assert(readerdata !=
NULL);
347 for( v = 0; v < nactivevars; ++v )
355 printRow(
scip, readerdata, activevars, conscnt, nactivevars, submatrixsize, scaledimage);
375 unsigned charbitcnt = 0;
376 unsigned charbitbuffer =
'\0';
379assert(readerdata !=
NULL);
381 for(
y= 0;
y< readerdata->maxrows;
y++ )
383 for(
x= 0;
x< readerdata->maxcols;
x++ )
386 if( scaledimage[
y*readerdata->maxcols+
x] >= 1 )
406assert(reader !=
NULL);
424assert(readerdata !=
NULL);
432#define readerReadPbm NULL 443assert(readerdata !=
NULL);
466readerCopyPbm, readerFreePbm,
readerReadPbm, readerWritePbm, readerdata) );
470 "reading/pbmreader/binary",
"should the output format be binary(P4) (otherwise plain(P1) format)",
473 "reading/pbmreader/maxrows",
"maximum number of rows in the scaled picture (-1 for no limit)",
476 "reading/pbmreader/maxcols",
"maximum number of columns in the scaled picture (-1 for no limit)",
501 const char* conshdlrname;
510assert(readerdata !=
NULL);
511assert(conss !=
NULL);
513readerdata_copy = *readerdata;
515readerdata = &readerdata_copy;
518assert(scaledimage !=
NULL);
522 if( readerdata->binary )
532 for( c = 0; c < nconss; ++c )
535assert(cons !=
NULL);
541assert(conshdlr !=
NULL);
546 if( strcmp(conshdlrname,
"linear") == 0 )
550assert(consvars !=
NULL|| nconsvars == 0);
555nconsvars, c, transformed, submatrixsize, scaledimage) );
558 else if( strcmp(conshdlrname,
"setppc") == 0 )
562assert(consvars !=
NULL|| nconsvars == 0);
567nconsvars, c, transformed, submatrixsize, scaledimage) );
570 else if( strcmp(conshdlrname,
"logicor") == 0 )
574assert(consvars !=
NULL|| nconsvars == 0);
579nconsvars, c, transformed, submatrixsize, scaledimage) );
582 else if( strcmp(conshdlrname,
"knapsack") == 0 )
588assert(consvars !=
NULL|| nconsvars == 0);
593 for( v = 0; v < nconsvars; ++v )
594consvals[v] = weights[v];
599submatrixsize, scaledimage) );
604 else if( strcmp(conshdlrname,
"varbound") == 0 )
616submatrixsize, scaledimage) );
640 printRow(
scip, readerdata, consvars, c, nconsvars, submatrixsize, scaledimage);
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 the set partitioning / packing / covering constraints .
Constraint handler for variable bound constraints .
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(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 ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPwritePbm(SCIP *scip, FILE *file, const char *name, SCIP_READERDATA *readerdata, SCIP_Bool transformed, int nvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
SCIP_RETCODE SCIPincludeReaderPbm(SCIP *scip)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
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)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPincludeReader(SCIP *scip, const char *name, const char *desc, const char *extension, SCIP_DECL_READERCOPY((*readercopy)), SCIP_DECL_READERFREE((*readerfree)), SCIP_DECL_READERREAD((*readerread)), SCIP_DECL_READERWRITE((*readerwrite)), SCIP_READERDATA *readerdata)
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
const char * SCIPreaderGetName(SCIP_READER *reader)
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)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_RETCODE SCIPgetActiveVars(SCIP *scip, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
static const SCIP_Real scalars[]
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
public methods for managing constraints
public methods for message output
public methods for input file readers
public methods for problem variables
static void appendBit(SCIP *scip, FILE *file, unsigned char bit, unsigned char *bitcnt, unsigned char *bitbuffer)
static void drawScaledImage(SCIP *scip, FILE *file, SCIP_READERDATA *readerdata, int *scaledimage)
static void clearLine(char *linebuffer, int *linecnt)
static SCIP_DECL_READERFREE(readerFreePbm)
static SCIP_RETCODE getActiveVariables2(SCIP *scip, SCIP_VAR **vars, int *nvars, SCIP_Bool transformed)
static void printRow(SCIP *scip, SCIP_READERDATA *readerdata, SCIP_VAR **vars, int conscnt, int nvars, int submatrixsize, int *scaledimage)
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
static void flushBits(SCIP *scip, FILE *file, unsigned char *bitcnt, unsigned char *bitbuffer)
#define DEFAULT_PBM_MAXROWS
#define DEFAULT_PBM_BINARY
static SCIP_DECL_READERCOPY(readerCopyPbm)
#define DEFAULT_PBM_MAXCOLS
static SCIP_DECL_READERWRITE(readerWritePbm)
static int getSubmatrixSize(SCIP_READERDATA *readerdata, int nvars, int nconss)
static SCIP_RETCODE printLinearCons(SCIP *scip, SCIP_READERDATA *readerdata, SCIP_VAR **vars, SCIP_Real *vals, int nvars, int conscnt, SCIP_Bool transformed, int submatrixsize, int *scaledimage)
file writer for portable bitmap file format (PBM), open with common graphic viewer programs (e....
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for SCIP parameter handling
public methods for reader plugins
public methods for SCIP variables
struct SCIP_ReaderData SCIP_READERDATA
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
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