COIN-OR::LEMON - Graph Library

Changeset 7:79d9c9f6c446 in lemon-benchmark for generators/netgen


Ignore:
Timestamp:
03/17/11 18:28:37 (14 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Command line parameter support for netgen

Location:
generators/netgen
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • generators/netgen/CMakeLists.txt

    r6 r7  
    99
    1010ADD_EXECUTABLE(netgen
    11         netgen.c index.c random.c
     11  main.cc netgen.c index.c random.c
    1212)
    1313
    1414SET_TARGET_PROPERTIES(netgen PROPERTIES COMPILE_DEFINITIONS "DIMACS")
     15
     16TARGET_LINK_LIBRARIES(netgen
     17  lemon
     18)
  • generators/netgen/netgen.c

    r6 r7  
    8686#include "netgen.h"
    8787
    88 #define PROBLEM_PARMS 13                /* aliases for generation parameters */
    89 #define NODES       parms[0]            /* number of nodes */
    90 #define SOURCES     parms[1]            /* number of sources (including transshipment) */
    91 #define SINKS       parms[2]            /* number of sinks (including transshipment) */
    92 #define DENSITY     parms[3]            /* number of (requested) arcs */
    93 #define MINCOST     parms[4]            /* minimum cost of arcs */
    94 #define MAXCOST     parms[5]            /* maximum cost of arcs */
    95 #define SUPPLY      parms[6]            /* total supply */
    96 #define TSOURCES    parms[7]            /* transshipment sources */
    97 #define TSINKS      parms[8]            /* transshipment sinks */
    98 #define HICOST      parms[9]            /* percent of skeleton arcs given maximum cost */
    99 #define CAPACITATED parms[10]           /* percent of arcs to be capacitated */
    100 #define MINCAP      parms[11]           /* minimum capacity for capacitated arcs */
    101 #define MAXCAP      parms[12]           /* maximum capacity for capacitated arcs */
    102 
     88#include "main.h"
    10389
    10490/*** Private interfaces */
     
    486472                }
    487473
    488 int main()
    489 {
    490   long seed;
    491   long problem;
    492   long parms[PROBLEM_PARMS];
     474int orig_main(long seed,long problem,long *parms)
     475{
    493476  long arcs;
    494477  int i;
    495478
    496479/*** Read problem parameters and generate networks */
    497 
    498   while (1) {
    499     READ(seed);
    500     if (seed <= 0) exit(0);
    501     READ(problem);
    502     if (problem <= 0) exit(0);
    503     for (i = 0; i < PROBLEM_PARMS; i++)
    504       READ(parms[i]);
     480  {
    505481    printf("c NETGEN flow network generator (C version)\n");
    506482    printf("c  Problem %2ld input parameters\n", problem);
Note: See TracChangeset for help on using the changeset viewer.