COIN-OR::LEMON - Graph Library

Changes in / [995:4bb9e72e1a41:998:7fdaa05a69a1] in lemon-main


Ignore:
Files:
1 added
35 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r964 r998  
    6767    # C4996: 'function': was declared deprecated
    6868  ELSE()
    69     SET(CXX_WARNING "-Wall -W")
     69    SET(CXX_WARNING "-Wall")
    7070  ENDIF()
    7171ENDIF()
     
    7474SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
    7575
    76 SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb" CACHE STRING
     76SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
    7777    "Flags used by the C++ compiler during maintainer builds."
    7878    FORCE )
    79 SET( CMAKE_C_FLAGS_MAINTAINER "-Werror" CACHE STRING
     79SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
    8080    "Flags used by the C compiler during maintainer builds."
    8181    FORCE )
  • cmake/FindCOIN.cmake

    r947 r973  
    5555)
    5656
     57FIND_LIBRARY(COIN_ZLIB_LIBRARY
     58  NAMES z libz
     59  HINTS ${COIN_ROOT_DIR}/lib/coin
     60  HINTS ${COIN_ROOT_DIR}/lib
     61)
     62FIND_LIBRARY(COIN_BZ2_LIBRARY
     63  NAMES bz2 libbz2
     64  HINTS ${COIN_ROOT_DIR}/lib/coin
     65  HINTS ${COIN_ROOT_DIR}/lib
     66)
     67
    5768INCLUDE(FindPackageHandleStandardArgs)
    5869FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
     
    7283IF(COIN_FOUND)
    7384  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    74   SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY}")
    75   SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    76   SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
     85  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
     86  IF(COIN_ZLIB_LIBRARY)
     87    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
     88  ENDIF(COIN_ZLIB_LIBRARY)
     89   IF(COIN_BZ2_LIBRARY)
     90    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
     91  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}")
     93  SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
    7794ENDIF(COIN_FOUND)
    7895
     
    89106  COIN_OSI_VOL_LIBRARY
    90107  COIN_VOL_LIBRARY
     108  COIN_ZLIB_LIBRARY
     109  COIN_BZ2_LIBRARY
    91110)
    92111
  • cmake/FindCPLEX.cmake

    r636 r972  
    33FIND_PATH(CPLEX_INCLUDE_DIR
    44  ilcplex/cplex.h
    5   PATHS "C:/ILOG/CPLEX91/include"
    6   PATHS "/opt/ilog/cplex91/include"
     5  PATHS "C:/ILOG/CPLEX/include"
     6  PATHS "/opt/ilog/cplex/include"
    77  HINTS ${CPLEX_ROOT_DIR}/include
    88)
    99FIND_LIBRARY(CPLEX_LIBRARY
    10   cplex91
    11   PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    12   PATHS "/opt/ilog/cplex91/bin"
     10  cplex
     11  PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
     12  PATHS "/opt/ilog/cplex/bin"
    1313  HINTS ${CPLEX_ROOT_DIR}/bin
     14  HINTS ${CPLEX_ROOT_DIR}/lib
    1415)
    1516
     
    1819
    1920FIND_PATH(CPLEX_BIN_DIR
    20   cplex91.dll
    21   PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
     21  cplex.dll
     22  PATHS "C:/ILOG/CPLEX/bin/x86_win32"
     23  HINTS ${CPLEX_ROOT_DIR}/bin
    2224)
    2325
  • lemon/adaptors.h

    r877 r998  
    13721372    /// and edge filter maps.
    13731373    SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
    1374       initialize(graph, node_filter, edge_filter);
     1374      this->initialize(graph, node_filter, edge_filter);
    13751375    }
    13761376
     
    22782278    /// Creates an undirected graph from the given digraph.
    22792279    Undirector(DGR& digraph) {
    2280       initialize(digraph);
     2280      this->initialize(digraph);
    22812281    }
    22822282
  • lemon/bfs.h

    r877 r976  
    12521252      }
    12531253      _Visitor& visitor;
     1254      Constraints() {}
    12541255    };
    12551256  };
  • lemon/bits/bezier.h

    r440 r997  
    160160    const Point d=(a+b)/2;
    161161    const Point e=(b+c)/2;
    162     const Point f=(d+e)/2;
     162    // const Point f=(d+e)/2;
    163163    R f1=_f(Bezier3(p1,a,d,e),_d);
    164164    R f2=_f(Bezier3(e,d,c,p4),_d);
  • lemon/bits/edge_set_extender.h

    r964 r998  
    524524    // Returns the base node of the iterator
    525525    Node baseNode(const IncEdgeIt &e) const {
    526       return e.direction ? u(e) : v(e);
     526      return e.direction ? this->u(e) : this->v(e);
    527527    }
    528528    // Running node of the iterator
     
    530530    // Returns the running node of the iterator
    531531    Node runningNode(const IncEdgeIt &e) const {
    532       return e.direction ? v(e) : u(e);
     532      return e.direction ? this->v(e) : this->u(e);
    533533    }
    534534
  • lemon/bits/graph_extender.h

    r778 r998  
    588588    // Returns the base node of the iterator
    589589    Node baseNode(const IncEdgeIt &edge) const {
    590       return edge._direction ? u(edge) : v(edge);
     590      return edge._direction ? this->u(edge) : this->v(edge);
    591591    }
    592592    // Running node of the iterator
     
    594594    // Returns the running node of the iterator
    595595    Node runningNode(const IncEdgeIt &edge) const {
    596       return edge._direction ? v(edge) : u(edge);
     596      return edge._direction ? this->v(edge) : this->u(edge);
    597597    }
    598598
  • lemon/bits/solver_bits.h

    r877 r989  
    4545      void clear() {
    4646        first_item = -1;
     47        last_item = -1;
    4748        first_free_item = -1;
    4849        items.clear();
  • lemon/cbc.cc

    r746 r998  
    2626#include <coin/OsiSolverInterface.hpp>
    2727
    28 #ifdef COIN_HAS_CLP
    2928#include "coin/OsiClpSolverInterface.hpp"
    30 #endif
    31 #ifdef COIN_HAS_OSL
    32 #include "coin/OsiOslSolverInterface.hpp"
    33 #endif
    3429
    3530#include "coin/CbcCutGenerator.hpp"
     
    271266      delete _osi_solver;
    272267    }
    273 #ifdef COIN_HAS_CLP
    274268    _osi_solver = new OsiClpSolverInterface();
    275 #elif COIN_HAS_OSL
    276     _osi_solver = new OsiOslSolverInterface();
    277 #else
    278 #error Cannot instantiate Osi solver
    279 #endif
    280269
    281270    _osi_solver->loadFromCoinModel(*_prob);
     
    329318      _cbc_model->addCutGenerator(&flowGen, -1, "FlowCover");
    330319
    331 #ifdef COIN_HAS_CLP
    332320      OsiClpSolverInterface* osiclp =
    333321        dynamic_cast<OsiClpSolverInterface*>(_cbc_model->solver());
     
    335323        osiclp->setupForRepeatedUse(2, 0);
    336324      }
    337 #endif
    338325
    339326      CbcRounding heuristic1(*_cbc_model);
     
    449436
    450437    _prob = new CoinModel();
    451     rows.clear();
    452     cols.clear();
    453438  }
    454439
  • lemon/circulation.h

    r877 r998  
    573573
    574574      Node act;
    575       Node bact=INVALID;
    576       Node last_activated=INVALID;
    577575      while((act=_level->highestActive())!=INVALID) {
    578576        int actlevel=(*_level)[act];
  • lemon/clp.cc

    r877 r989  
    438438    delete _prob;
    439439    _prob = new ClpSimplex();
    440     rows.clear();
    441     cols.clear();
    442440    _col_names_ref.clear();
    443441    _clear_temporals();
  • lemon/concept_check.h

    r440 r997  
    3636
    3737  template <class T> inline void ignore_unused_variable_warning(const T&) { }
     38  template <class T1, class T2>
     39  inline void ignore_unused_variable_warning(const T1&, const T2&) { }
     40  template <class T1, class T2, class T3>
     41  inline void ignore_unused_variable_warning(const T1&, const T2&,
     42                                             const T3&) { }
     43  template <class T1, class T2, class T3, class T4>
     44  inline void ignore_unused_variable_warning(const T1&, const T2&,
     45                                             const T3&, const T4&) { }
     46  template <class T1, class T2, class T3, class T4, class T5>
     47  inline void ignore_unused_variable_warning(const T1&, const T2&,
     48                                             const T3&, const T4&,
     49                                             const T5&) { }
     50  template <class T1, class T2, class T3, class T4, class T5, class T6>
     51  inline void ignore_unused_variable_warning(const T1&, const T2&,
     52                                             const T3&, const T4&,
     53                                             const T5&, const T6&) { }
    3854
    3955  ///\e
  • lemon/concepts/graph_components.h

    r877 r998  
    116116        const _GraphItem &ia;
    117117        const _GraphItem &ib;
     118        Constraints() {}
    118119      };
    119120    };
     
    175176
    176177        const _Digraph& digraph;
     178        Constraints() {}
    177179      };
    178180    };
     
    291293
    292294        const _Graph& graph;
     295      Constraints() {}
    293296      };
    294297
     
    370373
    371374        const _Digraph& digraph;
     375        Constraints() {}
    372376      };
    373377    };
     
    422426
    423427        const _Graph& graph;
     428        Constraints() {}
    424429      };
    425430    };
     
    490495          _GraphItemIt it3 = it1;
    491496          _GraphItemIt it4 = INVALID;
     497          ignore_unused_variable_warning(it3);
     498          ignore_unused_variable_warning(it4);
    492499
    493500          it2 = ++it1;
     
    499506        }
    500507        const GR& g;
     508        Constraints() {}
    501509      };
    502510    };
     
    578586          _GraphIncIt it3 = it1;
    579587          _GraphIncIt it4 = INVALID;
     588          ignore_unused_variable_warning(it3);
     589          ignore_unused_variable_warning(it4);
    580590
    581591          it2 = ++it1;
     
    587597        const Base& node;
    588598        const GR& graph;
     599        Constraints() {}
    589600      };
    590601    };
     
    763774
    764775        const _Digraph& digraph;
     776        Constraints() {}
    765777      };
    766778    };
     
    887899
    888900        const _Graph& graph;
     901        Constraints() {}
    889902      };
    890903    };
     
    944957
    945958        const _Digraph& digraph;
     959        Constraints() {}
    946960      };
    947961    };
     
    985999
    9861000        const _Graph& graph;
     1001        Constraints() {}
    9871002      };
    9881003    };
     
    10621077        const GR &g;
    10631078        const typename GraphMap::Value &t;
     1079        Constraints() {}
    10641080      };
    10651081
     
    12001216
    12011217        const _Digraph& digraph;
     1218        Constraints() {}
    12021219      };
    12031220    };
     
    12851302
    12861303        const _Graph& graph;
     1304        Constraints() {}
    12871305      };
    12881306    };
     
    13291347
    13301348        _Digraph& digraph;
     1349        Constraints() {}
    13311350      };
    13321351    };
     
    13731392
    13741393        _Graph& graph;
     1394        Constraints() {}
    13751395      };
    13761396    };
     
    14121432
    14131433        _Digraph& digraph;
     1434        Constraints() {}
    14141435      };
    14151436    };
     
    14511472
    14521473        _Graph& graph;
     1474        Constraints() {}
    14531475      };
    14541476    };
     
    14791501
    14801502        _Digraph& digraph;
     1503        Constraints() {}
    14811504      };
    14821505    };
     
    15071530
    15081531        _Graph& graph;
     1532        Constraints() {}
    15091533      };
    15101534    };
  • lemon/concepts/heap.h

    r877 r976  
    315315        _Heap& heap;
    316316        ItemIntMap& map;
     317        Constraints() {}
    317318      };
    318319    };
  • lemon/concepts/maps.h

    r718 r997  
    5050      /// Returns the value associated with the given key.
    5151      Value operator[](const Key &) const {
    52         return *static_cast<Value *>(0);
     52        return *(static_cast<Value *>(0)+1);
    5353      }
    5454
     
    6969        const typename _ReadMap::Key& own_key;
    7070        const _ReadMap& m;
     71        Constraints() {}
    7172      };
    7273
     
    110111        const typename _WriteMap::Value& own_val;
    111112        _WriteMap& m;
     113        Constraints() {}
    112114      };
    113115    };
     
    130132      /// Returns the value associated with the given key.
    131133      Value operator[](const Key &) const {
    132         return *static_cast<Value *>(0);
     134        Value *r = 0;
     135        return *r;
    133136      }
    134137
     
    170173      /// Returns a reference to the value associated with the given key.
    171174      Reference operator[](const Key &) {
    172         return *static_cast<Value *>(0);
     175        Value *r = 0;
     176        return *r;
    173177      }
    174178
    175179      /// Returns a const reference to the value associated with the given key.
    176180      ConstReference operator[](const Key &) const {
    177         return *static_cast<Value *>(0);
     181        Value *r = 0;
     182        return *r;
    178183      }
    179184
     
    206211        typename _ReferenceMap::ConstReference own_cref;
    207212        _ReferenceMap& m;
     213        Constraints() {}
    208214      };
    209215    };
  • lemon/concepts/path.h

    r785 r976  
    169169        }
    170170        _Path& p;
     171        PathDumperConstraints() {}
    171172      };
    172173
     
    194195        }
    195196        _Path& p;
     197        PathDumperConstraints() {}
    196198      };
    197199
  • lemon/core.h

    r964 r998  
    18501850    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
    18511851    ///
    1852 #ifdef DOXYGEN
    1853     Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
    1854 #else
    1855     using ArcLookUp<GR>::operator() ;
    1856     Arc operator()(Node s, Node t, Arc prev) const
     1852    Arc operator()(Node s, Node t, Arc prev=INVALID) const
    18571853    {
    1858       return prev==INVALID?(*this)(s,t):_next[prev];
    1859     }
     1854      if(prev==INVALID)
     1855        {
     1856          Arc f=INVALID;
     1857          Arc e;
     1858          for(e=_head[s];
     1859              e!=INVALID&&_g.target(e)!=t;
     1860              e = t < _g.target(e)?_left[e]:_right[e]) ;
     1861          while(e!=INVALID)
     1862            if(_g.target(e)==t)
     1863              {
     1864                f = e;
     1865                e = _left[e];
     1866              }
     1867            else e = _right[e];
     1868          return f;
     1869        }
     1870      else return _next[prev];
     1871    }
     1872
     1873  };
     1874
     1875  /// @}
     1876
     1877} //namespace lemon
     1878
    18601879#endif
    1861 
    1862   };
    1863 
    1864   /// @}
    1865 
    1866 } //namespace lemon
    1867 
    1868 #endif
  • lemon/cplex.cc

    r877 r989  
    471471    int status;
    472472    _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem");
    473     rows.clear();
    474     cols.clear();
    475473  }
    476474
  • lemon/dfs.h

    r964 r998  
    11941194      }
    11951195      _Visitor& visitor;
     1196      Constraints() {}
    11961197    };
    11971198  };
  • lemon/glpk.cc

    r877 r989  
    557557  void GlpkBase::_clear() {
    558558    glp_erase_prob(lp);
    559     rows.clear();
    560     cols.clear();
    561559  }
    562560
  • lemon/graph_to_eps.h

    r964 r998  
    223223  using T::_copyright;
    224224
    225   using T::NodeTextColorType;
     225  using typename T::NodeTextColorType;
    226226  using T::CUST_COL;
    227227  using T::DIST_COL;
  • lemon/lp_base.h

    r958 r989  
    15571557
    15581558    ///Clears the problem
    1559     void clear() { _clear(); }
     1559    void clear() { _clear(); rows.clear(); cols.clear(); }
    15601560
    15611561    /// Sets the message level of the solver
  • lemon/path.h

    r877 r998  
    6565    Path() {}
    6666
     67    /// \brief Copy constructor
     68    ///
     69    Path(const Path& cpath) {
     70      pathCopy(cpath, *this);
     71    }
     72
    6773    /// \brief Template copy constructor
    6874    ///
     
    7278    Path(const CPath& cpath) {
    7379      pathCopy(cpath, *this);
     80    }
     81
     82    /// \brief Copy assignment
     83    ///
     84    Path& operator=(const Path& cpath) {
     85      pathCopy(cpath, *this);
     86      return *this;
    7487    }
    7588
     
    253266    SimplePath() {}
    254267
     268    /// \brief Copy constructor
     269    ///
     270    SimplePath(const SimplePath& cpath) {
     271      pathCopy(cpath, *this);
     272    }
     273
    255274    /// \brief Template copy constructor
    256275    ///
     
    260279    SimplePath(const CPath& cpath) {
    261280      pathCopy(cpath, *this);
     281    }
     282
     283    /// \brief Copy assignment
     284    ///
     285    SimplePath& operator=(const SimplePath& cpath) {
     286      pathCopy(cpath, *this);
     287      return *this;
    262288    }
    263289
     
    432458    ListPath() : first(0), last(0) {}
    433459
     460    /// \brief Copy constructor
     461    ///
     462    ListPath(const ListPath& cpath) : first(0), last(0) {
     463      pathCopy(cpath, *this);
     464    }
     465
    434466    /// \brief Template copy constructor
    435467    ///
     
    446478    ~ListPath() {
    447479      clear();
     480    }
     481
     482    /// \brief Copy assignment
     483    ///
     484    ListPath& operator=(const ListPath& cpath) {
     485      pathCopy(cpath, *this);
     486      return *this;
    448487    }
    449488
     
    759798    StaticPath() : len(0), arcs(0) {}
    760799
     800    /// \brief Copy constructor
     801    ///
     802    StaticPath(const StaticPath& cpath) : arcs(0) {
     803      pathCopy(cpath, *this);
     804    }
     805
    761806    /// \brief Template copy constructor
    762807    ///
     
    772817    ~StaticPath() {
    773818      if (arcs) delete[] arcs;
     819    }
     820
     821    /// \brief Copy assignment
     822    ///
     823    StaticPath& operator=(const StaticPath& cpath) {
     824      pathCopy(cpath, *this);
     825      return *this;
    774826    }
    775827
  • test/CMakeLists.txt

    r964 r998  
    1414SET(TESTS
    1515  adaptors_test
     16  arc_look_up_test
    1617  bellman_ford_test
    1718  bfs_test
     
    8788    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    8889    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    89       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     90      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
    9091    )
    9192  ENDIF()
     
    129130    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    130131    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    131       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     132      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
    132133    )
    133134  ENDIF()
  • test/adaptors_test.cc

    r995 r998  
    6666  Digraph::Arc a2 = digraph.addArc(n1, n3);
    6767  Digraph::Arc a3 = digraph.addArc(n2, n3);
     68  ignore_unused_variable_warning(a3);
    6869
    6970  // Check the adaptor
     
    100101  Adaptor::Arc a7 = adaptor.addArc(n1, n4);
    101102  Adaptor::Arc a8 = adaptor.addArc(n1, n2);
     103  ignore_unused_variable_warning(a6,a7,a8);
    102104
    103105  adaptor.erase(a1);
     
    759761  Digraph::Arc a2 = digraph.addArc(n1, n3);
    760762  Digraph::Arc a3 = digraph.addArc(n2, n3);
     763  ignore_unused_variable_warning(a1,a2,a3);
    761764
    762765  checkGraphNodeList(adaptor, 6);
  • test/connectivity_test.cc

    r877 r998  
    6969    Graph g(d);
    7070    Digraph::Node n = d.addNode();
     71    ignore_unused_variable_warning(n);
    7172
    7273    check(stronglyConnected(d), "This digraph is strongly connected");
     
    246247    Digraph::Node watch = d.addNode();
    247248    Digraph::Node pants = d.addNode();
     249    ignore_unused_variable_warning(watch);
    248250
    249251    d.addArc(socks, shoe);
  • test/digraph_test.cc

    r877 r998  
    6565      a3 = G.addArc(n2, n3),
    6666      a4 = G.addArc(n2, n3);
     67  ignore_unused_variable_warning(a2,a3,a4);
    6768
    6869  checkGraphNodeList(G, 3);
     
    9394  Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
    9495      a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
     96  ignore_unused_variable_warning(a1,a2,a3,a4);
    9597
    9698  Node n4 = G.split(n2);
     
    126128      a3 = G.addArc(n4, n3), a4 = G.addArc(n4, n3),
    127129      a5 = G.addArc(n2, n4);
     130  ignore_unused_variable_warning(a1,a2,a3,a5);
    128131
    129132  checkGraphNodeList(G, 4);
     
    205208      a3 = G.addArc(n4, n3), a4 = G.addArc(n3, n1),
    206209      a5 = G.addArc(n2, n4);
     210  ignore_unused_variable_warning(a2,a3,a4,a5);
    207211
    208212  // Check arc deletion
     
    252256  Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
    253257      a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
     258  ignore_unused_variable_warning(a1,a2,a3,a4);
    254259
    255260  typename Digraph::Snapshot snapshot(G);
     
    352357    e1 = g.addArc(n1, n2),
    353358    e2 = g.addArc(n2, n3);
     359  ignore_unused_variable_warning(e2);
    354360
    355361  check(g.valid(n1), "Wrong validity check");
  • test/edge_set_test.cc

    r877 r998  
    4545
    4646  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     47  ignore_unused_variable_warning(ga1);
    4748
    4849  ArcSet arc_set(digraph);
    4950
    5051  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     52  ignore_unused_variable_warning(ga2);
    5153
    5254  checkGraphNodeList(arc_set, 2);
     
    7678    a3 = arc_set.addArc(n2, n3),
    7779    a4 = arc_set.addArc(n2, n3);
     80  ignore_unused_variable_warning(a2,a3,a4);
     81
    7882  checkGraphNodeList(arc_set, 3);
    7983  checkGraphArcList(arc_set, 4);
     
    111115
    112116  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     117  ignore_unused_variable_warning(ga1);
    113118
    114119  ArcSet arc_set(digraph);
    115120
    116121  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     122  ignore_unused_variable_warning(ga2);
    117123
    118124  checkGraphNodeList(arc_set, 2);
     
    142148    a3 = arc_set.addArc(n2, n3),
    143149    a4 = arc_set.addArc(n2, n3);
     150  ignore_unused_variable_warning(a2,a3,a4);
     151
    144152  checkGraphNodeList(arc_set, 3);
    145153  checkGraphArcList(arc_set, 4);
     
    191199
    192200  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     201  ignore_unused_variable_warning(ga1);
    193202
    194203  EdgeSet edge_set(digraph);
    195204
    196205  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     206  ignore_unused_variable_warning(ga2);
    197207
    198208  checkGraphNodeList(edge_set, 2);
     
    231241    e3 = edge_set.addEdge(n2, n3),
    232242    e4 = edge_set.addEdge(n2, n3);
     243  ignore_unused_variable_warning(e2,e3,e4);
     244
    233245  checkGraphNodeList(edge_set, 3);
    234246  checkGraphEdgeList(edge_set, 4);
     
    275287
    276288  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     289  ignore_unused_variable_warning(ga1);
    277290
    278291  EdgeSet edge_set(digraph);
    279292
    280293  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     294  ignore_unused_variable_warning(ga2);
    281295
    282296  checkGraphNodeList(edge_set, 2);
     
    315329    e3 = edge_set.addEdge(n2, n3),
    316330    e4 = edge_set.addEdge(n2, n3);
     331  ignore_unused_variable_warning(e2,e3,e4);
     332
    317333  checkGraphNodeList(edge_set, 3);
    318334  checkGraphEdgeList(edge_set, 4);
  • test/euler_test.cc

    r877 r998  
    102102    Graph g(d);
    103103    Digraph::Node n = d.addNode();
    104 
     104    ignore_unused_variable_warning(n);
     105 
    105106    checkDiEulerIt(d);
    106107    checkDiEulerIt(g);
     
    190191    Digraph::Node n4 = d.addNode();
    191192    Digraph::Node n5 = d.addNode();
     193    ignore_unused_variable_warning(n0,n4,n5);
    192194
    193195    d.addArc(n1, n2);
  • test/graph_test.cc

    r877 r998  
    6767  Edge e2 = G.addEdge(n2, n1),
    6868       e3 = G.addEdge(n2, n3);
     69  ignore_unused_variable_warning(e2,e3);
    6970
    7071  checkGraphNodeList(G, 3);
     
    99100       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    100101       e5 = G.addEdge(n4, n3);
     102  ignore_unused_variable_warning(e1,e3,e4,e5);
    101103
    102104  checkGraphNodeList(G, 4);
     
    178180       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    179181       e5 = G.addEdge(n4, n3);
     182  ignore_unused_variable_warning(e1,e3,e4,e5);
    180183
    181184  // Check edge deletion
     
    218221  Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    219222       e3 = G.addEdge(n2, n3);
     223  ignore_unused_variable_warning(e1,e2,e3);
    220224
    221225  checkGraphNodeList(G, 3);
     
    382386    e1 = g.addEdge(n1, n2),
    383387    e2 = g.addEdge(n2, n3);
     388  ignore_unused_variable_warning(e2);
    384389
    385390  check(g.valid(n1), "Wrong validity check");
     
    520525
    521526  Node n = G.nodeFromId(dim);
     527  ignore_unused_variable_warning(n);
    522528
    523529  for (NodeIt n(G); n != INVALID; ++n) {
  • test/lp_test.cc

    r957 r988  
    4242using namespace lemon;
    4343
     44int countCols(LpBase & lp) {
     45  int count=0;
     46  for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count;
     47  return count;
     48}
     49
     50int countRows(LpBase & lp) {
     51  int count=0;
     52  for (LpBase::RowIt r(lp); r!=INVALID; ++r) ++count;
     53  return count;
     54}
     55
     56
    4457void lpTest(LpSolver& lp)
    4558{
    4659
    4760  typedef LpSolver LP;
     61
     62  // Test LpBase::clear()
     63  check(countRows(lp)==0, "Wrong number of rows");
     64  check(countCols(lp)==0, "Wrong number of cols");
     65  lp.addCol(); lp.addRow(); lp.addRow();
     66  check(countRows(lp)==2, "Wrong number of rows");
     67  check(countCols(lp)==1, "Wrong number of cols");
     68  lp.clear();
     69  check(countRows(lp)==0, "Wrong number of rows");
     70  check(countCols(lp)==0, "Wrong number of cols");
     71  lp.addCol(); lp.addCol(); lp.addCol(); lp.addRow();
     72  check(countRows(lp)==1, "Wrong number of rows");
     73  check(countCols(lp)==3, "Wrong number of cols");
     74  lp.clear();
    4875
    4976  std::vector<LP::Col> x(10);
  • test/maps_test.cc

    r942 r998  
    104104    NullMap<A,B> map1;
    105105    NullMap<A,B> map2 = map1;
     106    ignore_unused_variable_warning(map2);
    106107    map1 = nullMap<A,B>();
    107108  }
     
    114115    ConstMap<A,B> map2 = B();
    115116    ConstMap<A,B> map3 = map1;
     117    ignore_unused_variable_warning(map2,map3);
     118
    116119    map1 = constMap<A>(B());
    117120    map1 = constMap<A,B>();
     
    119122    ConstMap<A,C> map4(C(1));
    120123    ConstMap<A,C> map5 = map4;
     124    ignore_unused_variable_warning(map5);
     125
    121126    map4 = constMap<A>(C(2));
    122127    map4.setAll(C(3));
     
    139144    IdentityMap<A> map1;
    140145    IdentityMap<A> map2 = map1;
     146    ignore_unused_variable_warning(map2);
     147
    141148    map1 = identityMap<A>();
    142149
     
    198205    checkConcept<ReadMap<B,double>, CompMap>();
    199206    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     207    ignore_unused_variable_warning(map1);
    200208    CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
     209    ignore_unused_variable_warning(map2);
    201210
    202211    SparseMap<double, bool> m1(false); m1[3.14] = true;
     
    211220    checkConcept<ReadMap<A,double>, CombMap>();
    212221    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
     222    ignore_unused_variable_warning(map1);
    213223    CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
     224    ignore_unused_variable_warning(map2);
    214225
    215226    check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
     
    223234    FunctorToMap<F> map1;
    224235    FunctorToMap<F> map2 = FunctorToMap<F>(F());
     236    ignore_unused_variable_warning(map2);
     237
    225238    B b = functorToMap(F())[A()];
     239    ignore_unused_variable_warning(b);
    226240
    227241    checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    228242    MapToFunctor<ReadMap<A,B> > map =
    229243      MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     244    ignore_unused_variable_warning(map);
    230245
    231246    check(functorToMap(&func)[A()] == 3,
     
    245260      ConvertMap<ReadMap<double, int>, double> >();
    246261    ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true));
     262    ignore_unused_variable_warning(map1);
    247263    ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false));
     264    ignore_unused_variable_warning(map2);
     265
    248266  }
    249267
  • test/path_test.cc

    r440 r990  
    3939}
    4040
     41// Check if proper copy consructor is called (use valgrind for testing)
     42template<class _Path>
     43void checkCopy()
     44{
     45  ListDigraph g;
     46  ListDigraph::Arc a  = g.addArc(g.addNode(), g.addNode());
     47 
     48  _Path p,q;
     49  p.addBack(a);
     50  q=p;
     51  _Path r(p);
     52  StaticPath<ListDigraph> s(r);
     53}
     54 
    4155int main() {
    4256  check_concepts();
     57
     58  checkCopy<Path<ListDigraph> >();
     59  checkCopy<SimplePath<ListDigraph> >();
     60  checkCopy<ListPath<ListDigraph> >();
     61
     62  ListDigraph g;
     63  ListDigraph::Arc a  = g.addArc(g.addNode(), g.addNode());
     64 
     65  Path<ListDigraph> p;
     66  StaticPath<ListDigraph> q,r;
     67  p.addBack(a);
     68  q=p;
     69  r=q;
     70  StaticPath<ListDigraph> s(q);
     71
    4372  return 0;
    4473}
  • test/time_measure_test.cc

    r558 r997  
    1818
    1919#include <lemon/time_measure.h>
     20#include <lemon/concept_check.h>
    2021
    2122using namespace lemon;
     
    3334
    3435  for(int i=0;i<1000;i++)
    35     TimeStamp x(T);
     36    {
     37      TimeStamp x(T);
     38      ignore_unused_variable_warning(x);
     39    }
    3640}
    3741
Note: See TracChangeset for help on using the changeset viewer.