COIN-OR::LEMON - Graph Library

Ticket #307: 307-2-impr-86c49553fea5.patch

File 307-2-impr-86c49553fea5.patch, 3.3 KB (added by Peter Kovacs, 10 years ago)
  • lemon/circulation.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1250584535 -7200
    # Node ID 86c49553fea53ec66f545929a2bc75c94f1b6a20
    # Parent  1f08e846df296135814062a8a9c4feb22c76d4ab
    Test file + doc improvements (#307)
    
    diff --git a/lemon/circulation.h b/lemon/circulation.h
    a b  
    450450      return *_level;
    451451    }
    452452
    453     /// \brief Sets the tolerance used by algorithm.
     453    /// \brief Sets the tolerance used by the algorithm.
    454454    ///
    455     /// Sets the tolerance used by algorithm.
     455    /// Sets the tolerance object used by the algorithm.
     456    /// \return <tt>(*this)</tt>
    456457    Circulation& tolerance(const Tolerance& tolerance) {
    457458      _tol = tolerance;
    458459      return *this;
     
    460461
    461462    /// \brief Returns a const reference to the tolerance.
    462463    ///
    463     /// Returns a const reference to the tolerance.
     464    /// Returns a const reference to the tolerance object used by
     465    /// the algorithm.
    464466    const Tolerance& tolerance() const {
    465467      return _tol;
    466468    }
  • lemon/preflow.h

    diff --git a/lemon/preflow.h b/lemon/preflow.h
    a b  
    9797  /// \e push-relabel algorithm producing a \ref max_flow
    9898  /// "flow of maximum value" in a digraph.
    9999  /// The preflow algorithms are the fastest known maximum
    100   /// flow algorithms. The current implementation use a mixture of the
     100  /// flow algorithms. The current implementation uses a mixture of the
    101101  /// \e "highest label" and the \e "bound decrease" heuristics.
    102102  /// The worst case time complexity of the algorithm is \f$O(n^2\sqrt{e})\f$.
    103103  ///
     
    371371      return *_level;
    372372    }
    373373
    374     /// \brief Sets the tolerance used by algorithm.
     374    /// \brief Sets the tolerance used by the algorithm.
    375375    ///
    376     /// Sets the tolerance used by algorithm.
     376    /// Sets the tolerance object used by the algorithm.
     377    /// \return <tt>(*this)</tt>
    377378    Preflow& tolerance(const Tolerance& tolerance) {
    378379      _tolerance = tolerance;
    379380      return *this;
     
    381382
    382383    /// \brief Returns a const reference to the tolerance.
    383384    ///
    384     /// Returns a const reference to the tolerance.
     385    /// Returns a const reference to the tolerance object used by
     386    /// the algorithm.
    385387    const Tolerance& tolerance() const {
    386388      return _tolerance;
    387389    }
  • test/circulation_test.cc

    diff --git a/test/circulation_test.cc b/test/circulation_test.cc
    a b  
    8787    .upperMap(ucap)
    8888    .supplyMap(supply)
    8989    .flowMap(flow);
     90 
     91  const CirculationType::Elevator& elev = const_circ_test.elevator();
     92  circ_test.elevator(const_cast<CirculationType::Elevator&>(elev));
     93  CirculationType::Tolerance tol = const_circ_test.tolerance();
     94  circ_test.tolerance(tol);
    9095
    9196  circ_test.init();
    9297  circ_test.greedyInit();
  • test/preflow_test.cc

    diff --git a/test/preflow_test.cc b/test/preflow_test.cc
    a b  
    9494            ::Create PreflowType;
    9595  PreflowType preflow_test(g, cap, n, n);
    9696  const PreflowType& const_preflow_test = preflow_test;
     97 
     98  const PreflowType::Elevator& elev = const_preflow_test.elevator();
     99  preflow_test.elevator(const_cast<PreflowType::Elevator&>(elev));
     100  PreflowType::Tolerance tol = const_preflow_test.tolerance();
     101  preflow_test.tolerance(tol);
    97102
    98103  preflow_test
    99104    .capacityMap(cap)