Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,50 @@
#ifndef BOOST_MPL_REVERSE_FOLD_HPP_INCLUDED
#define BOOST_MPL_REVERSE_FOLD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
// Copyright David Abrahams 2001-2002
//
// Distributed under 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)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/O1_size.hpp>
#include <boost/mpl/arg.hpp>
#include <boost/mpl/aux_/reverse_fold_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(State)
, typename BOOST_MPL_AUX_NA_PARAM(BackwardOp)
, typename ForwardOp = arg<1>
>
struct reverse_fold
{
typedef typename aux::reverse_fold_impl<
::boost::mpl::O1_size<Sequence>::value
, typename begin<Sequence>::type
, typename end<Sequence>::type
, State
, BackwardOp
, ForwardOp
>::state type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,reverse_fold,(Sequence,State,BackwardOp))
};
BOOST_MPL_AUX_NA_SPEC(3, reverse_fold)
}}
#endif // BOOST_MPL_REVERSE_FOLD_HPP_INCLUDED
@@ -0,0 +1,79 @@
/*
[auto_generated]
boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp
[begin_description]
Enable the factory functions for the controller and the dense output of the Rosenbrock4 method.
[end_description]
Copyright 2011-2012 Karsten Ahnert
Copyright 2011-2012 Mario Mulansky
Distributed under 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_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED
#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp>
namespace boost {
namespace numeric {
namespace odeint {
template< class Value , class Coefficients , class Resize >
struct get_controller< rosenbrock4< Value , Coefficients , Resize > >
{
typedef rosenbrock4< Value , Coefficients , Resize > stepper_type;
typedef rosenbrock4_controller< stepper_type > type;
};
template< class Value , class Coefficients , class Resize >
struct get_dense_output< rosenbrock4< Value , Coefficients , Resize > >
{
typedef rosenbrock4< Value , Coefficients , Resize > stepper_type;
typedef rosenbrock4_controller< stepper_type > controller_type;
typedef rosenbrock4_dense_output< controller_type > type;
};
// controller factory for controlled_runge_kutta
template< class Stepper >
struct dense_output_factory< Stepper , rosenbrock4_dense_output< rosenbrock4_controller< Stepper > > >
{
typedef Stepper stepper_type;
typedef rosenbrock4_controller< stepper_type > controller_type;
typedef typename stepper_type::value_type value_type;
typedef typename stepper_type::time_type time_type;
typedef rosenbrock4_dense_output< controller_type > dense_output_type;
dense_output_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper )
{
return dense_output_type( controller_type( abs_error , rel_error , stepper ) );
}
dense_output_type operator()( value_type abs_error , value_type rel_error ,
time_type max_dt, const stepper_type &stepper )
{
return dense_output_type( controller_type( abs_error , rel_error , max_dt , stepper ) );
}
};
} // odeint
} // numeric
} // boost
#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED
@@ -0,0 +1,10 @@
snr psuccess ntrials 10, r6321, r6333
-26.0 0.0
-25.5 0.007
-25.0 0.039
-24.5 0.157 0.14
-24.0 0.362
-23.5 0.701 0.681
-23.0 0.914
-22.5 0.985 0.988
-22.0 1.0 1.0
@@ -0,0 +1,19 @@
#ifndef BOOST_MPL_BEGIN_HPP_INCLUDED
#define BOOST_MPL_BEGIN_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under 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)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/begin_end.hpp>
#endif // BOOST_MPL_BEGIN_HPP_INCLUDED
@@ -0,0 +1,5 @@
image::colors.png[align="center",alt="Colors Screen"]
_WSJT-X_ uses colors to highlight decoded messages containing
information of particular interest. Click on one of the buttons to
select your preferred colors for any message category.
@@ -0,0 +1,419 @@
// (C) Copyright Gennadiy Rozental 2001.
// Distributed under 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)
// See http://www.boost.org/libs/test for the library home page.
//
//!@file
//!@brief Collection comparison with enhanced reporting
// ***************************************************************************
#ifndef BOOST_TEST_TOOLS_COLLECTION_COMPARISON_OP_HPP_050815GER
#define BOOST_TEST_TOOLS_COLLECTION_COMPARISON_OP_HPP_050815GER
// Boost.Test
#include <boost/test/tools/assertion.hpp>
#include <boost/test/utils/is_forward_iterable.hpp>
#include <boost/test/utils/is_cstring.hpp>
// Boost
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
//____________________________________________________________________________//
namespace boost {
namespace test_tools {
namespace assertion {
// ************************************************************************** //
// ************* selectors for specialized comparizon routines ************** //
// ************************************************************************** //
template<typename T>
struct specialized_compare : public mpl::false_ {};
#define BOOST_TEST_SPECIALIZED_COLLECTION_COMPARE(Col) \
namespace boost { namespace test_tools { namespace assertion { \
template<> \
struct specialized_compare<Col> : public mpl::true_ {}; \
}}} \
/**/
// ************************************************************************** //
// ************** lexicographic_compare ************** //
// ************************************************************************** //
namespace op {
template <typename OP, bool can_be_equal, bool prefer_shorter,
typename Lhs, typename Rhs>
inline
typename boost::enable_if_c<
unit_test::is_forward_iterable<Lhs>::value && unit_test::is_forward_iterable<Rhs>::value,
assertion_result>::type
lexicographic_compare( Lhs const& lhs, Rhs const& rhs )
{
assertion_result ar( true );
typename Lhs::const_iterator first1 = lhs.begin();
typename Rhs::const_iterator first2 = rhs.begin();
typename Lhs::const_iterator last1 = lhs.end();
typename Rhs::const_iterator last2 = rhs.end();
std::size_t pos = 0;
for( ; (first1 != last1) && (first2 != last2); ++first1, ++first2, ++pos ) {
assertion_result const& element_ar = OP::eval(*first1, *first2);
if( !can_be_equal && element_ar )
return ar; // a < b
assertion_result const& reverse_ar = OP::eval(*first2, *first1);
if( element_ar && !reverse_ar )
return ar; // a<=b and !(b<=a) => a < b => return true
if( element_ar || !reverse_ar )
continue; // (a<=b and b<=a) or (!(a<b) and !(b<a)) => a == b => keep looking
// !(a<=b) and b<=a => b < a => return false
ar = false;
ar.message() << "\nFailure at position " << pos << ": "
<< tt_detail::print_helper(*first1)
<< OP::revert()
<< tt_detail::print_helper(*first2)
<< ". " << element_ar.message();
return ar;
}
if( first1 != last1 ) {
if( prefer_shorter ) {
ar = false;
ar.message() << "\nFirst collection has extra trailing elements.";
}
}
else if( first2 != last2 ) {
if( !prefer_shorter ) {
ar = false;
ar.message() << "\nSecond collection has extra trailing elements.";
}
}
else if( !can_be_equal ) {
ar = false;
ar.message() << "\nCollections appear to be equal.";
}
return ar;
}
template <typename OP, bool can_be_equal, bool prefer_shorter,
typename Lhs, typename Rhs>
inline
typename boost::enable_if_c<
(!unit_test::is_forward_iterable<Lhs>::value && unit_test::is_cstring<Lhs>::value) ||
(!unit_test::is_forward_iterable<Rhs>::value && unit_test::is_cstring<Rhs>::value),
assertion_result>::type
lexicographic_compare( Lhs const& lhs, Rhs const& rhs )
{
typedef typename unit_test::deduce_cstring<Lhs>::type lhs_char_type;
typedef typename unit_test::deduce_cstring<Rhs>::type rhs_char_type;
return lexicographic_compare<OP, can_be_equal, prefer_shorter>(
boost::unit_test::basic_cstring<lhs_char_type>(lhs),
boost::unit_test::basic_cstring<rhs_char_type>(rhs));
}
//____________________________________________________________________________//
// ************************************************************************** //
// ************** equality_compare ************** //
// ************************************************************************** //
template <typename OP, typename Lhs, typename Rhs>
inline
typename boost::enable_if_c<
unit_test::is_forward_iterable<Lhs>::value && unit_test::is_forward_iterable<Rhs>::value,
assertion_result>::type
element_compare( Lhs const& lhs, Rhs const& rhs )
{
assertion_result ar( true );
if( lhs.size() != rhs.size() ) {
ar = false;
ar.message() << "\nCollections size mismatch: " << lhs.size() << " != " << rhs.size();
return ar;
}
typename Lhs::const_iterator left = lhs.begin();
typename Rhs::const_iterator right = rhs.begin();
std::size_t pos = 0;
for( ; pos < lhs.size(); ++left, ++right, ++pos ) {
assertion_result const element_ar = OP::eval( *left, *right );
if( element_ar )
continue;
ar = false;
ar.message() << "\nMismatch at position " << pos << ": "
<< tt_detail::print_helper(*left)
<< OP::revert()
<< tt_detail::print_helper(*right)
<< ". " << element_ar.message();
}
return ar;
}
// In case string comparison is branching here
template <typename OP, typename Lhs, typename Rhs>
inline
typename boost::enable_if_c<
(!unit_test::is_forward_iterable<Lhs>::value && unit_test::is_cstring<Lhs>::value) ||
(!unit_test::is_forward_iterable<Rhs>::value && unit_test::is_cstring<Rhs>::value),
assertion_result>::type
element_compare( Lhs const& lhs, Rhs const& rhs )
{
typedef typename unit_test::deduce_cstring<Lhs>::type lhs_char_type;
typedef typename unit_test::deduce_cstring<Rhs>::type rhs_char_type;
return element_compare<OP>(boost::unit_test::basic_cstring<lhs_char_type>(lhs),
boost::unit_test::basic_cstring<rhs_char_type>(rhs));
}
//____________________________________________________________________________//
// ************************************************************************** //
// ************** non_equality_compare ************** //
// ************************************************************************** //
template <typename OP, typename Lhs, typename Rhs>
inline assertion_result
non_equality_compare( Lhs const& lhs, Rhs const& rhs )
{
assertion_result ar( true );
if( lhs.size() != rhs.size() )
return ar;
typename Lhs::const_iterator left = lhs.begin();
typename Rhs::const_iterator right = rhs.begin();
typename Lhs::const_iterator end = lhs.end();
for( ; left != end; ++left, ++right ) {
if( OP::eval( *left, *right ) )
return ar;
}
ar = false;
ar.message() << "\nCollections appear to be equal";
return ar;
}
//____________________________________________________________________________//
// ************************************************************************** //
// ************** cctraits ************** //
// ************************************************************************** //
// set of collection comparison traits per comparison OP
template<typename OP>
struct cctraits;
template<typename Lhs, typename Rhs>
struct cctraits<op::EQ<Lhs, Rhs> > {
typedef specialized_compare<Lhs> is_specialized;
};
template<typename Lhs, typename Rhs>
struct cctraits<op::NE<Lhs, Rhs> > {
typedef specialized_compare<Lhs> is_specialized;
};
template<typename Lhs, typename Rhs>
struct cctraits<op::LT<Lhs, Rhs> > {
static const bool can_be_equal = false;
static const bool prefer_short = true;
typedef specialized_compare<Lhs> is_specialized;
};
template<typename Lhs, typename Rhs>
struct cctraits<op::LE<Lhs, Rhs> > {
static const bool can_be_equal = true;
static const bool prefer_short = true;
typedef specialized_compare<Lhs> is_specialized;
};
template<typename Lhs, typename Rhs>
struct cctraits<op::GT<Lhs, Rhs> > {
static const bool can_be_equal = false;
static const bool prefer_short = false;
typedef specialized_compare<Lhs> is_specialized;
};
template<typename Lhs, typename Rhs>
struct cctraits<op::GE<Lhs, Rhs> > {
static const bool can_be_equal = true;
static const bool prefer_short = false;
typedef specialized_compare<Lhs> is_specialized;
};
// ************************************************************************** //
// ************** compare_collections ************** //
// ************************************************************************** //
// Overloaded set of functions dispatching to specific implementation of comparison
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::EQ<L, R> >*, mpl::true_ )
{
return assertion::op::element_compare<op::EQ<L, R> >( lhs, rhs );
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::EQ<L, R> >*, mpl::false_ )
{
return lhs == rhs;
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::NE<L, R> >*, mpl::true_ )
{
return assertion::op::non_equality_compare<op::NE<L, R> >( lhs, rhs );
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::NE<L, R> >*, mpl::false_ )
{
return lhs != rhs;
}
//____________________________________________________________________________//
template <typename OP, typename Lhs, typename Rhs>
inline assertion_result
lexicographic_compare( Lhs const& lhs, Rhs const& rhs )
{
return assertion::op::lexicographic_compare<OP, cctraits<OP>::can_be_equal, cctraits<OP>::prefer_short>( lhs, rhs );
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename OP>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<OP>*, mpl::true_ )
{
return lexicographic_compare<OP>( lhs, rhs );
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::LT<L, R> >*, mpl::false_ )
{
return lhs < rhs;
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::LE<L, R> >*, mpl::false_ )
{
return lhs <= rhs;
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::GT<L, R> >*, mpl::false_ )
{
return lhs > rhs;
}
//____________________________________________________________________________//
template <typename Lhs, typename Rhs, typename L, typename R>
inline assertion_result
compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type<op::GE<L, R> >*, mpl::false_ )
{
return lhs >= rhs;
}
//____________________________________________________________________________//
// ************************************************************************** //
// ********* specialization of comparison operators for collections ********* //
// ************************************************************************** //
#define DEFINE_COLLECTION_COMPARISON( oper, name, rev ) \
template<typename Lhs,typename Rhs> \
struct name<Lhs,Rhs,typename boost::enable_if_c< \
unit_test::is_forward_iterable<Lhs>::value \
&& !unit_test::is_cstring<Lhs>::value \
&& unit_test::is_forward_iterable<Rhs>::value \
&& !unit_test::is_cstring<Rhs>::value>::type> { \
public: \
typedef assertion_result result_type; \
\
typedef name<Lhs, Rhs> OP; \
typedef typename \
mpl::if_c<is_same<typename decay<Lhs>::type, \
typename decay<Rhs>::type>::value, \
typename cctraits<OP>::is_specialized, \
mpl::false_>::type is_specialized; \
\
typedef name<typename Lhs::value_type, \
typename Rhs::value_type> elem_op; \
\
static assertion_result \
eval( Lhs const& lhs, Rhs const& rhs) \
{ \
return assertion::op::compare_collections( lhs, rhs, \
(boost::type<elem_op>*)0, \
is_specialized() ); \
} \
\
template<typename PrevExprType> \
static void \
report( std::ostream&, \
PrevExprType const&, \
Rhs const& ) {} \
\
static char const* revert() \
{ return " " #rev " "; } \
\
}; \
/**/
BOOST_TEST_FOR_EACH_COMP_OP( DEFINE_COLLECTION_COMPARISON )
#undef DEFINE_COLLECTION_COMPARISON
//____________________________________________________________________________//
} // namespace op
} // namespace assertion
} // namespace test_tools
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_TOOLS_COLLECTION_COMPARISON_OP_HPP_050815GER
@@ -0,0 +1,107 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under 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)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19> >
{
struct category : forward_traversal_tag, associative_tag {};
typedef set_tag fusion_tag;
typedef fusion_sequence_tag tag;
typedef mpl::false_ is_view;
typedef vector<
T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19>
storage_type;
typedef typename storage_type::size size;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set()
: data() {}
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
set(typename detail::call_param<T0 >::type arg0)
: data(arg0) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1)
: data(arg0 , arg1) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2)
: data(arg0 , arg1 , arg2) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3)
: data(arg0 , arg1 , arg2 , arg3) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4)
: data(arg0 , arg1 , arg2 , arg3 , arg4) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19) {}
template <typename T>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set&
operator=(T const& rhs)
{
data = rhs;
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type& get_data() { return data; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type const& get_data() const { return data; }
private:
storage_type data;
};
}}
@@ -0,0 +1,48 @@
/* Boost interval/detail/bugs.hpp file
*
* Copyright 2000 Jens Maurer
* Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion
*
* Distributed under 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_NUMERIC_INTERVAL_DETAIL_BUGS
#define BOOST_NUMERIC_INTERVAL_DETAIL_BUGS
#include <boost/config.hpp>
#if defined(__GLIBC__) && (defined(__USE_MISC) || defined(__USE_XOPEN_EXTENDED) || defined(__USE_ISOC99)) && !defined(__ICC)
# define BOOST_HAS_INV_HYPERBOLIC
#endif
#ifdef BOOST_NO_STDC_NAMESPACE
# define BOOST_NUMERIC_INTERVAL_using_math(a) using ::a
# ifdef BOOST_HAS_INV_HYPERBOLIC
# define BOOST_NUMERIC_INTERVAL_using_ahyp(a) using ::a
# endif
#else
# define BOOST_NUMERIC_INTERVAL_using_math(a) using std::a
# if defined(BOOST_HAS_INV_HYPERBOLIC)
# if defined(__GLIBCPP__) || defined(__GLIBCXX__)
# define BOOST_NUMERIC_INTERVAL_using_ahyp(a) using ::a
# else
# define BOOST_NUMERIC_INTERVAL_using_ahyp(a) using std::a
# endif
# endif
#endif
#if defined(__COMO__) || defined(BOOST_INTEL)
# define BOOST_NUMERIC_INTERVAL_using_max(a) using std::a
#elif defined(BOOST_NO_STDC_NAMESPACE)
# define BOOST_NUMERIC_INTERVAL_using_max(a) using ::a
#else
# define BOOST_NUMERIC_INTERVAL_using_max(a) using std::a
#endif
#ifndef BOOST_NUMERIC_INTERVAL_using_ahyp
# define BOOST_NUMERIC_INTERVAL_using_ahyp(a)
#endif
#endif // BOOST_NUMERIC_INTERVAL_DETAIL_BUGS
@@ -0,0 +1,43 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_TRANSFORM_VIEW_ITERATOR_20070127_0957)
#define BOOST_FUSION_TRANSFORM_VIEW_ITERATOR_20070127_0957
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
namespace boost { namespace fusion {
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template<typename Tag>
struct equal_to_impl;
template<>
struct equal_to_impl<transform_view_iterator_tag>
{
template<typename It1, typename It2>
struct apply
: result_of::equal_to<typename It1::first_type, typename It2::first_type>
{};
};
template<>
struct equal_to_impl<transform_view_iterator2_tag>
{
template<typename It1, typename It2>
struct apply
: result_of::equal_to<typename It1::first1_type, typename It2::first1_type>
{};
};
}
}}
#endif
@@ -0,0 +1,114 @@
// Copyright David Abrahams 2002.
// Distributed under 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 DEF_DWA200292_HPP
# define DEF_DWA200292_HPP
# include <boost/python/detail/prefix.hpp>
# include <boost/python/object_fwd.hpp>
# include <boost/python/make_function.hpp>
# include <boost/python/detail/def_helper.hpp>
# include <boost/python/detail/overloads_fwd.hpp>
# include <boost/python/scope.hpp>
# include <boost/python/signature.hpp>
# include <boost/python/detail/scope.hpp>
namespace boost { namespace python {
namespace detail
{
namespace error
{
// Compile-time error messages
template <bool> struct multiple_functions_passed_to_def;
template <> struct multiple_functions_passed_to_def<false> { typedef char type; };
}
//
// def_from_helper --
//
// Use a def_helper to define a regular wrapped function in the current scope.
template <class F, class Helper>
void def_from_helper(
char const* name, F const& fn, Helper const& helper)
{
// Must not try to use default implementations except with method definitions.
typedef typename error::multiple_functions_passed_to_def<
Helper::has_default_implementation
>::type assertion BOOST_ATTRIBUTE_UNUSED;
detail::scope_setattr_doc(
name, boost::python::make_function(
fn
, helper.policies()
, helper.keywords())
, helper.doc()
);
}
//
// These two overloads discriminate between def() as applied to
// regular functions and def() as applied to the result of
// BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to
// discriminate.
//
template <class Fn, class A1>
void
def_maybe_overloads(
char const* name
, Fn fn
, A1 const& a1
, ...)
{
detail::def_from_helper(name, fn, def_helper<A1>(a1));
}
template <class StubsT, class SigT>
void def_maybe_overloads(
char const* name
, SigT sig
, StubsT const& stubs
, detail::overloads_base const*)
{
scope current;
detail::define_with_defaults(
name, stubs, current, detail::get_signature(sig));
}
template <class T>
object make_function1(T fn, ...) { return make_function(fn); }
inline
object make_function1(object const& x, object const*) { return x; }
}
template <class Fn>
void def(char const* name, Fn fn)
{
detail::scope_setattr_doc(name, detail::make_function1(fn, &fn), 0);
}
template <class Arg1T, class Arg2T>
void def(char const* name, Arg1T arg1, Arg2T const& arg2)
{
detail::def_maybe_overloads(name, arg1, arg2, &arg2);
}
template <class F, class A1, class A2>
void def(char const* name, F f, A1 const& a1, A2 const& a2)
{
detail::def_from_helper(name, f, detail::def_helper<A1,A2>(a1,a2));
}
template <class F, class A1, class A2, class A3>
void def(char const* name, F f, A1 const& a1, A2 const& a2, A3 const& a3)
{
detail::def_from_helper(name, f, detail::def_helper<A1,A2,A3>(a1,a2,a3));
}
}} // namespace boost::python
#endif // DEF_DWA200292_HPP
@@ -0,0 +1,69 @@
// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
// Use, modification, and distribution is 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)
// See library home page at http://www.boost.org/libs/numeric/conversion
//
// Contact the author at: fernando_cacciola@hotmail.com
//
#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
#define BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
#include "boost/type_traits/is_arithmetic.hpp"
#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
#include "boost/mpl/integral_c.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'UdtMixture'
typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
// Metafunction:
//
// for_udt_mixture<UdtMixture,BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt>::type
//
// {UdtMixture} is one of the Integral Constants for UdMixture, declared above.
// {BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt} are aribtrary types. (not metafunctions)
//
// According to the value of 'UdtMixture', selects the corresponding type.
//
template<class UdtMixture, class BuiltIn2BuiltIn, class BuiltIn2Udt, class Udt2BuiltIn, class Udt2Udt>
struct for_udt_builtin_mixture
{
typedef typename
ct_switch4<UdtMixture
, builtin2builtin_c, builtin2udt_c, udt2builtin_c // default
, BuiltIn2BuiltIn , BuiltIn2Udt , Udt2BuiltIn , Udt2Udt
>::type
type ;
} ;
// Metafunction:
//
// get_udt_mixture<T,S>::type
//
// Selects the appropriate UdtMixture Integral Constant for the combination T,S.
//
template<class T,class S>
struct get_udt_builtin_mixture
{
typedef is_arithmetic<S> S_builtin ;
typedef is_arithmetic<T> T_builtin ;
typedef typename
for_both<S_builtin, T_builtin, builtin2builtin_c, builtin2udt_c, udt2builtin_c, udt2udt_c>::type
type ;
} ;
} } } // namespace boost::numeric::convdetail
#endif
@@ -0,0 +1,51 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under 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
//
// See http://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//
#ifndef BOOST_COMPUTE_FUNCTIONAL_AS_HPP
#define BOOST_COMPUTE_FUNCTIONAL_AS_HPP
namespace boost {
namespace compute {
namespace detail {
template<class T, class Arg>
struct invoked_as
{
invoked_as(const Arg &arg)
: m_arg(arg)
{
}
Arg m_arg;
};
} // end detail namespace
/// The \ref as function converts its argument to type \c T (similar to
/// reinterpret_cast<T>).
///
/// \see \ref convert "convert<T>"
template<class T>
struct as
{
typedef T result_type;
/// \internal_
template<class Arg>
detail::invoked_as<T, Arg> operator()(const Arg &arg) const
{
return detail::invoked_as<T, Arg>(arg);
}
};
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_FUNCTIONAL_AS_HPP
Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

@@ -0,0 +1,84 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Distributed under 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)
==============================================================================*/
#if !defined(FUSION_DISTANCE_IMPL_20060124_2033)
#define FUSION_DISTANCE_IMPL_20060124_2033
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/algorithm/query/find_if.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace fusion {
struct zip_view_iterator_tag;
struct random_access_iterator_tag;
namespace detail
{
template<typename FoundIt, typename SearchIt>
struct best_distance
{
typedef typename result_of::find_if<
typename SearchIt::iterators, is_same<traits::category_of<mpl::_>, random_access_iterator_tag> > finder;
BOOST_MPL_ASSERT_NOT((is_same<typename finder::type, result_of::end<typename SearchIt::iterators> >));
typedef typename result_of::distance<FoundIt, typename finder::type>::type type;
};
template<typename It1, typename It2>
struct default_distance
: result_of::distance<
typename result_of::value_at_c<typename It1::iterators, 0>::type,
typename result_of::value_at_c<typename It2::iterators, 0>::type>
{};
template<typename It1, typename It2>
struct zip_view_iterator_distance
{
typedef typename result_of::find_if<
typename It1::iterators, is_same<traits::category_of<mpl::_>, random_access_iterator_tag> > finder;
typedef typename mpl::eval_if<
is_same<typename finder::type, typename result_of::end<typename It1::iterators>::type>,
detail::default_distance<It1, It2> ,
detail::best_distance<typename finder::type, It2> >::type type;
};
}
namespace extension
{
template<typename Tag>
struct distance_impl;
template<>
struct distance_impl<zip_view_iterator_tag>
{
template<typename It1, typename It2>
struct apply
: detail::zip_view_iterator_distance<It1, It2>::type
{
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename detail::zip_view_iterator_distance<It1, It2>::type
call(It1 const& /*it1*/, It2 const& /*it2*/)
{
return typename detail::zip_view_iterator_distance<It1, It2>::type();
}
};
};
}
}}
#endif
@@ -0,0 +1,70 @@
// Copyright 2005 Daniel Wallin.
// Copyright 2005 Joel de Guzman.
//
// Use, modification and distribution is 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)
//
// Modeled after range_ex, Copyright 2004 Eric Niebler
///////////////////////////////////////////////////////////////////////////////
//
// std_hash_map_fwd.hpp
//
/////////////////////////////////////////////////////////////////////////////
#if defined(_MSC_VER)
# pragma once
#endif
#ifndef BOOST_PHOENIX_STD_HASH_MAP_FWD_EN_16_12_2004
#define BOOST_PHOENIX_STD_HASH_MAP_FWD_EN_16_12_2004
#include <boost/phoenix/config.hpp>
#if defined(BOOST_HAS_HASH)
namespace BOOST_STD_EXTENSION_NAMESPACE
{
template<
class Kty
, class Ty
, class Hash
, class Cmp
, class Alloc
>
class hash_map;
template<
class Kty
, class Ty
, class Hash
, class Cmp
, class Alloc
>
class hash_multimap;
}
#elif defined(BOOST_DINKUMWARE_STDLIB)
namespace BOOST_STD_EXTENSION_NAMESPACE
{
template<
class Kty
, class Ty
, class Tr
, class Alloc
>
class hash_map;
template<
class Kty
, class Ty
, class Tr
, class Alloc
>
class hash_multimap;
}
#endif
#endif
@@ -0,0 +1,169 @@
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under 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)
//
// Preprocessed version of "boost/mpl/list/list20.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10
>
struct list11
: l_item<
long_<11>
, T0
, list10< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >
>
{
typedef list11 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11
>
struct list12
: l_item<
long_<12>
, T0
, list11< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >
>
{
typedef list12 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12
>
struct list13
: l_item<
long_<13>
, T0
, list12< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >
>
{
typedef list13 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13
>
struct list14
: l_item<
long_<14>
, T0
, list13< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >
>
{
typedef list14 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
>
struct list15
: l_item<
long_<15>
, T0
, list14< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 >
>
{
typedef list15 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15
>
struct list16
: l_item<
long_<16>
, T0
, list15< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 >
>
{
typedef list16 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16
>
struct list17
: l_item<
long_<17>
, T0
, list16< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 >
>
{
typedef list17 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17
>
struct list18
: l_item<
long_<18>
, T0
, list17< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 >
>
{
typedef list18 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17, typename T18
>
struct list19
: l_item<
long_<19>
, T0
, list18< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 >
>
{
typedef list19 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17, typename T18, typename T19
>
struct list20
: l_item<
long_<20>
, T0
, list19< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 >
>
{
typedef list20 type;
};
}}
@@ -0,0 +1,99 @@
// Status=review
The following controls appear at the bottom of the Wide Graph window.
With the exception of *JT65 nnnn JT9* (when operating in JT9+JT65
mode), they affect only the graphical displays. They have no effect
on the decoding process.
image::wide-graph-controls.png[align="center",alt="Wide Graph Controls"]
- *Bins/Pixel* controls the displayed frequency resolution. Set this
value to 1 for the highest possible resolution, or to higher numbers
to compress the spectral display. Normal operation with a convenient
window size works well at 2 to 8 bins per pixel.
- *JT65 nnnn JT9* sets the dividing point (blue marker) for wide-band
decoding of JT65 and JT9 signals in *JT9+JT65* mode. The decoder
looks for JT65 signals everywhere, but JT9 signals only above this
frequency.
- *Start nnn Hz* sets the low-frequency starting point of the
waterfall frequency scale.
- *N Avg* is the number of successive spectra to be averaged before
updating the display. Values around 5 are suitable for normal JT9 and
JT65 operation. Adjust *N Avg* to make the waterfall move faster or
slower, as desired.
- A dropdown list below the *Palette* label lets you select from a
wide range of waterfall color palettes.
- Click *Adjust* to activate a window that allows you to create a
user-defined palette.
- Check *Flatten* if you want _WSJT-X_ to compensate for a sloping or
uneven response across the received passband. For this feature to
work properly, you should restrict the range of displayed frequencies
so that only the active part of the spectrum is shown.
- Select *Current* or *Cumulative* for the spectrum displayed in the
bottom one-third of the Wide Graph window. *Current* is the average
spectrum over the most recent *N Avg* FFT calculations. *Cumulative*
is the average spectrum since the start of the present UTC minute.
*Linear Avg* is useful in JT4 mode, especially when short-form
messages are used.
- Four sliders control reference levels and scaling for waterfall
colors and the spectrum plot. Values around midscale are usually
about right, depending on the input signal level, the chosen palette,
and your own preferences. Hover the mouse over a control to display a
tip reminding you of its function.
- *Smoothing* is active only when *Linear Average* has been selected.
Smoothing the displayed spectrum over more than one bin can enhance
your ability to detect weak EME signals with Doppler spread more than
a few Hz.
[[CONTROLS_FAST]]
=== Fast Graph
The waterfall palette used for the Fast Graph is the same as the one
selected on the Wide Graph. Three sliders at the bottom of the Fast
Graph window can be used to optimize gain and zero-offset for the
displayed information. Hover the mouse over a control to display a
tip reminding you of its function. Clicking the *Auto Level* button
will produce reasonable settings as a starting point.
image::fast-graph-controls.png[align="center",alt="Fast Graph Controls"]
[[CONTROLS_ECHO]]
=== Echo Graph
The following controls appear at the bottom of the Echo Graph:
image::echo-graph-controls.png[align="center",alt="EchoGraph Controls"]
- *Bins/Pixel* controls the displayed frequency resolution. Set this
value to 1 for the highest possible resolution, or to higher numbers
to compress the spectral display.
- *Gain* and *Zero* sliders control scaling and offset of plotted
spectra.
- *Smooth* values greater than 0 apply running averages to the plotted
spectra, thereby smoothing the curves over multiple bins.
- Label *N* shows the number of echo pulses averaged.
- Click the *Colors* button to cycle through 6 possible choices of
color and line width for the plots.
[[CONTROLS_MISCELLANEOUS]]
=== Miscellaneous
Most windows can be resized as desired. If you are short of screen
space you can make the Main Window and Wide Graph smaller by hiding
some controls and labels. To enable this feature type *Ctrl+M* with
focus on the appropriate window. (For the Main Window you can select
*Hide menus and labels* on the *View* menu.) Type *Ctrl+M* again
to make the controls visible once more.
@@ -0,0 +1,47 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_TAG_OF_09112011_1842)
#define BOOST_FUSION_TAG_OF_09112011_1842
#include <boost/fusion/support/config.hpp>
#include <tuple>
#include <boost/fusion/support/tag_of_fwd.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
struct fusion_sequence_tag;
namespace traits
{
template <typename... Elements>
struct tag_of<std::tuple<Elements...>>
{
typedef std_tuple_tag type;
};
}
}}
namespace boost { namespace mpl
{
template <typename>
struct sequence_tag;
template <typename... Elements>
struct sequence_tag<std::tuple<Elements...>>
{
typedef fusion::fusion_sequence_tag type;
};
template <typename... Elements>
struct sequence_tag<std::tuple<Elements...> const>
{
typedef fusion::fusion_sequence_tag type;
};
}}
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,561 @@
// Copyright 2005-2014 Daniel James.
// Distributed under 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)
// Based on Peter Dimov's proposal
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
// issue 6.18.
//
// This also contains public domain code from MurmurHash. From the
// MurmurHash header:
// MurmurHash3 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
#if !defined(BOOST_FUNCTIONAL_HASH_HASH_HPP)
#define BOOST_FUNCTIONAL_HASH_HASH_HPP
#include <boost/functional/hash/hash_fwd.hpp>
#include <functional>
#include <boost/functional/hash/detail/hash_float.hpp>
#include <string>
#include <boost/limits.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/cstdint.hpp>
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
#include <boost/type_traits/is_pointer.hpp>
#endif
#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
#include <typeindex>
#endif
#if defined(BOOST_MSVC)
#pragma warning(push)
#if BOOST_MSVC >= 1400
#pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values
// are always of range '0' to '4294967295'.
// Loop executes infinitely.
#endif
#endif
#if BOOST_WORKAROUND(__GNUC__, < 3) \
&& !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
#define BOOST_HASH_CHAR_TRAITS string_char_traits
#else
#define BOOST_HASH_CHAR_TRAITS char_traits
#endif
#if defined(_MSC_VER)
# define BOOST_FUNCTIONAL_HASH_ROTL32(x, r) _rotl(x,r)
#else
# define BOOST_FUNCTIONAL_HASH_ROTL32(x, r) (x << r) | (x >> (32 - r))
#endif
namespace boost
{
namespace hash_detail
{
struct enable_hash_value { typedef std::size_t type; };
template <typename T> struct basic_numbers {};
template <typename T> struct long_numbers;
template <typename T> struct ulong_numbers;
template <typename T> struct float_numbers {};
template <> struct basic_numbers<bool> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<char> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<unsigned char> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<signed char> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<short> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<unsigned short> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<int> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<unsigned int> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<long> :
boost::hash_detail::enable_hash_value {};
template <> struct basic_numbers<unsigned long> :
boost::hash_detail::enable_hash_value {};
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
template <> struct basic_numbers<wchar_t> :
boost::hash_detail::enable_hash_value {};
#endif
// long_numbers is defined like this to allow for separate
// specialization for long_long and int128_type, in case
// they conflict.
template <typename T> struct long_numbers2 {};
template <typename T> struct ulong_numbers2 {};
template <typename T> struct long_numbers : long_numbers2<T> {};
template <typename T> struct ulong_numbers : ulong_numbers2<T> {};
#if !defined(BOOST_NO_LONG_LONG)
template <> struct long_numbers<boost::long_long_type> :
boost::hash_detail::enable_hash_value {};
template <> struct ulong_numbers<boost::ulong_long_type> :
boost::hash_detail::enable_hash_value {};
#endif
#if defined(BOOST_HAS_INT128)
template <> struct long_numbers2<boost::int128_type> :
boost::hash_detail::enable_hash_value {};
template <> struct ulong_numbers2<boost::uint128_type> :
boost::hash_detail::enable_hash_value {};
#endif
template <> struct float_numbers<float> :
boost::hash_detail::enable_hash_value {};
template <> struct float_numbers<double> :
boost::hash_detail::enable_hash_value {};
template <> struct float_numbers<long double> :
boost::hash_detail::enable_hash_value {};
}
template <typename T>
typename boost::hash_detail::basic_numbers<T>::type hash_value(T);
template <typename T>
typename boost::hash_detail::long_numbers<T>::type hash_value(T);
template <typename T>
typename boost::hash_detail::ulong_numbers<T>::type hash_value(T);
template <typename T>
typename boost::enable_if<boost::is_enum<T>, std::size_t>::type
hash_value(T);
#if !BOOST_WORKAROUND(__DMC__, <= 0x848)
template <class T> std::size_t hash_value(T* const&);
#else
template <class T> std::size_t hash_value(T*);
#endif
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
template< class T, unsigned N >
std::size_t hash_value(const T (&x)[N]);
template< class T, unsigned N >
std::size_t hash_value(T (&x)[N]);
#endif
template <class Ch, class A>
std::size_t hash_value(
std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
template <typename T>
typename boost::hash_detail::float_numbers<T>::type hash_value(T);
#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
std::size_t hash_value(std::type_index);
#endif
// Implementation
namespace hash_detail
{
template <class T>
inline std::size_t hash_value_signed(T val)
{
const unsigned int size_t_bits = std::numeric_limits<std::size_t>::digits;
// ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
const int length = (std::numeric_limits<T>::digits - 1)
/ static_cast<int>(size_t_bits);
std::size_t seed = 0;
T positive = val < 0 ? -1 - val : val;
// Hopefully, this loop can be unrolled.
for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)
{
seed ^= (std::size_t) (positive >> i) + (seed<<6) + (seed>>2);
}
seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
return seed;
}
template <class T>
inline std::size_t hash_value_unsigned(T val)
{
const unsigned int size_t_bits = std::numeric_limits<std::size_t>::digits;
// ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
const int length = (std::numeric_limits<T>::digits - 1)
/ static_cast<int>(size_t_bits);
std::size_t seed = 0;
// Hopefully, this loop can be unrolled.
for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)
{
seed ^= (std::size_t) (val >> i) + (seed<<6) + (seed>>2);
}
seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
return seed;
}
template <typename SizeT>
inline void hash_combine_impl(SizeT& seed, SizeT value)
{
seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2);
}
inline void hash_combine_impl(boost::uint32_t& h1,
boost::uint32_t k1)
{
const uint32_t c1 = 0xcc9e2d51;
const uint32_t c2 = 0x1b873593;
k1 *= c1;
k1 = BOOST_FUNCTIONAL_HASH_ROTL32(k1,15);
k1 *= c2;
h1 ^= k1;
h1 = BOOST_FUNCTIONAL_HASH_ROTL32(h1,13);
h1 = h1*5+0xe6546b64;
}
// Don't define 64-bit hash combine on platforms without 64 bit integers,
// and also not for 32-bit gcc as it warns about the 64-bit constant.
#if !defined(BOOST_NO_INT64_T) && \
!(defined(__GNUC__) && ULONG_MAX == 0xffffffff)
inline void hash_combine_impl(boost::uint64_t& h,
boost::uint64_t k)
{
const boost::uint64_t m = UINT64_C(0xc6a4a7935bd1e995);
const int r = 47;
k *= m;
k ^= k >> r;
k *= m;
h ^= k;
h *= m;
// Completely arbitrary number, to prevent 0's
// from hashing to 0.
h += 0xe6546b64;
}
#endif // BOOST_NO_INT64_T
}
template <typename T>
typename boost::hash_detail::basic_numbers<T>::type hash_value(T v)
{
return static_cast<std::size_t>(v);
}
template <typename T>
typename boost::hash_detail::long_numbers<T>::type hash_value(T v)
{
return hash_detail::hash_value_signed(v);
}
template <typename T>
typename boost::hash_detail::ulong_numbers<T>::type hash_value(T v)
{
return hash_detail::hash_value_unsigned(v);
}
template <typename T>
typename boost::enable_if<boost::is_enum<T>, std::size_t>::type
hash_value(T v)
{
return static_cast<std::size_t>(v);
}
// Implementation by Alberto Barbati and Dave Harris.
#if !BOOST_WORKAROUND(__DMC__, <= 0x848)
template <class T> std::size_t hash_value(T* const& v)
#else
template <class T> std::size_t hash_value(T* v)
#endif
{
#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
// for some reason ptrdiff_t on OpenVMS compiler with
// 64 bit is not 64 bit !!!
std::size_t x = static_cast<std::size_t>(
reinterpret_cast<long long int>(v));
#else
std::size_t x = static_cast<std::size_t>(
reinterpret_cast<std::ptrdiff_t>(v));
#endif
return x + (x >> 3);
}
#if defined(BOOST_MSVC)
#pragma warning(push)
#if BOOST_MSVC <= 1400
#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to
// 'unsigned int', possible loss of data
// A misguided attempt to detect 64-bit
// incompatability.
#endif
#endif
template <class T>
inline void hash_combine(std::size_t& seed, T const& v)
{
boost::hash<T> hasher;
return boost::hash_detail::hash_combine_impl(seed, hasher(v));
}
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
template <class It>
inline std::size_t hash_range(It first, It last)
{
std::size_t seed = 0;
for(; first != last; ++first)
{
hash_combine(seed, *first);
}
return seed;
}
template <class It>
inline void hash_range(std::size_t& seed, It first, It last)
{
for(; first != last; ++first)
{
hash_combine(seed, *first);
}
}
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template <class T>
inline std::size_t hash_range(T* first, T* last)
{
std::size_t seed = 0;
for(; first != last; ++first)
{
boost::hash<T> hasher;
seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
}
return seed;
}
template <class T>
inline void hash_range(std::size_t& seed, T* first, T* last)
{
for(; first != last; ++first)
{
boost::hash<T> hasher;
seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
}
}
#endif
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
template< class T, unsigned N >
inline std::size_t hash_value(const T (&x)[N])
{
return hash_range(x, x + N);
}
template< class T, unsigned N >
inline std::size_t hash_value(T (&x)[N])
{
return hash_range(x, x + N);
}
#endif
template <class Ch, class A>
inline std::size_t hash_value(
std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)
{
return hash_range(v.begin(), v.end());
}
template <typename T>
typename boost::hash_detail::float_numbers<T>::type hash_value(T v)
{
return boost::hash_detail::float_hash_value(v);
}
#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
inline std::size_t hash_value(std::type_index v)
{
return v.hash_code();
}
#endif
//
// boost::hash
//
// Define the specializations required by the standard. The general purpose
// boost::hash is defined later in extensions.hpp if
// BOOST_HASH_NO_EXTENSIONS is not defined.
// BOOST_HASH_SPECIALIZE - define a specialization for a type which is
// passed by copy.
//
// BOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is
// passed by const reference.
//
// These are undefined later.
#define BOOST_HASH_SPECIALIZE(type) \
template <> struct hash<type> \
: public std::unary_function<type, std::size_t> \
{ \
std::size_t operator()(type v) const \
{ \
return boost::hash_value(v); \
} \
};
#define BOOST_HASH_SPECIALIZE_REF(type) \
template <> struct hash<type> \
: public std::unary_function<type, std::size_t> \
{ \
std::size_t operator()(type const& v) const \
{ \
return boost::hash_value(v); \
} \
};
BOOST_HASH_SPECIALIZE(bool)
BOOST_HASH_SPECIALIZE(char)
BOOST_HASH_SPECIALIZE(signed char)
BOOST_HASH_SPECIALIZE(unsigned char)
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
BOOST_HASH_SPECIALIZE(wchar_t)
#endif
BOOST_HASH_SPECIALIZE(short)
BOOST_HASH_SPECIALIZE(unsigned short)
BOOST_HASH_SPECIALIZE(int)
BOOST_HASH_SPECIALIZE(unsigned int)
BOOST_HASH_SPECIALIZE(long)
BOOST_HASH_SPECIALIZE(unsigned long)
BOOST_HASH_SPECIALIZE(float)
BOOST_HASH_SPECIALIZE(double)
BOOST_HASH_SPECIALIZE(long double)
BOOST_HASH_SPECIALIZE_REF(std::string)
#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
BOOST_HASH_SPECIALIZE_REF(std::wstring)
#endif
#if !defined(BOOST_NO_LONG_LONG)
BOOST_HASH_SPECIALIZE(boost::long_long_type)
BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
#endif
#if defined(BOOST_HAS_INT128)
BOOST_HASH_SPECIALIZE(boost::int128_type)
BOOST_HASH_SPECIALIZE(boost::uint128_type)
#endif
#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
BOOST_HASH_SPECIALIZE(std::type_index)
#endif
#undef BOOST_HASH_SPECIALIZE
#undef BOOST_HASH_SPECIALIZE_REF
// Specializing boost::hash for pointers.
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template <class T>
struct hash<T*>
: public std::unary_function<T*, std::size_t>
{
std::size_t operator()(T* v) const
{
#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
return boost::hash_value(v);
#else
std::size_t x = static_cast<std::size_t>(
reinterpret_cast<std::ptrdiff_t>(v));
return x + (x >> 3);
#endif
}
};
#else
// For compilers without partial specialization, we define a
// boost::hash for all remaining types. But hash_impl is only defined
// for pointers in 'extensions.hpp' - so when BOOST_HASH_NO_EXTENSIONS
// is defined there will still be a compile error for types not supported
// in the standard.
namespace hash_detail
{
template <bool IsPointer>
struct hash_impl;
template <>
struct hash_impl<true>
{
template <class T>
struct inner
: public std::unary_function<T, std::size_t>
{
std::size_t operator()(T val) const
{
#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 590)
return boost::hash_value(val);
#else
std::size_t x = static_cast<std::size_t>(
reinterpret_cast<std::ptrdiff_t>(val));
return x + (x >> 3);
#endif
}
};
};
}
template <class T> struct hash
: public boost::hash_detail::hash_impl<boost::is_pointer<T>::value>
::BOOST_NESTED_TEMPLATE inner<T>
{
};
#endif
}
#undef BOOST_HASH_CHAR_TRAITS
#undef BOOST_FUNCTIONAL_HASH_ROTL32
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
#endif // BOOST_FUNCTIONAL_HASH_HASH_HPP
// Include this outside of the include guards in case the file is included
// twice - once with BOOST_HASH_NO_EXTENSIONS defined, and then with it
// undefined.
#if !defined(BOOST_HASH_NO_EXTENSIONS) \
&& !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)
#include <boost/functional/hash/extensions.hpp>
#endif
@@ -0,0 +1,199 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// xml_iarchive_impl.cpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Distributed under 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)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <cstring> // memcpy
#include <cstddef> // NULL
#include <exception>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::memcpy;
} // namespace std
#endif
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // mbstate_t and mbrtowc
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::mbstate_t;
using ::mbrtowc;
} // namespace std
#endif
#endif // BOOST_NO_CWCHAR
#include <boost/detail/workaround.hpp> // RogueWave and Dinkumware
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp>
#endif
#include <boost/core/no_exceptions_support.hpp>
#include <boost/archive/xml_archive_exception.hpp>
#include <boost/archive/iterators/dataflow_exception.hpp>
#include <boost/archive/basic_xml_archive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include "basic_xml_grammar.hpp"
namespace boost {
namespace archive {
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// implemenations of functions specific to char archives
// wide char stuff used by char archives
#ifndef BOOST_NO_CWCHAR
#ifndef BOOST_NO_STD_WSTRING
template<class Archive>
BOOST_ARCHIVE_DECL void
xml_iarchive_impl<Archive>::load(std::wstring &ws){
std::string s;
bool result = gimpl->parse_string(is, s);
if(! result)
boost::serialization::throw_exception(
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
);
#if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
if(NULL != ws.data())
#endif
ws.resize(0);
std::mbstate_t mbs = std::mbstate_t();
const char * start = s.data();
const char * end = start + s.size();
while(start < end){
wchar_t wc;
std::size_t count = std::mbrtowc(&wc, start, end - start, &mbs);
if(count == static_cast<std::size_t>(-1))
boost::serialization::throw_exception(
iterators::dataflow_exception(
iterators::dataflow_exception::invalid_conversion
)
);
if(count == static_cast<std::size_t>(-2))
continue;
start += count;
ws += wc;
}
}
#endif // BOOST_NO_STD_WSTRING
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
template<class Archive>
BOOST_ARCHIVE_DECL void
xml_iarchive_impl<Archive>::load(wchar_t * ws){
std::string s;
bool result = gimpl->parse_string(is, s);
if(! result)
boost::serialization::throw_exception(
xml_archive_exception(
xml_archive_exception::xml_archive_parsing_error
)
);
std::mbstate_t mbs = std::mbstate_t();
const char * start = s.data();
const char * end = start + s.size();
while(start < end){
wchar_t wc;
std::size_t length = std::mbrtowc(&wc, start, end - start, &mbs);
if(static_cast<std::size_t>(-1) == length)
boost::serialization::throw_exception(
iterators::dataflow_exception(
iterators::dataflow_exception::invalid_conversion
)
);
if(static_cast<std::size_t>(-2) == length)
continue;
start += length;
*ws++ = wc;
}
*ws = L'\0';
}
#endif // BOOST_NO_INTRINSIC_WCHAR_T
#endif // BOOST_NO_CWCHAR
template<class Archive>
BOOST_ARCHIVE_DECL void
xml_iarchive_impl<Archive>::load(std::string &s){
bool result = gimpl->parse_string(is, s);
if(! result)
boost::serialization::throw_exception(
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
);
}
template<class Archive>
BOOST_ARCHIVE_DECL void
xml_iarchive_impl<Archive>::load(char * s){
std::string tstring;
bool result = gimpl->parse_string(is, tstring);
if(! result)
boost::serialization::throw_exception(
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
);
std::memcpy(s, tstring.data(), tstring.size());
s[tstring.size()] = 0;
}
template<class Archive>
BOOST_ARCHIVE_DECL void
xml_iarchive_impl<Archive>::load_override(class_name_type & t){
const std::string & s = gimpl->rv.class_name;
if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
boost::serialization::throw_exception(
archive_exception(archive_exception::invalid_class_name)
);
char * tptr = t;
std::memcpy(tptr, s.data(), s.size());
tptr[s.size()] = '\0';
}
template<class Archive>
BOOST_ARCHIVE_DECL void
xml_iarchive_impl<Archive>::init(){
gimpl->init(is);
this->set_library_version(
library_version_type(gimpl->rv.version)
);
}
template<class Archive>
BOOST_ARCHIVE_DECL
xml_iarchive_impl<Archive>::xml_iarchive_impl(
std::istream &is_,
unsigned int flags
) :
basic_text_iprimitive<std::istream>(
is_,
0 != (flags & no_codecvt)
),
basic_xml_iarchive<Archive>(flags),
gimpl(new xml_grammar())
{
if(0 == (flags & no_header))
init();
}
template<class Archive>
BOOST_ARCHIVE_DECL
xml_iarchive_impl<Archive>::~xml_iarchive_impl(){
if(std::uncaught_exception())
return;
if(0 == (this->get_flags() & no_header)){
gimpl->windup(is);
}
}
} // namespace archive
} // namespace boost
@@ -0,0 +1,102 @@
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under 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)
//
// Preprocessed version of "boost/mpl/greater_equal.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
, BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
, BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
>
struct greater_equal_impl
: if_c<
( tag1_ > tag2_ )
, aux::cast2nd_impl< greater_equal_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< greater_equal_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct greater_equal_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct greater_equal_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct greater_equal_impl< integral_c_tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct greater_equal_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct greater_equal
: aux::msvc_eti_base< typename apply_wrap2<
greater_equal_impl<
typename greater_equal_tag<N1>::type
, typename greater_equal_tag<N2>::type
>
, N1
, N2
>::type >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, greater_equal, (N1, N2))
};
BOOST_MPL_AUX_NA_SPEC2(2, 2, greater_equal)
}}
namespace boost { namespace mpl {
template<>
struct greater_equal_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
{
BOOST_STATIC_CONSTANT(bool, value =
( BOOST_MPL_AUX_VALUE_WKND(N1)::value >=
BOOST_MPL_AUX_VALUE_WKND(N2)::value )
);
typedef bool_<value> type;
};
};
}}
@@ -0,0 +1,133 @@
//-----------------------------------------------------------------------------
// boost variant/detail/enable_recursive.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2003
// Eric Friedman
//
// Distributed under 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_VARIANT_DETAIL_ENABLE_RECURSIVE_HPP
#define BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_HPP
#include <boost/variant/detail/enable_recursive_fwd.hpp>
#include <boost/variant/variant_fwd.hpp>
#if !defined(BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT)
# include <boost/mpl/apply.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/lambda.hpp>
#endif
#include <boost/variant/detail/substitute.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
#include <boost/mpl/bool_fwd.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/variant/recursive_wrapper.hpp>
namespace boost {
namespace detail { namespace variant {
#if !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
# define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL(T,Dest,Source) \
substitute< T , Dest , Source > \
/**/
#else // defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
///////////////////////////////////////////////////////////////////////////////
// (detail) class template rebind1
//
// Limited workaround in case 'substitute' metafunction unavailable.
//
template <typename T, typename U1>
struct rebind1
{
private:
typedef typename mpl::lambda<
mpl::identity<T>
>::type le_;
public:
typedef typename mpl::eval_if<
is_same< le_, mpl::identity<T> >
, le_ // identity<T>
, mpl::apply1<le_, U1>
>::type type;
};
# define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL(T,Dest,Source) \
rebind1< T , Dest > \
/**/
#endif // !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
///////////////////////////////////////////////////////////////////////////////
// (detail) metafunction enable_recursive
//
// See boost/variant/detail/enable_recursive_fwd.hpp for more information.
//
template <typename T, typename RecursiveVariant, typename NoWrapper>
struct enable_recursive
: BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL(
T, RecursiveVariant, ::boost::recursive_variant_
)
{
};
template <typename T, typename RecursiveVariant>
struct enable_recursive< T,RecursiveVariant,mpl::false_ >
{
private: // helpers, for metafunction result (below)
typedef typename BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL(
T, RecursiveVariant, ::boost::recursive_variant_
)::type t_;
public: // metafunction result
// [Wrap with recursive_wrapper only if rebind really changed something:]
typedef typename mpl::if_<
mpl::or_<
is_same< t_,T >
, is_reference<t_>
, is_pointer<t_>
>
, t_
, boost::recursive_wrapper<t_>
>::type type;
};
///////////////////////////////////////////////////////////////////////////////
// (detail) metafunction class quoted_enable_recursive
//
// Same behavior as enable_recursive metafunction (see above).
//
template <typename RecursiveVariant, typename NoWrapper>
struct quoted_enable_recursive
{
template <typename T>
struct apply
: enable_recursive<T, RecursiveVariant, NoWrapper>
{
};
};
}} // namespace detail::variant
} // namespace boost
#endif // BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_HPP
@@ -0,0 +1,42 @@
#include "countriesworked.h"
void CountriesWorked::init(const QStringList countryNames)
{
_data.clear();
foreach(QString name,countryNames)
_data.insert(name,false);
}
void CountriesWorked::setAsWorked(const QString countryName)
{
if (_data.contains(countryName))
_data.insert(countryName,true);
}
bool CountriesWorked::getHasWorked(const QString countryName)
{
if (_data.contains(countryName))
return _data.value(countryName);
return false;
}
int CountriesWorked::getWorkedCount()
{
int count = 0;
foreach (bool value,_data)
if (value)
count += 1;
return count;
}
int CountriesWorked::getSize()
{
return _data.count();
}
@@ -0,0 +1,63 @@
#ifndef BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
#define BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2008
//
// Distributed under 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)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/sequence_tag_fwd.hpp>
#include <boost/mpl/void.hpp>
#include <boost/mpl/aux_/preprocessor/params.hpp>
#include <boost/mpl/aux_/config/lambda.hpp>
#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) /**/
#elif !defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
template<> struct trait<void_> \
{ \
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
{ \
}; \
}; \
/**/
#else
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
template<> struct trait<void_> \
{ \
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
{ \
}; \
}; \
template<> struct trait<int> \
{ \
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
{ \
typedef int type; \
}; \
}; \
/**/
#endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
#define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
template<> struct trait<non_sequence_tag> {}; \
/**/
#endif // BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
@@ -0,0 +1,82 @@
/*
Copyright Rene Rivera 2008-2015
Distributed under 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_PREDEF_ARCHITECTURE_M68K_H
#define BOOST_PREDEF_ARCHITECTURE_M68K_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_ARCH_M68K`]
[@http://en.wikipedia.org/wiki/M68k Motorola 68k] architecture.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__m68k__`] [__predef_detection__]]
[[`M68000`] [__predef_detection__]]
[[`__mc68060__`] [6.0.0]]
[[`mc68060`] [6.0.0]]
[[`__mc68060`] [6.0.0]]
[[`__mc68040__`] [4.0.0]]
[[`mc68040`] [4.0.0]]
[[`__mc68040`] [4.0.0]]
[[`__mc68030__`] [3.0.0]]
[[`mc68030`] [3.0.0]]
[[`__mc68030`] [3.0.0]]
[[`__mc68020__`] [2.0.0]]
[[`mc68020`] [2.0.0]]
[[`__mc68020`] [2.0.0]]
[[`__mc68010__`] [1.0.0]]
[[`mc68010`] [1.0.0]]
[[`__mc68010`] [1.0.0]]
[[`__mc68000__`] [0.0.1]]
[[`mc68000`] [0.0.1]]
[[`__mc68000`] [0.0.1]]
]
*/
#define BOOST_ARCH_M68K BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__m68k__) || defined(M68000)
# undef BOOST_ARCH_M68K
# if !defined(BOOST_ARCH_M68K) && (defined(__mc68060__) || defined(mc68060) || defined(__mc68060))
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER(6,0,0)
# endif
# if !defined(BOOST_ARCH_M68K) && (defined(__mc68040__) || defined(mc68040) || defined(__mc68040))
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER(4,0,0)
# endif
# if !defined(BOOST_ARCH_M68K) && (defined(__mc68030__) || defined(mc68030) || defined(__mc68030))
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER(3,0,0)
# endif
# if !defined(BOOST_ARCH_M68K) && (defined(__mc68020__) || defined(mc68020) || defined(__mc68020))
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER(2,0,0)
# endif
# if !defined(BOOST_ARCH_M68K) && (defined(__mc68010__) || defined(mc68010) || defined(__mc68010))
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER(1,0,0)
# endif
# if !defined(BOOST_ARCH_M68K) && (defined(__mc68000__) || defined(mc68000) || defined(__mc68000))
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER_AVAILABLE
# endif
# if !defined(BOOST_ARCH_M68K)
# define BOOST_ARCH_M68K BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#if BOOST_ARCH_M68K
# define BOOST_ARCH_M68K_AVAILABLE
#endif
#define BOOST_ARCH_M68K_NAME "Motorola 68k"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_M68K,BOOST_ARCH_M68K_NAME)
@@ -0,0 +1,268 @@
// Copyright John Maddock 2006, 2010.
// 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_MATH_SP_FACTORIALS_HPP
#define BOOST_MATH_SP_FACTORIALS_HPP
#ifdef _MSC_VER
#pragma once
#endif
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/detail/unchecked_factorial.hpp>
#include <boost/array.hpp>
#ifdef BOOST_MSVC
#pragma warning(push) // Temporary until lexical cast fixed.
#pragma warning(disable: 4127 4701)
#endif
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/config/no_tr1/cmath.hpp>
namespace boost { namespace math
{
template <class T, class Policy>
inline T factorial(unsigned i, const Policy& pol)
{
BOOST_STATIC_ASSERT(!boost::is_integral<T>::value);
// factorial<unsigned int>(n) is not implemented
// because it would overflow integral type T for too small n
// to be useful. Use instead a floating-point type,
// and convert to an unsigned type if essential, for example:
// unsigned int nfac = static_cast<unsigned int>(factorial<double>(n));
// See factorial documentation for more detail.
BOOST_MATH_STD_USING // Aid ADL for floor.
if(i <= max_factorial<T>::value)
return unchecked_factorial<T>(i);
T result = boost::math::tgamma(static_cast<T>(i+1), pol);
if(result > tools::max_value<T>())
return result; // Overflowed value! (But tgamma will have signalled the error already).
return floor(result + 0.5f);
}
template <class T>
inline T factorial(unsigned i)
{
return factorial<T>(i, policies::policy<>());
}
/*
// Can't have these in a policy enabled world?
template<>
inline float factorial<float>(unsigned i)
{
if(i <= max_factorial<float>::value)
return unchecked_factorial<float>(i);
return tools::overflow_error<float>(BOOST_CURRENT_FUNCTION);
}
template<>
inline double factorial<double>(unsigned i)
{
if(i <= max_factorial<double>::value)
return unchecked_factorial<double>(i);
return tools::overflow_error<double>(BOOST_CURRENT_FUNCTION);
}
*/
template <class T, class Policy>
T double_factorial(unsigned i, const Policy& pol)
{
BOOST_STATIC_ASSERT(!boost::is_integral<T>::value);
BOOST_MATH_STD_USING // ADL lookup of std names
if(i & 1)
{
// odd i:
if(i < max_factorial<T>::value)
{
unsigned n = (i - 1) / 2;
return ceil(unchecked_factorial<T>(i) / (ldexp(T(1), (int)n) * unchecked_factorial<T>(n)) - 0.5f);
}
//
// Fallthrough: i is too large to use table lookup, try the
// gamma function instead.
//
T result = boost::math::tgamma(static_cast<T>(i) / 2 + 1, pol) / sqrt(constants::pi<T>());
if(ldexp(tools::max_value<T>(), -static_cast<int>(i+1) / 2) > result)
return ceil(result * ldexp(T(1), static_cast<int>(i+1) / 2) - 0.5f);
}
else
{
// even i:
unsigned n = i / 2;
T result = factorial<T>(n, pol);
if(ldexp(tools::max_value<T>(), -(int)n) > result)
return result * ldexp(T(1), (int)n);
}
//
// If we fall through to here then the result is infinite:
//
return policies::raise_overflow_error<T>("boost::math::double_factorial<%1%>(unsigned)", 0, pol);
}
template <class T>
inline T double_factorial(unsigned i)
{
return double_factorial<T>(i, policies::policy<>());
}
namespace detail{
template <class T, class Policy>
T rising_factorial_imp(T x, int n, const Policy& pol)
{
BOOST_STATIC_ASSERT(!boost::is_integral<T>::value);
if(x < 0)
{
//
// For x less than zero, we really have a falling
// factorial, modulo a possible change of sign.
//
// Note that the falling factorial isn't defined
// for negative n, so we'll get rid of that case
// first:
//
bool inv = false;
if(n < 0)
{
x += n;
n = -n;
inv = true;
}
T result = ((n&1) ? -1 : 1) * falling_factorial(-x, n, pol);
if(inv)
result = 1 / result;
return result;
}
if(n == 0)
return 1;
if(x == 0)
{
if(n < 0)
return -boost::math::tgamma_delta_ratio(x + 1, static_cast<T>(-n), pol);
else
return 0;
}
if((x < 1) && (x + n < 0))
{
T val = boost::math::tgamma_delta_ratio(1 - x, static_cast<T>(-n), pol);
return (n & 1) ? T(-val) : val;
}
//
// We don't optimise this for small n, because
// tgamma_delta_ratio is alreay optimised for that
// use case:
//
return 1 / boost::math::tgamma_delta_ratio(x, static_cast<T>(n), pol);
}
template <class T, class Policy>
inline T falling_factorial_imp(T x, unsigned n, const Policy& pol)
{
BOOST_STATIC_ASSERT(!boost::is_integral<T>::value);
BOOST_MATH_STD_USING // ADL of std names
if((x == 0) && (n >= 0))
return 0;
if(x < 0)
{
//
// For x < 0 we really have a rising factorial
// modulo a possible change of sign:
//
return (n&1 ? -1 : 1) * rising_factorial(-x, n, pol);
}
if(n == 0)
return 1;
if(x < 0.5f)
{
//
// 1 + x below will throw away digits, so split up calculation:
//
if(n > max_factorial<T>::value - 2)
{
// If the two end of the range are far apart we have a ratio of two very large
// numbers, split the calculation up into two blocks:
T t1 = x * boost::math::falling_factorial(x - 1, max_factorial<T>::value - 2);
T t2 = boost::math::falling_factorial(x - max_factorial<T>::value + 1, n - max_factorial<T>::value + 1);
if(tools::max_value<T>() / fabs(t1) < fabs(t2))
return boost::math::sign(t1) * boost::math::sign(t2) * policies::raise_overflow_error<T>("boost::math::falling_factorial<%1%>", 0, pol);
return t1 * t2;
}
return x * boost::math::falling_factorial(x - 1, n - 1);
}
if(x <= n - 1)
{
//
// x+1-n will be negative and tgamma_delta_ratio won't
// handle it, split the product up into three parts:
//
T xp1 = x + 1;
unsigned n2 = itrunc((T)floor(xp1), pol);
if(n2 == xp1)
return 0;
T result = boost::math::tgamma_delta_ratio(xp1, -static_cast<T>(n2), pol);
x -= n2;
result *= x;
++n2;
if(n2 < n)
result *= falling_factorial(x - 1, n - n2, pol);
return result;
}
//
// Simple case: just the ratio of two
// (positive argument) gamma functions.
// Note that we don't optimise this for small n,
// because tgamma_delta_ratio is alreay optimised
// for that use case:
//
return boost::math::tgamma_delta_ratio(x + 1, -static_cast<T>(n), pol);
}
} // namespace detail
template <class RT>
inline typename tools::promote_args<RT>::type
falling_factorial(RT x, unsigned n)
{
typedef typename tools::promote_args<RT>::type result_type;
return detail::falling_factorial_imp(
static_cast<result_type>(x), n, policies::policy<>());
}
template <class RT, class Policy>
inline typename tools::promote_args<RT>::type
falling_factorial(RT x, unsigned n, const Policy& pol)
{
typedef typename tools::promote_args<RT>::type result_type;
return detail::falling_factorial_imp(
static_cast<result_type>(x), n, pol);
}
template <class RT>
inline typename tools::promote_args<RT>::type
rising_factorial(RT x, int n)
{
typedef typename tools::promote_args<RT>::type result_type;
return detail::rising_factorial_imp(
static_cast<result_type>(x), n, policies::policy<>());
}
template <class RT, class Policy>
inline typename tools::promote_args<RT>::type
rising_factorial(RT x, int n, const Policy& pol)
{
typedef typename tools::promote_args<RT>::type result_type;
return detail::rising_factorial_imp(
static_cast<result_type>(x), n, pol);
}
} // namespace math
} // namespace boost
#endif // BOOST_MATH_SP_FACTORIALS_HPP