SCIP

    Solving Constraint Integer Programs

    reader_ccg.c
    Go to the documentation of this file.
    1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    2/* */
    3/* This file is part of the program and library */
    4/* SCIP --- Solving Constraint Integer Programs */
    5/* */
    6/* Copyright (c) 2002-2026 Zuse Institute Berlin (ZIB) */
    7/* */
    8/* Licensed under the Apache License, Version 2.0 (the "License"); */
    9/* you may not use this file except in compliance with the License. */
    10/* You may obtain a copy of the License at */
    11/* */
    12/* http://www.apache.org/licenses/LICENSE-2.0 */
    13/* */
    14/* Unless required by applicable law or agreed to in writing, software */
    15/* distributed under the License is distributed on an "AS IS" BASIS, */
    16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
    17/* See the License for the specific language governing permissions and */
    18/* limitations under the License. */
    19/* */
    20/* You should have received a copy of the Apache-2.0 license */
    21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
    22/* */
    23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    24
    25/**@file reader_ccg.c
    26 * @ingroup DEFPLUGINS_READER
    27 * @brief Graph file reader (actually, only a writer)
    28 * @author Marc Pfetsch
    29 *
    30 * Write a weighted column/variable graph, i.e., the nodes correspond to the columns (variables) of
    31 * the constraint matrix. Two nodes are adjacent if the corresponding columns/variables appear
    32 * in a common row/constraint (with nonzero coefficient). The weight is obtained by summing for
    33 * each row that produces an edge the absolute values of coefficients in the row; hence, we avoid
    34 * parallel edges.
    35 *
    36 * This graph gives an indication of the connectivity structure of the constraint matrix.
    37 *
    38 * The graph is output in DIMACS graph format.
    39 */
    40
    41/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    42
    44#include "scip/cons_knapsack.h"
    45#include "scip/cons_linear.h"
    46#include "scip/cons_logicor.h"
    47#include "scip/cons_setppc.h"
    48#include "scip/cons_varbound.h"
    49#include "scip/pub_cons.h"
    50#include "scip/pub_message.h"
    51#include "scip/pub_reader.h"
    52#include "scip/pub_var.h"
    53#include "scip/reader_ccg.h"
    54#include "scip/scip_cons.h"
    55#include "scip/scip_mem.h"
    56#include "scip/scip_message.h"
    57#include "scip/scip_reader.h"
    58#include "scip/scip_var.h"
    59
    60
    61#define READER_NAME "ccgreader"
    62#define READER_DESC "file writer for column connectivity graph file format"
    63#define READER_EXTENSION "ccg"
    64
    65/*
    66 * Data structures
    67 */
    68
    69
    70/* graph data structure */
    71struct sparseGraph
    72{
    73 unsigned int n; /**< number of nodes */
    74 unsigned int m; /**< number of edges */
    75 int** A; /**< adjacency list (= adjacent nodes) for each node (-1 for end of list) */
    76 SCIP_Real** W; /**< weights for each edge */
    77 unsigned int* deg; /**< degree each node */
    78 unsigned int* size; /**< size of A/w for each node */
    79};
    80
    81typedef struct sparseGraph SparseGraph;
    82
    83
    84/*
    85 * Local methods (for writing)
    86 */
    87
    88/** initialize graph */
    89static
    91 SCIP* scip, /**< SCIP data structure */
    92 SparseGraph* G, /**< graph to free */
    93 unsigned int nNodes, /**< number of nodes */
    94 unsigned int initSize /**< initial size of lists */
    95 )
    96{
    97 unsigned int i;
    98
    99 G->n = nNodes;
    100 G->m = 0;
    101
    102 SCIP_CALL( SCIPallocBufferArray(scip, &G->deg, (int) nNodes) );
    103 SCIP_CALL( SCIPallocBufferArray(scip, &G->size, (int) nNodes) );
    104 SCIP_CALL( SCIPallocBufferArray(scip, &G->A, (int) nNodes) );
    105 SCIP_CALL( SCIPallocBufferArray(scip, &G->W, (int) nNodes) );
    106
    107 for( i = 0; i < nNodes; ++i )
    108 {
    109 G->deg[i] = 0;
    110 G->size[i] = initSize;
    111
    112 SCIP_CALL( SCIPallocBufferArray(scip, &(G->A[i]), (int) initSize) ); /*lint !e866 */
    113 SCIP_CALL( SCIPallocBufferArray(scip, &(G->W[i]), (int) initSize) ); /*lint !e866 */
    114
    115 G->A[i][0] = -1;
    116 }
    117
    118 return SCIP_OKAY;
    119}
    120
    121
    122/** frees graph */
    123static
    125 SCIP* scip, /**< SCIP data structure */
    126 SparseGraph* G /**< graph to free */
    127 )
    128{
    129 unsigned int i;
    130
    131 for( i = 0; i < G->n; ++i )
    132 {
    133 SCIPfreeBufferArray(scip, &G->A[i]);
    134 SCIPfreeBufferArray(scip, &G->W[i]);
    135 }
    136
    139 SCIPfreeBufferArray(scip, &G->size);
    140 SCIPfreeBufferArray(scip, &G->deg);
    141}
    142
    143
    144/** check whether there is enough capacity for one additional edge in the given adjacency list */
    145static
    147 SCIP* scip, /**< SCIP data structure */
    148 SparseGraph* G, /**< graph */
    149 unsigned int node /**< list for node */
    150 )
    151{
    152 if( G->deg[node] + 2 > G->size[node] )
    153 {
    154 unsigned int newSize;
    155 newSize = G->size[node] * 2;
    156 SCIP_CALL( SCIPreallocBufferArray(scip, &(G->A[node]), (int) newSize) ); /*lint !e866 */
    157 SCIP_CALL( SCIPreallocBufferArray(scip, &(G->W[node]), (int) newSize) ); /*lint !e866 */
    158 G->size[node] = newSize;
    159 }
    160
    161 return SCIP_OKAY;
    162}
    163
    164
    165/** transforms given variables, scalars, and constant to the corresponding active variables, scalars, and constant */
    166static
    168 SCIP* scip, /**< SCIP data structure */
    169 SCIP_VAR** vars, /**< vars array to get active variables for */
    170 SCIP_Real* scalars, /**< scalars a_1, ..., a_n inrc/scip/reader_graph.c linear sum a_1*x_1 + ... + a_n*x_n + c */
    171 int* nvars, /**< pointer to number of variables and values in vars and vals array */
    172 SCIP_Real* constant, /**< pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c */
    173 SCIP_Bool transformed /**< transformed constraint? */
    174 )
    175{
    176 int requiredsize;
    177 int v;
    178
    179 assert( scip != NULL );
    180 assert( vars != NULL );
    181 assert( scalars != NULL );
    182 assert( nvars != NULL );
    183 assert( constant != NULL );
    184
    185 if( transformed )
    186 {
    187 SCIP_CALL( SCIPgetProbvarLinearSum(scip, vars, scalars, nvars, *nvars, constant, &requiredsize) );
    188
    189 if( requiredsize > *nvars )
    190 {
    191 SCIP_CALL( SCIPreallocBufferArray(scip, &vars, requiredsize) );
    192 SCIP_CALL( SCIPreallocBufferArray(scip, &scalars, requiredsize) );
    193
    194 SCIP_CALL( SCIPgetProbvarLinearSum(scip, vars, scalars, nvars, requiredsize, constant, &requiredsize) );
    195 }
    196 assert( requiredsize == *nvars );
    197 }
    198 else
    199 {
    200 for( v = 0; v < *nvars; ++v )
    201 SCIP_CALL( SCIPvarGetOrigvarSum(&vars[v], &scalars[v], constant) );
    202 }
    203 return SCIP_OKAY;
    204}
    205
    206
    207/* Generate edges from given row
    208 *
    209 * We avoid parallel edges. Each row generates a clique in the graph.
    210 */
    211static
    213 SCIP* scip, /**< SCIP data structure */
    214 SCIP_VAR** vars, /**< array of constraint variables */
    215 SCIP_Real* vals, /**< array of constraint values */
    216 int nvars, /**< number of constraint variables */
    217 SparseGraph* G /**< graph */
    218 )
    219{
    220 int i, j;
    221 SCIP_Real w;
    222
    223 assert( scip != NULL );
    224 assert( nvars > 0 );
    225
    226 /* compute weight */
    227 w = 0;
    228 for( i = 0; i < nvars; ++i )
    229 w += ABS(vals[i]);
    230
    231 /* generate edges */
    232 for( i = 0; i < nvars; ++i )
    233 {
    234 int s;
    235 s = SCIPvarGetProbindex(vars[i]);
    236 assert( s >= 0 );
    237
    238 for( j = i+1; j < nvars; ++j )
    239 {
    240 unsigned int k;
    241 int t;
    242 int a;
    243 t = SCIPvarGetProbindex(vars[j]);
    244 assert( t >= 0 );
    245
    246 /* search whether edge is already present */
    247 k = 0;
    248 a = G->A[s][k];
    249 while( a >= 0 )
    250 {
    251 /* if we found edge, add weight */
    252 if( a == t )
    253 {
    254 G->W[s][k] += w;
    255 break;
    256 }
    257 a = G->A[s][++k];
    258 assert( k <= G->size[s] );
    259 }
    260
    261 /* add new edge */
    262 if( a < 0 )
    263 {
    264 /* forward edge */
    265 SCIP_CALL( ensureEdgeCapacity(scip, G, (unsigned int) s) );
    266 k = G->deg[s];
    267 assert( G->A[s][k] == -1 );
    268
    269 G->A[s][k] = t;
    270 G->W[s][k] = w;
    271
    272 G->A[s][k+1] = -1; /*lint !e679*/
    273 ++G->deg[s];
    274
    275 /* backward edge */
    276 SCIP_CALL( ensureEdgeCapacity(scip, G, (unsigned int) t) );
    277 k = G->deg[t];
    278 assert( G->A[t][k] == -1 );
    279
    280 G->A[t][k] = s;
    281 G->W[t][k] = w;
    282
    283 G->A[t][k+1] = -1; /*lint !e679*/
    284 ++G->deg[t];
    285
    286 /* increase number of edges */
    287 ++G->m;
    288 }
    289 }
    290 }
    291
    292 return SCIP_OKAY;
    293}
    294
    295
    296/** handle given linear constraint information */
    297static
    299 SCIP* scip, /**< SCIP data structure */
    300 SCIP_VAR** vars, /**< array of variables */
    301 SCIP_Real* vals, /**< array of coefficients values (or NULL if all coefficient values are 1) */
    302 int nvars, /**< number of variables */
    303 SCIP_Bool transformed, /**< transformed constraint? */
    304 SparseGraph* G /**< graph */
    305 )
    306{
    307 int v;
    308 SCIP_VAR** activevars;
    309 SCIP_Real* activevals;
    310 int nactivevars;
    311 SCIP_Real activeconstant = 0.0;
    312
    313 assert( scip != NULL );
    314 assert( nvars > 0 );
    315
    316 /* duplicate variable and value array */
    317 nactivevars = nvars;
    318 SCIP_CALL( SCIPduplicateBufferArray(scip, &activevars, vars, nactivevars ) );
    319 if( vals != NULL )
    320 SCIP_CALL( SCIPduplicateBufferArray(scip, &activevals, vals, nactivevars ) );
    321 else
    322 {
    323 SCIP_CALL( SCIPallocBufferArray(scip, &activevals, nactivevars) );
    324
    325 for( v = 0; v < nactivevars; ++v )
    326 activevals[v] = 1.0;
    327 }
    328
    329 /* retransform given variables to active variables */
    330 SCIP_CALL( getActiveVariables(scip, activevars, activevals, &nactivevars, &activeconstant, transformed) );
    331
    332 /* print constraint */
    333 SCIP_CALL( createEdgesFromRow(scip, activevars, activevals, nactivevars, G) );
    334
    335 /* free buffer arrays */
    336 SCIPfreeBufferArray(scip, &activevars);
    337 SCIPfreeBufferArray(scip, &activevals);
    338
    339 return SCIP_OKAY;
    340}
    341
    342
    343/*
    344 * Callback methods of reader
    345 */
    346
    347/** copy method for reader plugins (called when SCIP copies plugins) */
    348static
    350{ /*lint --e{715}*/
    351 assert(scip != NULL);
    352 assert(reader != NULL);
    353
    355
    356 /* call inclusion method of reader */
    358
    359 return SCIP_OKAY;
    360}
    361
    362
    363/** problem writing method of reader */
    364static
    366{ /*lint --e{715}*/
    367
    368 SCIP_CALL( SCIPwriteCcg(scip, file, name, transformed, vars, nvars, conss, nconss, result) );
    369
    370 return SCIP_OKAY;
    371}
    372
    373/*
    374 * reader specific interface methods
    375 */
    376
    377/** includes the ccg file reader in SCIP */
    379 SCIP* scip /**< SCIP data structure */
    380 )
    381{
    382 SCIP_READER* reader;
    383
    384 /* include reader */
    386
    387 assert(reader != NULL);
    388
    389 /* set non-fundamental callbacks via setter functions */
    390 SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyCcg) );
    391 SCIP_CALL( SCIPsetReaderWrite(scip, reader, readerWriteCcg) );
    392
    393 return SCIP_OKAY;
    394}
    395
    396
    397/** writes problem to file */
    399 SCIP* scip, /**< SCIP data structure */
    400 FILE* file, /**< output file, or NULL if standard output should be used */
    401 const char* name, /**< problem name */
    402 SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
    403 SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
    404 int nvars, /**< number of active variables in the problem */
    405 SCIP_CONS** conss, /**< array with constraints of the problem */
    406 int nconss, /**< number of constraints in the problem */
    407 SCIP_RESULT* result /**< pointer to store the result of the file writing call */
    408 )
    409{ /*lint --e{715}*/
    410 int c;
    411 int v;
    412 int i;
    413
    414 SCIP_CONSHDLR* conshdlr;
    415 const char* conshdlrname;
    416 SCIP_CONS* cons;
    417
    418 SCIP_VAR** consvars;
    419 SCIP_Real* consvals;
    420 int nconsvars;
    421
    422 SparseGraph G;
    423
    424 assert( scip != NULL );
    425 assert( vars != NULL );
    426 assert( nvars >= 0 );
    427
    428 /* initialize graph */
    429 SCIP_CALL( initGraph(scip, &G, (unsigned int) nvars, 10) );
    430
    431 /* check all constraints */
    432 for( c = 0; c < nconss; ++c)
    433 {
    434 cons = conss[c];
    435 assert( cons != NULL);
    436
    437 /* in case the transformed is written only constraint are posted which are enabled in the current node */
    438 assert(!transformed || SCIPconsIsEnabled(cons));
    439
    440 conshdlr = SCIPconsGetHdlr(cons);
    441 assert( conshdlr != NULL );
    442
    443 conshdlrname = SCIPconshdlrGetName(conshdlr);
    444 assert( transformed == SCIPconsIsTransformed(cons) );
    445
    446 if( strcmp(conshdlrname, "linear") == 0 )
    447 {
    448 consvars = SCIPgetVarsLinear(scip, cons);
    449 nconsvars = SCIPgetNVarsLinear(scip, cons);
    450 assert( consvars != NULL || nconsvars == 0 );
    451
    452 if( nconsvars > 0 )
    453 {
    455 SCIPgetNVarsLinear(scip, cons), transformed, &G) );
    456 }
    457 }
    458 else if( strcmp(conshdlrname, "setppc") == 0 )
    459 {
    460 consvars = SCIPgetVarsSetppc(scip, cons);
    461 nconsvars = SCIPgetNVarsSetppc(scip, cons);
    462 assert( consvars != NULL || nconsvars == 0 );
    463
    464 if( nconsvars > 0 )
    465 {
    466 SCIP_CALL( handleLinearCons(scip, consvars, NULL, nconsvars, transformed, &G) );
    467 }
    468 }
    469 else if( strcmp(conshdlrname, "logicor") == 0 )
    470 {
    471 consvars = SCIPgetVarsLogicor(scip, cons);
    472 nconsvars = SCIPgetNVarsLogicor(scip, cons);
    473 assert( consvars != NULL || nconsvars == 0 );
    474
    475 if( nconsvars > 0 )
    476 {
    478 }
    479 }
    480 else if( strcmp(conshdlrname, "knapsack") == 0 )
    481 {
    483
    484 consvars = SCIPgetVarsKnapsack(scip, cons);
    485 nconsvars = SCIPgetNVarsKnapsack(scip, cons);
    486 assert( consvars != NULL || nconsvars == 0 );
    487
    488 /* copy Longint array to SCIP_Real array */
    490 SCIP_CALL( SCIPallocBufferArray(scip, &consvals, nconsvars) );
    491 for( v = 0; v < nconsvars; ++v )
    492 consvals[v] = (SCIP_Real)w[v];
    493
    494 if( nconsvars > 0 )
    495 {
    496 SCIP_CALL( handleLinearCons(scip, consvars, consvals, nconsvars, transformed, &G) );
    497 }
    498 SCIPfreeBufferArray(scip, &consvals);
    499 }
    500 else if( strcmp(conshdlrname, "varbound") == 0 )
    501 {
    502 SCIP_CALL( SCIPallocBufferArray(scip, &consvars, 2) );
    503 SCIP_CALL( SCIPallocBufferArray(scip, &consvals, 2) );
    504
    505 consvars[0] = SCIPgetVarVarbound(scip, cons);
    506 consvars[1] = SCIPgetVbdvarVarbound(scip, cons);
    507
    508 consvals[0] = 1.0;
    509 consvals[1] = SCIPgetVbdcoefVarbound(scip, cons);
    510
    511 SCIP_CALL( handleLinearCons(scip, consvars, consvals, 2, transformed, &G) );
    512
    513 SCIPfreeBufferArray(scip, &consvars);
    514 SCIPfreeBufferArray(scip, &consvals);
    515 }
    516 else
    517 {
    518 SCIPwarningMessage(scip, "constraint handler <%s> cannot print requested format\n", conshdlrname );
    519 SCIPinfoMessage(scip, file, "\\ ");
    520 SCIP_CALL( SCIPprintCons(scip, cons, file) );
    521 SCIPinfoMessage(scip, file, ";\n");
    522 }
    523 }
    524
    525 /* output graph */
    526 SCIPinfoMessage(scip, file, "c graph generated from %s\n", name);
    527 SCIPinfoMessage(scip, file, "p edge %d %u\n", nvars, G.m);
    528
    529 for( i = 0; i < nvars; ++i )
    530 {
    531 unsigned int k;
    532 int a;
    533
    534 k = 0;
    535 a = G.A[i][k];
    536 while( a >= 0 )
    537 {
    538 /* only output edges from lower to higher number */
    539 if( i < a )
    540 {
    541 /* note: node numbers start with 1 in the DIMACS format */
    542 SCIPinfoMessage(scip, file, "e %d %d %f\n", i+1, a+1, G.W[i][k]);
    543 }
    544
    545 a = G.A[i][++k];
    546 assert( k <= G.size[i] );
    547 }
    548 assert( k == G.deg[i] );
    549 }
    550
    551 freeGraph(scip, &G);
    552
    553 *result = SCIP_SUCCESS;
    554
    555 return SCIP_OKAY;
    556}
    SCIP_VAR * w
    Definition: circlepacking.c:67
    SCIP_VAR * a
    Definition: circlepacking.c:66
    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 .
    #define NULL
    Definition: def.h:257
    #define SCIP_Longint
    Definition: def.h:150
    #define SCIP_Bool
    Definition: def.h:100
    #define SCIP_STRINGEQ(name, reference, retcode)
    Definition: def.h:454
    #define SCIP_Real
    Definition: def.h:165
    #define ABS(x)
    Definition: def.h:225
    #define SCIP_CALL(x)
    Definition: def.h:364
    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)
    Definition: cons_setppc.c:9683
    SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
    Definition: cons_setppc.c:9701
    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 SCIPwriteCcg(SCIP *scip, FILE *file, const char *name, SCIP_Bool transformed, SCIP_VAR **vars, int nvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
    Definition: reader_ccg.c:398
    SCIP_RETCODE SCIPincludeReaderCcg(SCIP *scip)
    Definition: reader_ccg.c:378
    void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
    Definition: scip_message.c:208
    void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
    Definition: scip_message.c:120
    const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
    Definition: cons.c:4320
    SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
    Definition: cons.c:8413
    SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
    Definition: scip_cons.c:2536
    SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
    Definition: cons.c:8702
    SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
    Definition: cons.c:8490
    #define SCIPallocBufferArray(scip, ptr, num)
    Definition: scip_mem.h:124
    #define SCIPreallocBufferArray(scip, ptr, num)
    Definition: scip_mem.h:128
    #define SCIPfreeBufferArray(scip, ptr)
    Definition: scip_mem.h:136
    #define SCIPduplicateBufferArray(scip, ptr, source, num)
    Definition: scip_mem.h:132
    SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
    Definition: scip_reader.c:109
    SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
    Definition: scip_reader.c:147
    const char * SCIPreaderGetName(SCIP_READER *reader)
    Definition: reader.c:700
    SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
    Definition: scip_reader.c:219
    SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
    Definition: var.c:18365
    int SCIPvarGetProbindex(SCIP_VAR *var)
    Definition: var.c:23694
    SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize)
    Definition: scip_var.c:2378
    static const SCIP_Real scalars[]
    Definition: lp.c:5959
    memory allocation routines
    public methods for managing constraints
    public methods for message output
    public methods for input file readers
    public methods for problem variables
    static SCIP_RETCODE createEdgesFromRow(SCIP *scip, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SparseGraph *G)
    Definition: reader_ccg.c:212
    static SCIP_DECL_READERCOPY(readerCopyCcg)
    Definition: reader_ccg.c:349
    static SCIP_RETCODE initGraph(SCIP *scip, SparseGraph *G, unsigned int nNodes, unsigned int initSize)
    Definition: reader_ccg.c:90
    struct sparseGraph SparseGraph
    Definition: reader_ccg.c:81
    #define READER_DESC
    Definition: reader_ccg.c:62
    static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
    Definition: reader_ccg.c:167
    #define READER_EXTENSION
    Definition: reader_ccg.c:63
    static SCIP_RETCODE ensureEdgeCapacity(SCIP *scip, SparseGraph *G, unsigned int node)
    Definition: reader_ccg.c:146
    static SCIP_DECL_READERWRITE(readerWriteCcg)
    Definition: reader_ccg.c:365
    #define READER_NAME
    Definition: reader_ccg.c:61
    static SCIP_RETCODE handleLinearCons(SCIP *scip, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool transformed, SparseGraph *G)
    Definition: reader_ccg.c:298
    static void freeGraph(SCIP *scip, SparseGraph *G)
    Definition: reader_ccg.c:124
    Column connectivity graph file reader (actually, only a writer)
    public methods for constraint handler plugins and constraints
    public methods for memory management
    public methods for message handling
    public methods for reader plugins
    public methods for SCIP variables
    @ SCIP_SUCCESS
    Definition: type_result.h:58
    enum SCIP_Result SCIP_RESULT
    Definition: type_result.h:61
    @ SCIP_OKAY
    Definition: type_retcode.h:42
    @ SCIP_INVALIDCALL
    Definition: type_retcode.h:51
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63