Projects
Eulaceura:Factory
metslib
_service:obs_scm:metslib-0.5.3-boost.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:metslib-0.5.3-boost.patch of Package metslib
diff -up ./metslib/mets.hh.boost ./metslib/mets.hh --- ./metslib/mets.hh.boost 2011-05-05 08:38:51.000000000 -0400 +++ ./metslib/mets.hh 2016-02-01 19:52:22.848282043 -0500 @@ -106,7 +106,15 @@ #include <iostream> #include <stdexcept> #include <algorithm> -#if defined (METSLIB_HAVE_UNORDERED_MAP) + +#if defined (METSLIB_TR1_BOOST) +# include <boost/random/uniform_int.hpp> +# include <boost/random/uniform_real.hpp> +# include <boost/random/variate_generator.hpp> +# include <boost/random/mersenne_twister.hpp> +# include <boost/random/linear_congruential.hpp> +# include <boost/unordered_map.hpp> +#elif defined (METSLIB_HAVE_UNORDERED_MAP) # include <unordered_map> # include <random> #elif defined (METSLIB_HAVE_TR1_UNORDERED_MAP) diff -up ./metslib/metslib_config.hh.boost ./metslib/metslib_config.hh --- ./metslib/metslib_config.hh.boost 2011-05-05 08:38:51.000000000 -0400 +++ ./metslib/metslib_config.hh 2016-02-01 19:48:09.724145145 -0500 @@ -16,4 +16,5 @@ # define METSLIB_HAVE_TR1_UNORDERED_MAP 1 # endif #endif +#define METSLIB_TR1_BOOST 1 #endif diff -up ./metslib/model.hh.boost ./metslib/model.hh --- ./metslib/model.hh.boost 2011-05-05 08:38:51.000000000 -0400 +++ ./metslib/model.hh 2016-02-01 19:46:24.481900865 -0500 @@ -244,7 +244,11 @@ namespace mets { template<typename random_generator> void random_shuffle(permutation_problem& p, random_generator& rng) { -#if defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) +#if defined (METSLIB_TR1_BOOST) + boost::uniform_int<size_t> unigen; + boost::variate_generator<random_generator&, + boost::uniform_int<size_t> >gen(rng, unigen); +#elif defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) std::uniform_int<size_t> unigen; std::variate_generator<random_generator&, std::uniform_int<size_t> >gen(rng, unigen); @@ -263,7 +267,9 @@ namespace mets { template<typename random_generator> void perturbate(permutation_problem& p, unsigned int n, random_generator& rng) { -#if defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) +#if defined (METSLIB_TR1_BOOST) + boost::uniform_int<> int_range; +#elif defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) std::uniform_int<> int_range; #else std::tr1::uniform_int<> int_range; @@ -527,7 +533,9 @@ namespace mets { /// @brief Generates a stochastic subset of the neighborhood. -#if defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) +#if defined (METSLIB_TR1_BOOST) + template<typename random_generator = boost::minstd_rand0> +#elif defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) template<typename random_generator = std::minstd_rand0> #else template<typename random_generator = std::tr1::minstd_rand0> @@ -555,7 +563,10 @@ namespace mets { protected: random_generator& rng; -#if defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) + +#if defined (METSLIB_TR1_BOOST) + boost::uniform_int<> int_range; +#elif defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) std::uniform_int<> int_range; #else std::tr1::uniform_int<> int_range; diff -up ./metslib/simulated-annealing.hh.boost ./metslib/simulated-annealing.hh --- ./metslib/simulated-annealing.hh.boost 2011-05-05 08:38:51.000000000 -0400 +++ ./metslib/simulated-annealing.hh 2016-02-01 19:46:24.481900865 -0500 @@ -133,7 +133,11 @@ namespace mets { double stop_temp_m; double current_temp_m; double K_m; -#if defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) +#if defined (METSLIB_TR1_BOOST) + boost::uniform_real<double> ureal; + boost::mt19937 rng; + boost::variate_generator< boost::mt19937, boost::uniform_real<double> > gen; +#elif defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) std::uniform_real<double> ureal; std::mt19937 rng; std::variate_generator< std::mt19937, std::uniform_real<double> > gen; diff -up ./metslib/tabu-search.hh.boost ./metslib/tabu-search.hh --- ./metslib/tabu-search.hh.boost 2011-05-05 08:38:51.000000000 -0400 +++ ./metslib/tabu-search.hh 2016-02-01 19:46:24.482900905 -0500 @@ -314,7 +314,13 @@ namespace mets { protected: typedef std::deque<move*> move_list_type; -#if defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) +#if defined (METSLIB_TR1_BOOST) + typedef boost::unordered_map< + mana_move*, // Key type + int, //insert a move and the number of times it's present in the list + mana_move_hash, + dereferenced_equal_to<mana_move*> > move_map_type; +#elif defined (METSLIB_HAVE_UNORDERED_MAP) && !defined (METSLIB_TR1_MIXED_NAMESPACE) typedef std::unordered_map< mana_move*, // Key type int, //insert a move and the number of times it's present in the list
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2