44 #define READER_NAME "ccgreader" 45 #define READER_DESC "file writer for column connectivity graph file format" 46 #define READER_EXTENSION "ccg" 90 for( i = 0; i < nNodes; ++i )
93 G->size[i] = initSize;
114 for( i = 0; i < G->n; ++i )
135 if( G->deg[node] + 2 > G->size[node] )
137 unsigned int newSize;
138 newSize = G->size[node] * 2;
141 G->size[node] = newSize;
162 assert( scip !=
NULL );
163 assert( vars !=
NULL );
164 assert( scalars !=
NULL );
165 assert( nvars !=
NULL );
166 assert( constant !=
NULL );
172 if( requiredsize > *nvars )
178 assert( requiredsize <= *nvars );
183 for( v = 0; v < *nvars; ++v )
206 assert( scip !=
NULL );
211 for( i = 0; i < nvars; ++i )
215 for( i = 0; i < nvars; ++i )
221 for( j = i+1; j < nvars; ++j )
241 assert( k <= G->size[s] );
250 assert( G->A[s][k] == -1 );
261 assert( G->A[t][k] == -1 );
296 assert( scip !=
NULL );
308 for( v = 0; v < nactivevars; ++v )
335 assert(reader !=
NULL);
369 assert(reader !=
NULL);
397 const char* conshdlrname;
406 assert( scip !=
NULL );
407 assert( nvars >= 0 );
413 for( c = 0; c < nconss; ++c)
416 assert( cons !=
NULL);
422 assert( conshdlr !=
NULL );
427 if( strcmp(conshdlrname,
"linear") == 0 )
431 assert( consvars !=
NULL || nconsvars == 0 );
439 else if( strcmp(conshdlrname,
"setppc") == 0 )
443 assert( consvars !=
NULL || nconsvars == 0 );
450 else if( strcmp(conshdlrname,
"logicor") == 0 )
454 assert( consvars !=
NULL || nconsvars == 0 );
461 else if( strcmp(conshdlrname,
"knapsack") == 0 )
467 assert( consvars !=
NULL || nconsvars == 0 );
472 for( v = 0; v < nconsvars; ++v )
481 else if( strcmp(conshdlrname,
"varbound") == 0 )
499 SCIPwarningMessage(scip,
"constraint handler <%s> cannot print requested format\n", conshdlrname );
510 for( i = 0; i < nvars; ++i )
527 assert( k <= G.size[i] );
529 assert( k == G.deg[i] );
enum SCIP_Result SCIP_RESULT
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
Constraint handler for variable bound constraints .
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
const char * SCIPreaderGetName(SCIP_READER *reader)
enum SCIP_Retcode SCIP_RETCODE
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE ensureEdgeCapacity(SCIP *scip, SparseGraph *G, unsigned int node)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPfreeBufferArray(scip, ptr)
Constraint handler for the set partitioning / packing / covering constraints .
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPincludeReaderCcg(SCIP *scip)
static SCIP_DECL_READERCOPY(readerCopyCcg)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Constraint handler for knapsack constraints of the form , x binary and .
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
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)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
Column connectivity graph file reader (actually, only a writer)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPwriteCcg(SCIP *scip, FILE *file, const char *name, SCIP_Bool transformed, SCIP_VAR **vars, int nvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
static SCIP_RETCODE createEdgesFromRow(SCIP *scip, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SparseGraph *G)
static void freeGraph(SCIP *scip, SparseGraph *G)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
struct sparseGraph SparseGraph
static const SCIP_Real scalars[]
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE initGraph(SCIP *scip, SparseGraph *G, unsigned int nNodes, unsigned int initSize)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE handleLinearCons(SCIP *scip, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool transformed, SparseGraph *G)
static SCIP_DECL_READERWRITE(readerWriteCcg)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
#define SCIPreallocBufferArray(scip, ptr, num)