COIN-OR::LEMON - Graph Library

Ticket #179: 179-12-tolerance-5d1795170bb6.patch

File 179-12-tolerance-5d1795170bb6.patch, 3.1 KB (added by Peter Kovacs, 15 years ago)
  • lemon/hartmann_orlin.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1250582908 -7200
    # Node ID 5d1795170bb6df49b84e652c71faf8de581be862
    # Parent  631e955e3b94f427e940f8271a5e844ecbcc0b24
    Add tolerance() functions for MMC classes (#179)
    
    diff --git a/lemon/hartmann_orlin.h b/lemon/hartmann_orlin.h
    a b  
    282282      return *this;
    283283    }
    284284
     285    /// \brief Set the tolerance used by the algorithm.
     286    ///
     287    /// This function sets the tolerance object used by the algorithm.
     288    ///
     289    /// \return <tt>(*this)</tt>
     290    HartmannOrlin& tolerance(const Tolerance& tolerance) {
     291      _tolerance = tolerance;
     292      return *this;
     293    }
     294
     295    /// \brief Return a const reference to the tolerance.
     296    ///
     297    /// This function returns a const reference to the tolerance object
     298    /// used by the algorithm.
     299    const Tolerance& tolerance() const {
     300      return _tolerance;
     301    }
     302
    285303    /// \name Execution control
    286304    /// The simplest way to execute the algorithm is to call the \ref run()
    287305    /// function.\n
  • lemon/howard.h

    diff --git a/lemon/howard.h b/lemon/howard.h
    a b  
    273273      return *this;
    274274    }
    275275
     276    /// \brief Set the tolerance used by the algorithm.
     277    ///
     278    /// This function sets the tolerance object used by the algorithm.
     279    ///
     280    /// \return <tt>(*this)</tt>
     281    Howard& tolerance(const Tolerance& tolerance) {
     282      _tolerance = tolerance;
     283      return *this;
     284    }
     285
     286    /// \brief Return a const reference to the tolerance.
     287    ///
     288    /// This function returns a const reference to the tolerance object
     289    /// used by the algorithm.
     290    const Tolerance& tolerance() const {
     291      return _tolerance;
     292    }
     293
    276294    /// \name Execution control
    277295    /// The simplest way to execute the algorithm is to call the \ref run()
    278296    /// function.\n
  • lemon/karp.h

    diff --git a/lemon/karp.h b/lemon/karp.h
    a b  
    278278      return *this;
    279279    }
    280280
     281    /// \brief Set the tolerance used by the algorithm.
     282    ///
     283    /// This function sets the tolerance object used by the algorithm.
     284    ///
     285    /// \return <tt>(*this)</tt>
     286    Karp& tolerance(const Tolerance& tolerance) {
     287      _tolerance = tolerance;
     288      return *this;
     289    }
     290
     291    /// \brief Return a const reference to the tolerance.
     292    ///
     293    /// This function returns a const reference to the tolerance object
     294    /// used by the algorithm.
     295    const Tolerance& tolerance() const {
     296      return _tolerance;
     297    }
     298
    281299    /// \name Execution control
    282300    /// The simplest way to execute the algorithm is to call the \ref run()
    283301    /// function.\n
  • test/min_mean_cycle_test.cc

    diff --git a/test/min_mean_cycle_test.cc b/test/min_mean_cycle_test.cc
    a b  
    7878      MmcAlg mmc(me.g, me.length);
    7979      const MmcAlg& const_mmc = mmc;
    8080     
     81      typename MmcAlg::Tolerance tol = const_mmc.tolerance();
     82      mmc.tolerance(tol);
     83     
    8184      b = mmc.cycle(p).run();
    8285      b = mmc.findMinMean();
    8386      b = mmc.findCycle();