COIN-OR::LEMON - Graph Library

Ignore:
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1344 r1398  
    8383IF(LEMON_ENABLE_GLPK)
    8484  FIND_PACKAGE(GLPK 4.33)
     85  IF(GLPK_FOUND)
     86    SET(LEMON_HAVE_LP TRUE)
     87    SET(LEMON_HAVE_MIP TRUE)
     88    SET(LEMON_HAVE_GLPK TRUE)
     89  ENDIF(GLPK_FOUND)
    8590ENDIF(LEMON_ENABLE_GLPK)
    8691IF(LEMON_ENABLE_ILOG)
    8792  FIND_PACKAGE(ILOG)
     93  IF(ILOG_FOUND)
     94    SET(LEMON_HAVE_LP TRUE)
     95    SET(LEMON_HAVE_MIP TRUE)
     96    SET(LEMON_HAVE_CPLEX TRUE)
     97  ENDIF(ILOG_FOUND)
    8898ENDIF(LEMON_ENABLE_ILOG)
    8999IF(LEMON_ENABLE_COIN)
    90100  FIND_PACKAGE(COIN)
     101  IF(COIN_FOUND)
     102    SET(LEMON_HAVE_LP TRUE)
     103    SET(LEMON_HAVE_MIP TRUE)
     104    SET(LEMON_HAVE_CLP TRUE)
     105    SET(LEMON_HAVE_CBC TRUE)
     106  ENDIF(COIN_FOUND)
    91107ENDIF(LEMON_ENABLE_COIN)
    92108IF(LEMON_ENABLE_SOPLEX)
    93109  FIND_PACKAGE(SOPLEX)
     110  IF(SOPLEX_FOUND)
     111    SET(LEMON_HAVE_LP TRUE)
     112    SET(LEMON_HAVE_SOPLEX TRUE)
     113  ENDIF(SOPLEX_FOUND)
    94114ENDIF(LEMON_ENABLE_SOPLEX)
    95 
    96 IF(GLPK_FOUND)
    97   SET(LEMON_HAVE_LP TRUE)
    98   SET(LEMON_HAVE_MIP TRUE)
    99   SET(LEMON_HAVE_GLPK TRUE)
    100 ENDIF(GLPK_FOUND)
    101 IF(ILOG_FOUND)
    102   SET(LEMON_HAVE_LP TRUE)
    103   SET(LEMON_HAVE_MIP TRUE)
    104   SET(LEMON_HAVE_CPLEX TRUE)
    105 ENDIF(ILOG_FOUND)
    106 IF(COIN_FOUND)
    107   SET(LEMON_HAVE_LP TRUE)
    108   SET(LEMON_HAVE_MIP TRUE)
    109   SET(LEMON_HAVE_CLP TRUE)
    110   SET(LEMON_HAVE_CBC TRUE)
    111 ENDIF(COIN_FOUND)
    112 IF(SOPLEX_FOUND)
    113   SET(LEMON_HAVE_LP TRUE)
    114   SET(LEMON_HAVE_SOPLEX TRUE)
    115 ENDIF(SOPLEX_FOUND)
    116115
    117116IF(ILOG_FOUND)
  • cmake/FindCOIN.cmake

    r1232 r1398  
    6666)
    6767
     68FIND_LIBRARY(COIN_PTHREADS_LIBRARY
     69  NAMES pthreads libpthreads
     70  HINTS ${COIN_ROOT_DIR}/lib/coin
     71  HINTS ${COIN_ROOT_DIR}/lib
     72)
     73
    6874INCLUDE(FindPackageHandleStandardArgs)
    6975FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
     
    8389IF(COIN_FOUND)
    8490  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    85   SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
     91  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    8692  IF(COIN_ZLIB_LIBRARY)
    8793    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
     
    9096    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
    9197  ENDIF(COIN_BZ2_LIBRARY)
    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}")
     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}")
    93102  SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
    94103ENDIF(COIN_FOUND)
  • lemon/adaptors.h

    r1270 r1402  
    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

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

    r1270 r1400  
    23842384      if (!pe.run()) return false;
    23852385
    2386       run(pe);
     2386      run(pe.embeddingMap());
    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      }
    24002409
    24012410      if (3 * countNodes(_graph) - 6 == countEdges(_graph)) {
  • lemon/random.h

    r1340 r1396  
    343343          num = rnd() & mask;
    344344        } while (num > max);
    345         return num;
     345        return static_cast<Result>(num);
    346346      }
    347347    };
  • test/max_flow_test.cc

    r1385 r1396  
    420420  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf, 13);
    421421
    422   checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf_float, 0.3);
     422  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf_float, 0.3f);
    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.3);
     436  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf_float, 0.3f);
    437437  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf_float, 0.3);
    438438
  • test/planarity_test.cc

    r862 r1400  
    3131using namespace lemon::dim2;
    3232
    33 const int lgfn = 4;
     33const int lgfn = 8;
    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
    3565  "@nodes\n"
    3666  "label\n"
     
    137167    }
    138168  }
    139   check(face_num + countNodes(graph) - countConnectedComponents(graph) ==
    140         countEdges(graph) + 1, "Euler test does not passed");
     169
     170  if (face_num != 0) {
     171    check(face_num + countNodes(graph) - countConnectedComponents(graph) ==
     172          countEdges(graph) + 1, "Euler test does not passed");
     173  }
    141174}
    142175
     
    246279      checkEmbedding(graph, pe);
    247280
    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);
     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      }
    255304
    256305    } else {
  • tools/dimacs-to-lgf.cc

    r631 r1397  
    7474        throw IoError("Cannot open the file for writing", ap.files()[1]);
    7575      }
     76      // fall through
    7677    case 1:
    7778      input.open(ap.files()[0].c_str());
     
    7980        throw IoError("File cannot be found", ap.files()[0]);
    8081      }
     82      // fall through
    8183    case 0:
    8284      break;
Note: See TracChangeset for help on using the changeset viewer.