Initial Commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2012 John Maddock.
|
||||
// Copyright Christopher Kormanyos 2013. 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_MP_DETAIL_DYNAMIC_ARRAY_HPP
|
||||
#define BOOST_MP_DETAIL_DYNAMIC_ARRAY_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <boost/multiprecision/detail/rebind.hpp>
|
||||
|
||||
namespace boost { namespace multiprecision { namespace backends { namespace detail
|
||||
{
|
||||
template <class value_type, const boost::uint32_t elem_number, class my_allocator>
|
||||
struct dynamic_array : public std::vector<value_type, typename rebind<value_type, my_allocator>::type>
|
||||
{
|
||||
dynamic_array() :
|
||||
std::vector<value_type, typename rebind<value_type, my_allocator>::type>(static_cast<typename std::vector<value_type, typename rebind<value_type, my_allocator>::type>::size_type>(elem_number), static_cast<value_type>(0))
|
||||
{
|
||||
}
|
||||
|
||||
value_type* data() { return &(*(this->begin())); }
|
||||
const value_type* data() const { return &(*(this->begin())); }
|
||||
};
|
||||
} } } } // namespace boost::multiprecision::backends::detail
|
||||
|
||||
#endif // BOOST_MP_DETAIL_DYNAMIC_ARRAY_HPP
|
||||
@@ -0,0 +1,102 @@
|
||||
/*=============================================================================
|
||||
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)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
#if !defined(FUSION_PP_DEQUE_TIE_07192005_1242)
|
||||
#define FUSION_PP_DEQUE_TIE_07192005_1242
|
||||
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/fusion/container/deque/deque.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/generation/detail/preprocessed/deque_tie.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/deque_tie" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
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!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
FUSION_MAX_DEQUE_SIZE, typename T, void_)
|
||||
, typename Extra = void_
|
||||
>
|
||||
struct deque_tie;
|
||||
}
|
||||
|
||||
#define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)&
|
||||
|
||||
#define BOOST_PP_FILENAME_1 <boost/fusion/container/generation/detail/pp_deque_tie.hpp>
|
||||
#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE)
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_FUSION_REF
|
||||
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
||||
#else // defined(BOOST_PP_IS_ITERATING)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Preprocessor vertical repetition code
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename T)>
|
||||
#define TEXT(z, n, text) , text
|
||||
struct deque_tie< BOOST_PP_ENUM_PARAMS(N, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(N), FUSION_MAX_DEQUE_SIZE, TEXT, void_) >
|
||||
#undef TEXT
|
||||
{
|
||||
typedef deque<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename T)>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline deque<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)>
|
||||
deque_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg))
|
||||
{
|
||||
return deque<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)>(
|
||||
BOOST_PP_ENUM_PARAMS(N, arg));
|
||||
}
|
||||
|
||||
#undef N
|
||||
#endif // defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// 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_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
||||
#define BOOST_COMPUTE_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/function.hpp>
|
||||
#include <boost/compute/detail/literal.hpp>
|
||||
#include <boost/compute/types/fundamental.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// \class uniform_real_distribution
|
||||
/// \brief Produces uniformly distributed random floating-point numbers.
|
||||
///
|
||||
/// The following example shows how to setup a uniform real distribution to
|
||||
/// produce random \c float values between \c 1 and \c 100.
|
||||
///
|
||||
/// \snippet test/test_uniform_real_distribution.cpp generate
|
||||
///
|
||||
/// \see default_random_engine, normal_distribution
|
||||
template<class RealType = float>
|
||||
class uniform_real_distribution
|
||||
{
|
||||
public:
|
||||
typedef RealType result_type;
|
||||
|
||||
/// Creates a new uniform distribution producing numbers in the range
|
||||
/// [\p a, \p b).
|
||||
/// Requires a < b
|
||||
uniform_real_distribution(RealType a = 0.f, RealType b = 1.f)
|
||||
: m_a(a),
|
||||
m_b(b)
|
||||
{
|
||||
BOOST_ASSERT(a < b);
|
||||
}
|
||||
|
||||
/// Destroys the uniform_real_distribution object.
|
||||
~uniform_real_distribution()
|
||||
{
|
||||
}
|
||||
|
||||
/// Returns the minimum value of the distribution.
|
||||
result_type a() const
|
||||
{
|
||||
return m_a;
|
||||
}
|
||||
|
||||
/// Returns the maximum value of the distribution.
|
||||
result_type b() const
|
||||
{
|
||||
return m_b;
|
||||
}
|
||||
|
||||
/// Generates uniformly distributed floating-point numbers and stores
|
||||
/// them to the range [\p first, \p last).
|
||||
template<class OutputIterator, class Generator>
|
||||
void generate(OutputIterator first,
|
||||
OutputIterator last,
|
||||
Generator &generator,
|
||||
command_queue &queue)
|
||||
{
|
||||
BOOST_COMPUTE_FUNCTION(RealType, scale_random, (const uint_ x),
|
||||
{
|
||||
return nextafter(LO + (convert_RealType(x) / MAX_RANDOM) * (HI - LO), (RealType) LO);
|
||||
});
|
||||
|
||||
scale_random.define("LO", detail::make_literal(m_a));
|
||||
scale_random.define("HI", detail::make_literal(m_b));
|
||||
scale_random.define("MAX_RANDOM", "UINT_MAX");
|
||||
scale_random.define(
|
||||
"convert_RealType", std::string("convert_") + type_name<RealType>()
|
||||
);
|
||||
scale_random.define("RealType", type_name<RealType>());
|
||||
|
||||
generator.generate(
|
||||
first, last, scale_random, queue
|
||||
);
|
||||
}
|
||||
|
||||
/// \internal_ (deprecated)
|
||||
template<class OutputIterator, class Generator>
|
||||
void fill(OutputIterator first,
|
||||
OutputIterator last,
|
||||
Generator &g,
|
||||
command_queue &queue)
|
||||
{
|
||||
generate(first, last, g, queue);
|
||||
}
|
||||
|
||||
private:
|
||||
RealType m_a;
|
||||
RealType m_b;
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
boost::is_floating_point<RealType>::value,
|
||||
"Template argument must be a floating point type"
|
||||
);
|
||||
};
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
||||
@@ -0,0 +1,58 @@
|
||||
// (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 : $RCSfile$
|
||||
//
|
||||
// Version : $Revision: -1 $
|
||||
//
|
||||
// Description : defines traverse_test_tree algorithm
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_TREE_TRAVERSE_HPP_100211GER
|
||||
#define BOOST_TEST_TREE_TRAVERSE_HPP_100211GER
|
||||
|
||||
// Boost.Test
|
||||
#include <boost/test/detail/config.hpp>
|
||||
|
||||
#include <boost/test/tree/test_unit.hpp>
|
||||
#include <boost/test/tree/visitor.hpp>
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace unit_test {
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** traverse_test_tree ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
BOOST_TEST_DECL void traverse_test_tree( test_case const&, test_tree_visitor&, bool ignore_status = false );
|
||||
BOOST_TEST_DECL void traverse_test_tree( test_suite const&, test_tree_visitor&, bool ignore_status = false );
|
||||
BOOST_TEST_DECL void traverse_test_tree( test_unit_id , test_tree_visitor&, bool ignore_status = false );
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
inline void
|
||||
traverse_test_tree( test_unit const& tu, test_tree_visitor& V, bool ignore_status = false )
|
||||
{
|
||||
if( tu.p_type == TUT_CASE )
|
||||
traverse_test_tree( static_cast<test_case const&>( tu ), V, ignore_status );
|
||||
else
|
||||
traverse_test_tree( static_cast<test_suite const&>( tu ), V, ignore_status );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_TREE_TRAVERSE_HPP_100211GER
|
||||
@@ -0,0 +1,295 @@
|
||||
|
||||
// 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/aux_/reverse_fold_impl.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
/// forward declaration
|
||||
|
||||
template<
|
||||
long N
|
||||
, typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct reverse_fold_impl;
|
||||
|
||||
template< long N >
|
||||
struct reverse_fold_chunk;
|
||||
|
||||
template<> struct reverse_fold_chunk<0>
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State fwd_state0;
|
||||
typedef fwd_state0 bkwd_state0;
|
||||
typedef bkwd_state0 state;
|
||||
typedef iter0 iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template<> struct reverse_fold_chunk<1>
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State fwd_state0;
|
||||
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
|
||||
|
||||
typedef fwd_state1 bkwd_state1;
|
||||
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
|
||||
typedef bkwd_state0 state;
|
||||
typedef iter1 iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template<> struct reverse_fold_chunk<2>
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State fwd_state0;
|
||||
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
|
||||
|
||||
typedef fwd_state2 bkwd_state2;
|
||||
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
|
||||
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
|
||||
|
||||
|
||||
typedef bkwd_state0 state;
|
||||
typedef iter2 iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template<> struct reverse_fold_chunk<3>
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State fwd_state0;
|
||||
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
|
||||
|
||||
typedef fwd_state3 bkwd_state3;
|
||||
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
|
||||
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
|
||||
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
|
||||
|
||||
|
||||
typedef bkwd_state0 state;
|
||||
typedef iter3 iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template<> struct reverse_fold_chunk<4>
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State fwd_state0;
|
||||
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
typedef typename apply2< ForwardOp, fwd_state3, typename deref<iter3>::type >::type fwd_state4;
|
||||
typedef typename mpl::next<iter3>::type iter4;
|
||||
|
||||
|
||||
typedef fwd_state4 bkwd_state4;
|
||||
typedef typename apply2< BackwardOp, bkwd_state4, typename deref<iter3>::type >::type bkwd_state3;
|
||||
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
|
||||
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
|
||||
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
|
||||
|
||||
|
||||
typedef bkwd_state0 state;
|
||||
typedef iter4 iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template< long N >
|
||||
struct reverse_fold_chunk
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State fwd_state0;
|
||||
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
typedef typename apply2< ForwardOp, fwd_state3, typename deref<iter3>::type >::type fwd_state4;
|
||||
typedef typename mpl::next<iter3>::type iter4;
|
||||
|
||||
|
||||
typedef reverse_fold_impl<
|
||||
( (N - 4) < 0 ? 0 : N - 4 )
|
||||
, iter4
|
||||
, Last
|
||||
, fwd_state4
|
||||
, BackwardOp
|
||||
, ForwardOp
|
||||
> nested_chunk;
|
||||
|
||||
typedef typename nested_chunk::state bkwd_state4;
|
||||
typedef typename apply2< BackwardOp, bkwd_state4, typename deref<iter3>::type >::type bkwd_state3;
|
||||
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
|
||||
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
|
||||
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
|
||||
|
||||
|
||||
typedef bkwd_state0 state;
|
||||
typedef typename nested_chunk::iterator iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct reverse_fold_step;
|
||||
|
||||
template<
|
||||
typename Last
|
||||
, typename State
|
||||
>
|
||||
struct reverse_fold_null_step
|
||||
{
|
||||
typedef Last iterator;
|
||||
typedef State state;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct reverse_fold_chunk< -1 >
|
||||
{
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef typename if_<
|
||||
typename is_same< First,Last >::type
|
||||
, reverse_fold_null_step< Last,State >
|
||||
, reverse_fold_step< First,Last,State,BackwardOp,ForwardOp >
|
||||
>::type res_;
|
||||
|
||||
typedef typename res_::state state;
|
||||
typedef typename res_::iterator iterator;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct reverse_fold_step
|
||||
{
|
||||
typedef reverse_fold_chunk< -1 >::template result_<
|
||||
typename mpl::next<First>::type
|
||||
, Last
|
||||
, typename apply2<ForwardOp,State, typename deref<First>::type>::type
|
||||
, BackwardOp
|
||||
, ForwardOp
|
||||
> nested_step;
|
||||
|
||||
typedef typename apply2<
|
||||
BackwardOp
|
||||
, typename nested_step::state
|
||||
, typename deref<First>::type
|
||||
>::type state;
|
||||
|
||||
typedef typename nested_step::iterator iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
long N
|
||||
, typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct reverse_fold_impl
|
||||
: reverse_fold_chunk<N>
|
||||
::template result_< First,Last,State,BackwardOp,ForwardOp >
|
||||
{
|
||||
};
|
||||
|
||||
}}}
|
||||
@@ -0,0 +1,211 @@
|
||||
#include "displaytext.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
#include <QDateTime>
|
||||
#include <QTextCharFormat>
|
||||
#include <QFont>
|
||||
#include <QTextCursor>
|
||||
|
||||
#include "qt_helpers.hpp"
|
||||
|
||||
#include "moc_displaytext.cpp"
|
||||
|
||||
DisplayText::DisplayText(QWidget *parent) :
|
||||
QTextEdit(parent)
|
||||
{
|
||||
setReadOnly (true);
|
||||
viewport ()->setCursor (Qt::ArrowCursor);
|
||||
setWordWrapMode (QTextOption::NoWrap);
|
||||
setStyleSheet ("");
|
||||
}
|
||||
|
||||
void DisplayText::setContentFont(QFont const& font)
|
||||
{
|
||||
setFont (font);
|
||||
m_charFormat.setFont (font);
|
||||
selectAll ();
|
||||
auto cursor = textCursor ();
|
||||
cursor.mergeCharFormat (m_charFormat);
|
||||
cursor.clearSelection ();
|
||||
cursor.movePosition (QTextCursor::End);
|
||||
|
||||
// position so viewport scrolled to left
|
||||
cursor.movePosition (QTextCursor::Up);
|
||||
cursor.movePosition (QTextCursor::StartOfLine);
|
||||
|
||||
setTextCursor (cursor);
|
||||
ensureCursorVisible ();
|
||||
}
|
||||
|
||||
void DisplayText::mouseDoubleClickEvent(QMouseEvent *e)
|
||||
{
|
||||
bool ctrl = (e->modifiers() & Qt::ControlModifier);
|
||||
bool alt = (e->modifiers() & Qt::AltModifier);
|
||||
emit(selectCallsign(alt,ctrl));
|
||||
QTextEdit::mouseDoubleClickEvent(e);
|
||||
}
|
||||
|
||||
void DisplayText::insertLineSpacer(QString const& line)
|
||||
{
|
||||
appendText (line, "#d3d3d3");
|
||||
}
|
||||
|
||||
void DisplayText::appendText(QString const& text, QString const& bg)
|
||||
{
|
||||
QString escaped {text.trimmed().replace('<',"<").replace('>',">").replace(' ', " ")};
|
||||
QString s = "<table border=0 cellspacing=0 width=100%><tr><td bgcolor=\"" +
|
||||
bg + "\">" + escaped + "</td></tr></table>";
|
||||
auto cursor = textCursor ();
|
||||
cursor.movePosition (QTextCursor::End);
|
||||
auto pos = cursor.position ();
|
||||
cursor.insertHtml (s);
|
||||
cursor.setPosition (pos, QTextCursor::MoveAnchor);
|
||||
cursor.movePosition (QTextCursor::End, QTextCursor::KeepAnchor);
|
||||
cursor.mergeCharFormat (m_charFormat);
|
||||
cursor.clearSelection ();
|
||||
|
||||
// position so viewport scrolled to left
|
||||
cursor.movePosition (QTextCursor::Up);
|
||||
cursor.movePosition (QTextCursor::StartOfLine);
|
||||
setTextCursor (cursor);
|
||||
ensureCursorVisible ();
|
||||
}
|
||||
|
||||
|
||||
QString DisplayText::_appendDXCCWorkedB4(QString message, QString const& callsign, QString * bg,
|
||||
LogBook logBook, QColor color_CQ,
|
||||
QColor color_DXCC,
|
||||
QColor color_NewCall)
|
||||
{
|
||||
QString call = callsign;
|
||||
QString countryName;
|
||||
bool callWorkedBefore;
|
||||
bool countryWorkedBefore;
|
||||
|
||||
if(call.length()==2) {
|
||||
int i0=message.indexOf("CQ "+call);
|
||||
call=message.mid(i0+6,-1);
|
||||
i0=call.indexOf(" ");
|
||||
call=call.mid(0,i0);
|
||||
}
|
||||
if(call.length()<3) return message;
|
||||
if(!call.contains(QRegExp("[0-9]")) or !call.contains(QRegExp("[A-Z]"))) return message;
|
||||
|
||||
logBook.match(/*in*/call,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
||||
int charsAvail = 48;
|
||||
|
||||
// the decoder (seems) to always generate 41 chars. For a normal CQ call, the last five are spaces
|
||||
// TODO this magic 37 characters is also referenced in MainWindow::doubleClickOnCall()
|
||||
int nmin=37;
|
||||
int i=message.indexOf(" CQ ");
|
||||
int k=message.mid(i+4,3).toInt();
|
||||
if(k>0 and k<999) nmin += 4;
|
||||
int s3 = message.indexOf(" ",nmin);
|
||||
if (s3 < nmin) s3 = nmin; // always want at least the characters to position 35
|
||||
s3 += 1; // convert the index into a character count
|
||||
message = message.left(s3); // reduce trailing white space
|
||||
charsAvail -= s3;
|
||||
if (charsAvail > 4)
|
||||
{
|
||||
if (!countryWorkedBefore) // therefore not worked call either
|
||||
{
|
||||
message += "!";
|
||||
*bg = color_DXCC.name();
|
||||
}
|
||||
else
|
||||
if (!callWorkedBefore) // but have worked the country
|
||||
{
|
||||
message += "~";
|
||||
*bg = color_NewCall.name();
|
||||
}
|
||||
else
|
||||
{
|
||||
message += " "; // have worked this call before
|
||||
*bg = color_CQ.name();
|
||||
}
|
||||
charsAvail -= 1;
|
||||
|
||||
// do some obvious abbreviations
|
||||
countryName.replace ("Islands", "Is.");
|
||||
countryName.replace ("Island", "Is.");
|
||||
countryName.replace ("North ", "N. ");
|
||||
countryName.replace ("Northern ", "N. ");
|
||||
countryName.replace ("South ", "S. ");
|
||||
countryName.replace ("East ", "E. ");
|
||||
countryName.replace ("Eastern ", "E. ");
|
||||
countryName.replace ("West ", "W. ");
|
||||
countryName.replace ("Western ", "W. ");
|
||||
countryName.replace ("Central ", "C. ");
|
||||
countryName.replace (" and ", " & ");
|
||||
countryName.replace ("Republic", "Rep.");
|
||||
countryName.replace ("United States", "U.S.A.");
|
||||
countryName.replace ("Fed. Rep. of ", "");
|
||||
countryName.replace ("French ", "Fr.");
|
||||
countryName.replace ("Asiatic", "AS");
|
||||
countryName.replace ("European", "EU");
|
||||
countryName.replace ("African", "AF");
|
||||
message += countryName;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
void DisplayText::displayDecodedText(DecodedText decodedText, QString myCall,
|
||||
bool displayDXCCEntity, LogBook logBook,
|
||||
QColor color_CQ, QColor color_MyCall,
|
||||
QColor color_DXCC, QColor color_NewCall)
|
||||
{
|
||||
QString bg="white";
|
||||
bool CQcall = false;
|
||||
if (decodedText.string ().contains (" CQ ")
|
||||
|| decodedText.string ().contains (" CQDX ")
|
||||
|| decodedText.string ().contains (" QRZ "))
|
||||
{
|
||||
CQcall = true;
|
||||
bg=color_CQ.name();
|
||||
}
|
||||
if (myCall != "" and (
|
||||
decodedText.indexOf (" " + myCall + " ") >= 0
|
||||
or decodedText.indexOf (" " + myCall + "/") >= 0
|
||||
or decodedText.indexOf ("/" + myCall + " ") >= 0
|
||||
or decodedText.indexOf ("<" + myCall + " ") >= 0
|
||||
or decodedText.indexOf (" " + myCall + ">") >= 0)) {
|
||||
bg=color_MyCall.name();
|
||||
}
|
||||
// if enabled add the DXCC entity and B4 status to the end of the
|
||||
// preformated text line t1
|
||||
auto message = decodedText.string ();
|
||||
if (displayDXCCEntity && CQcall)
|
||||
message = _appendDXCCWorkedB4 (message, decodedText.CQersCall (), &bg, logBook, color_CQ,
|
||||
color_DXCC, color_NewCall);
|
||||
appendText (message, bg);
|
||||
}
|
||||
|
||||
|
||||
void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 txFreq,
|
||||
QColor color_TxMsg, bool bFastMode)
|
||||
{
|
||||
QString bg=color_TxMsg.name();
|
||||
QString t1=" @ ";
|
||||
if(modeTx=="FT8") t1=" ~ ";
|
||||
if(modeTx=="JT4") t1=" $ ";
|
||||
if(modeTx=="JT65") t1=" # ";
|
||||
if(modeTx=="MSK144") t1=" & ";
|
||||
QString t2;
|
||||
t2.sprintf("%4d",txFreq);
|
||||
QString t;
|
||||
if(bFastMode or modeTx=="FT8") {
|
||||
t = QDateTime::currentDateTimeUtc().toString("hhmmss") + \
|
||||
" Tx " + t2 + t1 + text;
|
||||
} else {
|
||||
t = QDateTime::currentDateTimeUtc().toString("hhmm") + \
|
||||
" Tx " + t2 + t1 + text;
|
||||
}
|
||||
appendText(t,bg);
|
||||
}
|
||||
|
||||
void DisplayText::displayQSY(QString text)
|
||||
{
|
||||
QString t = QDateTime::currentDateTimeUtc().toString("hhmmss") + " " + text;
|
||||
QString bg="hot pink";
|
||||
appendText(t,bg);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*=============================================================================
|
||||
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_SIZE_IMPL_09272006_0724)
|
||||
#define BOOST_FUSION_SIZE_IMPL_09272006_0724
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct boost_tuple_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<boost_tuple_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply : mpl::int_<tuples::length<Sequence>::value> {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,202 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-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(BOOST_PP_FUSION_DEQUE_26112006_1649)
|
||||
#define BOOST_PP_FUSION_DEQUE_26112006_1649
|
||||
|
||||
#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
|
||||
#error "C++03 only! This file should not have been included"
|
||||
#endif
|
||||
|
||||
#include <boost/fusion/container/deque/detail/cpp03/limits.hpp>
|
||||
#include <boost/fusion/container/deque/front_extended_deque.hpp>
|
||||
#include <boost/fusion/container/deque/back_extended_deque.hpp>
|
||||
#include <boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp>
|
||||
#include <boost/fusion/container/deque/detail/cpp03/deque_initial_size.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#include <boost/fusion/container/deque/deque_fwd.hpp>
|
||||
#include <boost/fusion/container/deque/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/at_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/end_impl.hpp>
|
||||
#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
#include <boost/fusion/support/void.hpp>
|
||||
#include <boost/fusion/support/detail/enabler.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
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!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define FUSION_HASH #
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct deque_tag;
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
|
||||
struct deque
|
||||
:
|
||||
detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
|
||||
sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
|
||||
{
|
||||
typedef deque_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
|
||||
typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
|
||||
typedef mpl::int_<size::value> next_up;
|
||||
typedef mpl::int_<-1> next_down;
|
||||
typedef mpl::false_ is_view;
|
||||
|
||||
#include <boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp>
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque()
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(typename detail::call_param<T0>::type t0)
|
||||
: base(t0, detail::nil_keyed_element())
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(deque const& rhs)
|
||||
: base(rhs)
|
||||
{}
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
|
||||
: base(seq)
|
||||
{}
|
||||
|
||||
template<typename Sequence>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(Sequence const& seq
|
||||
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
|
||||
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque&
|
||||
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque&
|
||||
operator=(T const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
template <typename T0_>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(T0_&& t0
|
||||
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
|
||||
)
|
||||
: base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element())
|
||||
{}
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(deque&& rhs)
|
||||
: base(std::forward<deque>(rhs))
|
||||
{}
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq
|
||||
, typename disable_if<
|
||||
is_convertible<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>, T0>
|
||||
, detail::enabler_
|
||||
>::type = detail::enabler)
|
||||
: base(std::forward<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>>(seq))
|
||||
{}
|
||||
template <typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque&
|
||||
operator=(T&& rhs)
|
||||
{
|
||||
base::operator=(BOOST_FUSION_FWD_ELEM(T, rhs));
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH endif
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct deque<> : detail::nil_keyed_element
|
||||
{
|
||||
typedef deque_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef mpl::int_<0> size;
|
||||
typedef mpl::int_<0> next_up;
|
||||
typedef mpl::int_<-1> next_down;
|
||||
typedef mpl::false_ is_view;
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(Sequence const&,
|
||||
typename enable_if<
|
||||
mpl::and_<
|
||||
traits::is_sequence<Sequence>
|
||||
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque() BOOST_NOEXCEPT {}
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#undef FUSION_HASH
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,36 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// 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_ALGORITHM_NONE_OF_HPP
|
||||
#define BOOST_COMPUTE_ALGORITHM_NONE_OF_HPP
|
||||
|
||||
#include <boost/compute/system.hpp>
|
||||
#include <boost/compute/algorithm/find_if.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// Returns \c true if \p predicate returns \c true for none of the elements in
|
||||
/// the range [\p first, \p last).
|
||||
///
|
||||
/// \see all_of(), any_of()
|
||||
template<class InputIterator, class UnaryPredicate>
|
||||
inline bool none_of(InputIterator first,
|
||||
InputIterator last,
|
||||
UnaryPredicate predicate,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
return ::boost::compute::find_if(first, last, predicate, queue) == last;
|
||||
}
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_ALGORITHM_NONE_OF_HPP
|
||||
@@ -0,0 +1,97 @@
|
||||
/*=============================================================================
|
||||
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_AT_IMPL_20060124_1933)
|
||||
#define FUSION_AT_IMPL_20060124_1933
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
#include <boost/fusion/container/vector/convert.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/transform.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/fusion/support/unused.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct zip_view_tag;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<typename N>
|
||||
struct poly_at
|
||||
{
|
||||
template<typename T>
|
||||
struct result;
|
||||
|
||||
template<typename N1, typename SeqRef>
|
||||
struct result<poly_at<N1>(SeqRef)>
|
||||
: mpl::eval_if<is_same<SeqRef, unused_type const&>,
|
||||
mpl::identity<unused_type>,
|
||||
result_of::at<typename remove_reference<SeqRef>::type, N> >
|
||||
{
|
||||
BOOST_MPL_ASSERT((is_reference<SeqRef>));
|
||||
};
|
||||
|
||||
template<typename Seq>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result<poly_at(Seq&)>::type
|
||||
operator()(Seq& seq) const
|
||||
{
|
||||
return fusion::at<N>(seq);
|
||||
}
|
||||
|
||||
template<typename Seq>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result<poly_at(Seq const&)>::type
|
||||
operator()(Seq const& seq) const
|
||||
{
|
||||
return fusion::at<N>(seq);
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type operator()(unused_type const&) const
|
||||
{
|
||||
return unused_type();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template<>
|
||||
struct at_impl<zip_view_tag>
|
||||
{
|
||||
template<typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename result_of::as_vector<
|
||||
typename result_of::transform<
|
||||
typename Seq::sequences, detail::poly_at<N> >::type>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Seq& seq)
|
||||
{
|
||||
return type(
|
||||
fusion::transform(seq.sequences_, detail::poly_at<N>()));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
// (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_BOUNDS_12NOV2002_HPP
|
||||
#define BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP
|
||||
|
||||
#include "boost/numeric/conversion/detail/bounds.hpp"
|
||||
|
||||
namespace boost { namespace numeric
|
||||
{
|
||||
|
||||
template<class N>
|
||||
struct bounds : boundsdetail::get_impl<N>::type
|
||||
{} ;
|
||||
|
||||
} } // namespace boost::numeric
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,105 @@
|
||||
// (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
|
||||
//! Input iterator facade
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_UTILS_INPUT_ITERATOR_FACADE_HPP
|
||||
#define BOOST_TEST_UTILS_INPUT_ITERATOR_FACADE_HPP
|
||||
|
||||
// Boost
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace unit_test {
|
||||
namespace utils {
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** input_iterator_core_access ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
class input_iterator_core_access
|
||||
{
|
||||
#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
public:
|
||||
#else
|
||||
template <class I, class V, class R, class TC> friend class input_iterator_facade;
|
||||
#endif
|
||||
|
||||
template <class Facade>
|
||||
static bool get( Facade& f )
|
||||
{
|
||||
return f.get();
|
||||
}
|
||||
|
||||
private:
|
||||
// objects of this class are useless
|
||||
input_iterator_core_access(); //undefined
|
||||
};
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** input_iterator_facade ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename Derived,
|
||||
typename ValueType,
|
||||
typename Reference = ValueType const&,
|
||||
typename Traversal = single_pass_traversal_tag>
|
||||
class input_iterator_facade : public iterator_facade<Derived,ValueType,Traversal,Reference>
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
input_iterator_facade() : m_valid( false ), m_value() {}
|
||||
|
||||
protected: // provide access to the Derived
|
||||
void init()
|
||||
{
|
||||
m_valid = true;
|
||||
increment();
|
||||
}
|
||||
|
||||
// Data members
|
||||
mutable bool m_valid;
|
||||
ValueType m_value;
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
// iterator facade interface implementation
|
||||
void increment()
|
||||
{
|
||||
// we make post-end incrementation indefinetly safe
|
||||
if( m_valid )
|
||||
m_valid = input_iterator_core_access::get( *static_cast<Derived*>(this) );
|
||||
}
|
||||
Reference dereference() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
// iterator facade interface implementation
|
||||
bool equal( input_iterator_facade const& rhs ) const
|
||||
{
|
||||
// two invalid iterator equals, inequal otherwise
|
||||
return !m_valid && !rhs.m_valid;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace utils
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_UTILS_INPUT_ITERATOR_FACADE_HPP
|
||||
@@ -0,0 +1,29 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2006. 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)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
|
||||
#ifndef BOOST_RANGE_CATEGORY_HPP
|
||||
#define BOOST_RANGE_CATEGORY_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/range/config.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template< class T >
|
||||
struct range_category : iterator_category< typename range_iterator<T>::type >
|
||||
{ };
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,172 @@
|
||||
/*=============================================================================
|
||||
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(FUSION_POP_BACK_09172005_1038)
|
||||
#define FUSION_POP_BACK_09172005_1038
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/view/iterator_range/iterator_range.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/iterator/iterator_adapter.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template <typename Iterator_, bool IsLast>
|
||||
struct pop_back_iterator
|
||||
: iterator_adapter<
|
||||
pop_back_iterator<Iterator_, IsLast>
|
||||
, Iterator_>
|
||||
{
|
||||
typedef iterator_adapter<
|
||||
pop_back_iterator<Iterator_, IsLast>
|
||||
, Iterator_>
|
||||
base_type;
|
||||
|
||||
static bool const is_last = IsLast;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
pop_back_iterator(Iterator_ const& iterator_base)
|
||||
: base_type(iterator_base) {}
|
||||
|
||||
template <typename BaseIterator>
|
||||
struct make
|
||||
{
|
||||
typedef pop_back_iterator<BaseIterator, is_last> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(BaseIterator const& i)
|
||||
{
|
||||
return type(i);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename I, bool IsLast_>
|
||||
struct equal_to_helper
|
||||
: mpl::identity<typename I::iterator_base_type>
|
||||
{};
|
||||
|
||||
template <typename I>
|
||||
struct equal_to_helper<I, true>
|
||||
: result_of::next<
|
||||
typename I::iterator_base_type>
|
||||
{};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct equal_to
|
||||
: result_of::equal_to<
|
||||
typename equal_to_helper<I1,
|
||||
(I2::is_last && !I1::is_last)>::type
|
||||
, typename equal_to_helper<I2,
|
||||
(I1::is_last && !I2::is_last)>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct distance
|
||||
: mpl::minus<
|
||||
typename result_of::distance<
|
||||
typename First::iterator_base_type
|
||||
, typename Last::iterator_base_type
|
||||
>::type
|
||||
, mpl::int_<(Last::is_last?1:0)>
|
||||
>::type
|
||||
{};
|
||||
|
||||
|
||||
template <typename Iterator, bool IsLast_>
|
||||
struct prior_impl
|
||||
{
|
||||
typedef typename Iterator::iterator_base_type base_type;
|
||||
|
||||
typedef typename
|
||||
result_of::prior<base_type>::type
|
||||
base_prior;
|
||||
|
||||
typedef pop_back_iterator<base_prior, false> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(fusion::prior(i.iterator_base));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct prior_impl<Iterator, true>
|
||||
{
|
||||
// If this is the last iterator, we'll have to double back
|
||||
typedef typename Iterator::iterator_base_type base_type;
|
||||
|
||||
typedef typename
|
||||
result_of::prior<
|
||||
typename result_of::prior<base_type>::type
|
||||
>::type
|
||||
base_prior;
|
||||
|
||||
typedef pop_back_iterator<base_prior, false> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(fusion::prior(
|
||||
fusion::prior(i.iterator_base)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct prior : prior_impl<Iterator, Iterator::is_last>
|
||||
{};
|
||||
};
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct pop_back
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((result_of::empty<Sequence>));
|
||||
|
||||
typedef pop_back_iterator<
|
||||
typename begin<Sequence>::type, false>
|
||||
begin_type;
|
||||
|
||||
typedef pop_back_iterator<
|
||||
typename end<Sequence>::type, true>
|
||||
end_type;
|
||||
|
||||
typedef
|
||||
iterator_range<begin_type, end_type>
|
||||
type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::pop_back<Sequence const>::type
|
||||
pop_back(Sequence const& seq)
|
||||
{
|
||||
typedef result_of::pop_back<Sequence const> comp;
|
||||
typedef typename comp::begin_type begin_type;
|
||||
typedef typename comp::end_type end_type;
|
||||
typedef typename comp::type result;
|
||||
|
||||
return result(
|
||||
begin_type(fusion::begin(seq))
|
||||
, end_type(fusion::end(seq))
|
||||
);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
// Status=review
|
||||
.Receiver Noise Level
|
||||
|
||||
- If it is not already highlighted in green, click the *Monitor*
|
||||
button to start normal receive operation.
|
||||
|
||||
- Be sure your transceiver is set to *USB* (or *USB Data*) mode.
|
||||
|
||||
- Use the receiver gain controls and/or the computer's audio mixer
|
||||
controls to set the background noise level (scale at lower left of
|
||||
main window) to around 30 dB when no signals are present. It is
|
||||
usually best to turn AGC off or reduce the RF gain control to minimize
|
||||
AGC action.
|
||||
|
||||
.Bandwidth and Frequency Setting
|
||||
|
||||
- If your transceiver offers more than one bandwidth setting in USB
|
||||
mode, it may be advantageous to choose the widest one possible, up to
|
||||
about 5 kHz. This choice has the desirable effect of allowing the
|
||||
*Wide Graph* (waterfall and 2D spectrum) to display the conventional
|
||||
JT65 and JT9 sub-bands simultaneously on most HF bands. Further
|
||||
details are provided in the <<TUTORIAL,Basic Operating Tutorial>>. A
|
||||
wider displayed bandwidth may also be helpful at VHF and above, where
|
||||
FT8, JT4, JT65, and QRA64 signals may be found over much wider ranges
|
||||
of frequencies.
|
||||
|
||||
- If you have only a standard SSB filter you won’t be able to display
|
||||
more than about 2.7 kHz bandwidth. Depending on the exact dial
|
||||
frequency setting, on HF bands you can display the full sub-band
|
||||
generally used for one mode.
|
||||
|
||||
- Of course, you might prefer to concentrate on one mode at a time,
|
||||
setting your dial frequency to (say) 14.074 for FT8, 14.076 for JT65,
|
||||
or 14.078 for JT9. Present conventions have the nominal JT9 dial
|
||||
frequency 2 kHz higher than the JT65 dial frequency on most bands, and
|
||||
the FT8 frequency 2 kHz lower.
|
||||
|
||||
.Transmitter Audio Level
|
||||
|
||||
* Click the *Tune* button on the main screen to switch the
|
||||
radio into transmit mode and generate a steady audio tone.
|
||||
|
||||
* Listen to the generated audio tone using your radio’s *Monitor*
|
||||
facility. The transmitted tone should be perfectly smooth, with no
|
||||
clicks or glitches. Make sure that this is true even when you
|
||||
simultaneously use the computer to do other tasks such as email, web
|
||||
browsing, etc.
|
||||
|
||||
* Adjust the *Pwr* slider (at right edge of main window) downward from
|
||||
its maximum until the RF output from your transmitter falls slightly.
|
||||
This is generally a good level for audio drive.
|
||||
|
||||
* Toggle the *Tune* button once more or click *Halt Tx* to stop your
|
||||
test transmission.
|
||||
@@ -0,0 +1,169 @@
|
||||
subroutine deep4(sym0,neme,flip,mycall,hiscall,hisgrid,decoded,qual)
|
||||
|
||||
! Deep search routine for JT4
|
||||
|
||||
use prog_args
|
||||
parameter (MAXCALLS=7000,MAXRPT=63)
|
||||
real*4 sym0(206),sym(206)
|
||||
character callsign*12,grid*4,message*22,hisgrid*6,ceme*3
|
||||
character*12 mycall,hiscall
|
||||
character mycall0*12,hiscall0*12,hisgrid0*6
|
||||
character*22 decoded
|
||||
character*22 testmsg(2*MAXCALLS + 2 + MAXRPT)
|
||||
character*15 callgrid(MAXCALLS)
|
||||
character*180 line
|
||||
character*4 rpt(MAXRPT)
|
||||
integer ncode(206)
|
||||
real*4 code(206,2*MAXCALLS + 2 + MAXRPT)
|
||||
real pp(2*MAXCALLS + 2 + MAXRPT)
|
||||
data neme0/-99/
|
||||
data rpt/'-01','-02','-03','-04','-05', &
|
||||
'-06','-07','-08','-09','-10', &
|
||||
'-11','-12','-13','-14','-15', &
|
||||
'-16','-17','-18','-19','-20', &
|
||||
'-21','-22','-23','-24','-25', &
|
||||
'-26','-27','-28','-29','-30', &
|
||||
'R-01','R-02','R-03','R-04','R-05', &
|
||||
'R-06','R-07','R-08','R-09','R-10', &
|
||||
'R-11','R-12','R-13','R-14','R-15', &
|
||||
'R-16','R-17','R-18','R-19','R-20', &
|
||||
'R-21','R-22','R-23','R-24','R-25', &
|
||||
'R-26','R-27','R-28','R-29','R-30', &
|
||||
'RO','RRR','73'/
|
||||
save mycall0,hiscall0,hisgrid0,neme0,ntot,code,testmsg
|
||||
|
||||
sym=sym0
|
||||
if(mycall.eq.mycall0 .and. hiscall.eq.hiscall0 .and. &
|
||||
hisgrid.eq.hisgrid0 .and. neme.eq.neme0) go to 30
|
||||
|
||||
open(23,file=trim(data_dir)//'/CALL3.TXT',status='unknown')
|
||||
k=0
|
||||
icall=0
|
||||
do n=1,MAXCALLS
|
||||
if(n.eq.1) then
|
||||
callsign=hiscall
|
||||
do i=4,12
|
||||
if(ichar(callsign(i:i)).eq.0) callsign(i:i)=' '
|
||||
enddo
|
||||
grid=hisgrid(1:4)
|
||||
if(ichar(grid(3:3)).eq.0) grid(3:3)=' '
|
||||
if(ichar(grid(4:4)).eq.0) grid(4:4)=' '
|
||||
else
|
||||
read(23,1002,end=20) line
|
||||
1002 format (A80)
|
||||
if(line(1:4).eq.'ZZZZ') go to 20
|
||||
if(line(1:2).eq.'//') go to 10
|
||||
i1=index(line,',')
|
||||
if(i1.lt.4) go to 10
|
||||
i2=index(line(i1+1:),',')
|
||||
if(i2.lt.5) go to 10
|
||||
i2=i2+i1
|
||||
i3=index(line(i2+1:),',')
|
||||
if(i3.lt.1) i3=index(line(i2+1:),' ')
|
||||
i3=i2+i3
|
||||
callsign=line(1:i1-1)
|
||||
grid=line(i1+1:i2-1)
|
||||
ceme=line(i2+1:i3-1)
|
||||
if(neme.eq.1 .and. ceme.ne.'EME') go to 10
|
||||
endif
|
||||
|
||||
icall=icall+1
|
||||
j1=index(mycall,' ') - 1
|
||||
if(j1.le.-1) j1=12
|
||||
if(j1.lt.3) j1=6
|
||||
j2=index(callsign,' ') - 1
|
||||
if(j2.le.-1) j2=12
|
||||
if(j2.lt.3) j2=6
|
||||
j3=index(mycall,'/') ! j3>0 means compound mycall
|
||||
j4=index(callsign,'/') ! j4>0 means compound hiscall
|
||||
callgrid(icall)=callsign(1:j2)
|
||||
|
||||
mz=1
|
||||
! Allow MyCall + HisCall + rpt (?)
|
||||
if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and. callsign(1:6).ne.' ') &
|
||||
mz=MAXRPT+1
|
||||
do m=1,mz
|
||||
if(m.gt.1) grid=rpt(m-1)
|
||||
if(j3.lt.1 .and.j4.lt.1) callgrid(icall)=callsign(1:j2)//' '//grid
|
||||
message=mycall(1:j1)//' '//callgrid(icall)
|
||||
k=k+1
|
||||
testmsg(k)=message
|
||||
call encode4(message,ncode)
|
||||
code(1:206,k)=2*ncode(1:206)-1
|
||||
if(n.ge.2) then
|
||||
! Insert CQ message
|
||||
if(j4.lt.1) callgrid(icall)=callsign(1:j2)//' '//grid
|
||||
message='CQ '//callgrid(icall)
|
||||
k=k+1
|
||||
testmsg(k)=message
|
||||
call encode4(message,ncode)
|
||||
code(1:206,k)=2*ncode(1:206)-1
|
||||
endif
|
||||
enddo
|
||||
10 continue
|
||||
enddo
|
||||
|
||||
20 continue
|
||||
close(23)
|
||||
ntot=k
|
||||
|
||||
30 mycall0=mycall
|
||||
hiscall0=hiscall
|
||||
hisgrid0=hisgrid
|
||||
neme0=neme
|
||||
|
||||
sq=0.
|
||||
do j=1,206
|
||||
sq=sq + sym(j)**2
|
||||
enddo
|
||||
rms=sqrt(sq/206.0)
|
||||
sym=sym/rms
|
||||
|
||||
p1=-1.e30
|
||||
p2=-1.e30
|
||||
do k=1,ntot
|
||||
pp(k)=0.
|
||||
! Should re-instate the following:
|
||||
! if(k.ge.2 .and. k.le.64 .and. flip.gt.0.0) cycle
|
||||
! Test all messages if flip=+1; skip the CQ messages if flip=-1.
|
||||
if(flip.gt.0.0 .or. testmsg(k)(1:3).ne.'CQ ') then
|
||||
p=0.
|
||||
do j=1,206
|
||||
p=p + code(j,k)*sym(j)
|
||||
enddo
|
||||
pp(k)=p
|
||||
if(p.gt.p1) then
|
||||
p1=p
|
||||
ip1=k
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
|
||||
do i=1,ntot
|
||||
if(pp(i).gt.p2 .and. testmsg(i).ne.testmsg(ip1)) p2=pp(i)
|
||||
enddo
|
||||
|
||||
qual=p1-max(1.15*p2,70.0)
|
||||
|
||||
! ### DO NOT REMOVE ###
|
||||
rewind 77
|
||||
if(ip1.ge.1 .and. ip1.le.2*MAXCALLS+2+MAXRPT) write(77,1001) p1,p2,ntot, &
|
||||
rms,qual,ip1,testmsg(ip1)
|
||||
1001 format(2f8.2,i8,2f8.2,i6,2x,a22)
|
||||
call flush(77)
|
||||
|
||||
if(qual.gt.1.0) then
|
||||
decoded=testmsg(ip1)
|
||||
else
|
||||
decoded=' '
|
||||
qual=0.
|
||||
endif
|
||||
|
||||
! Make sure everything is upper case.
|
||||
do i=1,22
|
||||
if(decoded(i:i).ge.'a' .and. decoded(i:i).le.'z') &
|
||||
decoded(i:i)=char(ichar(decoded(i:i))-32)
|
||||
enddo
|
||||
|
||||
return
|
||||
end subroutine deep4
|
||||
@@ -0,0 +1,251 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2014 John Fletcher
|
||||
|
||||
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 !BOOST_PHOENIX_IS_ITERATING
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
#include <boost/phoenix/core/expression.hpp>
|
||||
#include <boost/phoenix/core/reference.hpp>
|
||||
#include <boost/phoenix/core/detail/function_eval.hpp>
|
||||
#include <boost/phoenix/bind/detail/cpp03/member_function_ptr.hpp>
|
||||
|
||||
namespace boost { namespace phoenix
|
||||
{
|
||||
|
||||
template <typename RT, typename ClassT, typename ClassA>
|
||||
inline
|
||||
typename boost::lazy_enable_if<
|
||||
boost::is_member_function_pointer<RT (ClassT::*)()>,
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<0, RT, RT(ClassT::*)()>
|
||||
, ClassA >
|
||||
>::type const
|
||||
bind(RT(ClassT::*f)(), ClassA const& obj)
|
||||
{
|
||||
typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
|
||||
return
|
||||
detail::expression::function_eval<fp_type, ClassA>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
);
|
||||
}
|
||||
|
||||
template <typename RT, typename ClassT, typename ClassA>
|
||||
inline
|
||||
typename boost::lazy_enable_if<
|
||||
boost::is_member_function_pointer<RT (ClassT::*)()>,
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
|
||||
, ClassA >
|
||||
>::type const
|
||||
bind(RT(ClassT::*f)() const, ClassA const& obj)
|
||||
{
|
||||
typedef
|
||||
detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
|
||||
fp_type;
|
||||
return
|
||||
detail::expression::function_eval<fp_type, ClassA>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
);
|
||||
}
|
||||
|
||||
template <typename RT, typename ClassT>
|
||||
inline
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<0, RT, RT(ClassT::*)()>
|
||||
, ClassT
|
||||
>::type const
|
||||
bind(RT(ClassT::*f)(), ClassT& obj)
|
||||
{
|
||||
typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
|
||||
return
|
||||
detail::expression::function_eval<
|
||||
fp_type
|
||||
, ClassT
|
||||
>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
);
|
||||
}
|
||||
|
||||
template <typename RT, typename ClassT>
|
||||
inline
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
|
||||
, ClassT
|
||||
>::type const
|
||||
bind(RT(ClassT::*f)() const, ClassT& obj)
|
||||
{
|
||||
typedef detail::member_function_ptr<0, RT, RT(ClassT::*)() const> fp_type;
|
||||
return
|
||||
detail::expression::function_eval<
|
||||
fp_type
|
||||
, ClassT
|
||||
>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/phoenix/bind/detail/cpp03/preprocessed/bind_member_function.hpp>
|
||||
#else
|
||||
|
||||
#if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/bind_member_function_" BOOST_PHOENIX_LIMIT_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 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(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define BOOST_PHOENIX_ITERATION_PARAMS \
|
||||
(3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \
|
||||
<boost/phoenix/bind/detail/cpp03/bind_member_function.hpp>))
|
||||
#include BOOST_PHOENIX_ITERATE()
|
||||
|
||||
#if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
}}
|
||||
|
||||
#else
|
||||
|
||||
template <
|
||||
typename RT
|
||||
, typename ClassT
|
||||
, BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
|
||||
, typename ClassA
|
||||
, BOOST_PHOENIX_typename_A
|
||||
>
|
||||
inline
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, RT
|
||||
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
|
||||
>
|
||||
, ClassA
|
||||
, BOOST_PHOENIX_A
|
||||
>::type const
|
||||
bind(
|
||||
RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
|
||||
, ClassA const & obj
|
||||
, BOOST_PHOENIX_A_const_ref_a
|
||||
)
|
||||
{
|
||||
typedef detail::member_function_ptr<
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, RT
|
||||
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
|
||||
> fp_type;
|
||||
return
|
||||
detail::expression::function_eval<
|
||||
fp_type
|
||||
, ClassA
|
||||
, BOOST_PHOENIX_A
|
||||
>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
, BOOST_PHOENIX_a
|
||||
);
|
||||
}
|
||||
|
||||
template <
|
||||
typename RT
|
||||
, typename ClassT
|
||||
, BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
|
||||
, typename ClassA
|
||||
, BOOST_PHOENIX_typename_A
|
||||
>
|
||||
inline
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, RT
|
||||
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
|
||||
>
|
||||
, ClassA
|
||||
, BOOST_PHOENIX_A
|
||||
>::type const
|
||||
bind(
|
||||
RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
|
||||
, ClassA const & obj
|
||||
, BOOST_PHOENIX_A_const_ref_a
|
||||
)
|
||||
{
|
||||
typedef detail::member_function_ptr<
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, RT
|
||||
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
|
||||
> fp_type;
|
||||
return
|
||||
detail::expression::function_eval<
|
||||
fp_type
|
||||
, ClassA
|
||||
, BOOST_PHOENIX_A
|
||||
>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
, BOOST_PHOENIX_a
|
||||
);
|
||||
}
|
||||
|
||||
template <
|
||||
typename RT
|
||||
, typename ClassT
|
||||
, BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
|
||||
, BOOST_PHOENIX_typename_A
|
||||
>
|
||||
inline
|
||||
typename detail::expression::function_eval<
|
||||
detail::member_function_ptr<
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, RT
|
||||
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
|
||||
>
|
||||
, ClassT
|
||||
, BOOST_PHOENIX_A
|
||||
>::type const
|
||||
bind(
|
||||
RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
|
||||
, ClassT & obj
|
||||
, BOOST_PHOENIX_A_const_ref_a
|
||||
)
|
||||
{
|
||||
typedef detail::member_function_ptr<
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, RT
|
||||
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
|
||||
> fp_type;
|
||||
return
|
||||
detail::expression::function_eval<
|
||||
fp_type
|
||||
, ClassT
|
||||
, BOOST_PHOENIX_A
|
||||
>::make(
|
||||
fp_type(f)
|
||||
, obj
|
||||
, BOOST_PHOENIX_a
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# /* Copyright (C) 2001
|
||||
# * Housemarque Oy
|
||||
# * http://www.housemarque.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)
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_SUB_HPP
|
||||
# define BOOST_PREPROCESSOR_ARITHMETIC_SUB_HPP
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/control/while.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SUB */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SUB(x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_SUB_P, BOOST_PP_SUB_O, (x, y)))
|
||||
# else
|
||||
# define BOOST_PP_SUB(x, y) BOOST_PP_SUB_I(x, y)
|
||||
# define BOOST_PP_SUB_I(x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_SUB_P, BOOST_PP_SUB_O, (x, y)))
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SUB_P(d, xy) BOOST_PP_TUPLE_ELEM(2, 1, xy)
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# define BOOST_PP_SUB_O(d, xy) BOOST_PP_SUB_O_I xy
|
||||
# else
|
||||
# define BOOST_PP_SUB_O(d, xy) BOOST_PP_SUB_O_I(BOOST_PP_TUPLE_ELEM(2, 0, xy), BOOST_PP_TUPLE_ELEM(2, 1, xy))
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SUB_O_I(x, y) (BOOST_PP_DEC(x), BOOST_PP_DEC(y))
|
||||
#
|
||||
# /* BOOST_PP_SUB_D */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SUB_D(d, x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_SUB_P, BOOST_PP_SUB_O, (x, y)))
|
||||
# else
|
||||
# define BOOST_PP_SUB_D(d, x, y) BOOST_PP_SUB_D_I(d, x, y)
|
||||
# define BOOST_PP_SUB_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_SUB_P, BOOST_PP_SUB_O, (x, y)))
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/phoenix/support/iterate.hpp>
|
||||
#include <boost/phoenix/scope/detail/cpp03/preprocessed/lambda.hpp>
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/lambda_" BOOST_PHOENIX_LIMIT_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*==============================================================================
|
||||
Copyright (c) 2001-2010 Joel de Guzman
|
||||
Copyright (c) 2004 Daniel Wallin
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
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(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define BOOST_PHOENIX_SCOPE_ACTOR_GEN_NAME lambda_actor_gen
|
||||
#define BOOST_PHOENIX_SCOPE_ACTOR_GEN_FUNCTION operator()
|
||||
#define BOOST_PHOENIX_SCOPE_ACTOR_GEN_CONST const
|
||||
#include <boost/phoenix/scope/detail/cpp03/local_gen.hpp>
|
||||
#undef BOOST_PHOENIX_SCOPE_ACTOR_GEN_NAME
|
||||
#undef BOOST_PHOENIX_SCOPE_ACTOR_GEN_FUNCTION
|
||||
#undef BOOST_PHOENIX_SCOPE_ACTOR_GEN_CONST
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,104 @@
|
||||
program ft8sim
|
||||
|
||||
! Generate simulated data for a 15-second HF/6m mode using 8-FSK.
|
||||
! Output is saved to a *.wav file.
|
||||
|
||||
use wavhdr
|
||||
include 'ft8_params.f90' !Set various constants
|
||||
type(hdr) h !Header for .wav file
|
||||
character arg*12,fname*17
|
||||
character msg*22,msgsent*22
|
||||
complex c0(0:NMAX-1)
|
||||
complex c(0:NMAX-1)
|
||||
integer itone(NN)
|
||||
integer*1 msgbits(KK)
|
||||
integer*2 iwave(NMAX) !Generated full-length waveform
|
||||
|
||||
! Get command-line argument(s)
|
||||
nargs=iargc()
|
||||
if(nargs.ne.6) then
|
||||
print*,'Usage: ft8sim "message" DT fdop del nfiles snr'
|
||||
print*,'Example: ft8sim "K1ABC W9XYZ EN37" 0.0 0.1 1.0 10 -18'
|
||||
go to 999
|
||||
endif
|
||||
call getarg(1,msg) !Message to be transmitted
|
||||
call getarg(2,arg)
|
||||
read(arg,*) xdt !Time offset from nominal (s)
|
||||
call getarg(3,arg)
|
||||
read(arg,*) fspread !Watterson frequency spread (Hz)
|
||||
call getarg(4,arg)
|
||||
read(arg,*) delay !Watterson delay (ms)
|
||||
call getarg(5,arg)
|
||||
read(arg,*) nfiles !Number of files
|
||||
call getarg(6,arg)
|
||||
read(arg,*) snrdb !SNR_2500
|
||||
|
||||
twopi=8.0*atan(1.0)
|
||||
fs=12000.0 !Sample rate (Hz)
|
||||
dt=1.0/fs !Sample interval (s)
|
||||
tt=NSPS*dt !Duration of symbols (s)
|
||||
baud=1.0/tt !Keying rate (baud)
|
||||
bw=8*baud !Occupied bandwidth (Hz)
|
||||
txt=NZ*dt !Transmission length (s)
|
||||
bandwidth_ratio=2500.0/(fs/2.0)
|
||||
sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snrdb)
|
||||
if(snrdb.gt.90.0) sig=1.0
|
||||
txt=NN*NSPS/12000.0
|
||||
|
||||
call genft8(msg,msgsent,msgbits,itone) !Source-encode, then get itone()
|
||||
write(*,1000) f0,xdt,txt,snrdb,bw,msgsent
|
||||
1000 format('f0:',f9.3,' DT:',f6.2,' TxT:',f6.1,' SNR:',f6.1, &
|
||||
' BW:',f4.1,2x,a22)
|
||||
|
||||
write(*,'(28i1,1x,28i1)') msgbits(1:56)
|
||||
write(*,'(16i1)') msgbits(57:72)
|
||||
write(*,'(3i1)') msgbits(73:75)
|
||||
write(*,'(12i1)') msgbits(76:87)
|
||||
|
||||
! call sgran()
|
||||
c=0.
|
||||
do ifile=1,nfiles
|
||||
c0=0.
|
||||
do isig=1,25
|
||||
f0=(isig+2)*100.0
|
||||
phi=0.0
|
||||
k=-1 + nint(xdt+0.5/dt)
|
||||
do j=1,NN !Generate complex waveform
|
||||
dphi=twopi*(f0+itone(j)*baud)*dt
|
||||
if(k.eq.0) phi=-dphi
|
||||
do i=1,NSPS
|
||||
k=k+1
|
||||
phi=phi+dphi
|
||||
if(phi.gt.twopi) phi=phi-twopi
|
||||
xphi=phi
|
||||
if(k.ge.0 .and. k.lt.NMAX) c0(k)=cmplx(cos(xphi),sin(xphi))
|
||||
enddo
|
||||
enddo
|
||||
if(fspread.ne.0.0 .or. delay.ne.0.0) call watterson(c,NMAX,fs,delay,fspread)
|
||||
c=c+c0
|
||||
enddo
|
||||
c=c*sig
|
||||
if(snrdb.lt.90) then
|
||||
do i=0,NMAX-1 !Add gaussian noise at specified SNR
|
||||
xnoise=gran()
|
||||
ynoise=gran()
|
||||
c(i)=c(i) + cmplx(xnoise,ynoise)
|
||||
enddo
|
||||
endif
|
||||
|
||||
fac=32767.0
|
||||
rms=100.0
|
||||
if(snrdb.ge.90.0) iwave(1:NMAX)=nint(fac*real(c))
|
||||
if(snrdb.lt.90.0) iwave(1:NMAX)=nint(rms*real(c))
|
||||
|
||||
h=default_header(12000,NMAX)
|
||||
write(fname,1102) ifile
|
||||
1102 format('000000_',i6.6,'.wav')
|
||||
open(10,file=fname,status='unknown',access='stream')
|
||||
write(10) h,iwave !Save to *.wav file
|
||||
close(10)
|
||||
write(*,1110) ifile,xdt,f0,snrdb,fname
|
||||
1110 format(i4,f7.2,f8.2,f7.1,2x,a17)
|
||||
enddo
|
||||
|
||||
999 end program ft8sim
|
||||
@@ -0,0 +1,74 @@
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* 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/multi_index for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_BASE_TYPE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_BASE_TYPE_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/mpl/at.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/mpl/size.hpp>
|
||||
#include <boost/multi_index/detail/index_base.hpp>
|
||||
#include <boost/multi_index/detail/is_index_list.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
/* MPL machinery to construct a linear hierarchy of indices out of
|
||||
* a index list.
|
||||
*/
|
||||
|
||||
struct index_applier
|
||||
{
|
||||
template<typename IndexSpecifierMeta,typename SuperMeta>
|
||||
struct apply
|
||||
{
|
||||
typedef typename IndexSpecifierMeta::type index_specifier;
|
||||
typedef typename index_specifier::
|
||||
BOOST_NESTED_TEMPLATE index_class<SuperMeta>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
template<int N,typename Value,typename IndexSpecifierList,typename Allocator>
|
||||
struct nth_layer
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int,length=mpl::size<IndexSpecifierList>::value);
|
||||
|
||||
typedef typename mpl::eval_if_c<
|
||||
N==length,
|
||||
mpl::identity<index_base<Value,IndexSpecifierList,Allocator> >,
|
||||
mpl::apply2<
|
||||
index_applier,
|
||||
mpl::at_c<IndexSpecifierList,N>,
|
||||
nth_layer<N+1,Value,IndexSpecifierList,Allocator>
|
||||
>
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template<typename Value,typename IndexSpecifierList,typename Allocator>
|
||||
struct multi_index_base_type:nth_layer<0,Value,IndexSpecifierList,Allocator>
|
||||
{
|
||||
BOOST_STATIC_ASSERT(detail::is_index_list<IndexSpecifierList>::value);
|
||||
};
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
subroutine spec9f(id2,npts,nsps,s1,jz,nq)
|
||||
|
||||
! Compute symbol spectra at quarter-symbol steps.
|
||||
|
||||
integer*2 id2(0:npts)
|
||||
real s1(nq,jz)
|
||||
real x(960)
|
||||
complex c(0:480)
|
||||
equivalence (x,c)
|
||||
|
||||
nfft=2*nsps !FFTs at twice the symbol length
|
||||
nh=nfft/2
|
||||
do j=1,jz
|
||||
ia=(j-1)*nsps/4
|
||||
ib=ia+nsps-1
|
||||
if(ib.gt.npts) exit
|
||||
x(1:nh)=id2(ia:ib)
|
||||
x(nh+1:)=0.
|
||||
call four2a(x,nfft,1,-1,0) !r2c
|
||||
k=mod(j-1,340)+1
|
||||
do i=1,NQ
|
||||
s1(i,j)=1.e-10*(real(c(i))**2 + aimag(c(i))**2)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
!### Reference spectrum should be applied here (or possibly earlier?) ###
|
||||
!### Normalize so that rms (or level?) is 1.0 ? ###
|
||||
|
||||
return
|
||||
end subroutine spec9f
|
||||
@@ -0,0 +1,458 @@
|
||||
// Copyright (c) 2006-7 John Maddock
|
||||
// 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_TOOLS_CONFIG_HPP
|
||||
#define BOOST_MATH_TOOLS_CONFIG_HPP
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/predef.h>
|
||||
#include <boost/cstdint.hpp> // for boost::uintmax_t
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <algorithm> // for min and max
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <climits>
|
||||
#include <cfloat>
|
||||
#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
|
||||
# include <math.h>
|
||||
#endif
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
# include <limits>
|
||||
#endif
|
||||
|
||||
#include <boost/math/tools/user.hpp>
|
||||
|
||||
#if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \
|
||||
|| (defined(__hppa) && !defined(__OpenBSD__)) || (defined(__NO_LONG_DOUBLE_MATH) && (DBL_MANT_DIG != LDBL_MANT_DIG))) \
|
||||
&& !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
|
||||
//
|
||||
// Borland post 5.8.2 uses Dinkumware's std C lib which
|
||||
// doesn't have true long double precision. Earlier
|
||||
// versions are problematic too:
|
||||
//
|
||||
# define BOOST_MATH_NO_REAL_CONCEPT_TESTS
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
|
||||
# include <float.h>
|
||||
#endif
|
||||
#ifdef __IBMCPP__
|
||||
//
|
||||
// For reasons I don't unserstand, the tests with IMB's compiler all
|
||||
// pass at long double precision, but fail with real_concept, those tests
|
||||
// are disabled for now. (JM 2012).
|
||||
# define BOOST_MATH_NO_REAL_CONCEPT_TESTS
|
||||
#endif
|
||||
#ifdef sun
|
||||
// Any use of __float128 in program startup code causes a segfault (tested JM 2015, Solaris 11).
|
||||
# define BOOST_MATH_DISABLE_FLOAT128
|
||||
#endif
|
||||
#ifdef __HAIKU__
|
||||
//
|
||||
// Not sure what's up with the math detection on Haiku, but linking fails with
|
||||
// float128 code enabled, and we don't have an implementation of __expl, so
|
||||
// disabling long double functions for now as well.
|
||||
# define BOOST_MATH_DISABLE_FLOAT128
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
|
||||
//
|
||||
// Darwin's rather strange "double double" is rather hard to
|
||||
// support, it should be possible given enough effort though...
|
||||
//
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
#if defined(unix) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1000) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
|
||||
//
|
||||
// Intel compiler prior to version 10 has sporadic problems
|
||||
// calling the long double overloads of the std lib math functions:
|
||||
// calling ::powl is OK, but std::pow(long double, long double)
|
||||
// may segfault depending upon the value of the arguments passed
|
||||
// and the specific Linux distribution.
|
||||
//
|
||||
// We'll be conservative and disable long double support for this compiler.
|
||||
//
|
||||
// Comment out this #define and try building the tests to determine whether
|
||||
// your Intel compiler version has this issue or not.
|
||||
//
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
#if defined(unix) && defined(__INTEL_COMPILER)
|
||||
//
|
||||
// Intel compiler has sporadic issues compiling std::fpclassify depending on
|
||||
// the exact OS version used. Use our own code for this as we know it works
|
||||
// well on Intel processors:
|
||||
//
|
||||
#define BOOST_MATH_DISABLE_STD_FPCLASSIFY
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC) && !defined(_WIN32_WCE)
|
||||
// Better safe than sorry, our tests don't support hardware exceptions:
|
||||
# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
|
||||
#endif
|
||||
|
||||
#ifdef __IBMCPP__
|
||||
# define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS
|
||||
#endif
|
||||
|
||||
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901))
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if (defined(__hpux) && !defined(__hppa))
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(_GLIBCXX_USE_C99)
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_VERSION) && !defined(_MSC_VER)
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
|
||||
|| defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
|
||||
|| (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))\
|
||||
|| defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
|
||||
# define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
|
||||
|
||||
# include "boost/type.hpp"
|
||||
# include "boost/non_type.hpp"
|
||||
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) boost::type<t>* = 0
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type<t>*
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type<t, v>* = 0
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type<t, v>*
|
||||
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
#else
|
||||
|
||||
// no workaround needed: expand to nothing
|
||||
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
|
||||
#endif // __SUNPRO_CC
|
||||
|
||||
#if (defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__)) && !defined(BOOST_MATH_SMALL_CONSTANT)
|
||||
// Sun's compiler emits a hard error if a constant underflows,
|
||||
// as does aCC on PA-RISC, while gcc issues a large number of warnings:
|
||||
# define BOOST_MATH_SMALL_CONSTANT(x) 0.0
|
||||
#else
|
||||
# define BOOST_MATH_SMALL_CONSTANT(x) x
|
||||
#endif
|
||||
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
|
||||
//
|
||||
// Define if constants too large for a float cause "bad"
|
||||
// values to be stored in the data, rather than infinity
|
||||
// or a suitably large value.
|
||||
//
|
||||
# define BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
|
||||
#endif
|
||||
//
|
||||
// Tune performance options for specific compilers:
|
||||
//
|
||||
#ifdef BOOST_MSVC
|
||||
# define BOOST_MATH_POLY_METHOD 2
|
||||
# define BOOST_MATH_RATIONAL_METHOD 1
|
||||
#elif defined(BOOST_INTEL)
|
||||
# define BOOST_MATH_POLY_METHOD 2
|
||||
# define BOOST_MATH_RATIONAL_METHOD 1
|
||||
#elif defined(__GNUC__)
|
||||
#if __GNUC__ < 4
|
||||
# define BOOST_MATH_POLY_METHOD 3
|
||||
# define BOOST_MATH_RATIONAL_METHOD 3
|
||||
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
|
||||
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
|
||||
#else
|
||||
# define BOOST_MATH_POLY_METHOD 3
|
||||
# define BOOST_MATH_RATIONAL_METHOD 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_LONG_LONG) && !defined(BOOST_MATH_INT_TABLE_TYPE)
|
||||
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
|
||||
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
|
||||
#endif
|
||||
|
||||
//
|
||||
// constexpr support, early GCC implementations can't cope so disable
|
||||
// constexpr for them:
|
||||
//
|
||||
#if !defined(__clang) && defined(__GNUC__)
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 490
|
||||
# define BOOST_MATH_DISABLE_CONSTEXPR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MATH_DISABLE_CONSTEXPR
|
||||
# define BOOST_MATH_CONSTEXPR
|
||||
#else
|
||||
# define BOOST_MATH_CONSTEXPR BOOST_CONSTEXPR
|
||||
#endif
|
||||
|
||||
//
|
||||
// noexcept support:
|
||||
//
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS
|
||||
#include <type_traits>
|
||||
# define BOOST_MATH_NOEXCEPT(T) noexcept(std::is_floating_point<T>::value)
|
||||
# define BOOST_MATH_IS_FLOAT(T) (std::is_floating_point<T>::value)
|
||||
#else
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
# define BOOST_MATH_NOEXCEPT(T) noexcept(boost::is_floating_point<T>::value)
|
||||
# define BOOST_MATH_IS_FLOAT(T) (boost::is_floating_point<T>::value)
|
||||
#endif
|
||||
#else
|
||||
# define BOOST_MATH_NOEXCEPT(T)
|
||||
# define BOOST_MATH_IS_FLOAT(T) false
|
||||
#endif
|
||||
|
||||
//
|
||||
// The maximum order of polynomial that will be evaluated
|
||||
// via an unrolled specialisation:
|
||||
//
|
||||
#ifndef BOOST_MATH_MAX_POLY_ORDER
|
||||
# define BOOST_MATH_MAX_POLY_ORDER 20
|
||||
#endif
|
||||
//
|
||||
// Set the method used to evaluate polynomials and rationals:
|
||||
//
|
||||
#ifndef BOOST_MATH_POLY_METHOD
|
||||
# define BOOST_MATH_POLY_METHOD 2
|
||||
#endif
|
||||
#ifndef BOOST_MATH_RATIONAL_METHOD
|
||||
# define BOOST_MATH_RATIONAL_METHOD 1
|
||||
#endif
|
||||
//
|
||||
// decide whether to store constants as integers or reals:
|
||||
//
|
||||
#ifndef BOOST_MATH_INT_TABLE_TYPE
|
||||
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT
|
||||
#endif
|
||||
#ifndef BOOST_MATH_INT_VALUE_SUFFIX
|
||||
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF
|
||||
#endif
|
||||
//
|
||||
// And then the actual configuration:
|
||||
//
|
||||
#if defined(_GLIBCXX_USE_FLOAT128) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__) \
|
||||
&& !defined(BOOST_MATH_DISABLE_FLOAT128) || defined(BOOST_MATH_USE_FLOAT128)
|
||||
//
|
||||
// Only enable this when the compiler really is GCC as clang and probably
|
||||
// intel too don't support __float128 yet :-(
|
||||
//
|
||||
#ifndef BOOST_MATH_USE_FLOAT128
|
||||
# define BOOST_MATH_USE_FLOAT128
|
||||
#endif
|
||||
|
||||
# if defined(BOOST_INTEL) && defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION >= 1310) && defined(__GNUC__)
|
||||
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
|
||||
# define BOOST_MATH_FLOAT128_TYPE __float128
|
||||
# endif
|
||||
# elif defined(__GNUC__)
|
||||
# define BOOST_MATH_FLOAT128_TYPE __float128
|
||||
# endif
|
||||
|
||||
# ifndef BOOST_MATH_FLOAT128_TYPE
|
||||
# define BOOST_MATH_FLOAT128_TYPE _Quad
|
||||
# endif
|
||||
#endif
|
||||
//
|
||||
// Check for WinCE with no iostream support:
|
||||
//
|
||||
#if defined(_WIN32_WCE) && !defined(__SGI_STL_PORT)
|
||||
# define BOOST_MATH_NO_LEXICAL_CAST
|
||||
#endif
|
||||
|
||||
//
|
||||
// Helper macro for controlling the FP behaviour:
|
||||
//
|
||||
#ifndef BOOST_MATH_CONTROL_FP
|
||||
# define BOOST_MATH_CONTROL_FP
|
||||
#endif
|
||||
//
|
||||
// Helper macro for using statements:
|
||||
//
|
||||
#define BOOST_MATH_STD_USING_CORE \
|
||||
using std::abs;\
|
||||
using std::acos;\
|
||||
using std::cos;\
|
||||
using std::fmod;\
|
||||
using std::modf;\
|
||||
using std::tan;\
|
||||
using std::asin;\
|
||||
using std::cosh;\
|
||||
using std::frexp;\
|
||||
using std::pow;\
|
||||
using std::tanh;\
|
||||
using std::atan;\
|
||||
using std::exp;\
|
||||
using std::ldexp;\
|
||||
using std::sin;\
|
||||
using std::atan2;\
|
||||
using std::fabs;\
|
||||
using std::log;\
|
||||
using std::sinh;\
|
||||
using std::ceil;\
|
||||
using std::floor;\
|
||||
using std::log10;\
|
||||
using std::sqrt;
|
||||
|
||||
#define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE
|
||||
|
||||
namespace boost{ namespace math{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
template <class T>
|
||||
inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
return (std::max)((std::max)(a, b), c);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
return (std::max)((std::max)(a, b), (std::max)(c, d));
|
||||
}
|
||||
|
||||
} // namespace tools
|
||||
|
||||
template <class T>
|
||||
void suppress_unused_variable_warning(const T&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
}
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class T>
|
||||
struct is_integer_for_rounding
|
||||
{
|
||||
static const bool value = boost::is_integral<T>::value
|
||||
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
|| (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer)
|
||||
#endif
|
||||
;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost namespace math
|
||||
|
||||
#ifdef __GLIBC_PREREQ
|
||||
# if __GLIBC_PREREQ(2,14)
|
||||
# define BOOST_MATH_HAVE_FIXED_GLIBC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if ((defined(__linux__) && !defined(__UCLIBC__) && !defined(BOOST_MATH_HAVE_FIXED_GLIBC)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H)
|
||||
//
|
||||
// This code was introduced in response to this glibc bug: http://sourceware.org/bugzilla/show_bug.cgi?id=2445
|
||||
// Basically powl and expl can return garbage when the result is small and certain exception flags are set
|
||||
// on entrance to these functions. This appears to have been fixed in Glibc 2.14 (May 2011).
|
||||
// Much more information in this message thread: https://groups.google.com/forum/#!topic/boost-list/ZT99wtIFlb4
|
||||
//
|
||||
|
||||
#include <boost/detail/fenv.hpp>
|
||||
|
||||
# ifdef FE_ALL_EXCEPT
|
||||
|
||||
namespace boost{ namespace math{
|
||||
namespace detail
|
||||
{
|
||||
struct fpu_guard
|
||||
{
|
||||
fpu_guard()
|
||||
{
|
||||
fegetexceptflag(&m_flags, FE_ALL_EXCEPT);
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
}
|
||||
~fpu_guard()
|
||||
{
|
||||
fesetexceptflag(&m_flags, FE_ALL_EXCEPT);
|
||||
}
|
||||
private:
|
||||
fexcept_t m_flags;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
}} // namespaces
|
||||
|
||||
# define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object;
|
||||
# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0);
|
||||
|
||||
# else
|
||||
|
||||
# define BOOST_FPU_EXCEPTION_GUARD
|
||||
# define BOOST_MATH_INSTRUMENT_FPU
|
||||
|
||||
# endif
|
||||
|
||||
#else // All other platforms.
|
||||
# define BOOST_FPU_EXCEPTION_GUARD
|
||||
# define BOOST_MATH_INSTRUMENT_FPU
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MATH_INSTRUMENT
|
||||
|
||||
# include <iostream>
|
||||
# include <iomanip>
|
||||
# include <typeinfo>
|
||||
|
||||
# define BOOST_MATH_INSTRUMENT_CODE(x) \
|
||||
std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl;
|
||||
# define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name)
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_MATH_INSTRUMENT_CODE(x)
|
||||
# define BOOST_MATH_INSTRUMENT_VARIABLE(name)
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Thread local storage:
|
||||
//
|
||||
#if !defined(BOOST_NO_CXX11_THREAD_LOCAL) && !defined(BOOST_INTEL)
|
||||
# define BOOST_MATH_THREAD_LOCAL thread_local
|
||||
#else
|
||||
# define BOOST_MATH_THREAD_LOCAL
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MATH_TOOLS_CONFIG_HPP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,656 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2012 John Maddock. 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_
|
||||
//
|
||||
// Comparison operators for cpp_int_backend:
|
||||
//
|
||||
#ifndef BOOST_MP_CPP_INT_MISC_HPP
|
||||
#define BOOST_MP_CPP_INT_MISC_HPP
|
||||
|
||||
#include <boost/multiprecision/detail/bitscan.hpp> // lsb etc
|
||||
#include <boost/integer/common_factor_rt.hpp> // gcd/lcm
|
||||
#include <boost/functional/hash_fwd.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4702)
|
||||
#pragma warning(disable:4127) // conditional expression is constant
|
||||
#pragma warning(disable:4146) // unary minus operator applied to unsigned type, result still unsigned
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost{ namespace multiprecision{ namespace backends{
|
||||
|
||||
template <class R, class CppInt>
|
||||
void check_in_range(const CppInt& val, const mpl::int_<checked>&)
|
||||
{
|
||||
typedef typename boost::multiprecision::detail::canonical<R, CppInt>::type cast_type;
|
||||
if(val.sign())
|
||||
{
|
||||
if(val.compare(static_cast<cast_type>((std::numeric_limits<R>::min)())) < 0)
|
||||
BOOST_THROW_EXCEPTION(std::overflow_error("Could not convert to the target type - -value is out of range."));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(val.compare(static_cast<cast_type>((std::numeric_limits<R>::max)())) > 0)
|
||||
BOOST_THROW_EXCEPTION(std::overflow_error("Could not convert to the target type - -value is out of range."));
|
||||
}
|
||||
}
|
||||
template <class R, class CppInt>
|
||||
inline void check_in_range(const CppInt& /*val*/, const mpl::int_<unchecked>&) BOOST_NOEXCEPT {}
|
||||
|
||||
inline void check_is_negative(const mpl::true_&) BOOST_NOEXCEPT {}
|
||||
inline void check_is_negative(const mpl::false_&)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("Attempt to assign a negative value to an unsigned type."));
|
||||
}
|
||||
|
||||
template <class Integer>
|
||||
inline Integer negate_integer(Integer i, const mpl::true_&) BOOST_NOEXCEPT
|
||||
{
|
||||
return -i;
|
||||
}
|
||||
template <class Integer>
|
||||
inline Integer negate_integer(Integer i, const mpl::false_&) BOOST_NOEXCEPT
|
||||
{
|
||||
return ~(i-1);
|
||||
}
|
||||
|
||||
template <class R, unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<is_integral<R>::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, void>::type
|
||||
eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& backend) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
|
||||
{
|
||||
typedef mpl::int_<Checked1> checked_type;
|
||||
check_in_range<R>(backend, checked_type());
|
||||
|
||||
*result = static_cast<R>(backend.limbs()[0]);
|
||||
unsigned shift = cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
for(unsigned i = 1; (i < backend.size()) && (shift < static_cast<unsigned>(std::numeric_limits<R>::digits)); ++i)
|
||||
{
|
||||
*result += static_cast<R>(backend.limbs()[i]) << shift;
|
||||
shift += cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
}
|
||||
if(backend.sign())
|
||||
{
|
||||
check_is_negative(boost::is_signed<R>());
|
||||
*result = negate_integer(*result, boost::is_signed<R>());
|
||||
}
|
||||
}
|
||||
|
||||
template <class R, unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<is_floating_point<R>::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, void>::type
|
||||
eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& backend) BOOST_MP_NOEXCEPT_IF(is_arithmetic<R>::value)
|
||||
{
|
||||
typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::const_limb_pointer p = backend.limbs();
|
||||
unsigned shift = cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
*result = static_cast<R>(*p);
|
||||
for(unsigned i = 1; i < backend.size(); ++i)
|
||||
{
|
||||
*result += static_cast<R>(std::ldexp(static_cast<long double>(p[i]), shift));
|
||||
shift += cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
}
|
||||
if(backend.sign())
|
||||
*result = -*result;
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, bool>::type
|
||||
eval_is_zero(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val) BOOST_NOEXCEPT
|
||||
{
|
||||
return (val.size() == 1) && (val.limbs()[0] == 0);
|
||||
}
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, int>::type
|
||||
eval_get_sign(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val) BOOST_NOEXCEPT
|
||||
{
|
||||
return eval_is_zero(val) ? 0 : val.sign() ? -1 : 1;
|
||||
}
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_abs(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
|
||||
{
|
||||
result = val;
|
||||
result.sign(false);
|
||||
}
|
||||
|
||||
//
|
||||
// Get the location of the least-significant-bit:
|
||||
//
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
|
||||
eval_lsb(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
|
||||
{
|
||||
using default_ops::eval_get_sign;
|
||||
if(eval_get_sign(a) == 0)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
|
||||
}
|
||||
if(a.sign())
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
|
||||
}
|
||||
|
||||
//
|
||||
// Find the index of the least significant limb that is non-zero:
|
||||
//
|
||||
unsigned index = 0;
|
||||
while(!a.limbs()[index] && (index < a.size()))
|
||||
++index;
|
||||
//
|
||||
// Find the index of the least significant bit within that limb:
|
||||
//
|
||||
unsigned result = boost::multiprecision::detail::find_lsb(a.limbs()[index]);
|
||||
|
||||
return result + index * cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the location of the most-significant-bit:
|
||||
//
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
|
||||
eval_msb_imp(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
|
||||
{
|
||||
//
|
||||
// Find the index of the most significant bit that is non-zero:
|
||||
//
|
||||
return (a.size() - 1) * cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits + boost::multiprecision::detail::find_msb(a.limbs()[a.size() - 1]);
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
|
||||
eval_msb(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
|
||||
{
|
||||
using default_ops::eval_get_sign;
|
||||
if(eval_get_sign(a) == 0)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
|
||||
}
|
||||
if(a.sign())
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
|
||||
}
|
||||
return eval_msb_imp(a);
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, bool>::type
|
||||
eval_bit_test(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val, unsigned index) BOOST_NOEXCEPT
|
||||
{
|
||||
unsigned offset = index / cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
unsigned shift = index % cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
limb_type mask = shift ? limb_type(1u) << shift : limb_type(1u);
|
||||
if(offset >= val.size())
|
||||
return false;
|
||||
return val.limbs()[offset] & mask ? true : false;
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_bit_set(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val, unsigned index)
|
||||
{
|
||||
unsigned offset = index / cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
unsigned shift = index % cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
limb_type mask = shift ? limb_type(1u) << shift : limb_type(1u);
|
||||
if(offset >= val.size())
|
||||
{
|
||||
unsigned os = val.size();
|
||||
val.resize(offset + 1, offset + 1);
|
||||
if(offset >= val.size())
|
||||
return; // fixed precision overflow
|
||||
for(unsigned i = os; i <= offset; ++i)
|
||||
val.limbs()[i] = 0;
|
||||
}
|
||||
val.limbs()[offset] |= mask;
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_bit_unset(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val, unsigned index) BOOST_NOEXCEPT
|
||||
{
|
||||
unsigned offset = index / cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
unsigned shift = index % cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
limb_type mask = shift ? limb_type(1u) << shift : limb_type(1u);
|
||||
if(offset >= val.size())
|
||||
return;
|
||||
val.limbs()[offset] &= ~mask;
|
||||
val.normalize();
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_bit_flip(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val, unsigned index)
|
||||
{
|
||||
unsigned offset = index / cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
unsigned shift = index % cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
|
||||
limb_type mask = shift ? limb_type(1u) << shift : limb_type(1u);
|
||||
if(offset >= val.size())
|
||||
{
|
||||
unsigned os = val.size();
|
||||
val.resize(offset + 1, offset + 1);
|
||||
if(offset >= val.size())
|
||||
return; // fixed precision overflow
|
||||
for(unsigned i = os; i <= offset; ++i)
|
||||
val.limbs()[i] = 0;
|
||||
}
|
||||
val.limbs()[offset] ^= mask;
|
||||
val.normalize();
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_qr(
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x,
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& y,
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& q,
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& r) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
|
||||
{
|
||||
divide_unsigned_helper(&q, x, y, r);
|
||||
q.sign(x.sign() != y.sign());
|
||||
r.sign(x.sign());
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_qr(
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x,
|
||||
limb_type y,
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& q,
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& r) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
|
||||
{
|
||||
divide_unsigned_helper(&q, x, y, r);
|
||||
q.sign(x.sign());
|
||||
r.sign(x.sign());
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class U>
|
||||
inline typename enable_if_c<is_integral<U>::value>::type eval_qr(
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x,
|
||||
U y,
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& q,
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& r) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
|
||||
{
|
||||
using default_ops::eval_qr;
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> t;
|
||||
t = y;
|
||||
eval_qr(x, t, q, r);
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class Integer>
|
||||
inline typename enable_if_c<is_unsigned<Integer>::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, Integer>::type
|
||||
eval_integer_modulus(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x, Integer val)
|
||||
{
|
||||
if((sizeof(Integer) <= sizeof(limb_type)) || (val <= (std::numeric_limits<limb_type>::max)()))
|
||||
{
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> d;
|
||||
divide_unsigned_helper(static_cast<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>*>(0), x, static_cast<limb_type>(val), d);
|
||||
return d.limbs()[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return default_ops::eval_integer_modulus(x, val);
|
||||
}
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class Integer>
|
||||
BOOST_MP_FORCEINLINE typename enable_if_c<is_signed<Integer>::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, Integer>::type
|
||||
eval_integer_modulus(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& x, Integer val)
|
||||
{
|
||||
return eval_integer_modulus(x, boost::multiprecision::detail::unsigned_abs(val));
|
||||
}
|
||||
|
||||
inline limb_type integer_gcd_reduce(limb_type u, limb_type v)
|
||||
{
|
||||
do
|
||||
{
|
||||
if(u > v)
|
||||
std::swap(u, v);
|
||||
if(u == v)
|
||||
break;
|
||||
v -= u;
|
||||
v >>= boost::multiprecision::detail::find_lsb(v);
|
||||
} while(true);
|
||||
return u;
|
||||
}
|
||||
|
||||
inline double_limb_type integer_gcd_reduce(double_limb_type u, double_limb_type v)
|
||||
{
|
||||
do
|
||||
{
|
||||
if(u > v)
|
||||
std::swap(u, v);
|
||||
if(u == v)
|
||||
break;
|
||||
if(v <= ~static_cast<limb_type>(0))
|
||||
{
|
||||
u = integer_gcd_reduce(static_cast<limb_type>(v), static_cast<limb_type>(u));
|
||||
break;
|
||||
}
|
||||
v -= u;
|
||||
#ifdef __MSVC_RUNTIME_CHECKS
|
||||
while((v & 1u) == 0)
|
||||
#else
|
||||
while((static_cast<unsigned>(v) & 1u) == 0)
|
||||
#endif
|
||||
v >>= 1;
|
||||
} while(true);
|
||||
return u;
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_gcd(
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a,
|
||||
limb_type v)
|
||||
{
|
||||
using default_ops::eval_lsb;
|
||||
using default_ops::eval_is_zero;
|
||||
using default_ops::eval_get_sign;
|
||||
|
||||
int shift;
|
||||
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> u(a);
|
||||
|
||||
int s = eval_get_sign(u);
|
||||
|
||||
/* GCD(0,x) := x */
|
||||
if(s < 0)
|
||||
{
|
||||
u.negate();
|
||||
}
|
||||
else if(s == 0)
|
||||
{
|
||||
result = v;
|
||||
return;
|
||||
}
|
||||
if(v == 0)
|
||||
{
|
||||
result = u;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Let shift := lg K, where K is the greatest power of 2
|
||||
dividing both u and v. */
|
||||
|
||||
unsigned us = eval_lsb(u);
|
||||
unsigned vs = boost::multiprecision::detail::find_lsb(v);
|
||||
shift = (std::min)(us, vs);
|
||||
eval_right_shift(u, us);
|
||||
if(vs)
|
||||
v >>= vs;
|
||||
|
||||
do
|
||||
{
|
||||
/* Now u and v are both odd, so diff(u, v) is even.
|
||||
Let u = min(u, v), v = diff(u, v)/2. */
|
||||
if(u.size() <= 2)
|
||||
{
|
||||
if(u.size() == 1)
|
||||
v = integer_gcd_reduce(*u.limbs(), v);
|
||||
else
|
||||
{
|
||||
double_limb_type i;
|
||||
i = u.limbs()[0] | (static_cast<double_limb_type>(u.limbs()[1]) << sizeof(limb_type) * CHAR_BIT);
|
||||
v = static_cast<limb_type>(integer_gcd_reduce(i, static_cast<double_limb_type>(v)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
eval_subtract(u, v);
|
||||
us = eval_lsb(u);
|
||||
eval_right_shift(u, us);
|
||||
}
|
||||
while(true);
|
||||
|
||||
result = v;
|
||||
eval_left_shift(result, shift);
|
||||
}
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class Integer>
|
||||
inline typename enable_if_c<is_unsigned<Integer>::value && (sizeof(Integer) <= sizeof(limb_type)) && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_gcd(
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a,
|
||||
const Integer& v)
|
||||
{
|
||||
eval_gcd(result, a, static_cast<limb_type>(v));
|
||||
}
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class Integer>
|
||||
inline typename enable_if_c<is_signed<Integer>::value && (sizeof(Integer) <= sizeof(limb_type)) && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_gcd(
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a,
|
||||
const Integer& v)
|
||||
{
|
||||
eval_gcd(result, a, static_cast<limb_type>(v < 0 ? -v : v));
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_gcd(
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a,
|
||||
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& b)
|
||||
{
|
||||
using default_ops::eval_lsb;
|
||||
using default_ops::eval_is_zero;
|
||||
using default_ops::eval_get_sign;
|
||||
|
||||
if(a.size() == 1)
|
||||
{
|
||||
eval_gcd(result, b, *a.limbs());
|
||||
return;
|
||||
}
|
||||
if(b.size() == 1)
|
||||
{
|
||||
eval_gcd(result, a, *b.limbs());
|
||||
return;
|
||||
}
|
||||
|
||||
int shift;
|
||||
|
||||
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> u(a), v(b);
|
||||
|
||||
int s = eval_get_sign(u);
|
||||
|
||||
/* GCD(0,x) := x */
|
||||
if(s < 0)
|
||||
{
|
||||
u.negate();
|
||||
}
|
||||
else if(s == 0)
|
||||
{
|
||||
result = v;
|
||||
return;
|
||||
}
|
||||
s = eval_get_sign(v);
|
||||
if(s < 0)
|
||||
{
|
||||
v.negate();
|
||||
}
|
||||
else if(s == 0)
|
||||
{
|
||||
result = u;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Let shift := lg K, where K is the greatest power of 2
|
||||
dividing both u and v. */
|
||||
|
||||
unsigned us = eval_lsb(u);
|
||||
unsigned vs = eval_lsb(v);
|
||||
shift = (std::min)(us, vs);
|
||||
eval_right_shift(u, us);
|
||||
eval_right_shift(v, vs);
|
||||
|
||||
do
|
||||
{
|
||||
/* Now u and v are both odd, so diff(u, v) is even.
|
||||
Let u = min(u, v), v = diff(u, v)/2. */
|
||||
s = u.compare(v);
|
||||
if(s > 0)
|
||||
u.swap(v);
|
||||
if(s == 0)
|
||||
break;
|
||||
if(v.size() <= 2)
|
||||
{
|
||||
if(v.size() == 1)
|
||||
u = integer_gcd_reduce(*v.limbs(), *u.limbs());
|
||||
else
|
||||
{
|
||||
double_limb_type i, j;
|
||||
i = v.limbs()[0] | (static_cast<double_limb_type>(v.limbs()[1]) << sizeof(limb_type) * CHAR_BIT);
|
||||
j = (u.size() == 1) ? *u.limbs() : u.limbs()[0] | (static_cast<double_limb_type>(u.limbs()[1]) << sizeof(limb_type) * CHAR_BIT);
|
||||
u = integer_gcd_reduce(i, j);
|
||||
}
|
||||
break;
|
||||
}
|
||||
eval_subtract(v, u);
|
||||
vs = eval_lsb(v);
|
||||
eval_right_shift(v, vs);
|
||||
}
|
||||
while(true);
|
||||
|
||||
result = u;
|
||||
eval_left_shift(result, shift);
|
||||
}
|
||||
//
|
||||
// Now again for trivial backends:
|
||||
//
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
BOOST_MP_FORCEINLINE typename enable_if_c<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
|
||||
eval_gcd(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& b) BOOST_NOEXCEPT
|
||||
{
|
||||
*result.limbs() = boost::integer::gcd(*a.limbs(), *b.limbs());
|
||||
}
|
||||
// This one is only enabled for unchecked cpp_int's, for checked int's we need the checking in the default version:
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
BOOST_MP_FORCEINLINE typename enable_if_c<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && (Checked1 == unchecked)>::type
|
||||
eval_lcm(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& b) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
|
||||
{
|
||||
*result.limbs() = boost::integer::lcm(*a.limbs(), *b.limbs());
|
||||
result.normalize(); // result may overflow the specified number of bits
|
||||
}
|
||||
|
||||
inline void conversion_overflow(const mpl::int_<checked>&)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::overflow_error("Overflow in conversion to narrower type"));
|
||||
}
|
||||
inline void conversion_overflow(const mpl::int_<unchecked>&){}
|
||||
|
||||
template <class R, unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<
|
||||
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
|
||||
&& is_signed_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
|
||||
&& boost::is_convertible<typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::local_limb_type, R>::value
|
||||
>::type
|
||||
eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val)
|
||||
{
|
||||
typedef typename common_type<R, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::local_limb_type>::type common_type;
|
||||
if(std::numeric_limits<R>::is_specialized && (static_cast<common_type>(*val.limbs()) > static_cast<common_type>((std::numeric_limits<R>::max)())))
|
||||
{
|
||||
if(val.isneg())
|
||||
{
|
||||
if(static_cast<common_type>(*val.limbs()) > -static_cast<common_type>((std::numeric_limits<R>::min)()))
|
||||
conversion_overflow(typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
|
||||
*result = (std::numeric_limits<R>::min)();
|
||||
}
|
||||
else
|
||||
{
|
||||
conversion_overflow(typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
|
||||
*result = (std::numeric_limits<R>::max)();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*result = static_cast<R>(*val.limbs());
|
||||
if(val.isneg())
|
||||
{
|
||||
check_is_negative(mpl::bool_<is_signed_number<R>::value || (number_category<R>::value == number_kind_floating_point)>());
|
||||
*result = negate_integer(*result, mpl::bool_<is_signed_number<R>::value || (number_category<R>::value == number_kind_floating_point)>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class R, unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<
|
||||
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
|
||||
&& is_unsigned_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
|
||||
&& boost::is_convertible<typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::local_limb_type, R>::value
|
||||
>::type
|
||||
eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val)
|
||||
{
|
||||
typedef typename common_type<R, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::local_limb_type>::type common_type;
|
||||
if(std::numeric_limits<R>::is_specialized && (static_cast<common_type>(*val.limbs()) > static_cast<common_type>((std::numeric_limits<R>::max)())))
|
||||
{
|
||||
conversion_overflow(typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
|
||||
*result = (std::numeric_limits<R>::max)();
|
||||
}
|
||||
else
|
||||
*result = static_cast<R>(*val.limbs());
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
|
||||
eval_lsb(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
|
||||
{
|
||||
using default_ops::eval_get_sign;
|
||||
if(eval_get_sign(a) == 0)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
|
||||
}
|
||||
if(a.sign())
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
|
||||
}
|
||||
//
|
||||
// Find the index of the least significant bit within that limb:
|
||||
//
|
||||
return boost::multiprecision::detail::find_lsb(*a.limbs());
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
|
||||
eval_msb_imp(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
|
||||
{
|
||||
//
|
||||
// Find the index of the least significant bit within that limb:
|
||||
//
|
||||
return boost::multiprecision::detail::find_msb(*a.limbs());
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline typename enable_if_c<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
|
||||
eval_msb(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
|
||||
{
|
||||
using default_ops::eval_get_sign;
|
||||
if(eval_get_sign(a) == 0)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
|
||||
}
|
||||
if(a.sign())
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
|
||||
}
|
||||
return eval_msb_imp(a);
|
||||
}
|
||||
|
||||
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
|
||||
inline std::size_t hash_value(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& val) BOOST_NOEXCEPT
|
||||
{
|
||||
std::size_t result = 0;
|
||||
for(unsigned i = 0; i < val.size(); ++i)
|
||||
{
|
||||
boost::hash_combine(result, val.limbs()[i]);
|
||||
}
|
||||
boost::hash_combine(result, val.sign());
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright David Abrahams 2009. 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_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
|
||||
# define BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace concepts {}
|
||||
|
||||
# if defined(BOOST_HAS_CONCEPTS) && !defined(BOOST_CONCEPT_NO_BACKWARD_KEYWORD)
|
||||
namespace concept = concepts;
|
||||
# endif
|
||||
} // namespace boost::concept
|
||||
|
||||
#endif // BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
|
||||
@@ -0,0 +1,24 @@
|
||||
// (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 user's config for Boost.Test debugging support
|
||||
//!
|
||||
//! This file is intended to be edited by end user to specify varios macros, which configure debugger interface
|
||||
//! Alterntively you can set these parameters in your own sources/makefiles
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_DEBUG_CONFIG_HPP_112006GER
|
||||
#define BOOST_TEST_DEBUG_CONFIG_HPP_112006GER
|
||||
|
||||
// ';' separated list of supported debuggers
|
||||
// #define BOOST_TEST_DBG_LIST gdb;dbx
|
||||
|
||||
// maximum size of /proc/pid/stat file
|
||||
// #define BOOST_TEST_STAT_LINE_MAX
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// 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_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/derived_dimension.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
#include <boost/units/physical_dimensions/current.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// derived dimension for resistance : L^2 M T^-3 I^-2
|
||||
typedef derived_dimension<length_base_dimension,2,
|
||||
mass_base_dimension,1,
|
||||
time_base_dimension,-3,
|
||||
current_base_dimension,-2>::type resistance_dimension;
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP
|
||||
@@ -0,0 +1,21 @@
|
||||
subroutine degrade_snr(d2,npts,db,bw)
|
||||
|
||||
! Degrade S/N by specified number of dB.
|
||||
|
||||
integer*2 d2(npts)
|
||||
|
||||
p0=0.
|
||||
do i=1,npts
|
||||
x=d2(i)
|
||||
p0=p0 + x*x
|
||||
enddo
|
||||
p0=p0/npts
|
||||
if(bw.gt.0.0) p0=p0*6000.0/bw
|
||||
s=sqrt(p0*(10.0**(0.1*db) - 1.0))
|
||||
fac=sqrt(p0/(p0+s*s))
|
||||
do i=1,npts
|
||||
d2(i)=nint(fac*(d2(i) + s*gran()))
|
||||
enddo
|
||||
|
||||
return
|
||||
end subroutine degrade_snr
|
||||
@@ -0,0 +1,20 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Vicente J. Botet Escriba 2010.
|
||||
// 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/stm for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_CHRONO_HPP
|
||||
#define BOOST_CHRONO_HPP
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <boost/chrono/include.hpp>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif // BOOST_CHRONO_HPP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2001-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/aux_/na.hpp>
|
||||
#include <boost/mpl/aux_/config/msvc.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if !BOOST_WORKAROUND(_MSC_FULL_VER, <= 140050601) \
|
||||
&& !BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
|
||||
# include <boost/mpl/assert.hpp>
|
||||
# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \
|
||||
BOOST_MPL_ASSERT_NOT((boost::mpl::is_na<type>)) \
|
||||
/**/
|
||||
#else
|
||||
# include <boost/static_assert.hpp>
|
||||
# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \
|
||||
BOOST_STATIC_ASSERT(!boost::mpl::is_na<x>::value) \
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED
|
||||
@@ -0,0 +1,762 @@
|
||||
// Copyright (C) 2012 Vicente J. Botet Escriba
|
||||
//
|
||||
// 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)
|
||||
|
||||
// 2013/04 Vicente J. Botet Escriba
|
||||
// Provide implementation up to 9 parameters when BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined.
|
||||
// Make use of Boost.Move
|
||||
// Make use of Boost.Tuple (movable)
|
||||
// 2012/11 Vicente J. Botet Escriba
|
||||
// Adapt to boost libc++ implementation
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
// The invoker code is based on the one from libcxx.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef BOOST_THREAD_DETAIL_INVOKER_HPP
|
||||
#define BOOST_THREAD_DETAIL_INVOKER_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/utility/result_of.hpp>
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
#include <boost/thread/detail/make_tuple_indices.hpp>
|
||||
#include <boost/thread/csbl/tuple.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
#include <boost/thread/detail/variadic_header.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#if defined(BOOST_THREAD_PROVIDES_INVOKE) && ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && ! defined(BOOST_NO_CXX11_HDR_TUPLE)
|
||||
|
||||
template <class Fp, class ... Args>
|
||||
class invoker
|
||||
{
|
||||
//typedef typename decay<Fp>::type Fpd;
|
||||
//typedef tuple<typename decay<Args>::type...> Argsd;
|
||||
|
||||
//csbl::tuple<Fpd, Argsd...> f_;
|
||||
csbl::tuple<Fp, Args...> f_;
|
||||
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE( invoker)
|
||||
//typedef typename invoke_of<_Fp, _Args...>::type Rp;
|
||||
typedef typename result_of<Fp(Args...)>::type result_type;
|
||||
|
||||
template <class F, class ... As>
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(As)... args)
|
||||
: f_(boost::forward<F>(f), boost::forward<As>(args)...)
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f) : f_(boost::move(BOOST_THREAD_RV(f).f_))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker( const invoker& f) : f_(f.f_)
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker& operator=(BOOST_THREAD_RV_REF(invoker) f)
|
||||
{
|
||||
if (this != &f)
|
||||
{
|
||||
f_ = boost::move(BOOST_THREAD_RV(f).f_);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker& operator=( BOOST_THREAD_COPY_ASSIGN_REF(invoker) f)
|
||||
{
|
||||
if (this != &f)
|
||||
{
|
||||
f_ = f.f_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
typedef typename make_tuple_indices<1+sizeof...(Args), 1>::type Index;
|
||||
return execute(Index());
|
||||
}
|
||||
private:
|
||||
template <size_t ...Indices>
|
||||
result_type
|
||||
execute(tuple_indices<Indices...>)
|
||||
{
|
||||
return detail::invoke(boost::move(csbl::get<0>(f_)), boost::move(csbl::get<Indices>(f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
template <class R, class Fp, class ... Args>
|
||||
class invoker_ret
|
||||
{
|
||||
//typedef typename decay<Fp>::type Fpd;
|
||||
//typedef tuple<typename decay<Args>::type...> Argsd;
|
||||
|
||||
//csbl::tuple<Fpd, Argsd...> f_;
|
||||
csbl::tuple<Fp, Args...> f_;
|
||||
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE( invoker_ret)
|
||||
typedef R result_type;
|
||||
|
||||
template <class F, class ... As>
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker_ret(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(As)... args)
|
||||
: f_(boost::forward<F>(f), boost::forward<As>(args)...)
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker_ret(BOOST_THREAD_RV_REF(invoker_ret) f) : f_(boost::move(BOOST_THREAD_RV(f).f_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
typedef typename make_tuple_indices<1+sizeof...(Args), 1>::type Index;
|
||||
return execute(Index());
|
||||
}
|
||||
private:
|
||||
template <size_t ...Indices>
|
||||
result_type
|
||||
execute(tuple_indices<Indices...>)
|
||||
{
|
||||
return detail::invoke<R>(boost::move(csbl::get<0>(f_)), boost::move(csbl::get<Indices>(f_))...);
|
||||
}
|
||||
};
|
||||
//BOOST_THREAD_DCL_MOVABLE_BEG(X) invoker<Fp> BOOST_THREAD_DCL_MOVABLE_END
|
||||
#else
|
||||
|
||||
#if ! defined BOOST_MSVC && defined(BOOST_THREAD_PROVIDES_INVOKE)
|
||||
|
||||
#define BOOST_THREAD_RV_REF_ARG_T(z, n, unused) BOOST_PP_COMMA_IF(n) BOOST_THREAD_RV_REF(Arg##n)
|
||||
#define BOOST_THREAD_RV_REF_A_T(z, n, unused) BOOST_PP_COMMA_IF(n) BOOST_THREAD_RV_REF(A##n)
|
||||
#define BOOST_THREAD_RV_REF_ARG(z, n, unused) , BOOST_THREAD_RV_REF(Arg##n) arg##n
|
||||
#define BOOST_THREAD_FWD_REF_A(z, n, unused) , BOOST_THREAD_FWD_REF(A##n) arg##n
|
||||
#define BOOST_THREAD_FWD_REF_ARG(z, n, unused) , BOOST_THREAD_FWD_REF(Arg##n) arg##n
|
||||
#define BOOST_THREAD_FWD_PARAM(z, n, unused) , boost::forward<Arg##n>(arg##n)
|
||||
#define BOOST_THREAD_FWD_PARAM_A(z, n, unused) , boost::forward<A##n>(arg##n)
|
||||
#define BOOST_THREAD_DCL(z, n, unused) Arg##n v##n;
|
||||
#define BOOST_THREAD_MOVE_PARAM(z, n, unused) , v##n(boost::move(arg##n))
|
||||
#define BOOST_THREAD_FORWARD_PARAM_A(z, n, unused) , v##n(boost::forward<A##n>(arg##n))
|
||||
#define BOOST_THREAD_MOVE_RHS_PARAM(z, n, unused) , v##n(boost::move(x.v##n))
|
||||
#define BOOST_THREAD_MOVE_DCL(z, n, unused) , boost::move(v##n)
|
||||
#define BOOST_THREAD_MOVE_DCL_T(z, n, unused) BOOST_PP_COMMA_IF(n) boost::move(v##n)
|
||||
#define BOOST_THREAD_ARG_DEF(z, n, unused) , class Arg##n = tuples::null_type
|
||||
|
||||
template <class Fp, class Arg = tuples::null_type
|
||||
BOOST_PP_REPEAT(BOOST_THREAD_MAX_ARGS, BOOST_THREAD_ARG_DEF, ~)
|
||||
>
|
||||
class invoker;
|
||||
|
||||
#define BOOST_THREAD_ASYNC_FUNCT(z, n, unused) \
|
||||
template <class Fp BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class Arg) > \
|
||||
class invoker<Fp BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, Arg)> \
|
||||
{ \
|
||||
Fp fp_; \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_DCL, ~) \
|
||||
public: \
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker) \
|
||||
typedef typename result_of<Fp(BOOST_PP_ENUM_PARAMS(n, Arg))>::type result_type; \
|
||||
\
|
||||
template <class F BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class A) > \
|
||||
BOOST_SYMBOL_VISIBLE \
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(F) f \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_FWD_REF_A, ~) \
|
||||
) \
|
||||
: fp_(boost::forward<F>(f)) \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_FORWARD_PARAM_A, ~) \
|
||||
{} \
|
||||
\
|
||||
BOOST_SYMBOL_VISIBLE \
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) x) \
|
||||
: fp_(boost::move(x.fp_)) \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_RHS_PARAM, ~) \
|
||||
{} \
|
||||
\
|
||||
result_type operator()() { \
|
||||
return detail::invoke(boost::move(fp_) \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_DCL, ~) \
|
||||
); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template <class R BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class Arg) > \
|
||||
class invoker<R(*)(BOOST_PP_REPEAT(n, BOOST_THREAD_RV_REF_ARG_T, ~)) BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, Arg)> \
|
||||
{ \
|
||||
typedef R(*Fp)(BOOST_PP_REPEAT(n, BOOST_THREAD_RV_REF_ARG_T, ~)); \
|
||||
Fp fp_; \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_DCL, ~) \
|
||||
public: \
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker) \
|
||||
typedef typename result_of<Fp(BOOST_PP_ENUM_PARAMS(n, Arg))>::type result_type; \
|
||||
\
|
||||
template <class R2 BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class A) > \
|
||||
BOOST_SYMBOL_VISIBLE \
|
||||
explicit invoker(R2(*f)(BOOST_PP_REPEAT(n, BOOST_THREAD_RV_REF_A_T, ~)) \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_FWD_REF_A, ~) \
|
||||
) \
|
||||
: fp_(f) \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_FORWARD_PARAM_A, ~) \
|
||||
{} \
|
||||
\
|
||||
BOOST_SYMBOL_VISIBLE \
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) x) \
|
||||
: fp_(x.fp_) \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_RHS_PARAM, ~) \
|
||||
{} \
|
||||
\
|
||||
result_type operator()() { \
|
||||
return fp_( \
|
||||
BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_DCL_T, ~) \
|
||||
); \
|
||||
} \
|
||||
};
|
||||
|
||||
BOOST_PP_REPEAT(BOOST_THREAD_MAX_ARGS, BOOST_THREAD_ASYNC_FUNCT, ~)
|
||||
|
||||
#undef BOOST_THREAD_RV_REF_ARG_T
|
||||
#undef BOOST_THREAD_RV_REF_ARG
|
||||
#undef BOOST_THREAD_FWD_REF_ARG
|
||||
#undef BOOST_THREAD_FWD_REF_A
|
||||
#undef BOOST_THREAD_FWD_PARAM
|
||||
#undef BOOST_THREAD_FWD_PARAM_A
|
||||
#undef BOOST_THREAD_DCL
|
||||
#undef BOOST_THREAD_MOVE_PARAM
|
||||
#undef BOOST_THREAD_MOVE_RHS_PARAM
|
||||
#undef BOOST_THREAD_MOVE_DCL
|
||||
#undef BOOST_THREAD_ARG_DEF
|
||||
#undef BOOST_THREAD_ASYNC_FUNCT
|
||||
|
||||
#else
|
||||
|
||||
template <class Fp,
|
||||
class T0 = tuples::null_type, class T1 = tuples::null_type, class T2 = tuples::null_type,
|
||||
class T3 = tuples::null_type, class T4 = tuples::null_type, class T5 = tuples::null_type,
|
||||
class T6 = tuples::null_type, class T7 = tuples::null_type, class T8 = tuples::null_type
|
||||
, class T9 = tuples::null_type
|
||||
>
|
||||
class invoker;
|
||||
|
||||
template <class Fp,
|
||||
class T0 , class T1 , class T2 ,
|
||||
class T3 , class T4 , class T5 ,
|
||||
class T6 , class T7 , class T8 >
|
||||
class invoker<Fp, T0, T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
T3 v3_;
|
||||
T4 v4_;
|
||||
T5 v5_;
|
||||
T6 v6_;
|
||||
T7 v7_;
|
||||
T8 v8_;
|
||||
//::boost::tuple<Fp, T0, T1, T2, T3, T4, T5, T6, T7, T8> f_;
|
||||
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5, T6, T7, T8)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
, BOOST_THREAD_RV_REF(T3) a3
|
||||
, BOOST_THREAD_RV_REF(T4) a4
|
||||
, BOOST_THREAD_RV_REF(T5) a5
|
||||
, BOOST_THREAD_RV_REF(T6) a6
|
||||
, BOOST_THREAD_RV_REF(T7) a7
|
||||
, BOOST_THREAD_RV_REF(T8) a8
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
, v3_(boost::move(a3))
|
||||
, v4_(boost::move(a4))
|
||||
, v5_(boost::move(a5))
|
||||
, v6_(boost::move(a6))
|
||||
, v7_(boost::move(a7))
|
||||
, v8_(boost::move(a8))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
, v3_(boost::move(BOOST_THREAD_RV(f).v3_))
|
||||
, v4_(boost::move(BOOST_THREAD_RV(f).v4_))
|
||||
, v5_(boost::move(BOOST_THREAD_RV(f).v5_))
|
||||
, v6_(boost::move(BOOST_THREAD_RV(f).v6_))
|
||||
, v7_(boost::move(BOOST_THREAD_RV(f).v7_))
|
||||
, v8_(boost::move(BOOST_THREAD_RV(f).v8_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
, boost::move(v3_)
|
||||
, boost::move(v4_)
|
||||
, boost::move(v5_)
|
||||
, boost::move(v6_)
|
||||
, boost::move(v7_)
|
||||
, boost::move(v8_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7 >
|
||||
class invoker<Fp, T0, T1, T2, T3, T4, T5, T6, T7>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
T3 v3_;
|
||||
T4 v4_;
|
||||
T5 v5_;
|
||||
T6 v6_;
|
||||
T7 v7_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5, T6, T7)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
, BOOST_THREAD_RV_REF(T3) a3
|
||||
, BOOST_THREAD_RV_REF(T4) a4
|
||||
, BOOST_THREAD_RV_REF(T5) a5
|
||||
, BOOST_THREAD_RV_REF(T6) a6
|
||||
, BOOST_THREAD_RV_REF(T7) a7
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
, v3_(boost::move(a3))
|
||||
, v4_(boost::move(a4))
|
||||
, v5_(boost::move(a5))
|
||||
, v6_(boost::move(a6))
|
||||
, v7_(boost::move(a7))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
, v3_(boost::move(BOOST_THREAD_RV(f).v3_))
|
||||
, v4_(boost::move(BOOST_THREAD_RV(f).v4_))
|
||||
, v5_(boost::move(BOOST_THREAD_RV(f).v5_))
|
||||
, v6_(boost::move(BOOST_THREAD_RV(f).v6_))
|
||||
, v7_(boost::move(BOOST_THREAD_RV(f).v7_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
, boost::move(v3_)
|
||||
, boost::move(v4_)
|
||||
, boost::move(v5_)
|
||||
, boost::move(v6_)
|
||||
, boost::move(v7_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
class invoker<Fp, T0, T1, T2, T3, T4, T5, T6>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
T3 v3_;
|
||||
T4 v4_;
|
||||
T5 v5_;
|
||||
T6 v6_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5, T6)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
, BOOST_THREAD_RV_REF(T3) a3
|
||||
, BOOST_THREAD_RV_REF(T4) a4
|
||||
, BOOST_THREAD_RV_REF(T5) a5
|
||||
, BOOST_THREAD_RV_REF(T6) a6
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
, v3_(boost::move(a3))
|
||||
, v4_(boost::move(a4))
|
||||
, v5_(boost::move(a5))
|
||||
, v6_(boost::move(a6))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
, v3_(boost::move(BOOST_THREAD_RV(f).v3_))
|
||||
, v4_(boost::move(BOOST_THREAD_RV(f).v4_))
|
||||
, v5_(boost::move(BOOST_THREAD_RV(f).v5_))
|
||||
, v6_(boost::move(BOOST_THREAD_RV(f).v6_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
, boost::move(v3_)
|
||||
, boost::move(v4_)
|
||||
, boost::move(v5_)
|
||||
, boost::move(v6_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1, class T2, class T3, class T4, class T5>
|
||||
class invoker<Fp, T0, T1, T2, T3, T4, T5>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
T3 v3_;
|
||||
T4 v4_;
|
||||
T5 v5_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
, BOOST_THREAD_RV_REF(T3) a3
|
||||
, BOOST_THREAD_RV_REF(T4) a4
|
||||
, BOOST_THREAD_RV_REF(T5) a5
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
, v3_(boost::move(a3))
|
||||
, v4_(boost::move(a4))
|
||||
, v5_(boost::move(a5))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
, v3_(boost::move(BOOST_THREAD_RV(f).v3_))
|
||||
, v4_(boost::move(BOOST_THREAD_RV(f).v4_))
|
||||
, v5_(boost::move(BOOST_THREAD_RV(f).v5_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
, boost::move(v3_)
|
||||
, boost::move(v4_)
|
||||
, boost::move(v5_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1, class T2, class T3, class T4>
|
||||
class invoker<Fp, T0, T1, T2, T3, T4>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
T3 v3_;
|
||||
T4 v4_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2, T3, T4)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
, BOOST_THREAD_RV_REF(T3) a3
|
||||
, BOOST_THREAD_RV_REF(T4) a4
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
, v3_(boost::move(a3))
|
||||
, v4_(boost::move(a4))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
, v3_(boost::move(BOOST_THREAD_RV(f).v3_))
|
||||
, v4_(boost::move(BOOST_THREAD_RV(f).v4_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
, boost::move(v3_)
|
||||
, boost::move(v4_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1, class T2, class T3>
|
||||
class invoker<Fp, T0, T1, T2, T3>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
T3 v3_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2, T3)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
, BOOST_THREAD_RV_REF(T3) a3
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
, v3_(boost::move(a3))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
, v3_(boost::move(BOOST_THREAD_RV(f).v3_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
, boost::move(v3_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1, class T2>
|
||||
class invoker<Fp, T0, T1, T2>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
T2 v2_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1, T2)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
, BOOST_THREAD_RV_REF(T2) a2
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
, v2_(boost::move(a2))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
, v2_(boost::move(BOOST_THREAD_RV(f).v2_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
, boost::move(v2_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0, class T1>
|
||||
class invoker<Fp, T0, T1>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
T1 v1_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0, T1)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
, BOOST_THREAD_RV_REF(T1) a1
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
, v1_(boost::move(a1))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
, v1_(boost::move(BOOST_THREAD_RV(f).v1_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
, boost::move(v1_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp, class T0>
|
||||
class invoker<Fp, T0>
|
||||
{
|
||||
Fp fp_;
|
||||
T0 v0_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp(T0)>::type result_type;
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
|
||||
, BOOST_THREAD_RV_REF(T0) a0
|
||||
)
|
||||
: fp_(boost::move(f))
|
||||
, v0_(boost::move(a0))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(BOOST_THREAD_RV(f).fp))
|
||||
, v0_(boost::move(BOOST_THREAD_RV(f).v0_))
|
||||
{}
|
||||
|
||||
result_type operator()()
|
||||
{
|
||||
return detail::invoke(boost::move(fp_)
|
||||
, boost::move(v0_)
|
||||
);
|
||||
}
|
||||
};
|
||||
template <class Fp>
|
||||
class invoker<Fp>
|
||||
{
|
||||
Fp fp_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp()>::type result_type;
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(BOOST_THREAD_FWD_REF(Fp) f)
|
||||
: fp_(boost::move(f))
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(boost::move(f.fp_))
|
||||
{}
|
||||
result_type operator()()
|
||||
{
|
||||
return fp_();
|
||||
}
|
||||
};
|
||||
template <class R>
|
||||
class invoker<R(*)()>
|
||||
{
|
||||
typedef R(*Fp)();
|
||||
Fp fp_;
|
||||
public:
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
|
||||
typedef typename result_of<Fp()>::type result_type;
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
explicit invoker(Fp f)
|
||||
: fp_(f)
|
||||
{}
|
||||
|
||||
BOOST_SYMBOL_VISIBLE
|
||||
invoker(BOOST_THREAD_RV_REF(invoker) f)
|
||||
: fp_(f.fp_)
|
||||
{}
|
||||
result_type operator()()
|
||||
{
|
||||
return fp_();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/thread/detail/variadic_footer.hpp>
|
||||
|
||||
#endif // header
|
||||
@@ -0,0 +1,27 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 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 for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_SEQ_POP_FRONT_HPP
|
||||
# define BOOST_PREPROCESSOR_SEQ_POP_FRONT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/seq/seq.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SEQ_POP_FRONT */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_POP_FRONT(seq) BOOST_PP_SEQ_TAIL(seq)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_POP_FRONT(seq) BOOST_PP_SEQ_POP_FRONT_I(seq)
|
||||
# define BOOST_PP_SEQ_POP_FRONT_I(seq) BOOST_PP_SEQ_TAIL(seq)
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,25 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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_FUSION_CONTAINER_SET_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_CONTAINER_SET_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/set/detail/deref_impl.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<set_iterator_tag>
|
||||
: deref_impl<set_iterator_tag>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_RANGE_C_ITERATOR_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_RANGE_C_ITERATOR_HPP_INCLUDED
|
||||
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/iterator_tags.hpp>
|
||||
#include <boost/mpl/advance_fwd.hpp>
|
||||
#include <boost/mpl/distance_fwd.hpp>
|
||||
#include <boost/mpl/next_prior.hpp>
|
||||
#include <boost/mpl/deref.hpp>
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/mpl/aux_/value_wknd.hpp>
|
||||
#include <boost/mpl/aux_/config/ctps.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
// theoretically will work on any discrete numeric type
|
||||
template< typename N > struct r_iter
|
||||
{
|
||||
typedef aux::r_iter_tag tag;
|
||||
typedef random_access_iterator_tag category;
|
||||
typedef N type;
|
||||
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
typedef r_iter< typename mpl::next<N>::type > next;
|
||||
typedef r_iter< typename mpl::prior<N>::type > prior;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
template<
|
||||
typename N
|
||||
>
|
||||
struct next< r_iter<N> >
|
||||
{
|
||||
typedef r_iter< typename mpl::next<N>::type > type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename N
|
||||
>
|
||||
struct prior< r_iter<N> >
|
||||
{
|
||||
typedef r_iter< typename mpl::prior<N>::type > type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
template<> struct advance_impl<aux::r_iter_tag>
|
||||
{
|
||||
template< typename Iter, typename Dist > struct apply
|
||||
{
|
||||
typedef typename deref<Iter>::type n_;
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
typedef typename plus_impl<integral_c_tag,integral_c_tag>
|
||||
::template apply<n_,Dist>::type m_;
|
||||
#else
|
||||
typedef typename plus<n_,Dist>::type m_;
|
||||
#endif
|
||||
// agurt, 10/nov/04: to be generic, the code have to do something along
|
||||
// the lines below...
|
||||
//
|
||||
// typedef typename apply_wrap1<
|
||||
// numeric_cast< typename m_::tag, typename n_::tag >
|
||||
// , m_
|
||||
// >::type result_;
|
||||
//
|
||||
// ... meanwhile:
|
||||
|
||||
typedef integral_c<
|
||||
typename aux::value_type_wknd<n_>::type
|
||||
, BOOST_MPL_AUX_VALUE_WKND(m_)::value
|
||||
> result_;
|
||||
|
||||
typedef r_iter<result_> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<> struct distance_impl<aux::r_iter_tag>
|
||||
{
|
||||
template< typename Iter1, typename Iter2 > struct apply
|
||||
: minus<
|
||||
typename Iter2::type
|
||||
, typename Iter1::type
|
||||
>
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_AUX_RANGE_C_ITERATOR_HPP_INCLUDED
|
||||
Reference in New Issue
Block a user