Commit f90e424e authored by Manuel Günther's avatar Manuel Günther
Browse files

Moved dependent boost functions to bob::core namespace

parent 9f046bdf
......@@ -306,7 +306,7 @@ public:
/** Writes the parameters to a @c std::ostream. */
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm)
{
boost::random::detail::print_vector(os, parm._probabilities);
bob::core::random::detail::print_vector(os, parm._probabilities);
return os;
}
......@@ -314,7 +314,7 @@ public:
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm)
{
std::vector<WeightType> temp;
boost::random::detail::read_vector(is, temp);
bob::core::random::detail::read_vector(is, temp);
if(is) {
parm._probabilities.swap(temp);
}
......
......@@ -14,8 +14,8 @@
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#define BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#ifndef BOB_BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#define BOB_BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <iosfwd>
......@@ -27,7 +27,8 @@
#include <bob.core/boost/operators.hpp>
namespace boost {
namespace bob {
namespace core {
namespace random {
/**
......@@ -131,7 +132,7 @@ public:
{
using std::log;
return -result_type(1) /
_lambda * log(result_type(1)-uniform_01<RealType>()(eng));
_lambda * log(result_type(1)-boost::uniform_01<RealType>()(eng));
}
/**
......@@ -175,10 +176,6 @@ private:
result_type _lambda;
};
} // namespace random
} } } // namespaces
using random::exponential_distribution;
} // namespace boost
#endif // BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#endif // BOB_BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
......@@ -11,14 +11,15 @@
*
*/
#ifndef BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP
#define BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP
#ifndef BOB_BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP
#define BOB_BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/pending/integer_log2.hpp>
namespace boost {
namespace bob {
namespace core {
namespace random {
namespace detail {
......@@ -79,6 +80,7 @@ BOOST_RANDOM_DETAIL_CONSTEXPR int integer_log2(T t)
} // namespace detail
} // namespace random
} // namespace boost
} // namespace core
} // namespace bob
#endif // BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP
#endif // BOB_BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP
......@@ -151,7 +151,7 @@ std::pair<RealType, int> generate_int_float_pair(Engine& eng, boost::mpl::true_)
std::size_t m =
(range == (std::numeric_limits<base_unsigned>::max)()) ?
std::numeric_limits<base_unsigned>::digits :
boost::random::detail::integer_log2(range + 1);
bob::core::random::detail::integer_log2(range + 1);
int bucket = 0;
// process as many full digits as possible into the int part
......@@ -230,13 +230,11 @@ struct unit_normal_distribution
}
template<class Engine>
RealType generate_tail(Engine& eng) {
boost::exponential_distribution<RealType> exponential;
bob::core::random::exponential_distribution<RealType> exponential;
const RealType tail_start = RealType(normal_table<double>::table_x[1]);
std::cout << "Enter" << std::endl;
for(;;) {
RealType x = exponential(eng)/tail_start;
RealType y = exponential(eng);
std::cout << "x = " << x << "; y = " << y << std::endl;
if(2*y > x*x) return x + tail_start;
}
}
......
......@@ -10,8 +10,8 @@
* $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_OPERATORS_HPP
#define BOOST_RANDOM_DETAIL_OPERATORS_HPP
#ifndef BOB_BOOST_RANDOM_DETAIL_OPERATORS_HPP
#define BOB_BOOST_RANDOM_DETAIL_OPERATORS_HPP
#include <boost/random/detail/config.hpp>
#include <boost/detail/workaround.hpp>
......@@ -84,7 +84,8 @@
// from vector_io.hpp
namespace boost {
namespace bob {
namespace core {
namespace random {
namespace detail {
......@@ -135,8 +136,6 @@ void read_vector(std::basic_istream<CharT, Traits>& is, std::vector<T>& vec)
}
}
}
}
}
} } } } // namespaces
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment