COIN-OR::LEMON - Graph Library

Ignore:
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1404 r1346  
    8787IF(LEMON_ENABLE_GLPK)
    8888  FIND_PACKAGE(GLPK 4.33)
    89   IF(GLPK_FOUND)
    90     SET(LEMON_HAVE_LP TRUE)
    91     SET(LEMON_HAVE_MIP TRUE)
    92     SET(LEMON_HAVE_GLPK TRUE)
    93   ENDIF(GLPK_FOUND)
    9489ENDIF(LEMON_ENABLE_GLPK)
    9590IF(LEMON_ENABLE_ILOG)
    9691  FIND_PACKAGE(ILOG)
    97   IF(ILOG_FOUND)
    98     SET(LEMON_HAVE_LP TRUE)
    99     SET(LEMON_HAVE_MIP TRUE)
    100     SET(LEMON_HAVE_CPLEX TRUE)
    101   ENDIF(ILOG_FOUND)
    10292ENDIF(LEMON_ENABLE_ILOG)
    10393IF(LEMON_ENABLE_COIN)
    10494  FIND_PACKAGE(COIN)
    105   IF(COIN_FOUND)
    106     SET(LEMON_HAVE_LP TRUE)
    107     SET(LEMON_HAVE_MIP TRUE)
    108     SET(LEMON_HAVE_CLP TRUE)
    109     SET(LEMON_HAVE_CBC TRUE)
    110   ENDIF(COIN_FOUND)
    11195ENDIF(LEMON_ENABLE_COIN)
    11296IF(LEMON_ENABLE_SOPLEX)
    11397  FIND_PACKAGE(SOPLEX)
    114   IF(SOPLEX_FOUND)
    115     SET(LEMON_HAVE_LP TRUE)
    116     SET(LEMON_HAVE_SOPLEX TRUE)
    117   ENDIF(SOPLEX_FOUND)
    11898ENDIF(LEMON_ENABLE_SOPLEX)
     99
     100IF(GLPK_FOUND)
     101  SET(LEMON_HAVE_LP TRUE)
     102  SET(LEMON_HAVE_MIP TRUE)
     103  SET(LEMON_HAVE_GLPK TRUE)
     104ENDIF(GLPK_FOUND)
     105IF(ILOG_FOUND)
     106  SET(LEMON_HAVE_LP TRUE)
     107  SET(LEMON_HAVE_MIP TRUE)
     108  SET(LEMON_HAVE_CPLEX TRUE)
     109ENDIF(ILOG_FOUND)
     110IF(COIN_FOUND)
     111  SET(LEMON_HAVE_LP TRUE)
     112  SET(LEMON_HAVE_MIP TRUE)
     113  SET(LEMON_HAVE_CLP TRUE)
     114  SET(LEMON_HAVE_CBC TRUE)
     115ENDIF(COIN_FOUND)
     116IF(SOPLEX_FOUND)
     117  SET(LEMON_HAVE_LP TRUE)
     118  SET(LEMON_HAVE_SOPLEX TRUE)
     119ENDIF(SOPLEX_FOUND)
    119120
    120121IF(ILOG_FOUND)
  • cmake/FindCOIN.cmake

    r1398 r1232  
    6666)
    6767
    68 FIND_LIBRARY(COIN_PTHREADS_LIBRARY
    69   NAMES pthreads libpthreads
    70   HINTS ${COIN_ROOT_DIR}/lib/coin
    71   HINTS ${COIN_ROOT_DIR}/lib
    72 )
    73 
    7468INCLUDE(FindPackageHandleStandardArgs)
    7569FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
     
    8983IF(COIN_FOUND)
    9084  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    91   SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
     85  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
    9286  IF(COIN_ZLIB_LIBRARY)
    9387    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
     
    9690    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
    9791  ENDIF(COIN_BZ2_LIBRARY)
    98    IF(COIN_PTHREADS_LIBRARY)
    99     SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_PTHREADS_LIBRARY}")
    100   ENDIF(COIN_PTHREADS_LIBRARY)
    101   SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
     92  SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY};${COIN_CLP_LIBRARIES}")
    10293  SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
    10394ENDIF(COIN_FOUND)
  • lemon/adaptors.h

    r1402 r1270  
    34473447    /// This map adaptor class adapts two node maps of the original digraph
    34483448    /// to get a node map of the split digraph.
    3449     /// Its value type is inherited from the first node map type (\c In).
    3450     /// \tparam In The type of the node map for the in-nodes.
    3451     /// \tparam Out The type of the node map for the out-nodes.
    3452     template <typename In, typename Out>
     3449    /// Its value type is inherited from the first node map type (\c IN).
     3450    /// \tparam IN The type of the node map for the in-nodes.
     3451    /// \tparam OUT The type of the node map for the out-nodes.
     3452    template <typename IN, typename OUT>
    34533453    class CombinedNodeMap {
    34543454    public:
     
    34573457      typedef Node Key;
    34583458      /// The value type of the map
    3459       typedef typename In::Value Value;
    3460 
    3461       typedef typename MapTraits<In>::ReferenceMapTag ReferenceMapTag;
    3462       typedef typename MapTraits<In>::ReturnValue ReturnValue;
    3463       typedef typename MapTraits<In>::ConstReturnValue ConstReturnValue;
    3464       typedef typename MapTraits<In>::ReturnValue Reference;
    3465       typedef typename MapTraits<In>::ConstReturnValue ConstReference;
     3459      typedef typename IN::Value Value;
     3460
     3461      typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag;
     3462      typedef typename MapTraits<IN>::ReturnValue ReturnValue;
     3463      typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue;
     3464      typedef typename MapTraits<IN>::ReturnValue Reference;
     3465      typedef typename MapTraits<IN>::ConstReturnValue ConstReference;
    34663466
    34673467      /// Constructor
    3468       CombinedNodeMap(In& in_map, Out& out_map)
     3468      CombinedNodeMap(IN& in_map, OUT& out_map)
    34693469        : _in_map(in_map), _out_map(out_map) {}
    34703470
     
    34983498    private:
    34993499
    3500       In& _in_map;
    3501       Out& _out_map;
     3500      IN& _in_map;
     3501      OUT& _out_map;
    35023502
    35033503    };
     
    35073507    ///
    35083508    /// This function just returns a combined node map.
    3509     template <typename In, typename Out>
    3510     static CombinedNodeMap<In, Out>
    3511     combinedNodeMap(In& in_map, Out& out_map) {
    3512       return CombinedNodeMap<In, Out>(in_map, out_map);
    3513     }
    3514 
    3515     template <typename In, typename Out>
    3516     static CombinedNodeMap<const In, Out>
    3517     combinedNodeMap(const In& in_map, Out& out_map) {
    3518       return CombinedNodeMap<const In, Out>(in_map, out_map);
    3519     }
    3520 
    3521     template <typename In, typename Out>
    3522     static CombinedNodeMap<In, const Out>
    3523     combinedNodeMap(In& in_map, const Out& out_map) {
    3524       return CombinedNodeMap<In, const Out>(in_map, out_map);
    3525     }
    3526 
    3527     template <typename In, typename Out>
    3528     static CombinedNodeMap<const In, const Out>
    3529     combinedNodeMap(const In& in_map, const Out& out_map) {
    3530       return CombinedNodeMap<const In, const Out>(in_map, out_map);
     3509    template <typename IN, typename OUT>
     3510    static CombinedNodeMap<IN, OUT>
     3511    combinedNodeMap(IN& in_map, OUT& out_map) {
     3512      return CombinedNodeMap<IN, OUT>(in_map, out_map);
     3513    }
     3514
     3515    template <typename IN, typename OUT>
     3516    static CombinedNodeMap<const IN, OUT>
     3517    combinedNodeMap(const IN& in_map, OUT& out_map) {
     3518      return CombinedNodeMap<const IN, OUT>(in_map, out_map);
     3519    }
     3520
     3521    template <typename IN, typename OUT>
     3522    static CombinedNodeMap<IN, const OUT>
     3523    combinedNodeMap(IN& in_map, const OUT& out_map) {
     3524      return CombinedNodeMap<IN, const OUT>(in_map, out_map);
     3525    }
     3526
     3527    template <typename IN, typename OUT>
     3528    static CombinedNodeMap<const IN, const OUT>
     3529    combinedNodeMap(const IN& in_map, const OUT& out_map) {
     3530      return CombinedNodeMap<const IN, const OUT>(in_map, out_map);
    35313531    }
    35323532
  • lemon/arg_parser.cc

    r1397 r956  
    222222  {
    223223    Opts::iterator o = _opts.find(opt);
     224    Opts::iterator s = _opts.find(syn);
    224225    LEMON_ASSERT(o!=_opts.end(), "Unknown option: '"+opt+"'");
    225     LEMON_ASSERT(_opts.find(syn)==_opts.end(),
    226                  "Option already used: '"+syn+"'");
     226    LEMON_ASSERT(s==_opts.end(), "Option already used: '"+syn+"'");
    227227    ParData p;
    228228    p.help=opt;
  • lemon/planarity.h

    r1400 r1270  
    23842384      if (!pe.run()) return false;
    23852385
    2386       run(pe.embeddingMap());
     2386      run(pe);
    23872387      return true;
    23882388    }
     
    23982398    void run(const EmbeddingMap& embedding) {
    23992399      typedef SmartEdgeSet<Graph> AuxGraph;
    2400 
    2401       if (countNodes(_graph) < 3) {
    2402         int y = 0;
    2403         for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
    2404           _point_map[n].x = 0;
    2405           _point_map[n].y = y++;
    2406         }
    2407         return;
    2408       }
    24092400
    24102401      if (3 * countNodes(_graph) - 6 == countEdges(_graph)) {
  • lemon/random.h

    r1404 r1380  
    340340          num = rnd() & mask;
    341341        } while (num > max);
    342         return static_cast<Result>(num);
     342        return num;
    343343      }
    344344    };
  • test/max_flow_test.cc

    r1396 r1385  
    420420  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf, 13);
    421421
    422   checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf_float, 0.3f);
     422  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf_float, 0.3);
    423423  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf_float, 0.3);
    424424
     
    434434  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf, 13);
    435435
    436   checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf_float, 0.3f);
     436  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf_float, 0.3);
    437437  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf_float, 0.3);
    438438
  • test/planarity_test.cc

    r1400 r862  
    3131using namespace lemon::dim2;
    3232
    33 const int lgfn = 8;
     33const int lgfn = 4;
    3434const std::string lgf[lgfn] = {
    35   "@nodes\n"
    36   "label\n"
    37   "@edges\n"
    38   "     label\n",
    39 
    40   "@nodes\n"
    41   "label\n"
    42   "0\n"
    43   "@edges\n"
    44   "     label\n",
    45 
    46   "@nodes\n"
    47   "label\n"
    48   "0\n"
    49   "1\n"
    50   "@edges\n"
    51   "     label\n"
    52   "0 1  0\n",
    53 
    54   "@nodes\n"
    55   "label\n"
    56   "0\n"
    57   "1\n"
    58   "2\n"
    59   "@edges\n"
    60   "     label\n"
    61   "0 1  0\n"
    62   "1 2  1\n"
    63   "2 0  2\n",
    64 
    6535  "@nodes\n"
    6636  "label\n"
     
    167137    }
    168138  }
    169 
    170   if (face_num != 0) {
    171     check(face_num + countNodes(graph) - countConnectedComponents(graph) ==
    172           countEdges(graph) + 1, "Euler test does not passed");
    173   }
     139  check(face_num + countNodes(graph) - countConnectedComponents(graph) ==
     140        countEdges(graph) + 1, "Euler test does not passed");
    174141}
    175142
     
    279246      checkEmbedding(graph, pe);
    280247
    281       {
    282         PlanarDrawing<Graph> pd(graph);
    283         pd.run(pe.embeddingMap());
    284         checkDrawing(graph, pd);
    285       }
    286 
    287       {
    288         PlanarDrawing<Graph> pd(graph);
    289         pd.run();
    290         checkDrawing(graph, pd);
    291       }
    292 
    293       {
    294         PlanarColoring<Graph> pc(graph);
    295         pc.runFiveColoring(pe.embeddingMap());
    296         checkColoring(graph, pc, 5);
    297       }
    298 
    299       {
    300         PlanarColoring<Graph> pc(graph);
    301         pc.runFiveColoring();
    302         checkColoring(graph, pc, 5);
    303       }
     248      PlanarDrawing<Graph> pd(graph);
     249      pd.run(pe.embeddingMap());
     250      checkDrawing(graph, pd);
     251
     252      PlanarColoring<Graph> pc(graph);
     253      pc.runFiveColoring(pe.embeddingMap());
     254      checkColoring(graph, pc, 5);
    304255
    305256    } else {
  • tools/dimacs-to-lgf.cc

    r1397 r631  
    7474        throw IoError("Cannot open the file for writing", ap.files()[1]);
    7575      }
    76       // fall through
    7776    case 1:
    7877      input.open(ap.files()[0].c_str());
     
    8079        throw IoError("File cannot be found", ap.files()[0]);
    8180      }
    82       // fall through
    8381    case 0:
    8482      break;
Note: See TracChangeset for help on using the changeset viewer.