Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2008-01-14 08:55:51


Author: asutton
Date: 2008-01-14 08:55:50 EST (Mon, 14 Jan 2008)
New Revision: 42763
URL: http://svn.boost.org/trac/boost/changeset/42763

Log:
Renamed the extreme_value distribution to explicitly cite the type. This
conforms to the Boost.Math naming (temporary only) to support both min
and max variants of this distribution.

Added:
   sandbox/random/boost/random/extreme_value_i_distribution.hpp
      - copied, changed from r42757, /sandbox/random/boost/random/extreme_value_distribution.hpp
Removed:
   sandbox/random/boost/random/extreme_value_distribution.hpp
Text files modified:
   sandbox/random/boost/random/distributions.hpp | 2 +-
   sandbox/random/boost/random/extreme_value_i_distribution.hpp | 16 ++++++++--------
   2 files changed, 9 insertions(+), 9 deletions(-)

Modified: sandbox/random/boost/random/distributions.hpp
==============================================================================
--- sandbox/random/boost/random/distributions.hpp (original)
+++ sandbox/random/boost/random/distributions.hpp 2008-01-14 08:55:50 EST (Mon, 14 Jan 2008)
@@ -21,7 +21,7 @@
 #include <boost/random/fisher_f_distribution.hpp>
 #include <boost/random/students_t_distribution.hpp>
 #include <boost/random/cauchy_distribution.hpp>
-#include <boost/random/extreme_value_distribution.hpp>
+#include <boost/random/extreme_value_i_distribution.hpp>
 #include <boost/random/weibull_distribution.hpp>
 #include <boost/random/rayleigh_distribution.hpp>
 #include <boost/random/pareto_distribution.hpp>

Deleted: sandbox/random/boost/random/extreme_value_distribution.hpp
==============================================================================
--- sandbox/random/boost/random/extreme_value_distribution.hpp 2008-01-14 08:55:50 EST (Mon, 14 Jan 2008)
+++ (empty file)
@@ -1,93 +0,0 @@
-// Copyright Andrew Sutton 2007
-//
-// Use, modification and distribution are subject to the
-// Boost Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_RANDOM_EXTREME_VALUE_DISTRIBUTION_HPP
-#define BOOST_RANDOM_EXTREME_VALUE_DISTRIBUTION_HPP
-
-#include <iostream>
-#include <cmath>
-
-#include <boost/assert.hpp>
-
-namespace boost {
-
- // The Gumbel distribution is one of the extreme value (I) distributions
- // along with Weibull and Frechet. This is also known as the Fisher-Tippet
- // distribution or the log-Weibull.
- //
- // This distribution actually implements a class of several different
- // distributions. The extreme value distribution deals with the median
- // of different distributions. There are three distinct flavors of extreme
- // value distributions (I, II, and III). For type I distributions, there
- // are two cases: minimum and maximum. Generally when authors refer to the
- // type I distribution, they refer to the maximum case. The different cases
- // only differ by a factor of -1 in most cases.
- //
- // Note that the type II and III are closely related to the minimum and
- // maximum cases of the type I.
- template<class RealType = double>
- class extreme_value_distribution
- {
- public:
- typedef RealType result_type;
-
- explicit extreme_value_distribution(const result_type& mu = result_type(0),
- const result_type& beta = result_type(1),
- const result_type& sign = result_type(1))
- : m_mu(mu)
- , m_beta(beta)
- , m_sign(sign)
- {
- BOOST_ASSERT(m_beta > result_type(0));
- BOOST_ASSERT(m_sign == -1 || m_sign == 1);
- }
-
- result_type mu() const
- { return m_mu; }
-
- result_type beta() const
- { return m_beta; }
-
- result_type sign() const
- { return m_sign; }
-
- void reset()
- { }
-
- // Note that eng must provide values in the range (0, 1].
- template<class Engine>
- result_type operator()(Engine& eng)
- {
- using std::log;
- return m_mu - m_sign * m_beta * log(-log(eng()));
- }
-
-#if !defined(BOOST_NO_OPERATORS_IN_NAMESPACE) && !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
- template<class CharT, class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator <<(std::basic_ostream<CharT, Traits>& os, const extreme_value_distribution& dist)
- {
- os << dist.m_mu << " " << dist.m_beta << " " << dist.m_sign;
- return os;
- }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT,Traits>&
- operator >>(std::basic_istream<CharT,Traits>& is, extreme_value_distribution& dist)
- {
- is >> std::ws >> dist.m_mu >> std::ws >> dist.m_beta >> std::ws >> dist.m_sign;
- return is;
- }
-#endif
-
- result_type m_mu;
- result_type m_beta;
- result_type m_sign;
- };
-
-} // namespace boost
-
-#endif // BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP

Copied: sandbox/random/boost/random/extreme_value_i_distribution.hpp (from r42757, /sandbox/random/boost/random/extreme_value_distribution.hpp)
==============================================================================
--- /sandbox/random/boost/random/extreme_value_distribution.hpp (original)
+++ sandbox/random/boost/random/extreme_value_i_distribution.hpp 2008-01-14 08:55:50 EST (Mon, 14 Jan 2008)
@@ -4,8 +4,8 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_RANDOM_EXTREME_VALUE_DISTRIBUTION_HPP
-#define BOOST_RANDOM_EXTREME_VALUE_DISTRIBUTION_HPP
+#ifndef BOOST_RANDOM_EXTREME_VALUE_I_DISTRIBUTION_HPP
+#define BOOST_RANDOM_EXTREME_VALUE_I_DISTRIBUTION_HPP
 
 #include <iostream>
 #include <cmath>
@@ -29,14 +29,14 @@
     // Note that the type II and III are closely related to the minimum and
     // maximum cases of the type I.
     template<class RealType = double>
- class extreme_value_distribution
+ class extreme_value_i_distribution
     {
     public:
         typedef RealType result_type;
 
- explicit extreme_value_distribution(const result_type& mu = result_type(0),
- const result_type& beta = result_type(1),
- const result_type& sign = result_type(1))
+ explicit extreme_value_i_distribution(const result_type& mu = result_type(0),
+ const result_type& beta = result_type(1),
+ const result_type& sign = result_type(1))
             : m_mu(mu)
             , m_beta(beta)
             , m_sign(sign)
@@ -68,7 +68,7 @@
 #if !defined(BOOST_NO_OPERATORS_IN_NAMESPACE) && !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
         template<class CharT, class Traits>
         friend std::basic_ostream<CharT, Traits>&
- operator <<(std::basic_ostream<CharT, Traits>& os, const extreme_value_distribution& dist)
+ operator <<(std::basic_ostream<CharT, Traits>& os, const extreme_value_i_distribution& dist)
         {
             os << dist.m_mu << " " << dist.m_beta << " " << dist.m_sign;
             return os;
@@ -76,7 +76,7 @@
 
         template<class CharT, class Traits>
         friend std::basic_istream<CharT,Traits>&
- operator >>(std::basic_istream<CharT,Traits>& is, extreme_value_distribution& dist)
+ operator >>(std::basic_istream<CharT,Traits>& is, extreme_value_i_distribution& dist)
         {
             is >> std::ws >> dist.m_mu >> std::ws >> dist.m_beta >> std::ws >> dist.m_sign;
             return is;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk