Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,275 @@
// Copyright John Maddock 2006.
// 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_STATS_EXPONENTIAL_HPP
#define BOOST_STATS_EXPONENTIAL_HPP
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
# pragma warning(disable: 4702) // unreachable code (return after domain_error throw).
#endif
#include <utility>
namespace boost{ namespace math{
namespace detail{
//
// Error check:
//
template <class RealType, class Policy>
inline bool verify_lambda(const char* function, RealType l, RealType* presult, const Policy& pol)
{
if((l <= 0) || !(boost::math::isfinite)(l))
{
*presult = policies::raise_domain_error<RealType>(
function,
"The scale parameter \"lambda\" must be > 0, but was: %1%.", l, pol);
return false;
}
return true;
}
template <class RealType, class Policy>
inline bool verify_exp_x(const char* function, RealType x, RealType* presult, const Policy& pol)
{
if((x < 0) || (boost::math::isnan)(x))
{
*presult = policies::raise_domain_error<RealType>(
function,
"The random variable must be >= 0, but was: %1%.", x, pol);
return false;
}
return true;
}
} // namespace detail
template <class RealType = double, class Policy = policies::policy<> >
class exponential_distribution
{
public:
typedef RealType value_type;
typedef Policy policy_type;
exponential_distribution(RealType l_lambda = 1)
: m_lambda(l_lambda)
{
RealType err;
detail::verify_lambda("boost::math::exponential_distribution<%1%>::exponential_distribution", l_lambda, &err, Policy());
} // exponential_distribution
RealType lambda()const { return m_lambda; }
private:
RealType m_lambda;
};
typedef exponential_distribution<double> exponential;
template <class RealType, class Policy>
inline const std::pair<RealType, RealType> range(const exponential_distribution<RealType, Policy>& /*dist*/)
{ // Range of permissible values for random variable x.
if (std::numeric_limits<RealType>::has_infinity)
{
return std::pair<RealType, RealType>(static_cast<RealType>(0), std::numeric_limits<RealType>::infinity()); // 0 to + infinity.
}
else
{
using boost::math::tools::max_value;
return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>()); // 0 to + max
}
}
template <class RealType, class Policy>
inline const std::pair<RealType, RealType> support(const exponential_distribution<RealType, Policy>& /*dist*/)
{ // Range of supported values for random variable x.
// This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
using boost::math::tools::max_value;
using boost::math::tools::min_value;
return std::pair<RealType, RealType>(min_value<RealType>(), max_value<RealType>());
// min_value<RealType>() to avoid a discontinuity at x = 0.
}
template <class RealType, class Policy>
inline RealType pdf(const exponential_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::pdf(const exponential_distribution<%1%>&, %1%)";
RealType lambda = dist.lambda();
RealType result = 0;
if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
return result;
if(0 == detail::verify_exp_x(function, x, &result, Policy()))
return result;
// Workaround for VC11/12 bug:
if ((boost::math::isinf)(x))
return 0;
result = lambda * exp(-lambda * x);
return result;
} // pdf
template <class RealType, class Policy>
inline RealType cdf(const exponential_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";
RealType result = 0;
RealType lambda = dist.lambda();
if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
return result;
if(0 == detail::verify_exp_x(function, x, &result, Policy()))
return result;
result = -boost::math::expm1(-x * lambda, Policy());
return result;
} // cdf
template <class RealType, class Policy>
inline RealType quantile(const exponential_distribution<RealType, Policy>& dist, const RealType& p)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";
RealType result = 0;
RealType lambda = dist.lambda();
if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
return result;
if(0 == detail::check_probability(function, p, &result, Policy()))
return result;
if(p == 0)
return 0;
if(p == 1)
return policies::raise_overflow_error<RealType>(function, 0, Policy());
result = -boost::math::log1p(-p, Policy()) / lambda;
return result;
} // quantile
template <class RealType, class Policy>
inline RealType cdf(const complemented2_type<exponential_distribution<RealType, Policy>, RealType>& c)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";
RealType result = 0;
RealType lambda = c.dist.lambda();
if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
return result;
if(0 == detail::verify_exp_x(function, c.param, &result, Policy()))
return result;
// Workaround for VC11/12 bug:
if (c.param >= tools::max_value<RealType>())
return 0;
result = exp(-c.param * lambda);
return result;
}
template <class RealType, class Policy>
inline RealType quantile(const complemented2_type<exponential_distribution<RealType, Policy>, RealType>& c)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";
RealType result = 0;
RealType lambda = c.dist.lambda();
if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
return result;
RealType q = c.param;
if(0 == detail::check_probability(function, q, &result, Policy()))
return result;
if(q == 1)
return 0;
if(q == 0)
return policies::raise_overflow_error<RealType>(function, 0, Policy());
result = -log(q) / lambda;
return result;
}
template <class RealType, class Policy>
inline RealType mean(const exponential_distribution<RealType, Policy>& dist)
{
RealType result = 0;
RealType lambda = dist.lambda();
if(0 == detail::verify_lambda("boost::math::mean(const exponential_distribution<%1%>&)", lambda, &result, Policy()))
return result;
return 1 / lambda;
}
template <class RealType, class Policy>
inline RealType standard_deviation(const exponential_distribution<RealType, Policy>& dist)
{
RealType result = 0;
RealType lambda = dist.lambda();
if(0 == detail::verify_lambda("boost::math::standard_deviation(const exponential_distribution<%1%>&)", lambda, &result, Policy()))
return result;
return 1 / lambda;
}
template <class RealType, class Policy>
inline RealType mode(const exponential_distribution<RealType, Policy>& /*dist*/)
{
return 0;
}
template <class RealType, class Policy>
inline RealType median(const exponential_distribution<RealType, Policy>& dist)
{
using boost::math::constants::ln_two;
return ln_two<RealType>() / dist.lambda(); // ln(2) / lambda
}
template <class RealType, class Policy>
inline RealType skewness(const exponential_distribution<RealType, Policy>& /*dist*/)
{
return 2;
}
template <class RealType, class Policy>
inline RealType kurtosis(const exponential_distribution<RealType, Policy>& /*dist*/)
{
return 9;
}
template <class RealType, class Policy>
inline RealType kurtosis_excess(const exponential_distribution<RealType, Policy>& /*dist*/)
{
return 6;
}
} // namespace math
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
// This include must be at the end, *after* the accessors
// for this distribution have been defined, in order to
// keep compilers that support two-phase lookup happy.
#include <boost/math/distributions/detail/derived_accessors.hpp>
#endif // BOOST_STATS_EXPONENTIAL_HPP
@@ -0,0 +1,79 @@
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
#include <boost/proto/transform/detail/preprocessed/lazy.hpp>
#elif !defined(BOOST_PP_IS_ITERATING)
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/lazy.hpp")
#endif
///////////////////////////////////////////////////////////////////////////////
/// \file lazy.hpp
/// Contains definition of the lazy<> transform.
//
// Copyright 2008 Eric Niebler. 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_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/lazy.hpp>))
#include BOOST_PP_ITERATE()
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#else
#define N BOOST_PP_ITERATION()
/// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
/// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
///
/// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
/// transform to be applied depends on the current state of the
/// transformation. The invocation of the <tt>make\<\></tt> transform
/// evaluates any nested transforms, and the resulting type is treated
/// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))>
: transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
{
template<typename Expr, typename State, typename Data>
struct impl
: call<
typename make<Object>::template impl<Expr, State, Data>::result_type
(BOOST_PP_ENUM_PARAMS(N, A))
>::template impl<Expr, State, Data>
{};
};
#if N > 0
template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A)...)>
: transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A)...)> >
{
template<typename Expr, typename State, typename Data>
struct impl
: lazy<
typename detail::expand_pattern<
proto::arity_of<Expr>::value
, BOOST_PP_CAT(A, BOOST_PP_DEC(N))
, detail::BOOST_PP_CAT(expand_pattern_rest_, BOOST_PP_DEC(N))<
Object
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_DEC(N), A)
>
>::type
>::template impl<Expr, State, Data>
{};
};
#endif
#undef N
#endif
@@ -0,0 +1,103 @@
!subroutine sync65(ss,nfa,nfb,naggressive,ntol,nqsym,ca,ncand,nrobust, &
! bVHF)
subroutine sync65(nfa,nfb,naggressive,ntol,nqsym,ca,ncand,nrobust, &
bVHF)
parameter (NSZ=3413,NFFT=8192,MAXCAND=300)
! real ss(322,NSZ)
real ss(552,NSZ)
real ccfblue(-32:82) !CCF with pseudorandom sequence
real ccfred(NSZ) !Peak of ccfblue, as function of freq
logical bVHF
type candidate
real freq
real dt
real sync
real flip
end type candidate
type(candidate) ca(MAXCAND)
common/steve/thresh0
common/sync/ss
if(ntol.eq.-99) stop !Silence compiler warning
call setup65
df=12000.0/NFFT !df = 12000.0/8192 = 1.465 Hz
ia=max(2,nint(nfa/df))
ib=min(NSZ-1,nint(nfb/df))
! lag1=-11
! lag2=59
! lag1=-22
! lag2=118
lag1=-32
lag2=82 !may need to be extended for EME
nsym=126
ncand=0
fdot=0.
ccfred=0.
ccfblue=0.
ccfmax=0.
ipk=0
do i=ia,ib
! call xcor(ss,i,nqsym,nsym,lag1,lag2,ccfblue,ccf0,lagpk0,flip,fdot,nrobust)
call xcor(i,nqsym,nsym,lag1,lag2,ccfblue,ccf0,lagpk0,flip,fdot,nrobust)
! Remove best-fit slope from ccfblue and normalize so baseline rms=1.0
if(.not.bVHF) call slope(ccfblue(lag1),lag2-lag1+1, &
lagpk0-lag1+1.0)
ccfred(i)=ccfblue(lagpk0)
if(ccfred(i).gt.ccfmax) then
ccfmax=ccfred(i)
ipk=i
endif
enddo
call pctile(ccfred(ia:ib),ib-ia+1,35,xmed)
ccfred(ia:ib)=ccfred(ia:ib)-xmed
ccfred(ia-1)=ccfred(ia)
ccfred(ib+1)=ccfred(ib)
do i=ia,ib
freq=i*df
itry=0
! if(naggressive.gt.0 .and. ntol.lt.1000 .and. ccfmax.ge.thresh0) then
if(naggressive.gt.0 .and. ccfmax.ge.thresh0) then
if(i.ne.ipk) cycle
itry=1
ncand=ncand+1
else
if(ccfred(i).ge.thresh0 .and. ccfred(i).gt.ccfred(i-1) .and. &
ccfred(i).gt.ccfred(i+1)) then
itry=1
ncand=ncand+1
endif
endif
if(itry.ne.0) then
! call xcor(ss,i,nqsym,nsym,lag1,lag2,ccfblue,ccf0,lagpk,flip,fdot, &
! nrobust)
call xcor(i,nqsym,nsym,lag1,lag2,ccfblue,ccf0,lagpk,flip,fdot,nrobust)
if(.not.bVHF) call slope(ccfblue(lag1),lag2-lag1+1, &
lagpk-lag1+1.0)
xlag=lagpk
if(lagpk.gt.lag1 .and. lagpk.lt.lag2) then
call peakup(ccfblue(lagpk-1),ccfmax,ccfblue(lagpk+1),dx2)
xlag=lagpk+dx2
endif
! dtx=xlag*2048.0/11025.0
dtx=xlag*1024.0/11025.0
ccfblue(lag1)=0.
ccfblue(lag2)=0.
ca(ncand)%freq=freq
ca(ncand)%dt=dtx
ca(ncand)%flip=flip
if(bVHF) then
ca(ncand)%sync=db(ccfred(i)) - 16.0
else
ca(ncand)%sync=ccfred(i)
endif
endif
if(ncand.eq.MAXCAND) exit
enddo
return
end subroutine sync65
@@ -0,0 +1,41 @@
#ifndef BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
#define BOOST_MPL_AUX_FRONT_IMPL_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/front_fwd.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/aux_/traits_lambda_spec.hpp>
namespace boost { namespace mpl {
// default implementation; conrete sequences might override it by
// specializing either the 'front_impl' or the primary 'front' template
template< typename Tag >
struct front_impl
{
template< typename Sequence > struct apply
{
typedef typename begin<Sequence>::type iter_;
typedef typename deref<iter_>::type type;
};
};
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,front_impl)
}}
#endif // BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
@@ -0,0 +1,409 @@
// 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)
// (C) Copyright 2007 Anthony Williams
#ifndef THREAD_HEAP_ALLOC_HPP
#define THREAD_HEAP_ALLOC_HPP
#include <new>
#include <boost/thread/detail/config.hpp>
#include <boost/thread/win32/thread_primitives.hpp>
#include <stdexcept>
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
#include <boost/core/no_exceptions_support.hpp>
#if defined( BOOST_USE_WINDOWS_H )
# include <windows.h>
namespace boost
{
namespace detail
{
namespace win32
{
using ::GetProcessHeap;
using ::HeapAlloc;
using ::HeapFree;
}
}
}
#else
# ifdef HeapAlloc
# undef HeapAlloc
# endif
namespace boost
{
namespace detail
{
namespace win32
{
extern "C"
{
__declspec(dllimport) handle __stdcall GetProcessHeap();
__declspec(dllimport) void* __stdcall HeapAlloc(handle,unsigned long,ulong_ptr);
__declspec(dllimport) int __stdcall HeapFree(handle,unsigned long,void*);
}
}
}
}
#endif
#include <boost/config/abi_prefix.hpp>
namespace boost
{
namespace detail
{
inline void* allocate_raw_heap_memory(unsigned size)
{
void* const heap_memory=detail::win32::HeapAlloc(detail::win32::GetProcessHeap(),0,size);
if(!heap_memory)
{
boost::throw_exception(std::bad_alloc());
}
return heap_memory;
}
inline void free_raw_heap_memory(void* heap_memory)
{
BOOST_VERIFY(detail::win32::HeapFree(detail::win32::GetProcessHeap(),0,heap_memory)!=0);
}
template<typename T>
inline T* heap_new()
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T();
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template<typename T,typename A1>
inline T* heap_new(A1&& a1)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1));
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1,typename A2>
inline T* heap_new(A1&& a1,A2&& a2)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2));
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1&& a1,A2&& a2,A3&& a3)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2),
static_cast<A3&&>(a3));
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1&& a1,A2&& a2,A3&& a3,A4&& a4)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2),
static_cast<A3&&>(a3),static_cast<A4&&>(a4));
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
#else
template<typename T,typename A1>
inline T* heap_new_impl(A1 a1)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(a1);
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1,typename A2>
inline T* heap_new_impl(A1 a1,A2 a2)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(a1,a2);
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new_impl(A1 a1,A2 a2,A3 a3)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(a1,a2,a3);
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
BOOST_TRY
{
T* const data=new (heap_memory) T(a1,a2,a3,a4);
return data;
}
BOOST_CATCH(...)
{
free_raw_heap_memory(heap_memory);
BOOST_RETHROW
}
BOOST_CATCH_END
}
template<typename T,typename A1>
inline T* heap_new(A1 const& a1)
{
return heap_new_impl<T,A1 const&>(a1);
}
template<typename T,typename A1>
inline T* heap_new(A1& a1)
{
return heap_new_impl<T,A1&>(a1);
}
template<typename T,typename A1,typename A2>
inline T* heap_new(A1 const& a1,A2 const& a2)
{
return heap_new_impl<T,A1 const&,A2 const&>(a1,a2);
}
template<typename T,typename A1,typename A2>
inline T* heap_new(A1& a1,A2 const& a2)
{
return heap_new_impl<T,A1&,A2 const&>(a1,a2);
}
template<typename T,typename A1,typename A2>
inline T* heap_new(A1 const& a1,A2& a2)
{
return heap_new_impl<T,A1 const&,A2&>(a1,a2);
}
template<typename T,typename A1,typename A2>
inline T* heap_new(A1& a1,A2& a2)
{
return heap_new_impl<T,A1&,A2&>(a1,a2);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1 const& a1,A2 const& a2,A3 const& a3)
{
return heap_new_impl<T,A1 const&,A2 const&,A3 const&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1& a1,A2 const& a2,A3 const& a3)
{
return heap_new_impl<T,A1&,A2 const&,A3 const&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1 const& a1,A2& a2,A3 const& a3)
{
return heap_new_impl<T,A1 const&,A2&,A3 const&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1& a1,A2& a2,A3 const& a3)
{
return heap_new_impl<T,A1&,A2&,A3 const&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1 const& a1,A2 const& a2,A3& a3)
{
return heap_new_impl<T,A1 const&,A2 const&,A3&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1& a1,A2 const& a2,A3& a3)
{
return heap_new_impl<T,A1&,A2 const&,A3&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1 const& a1,A2& a2,A3& a3)
{
return heap_new_impl<T,A1 const&,A2&,A3&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1& a1,A2& a2,A3& a3)
{
return heap_new_impl<T,A1&,A2&,A3&>(a1,a2,a3);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2 const& a2,A3 const& a3,A4 const& a4)
{
return heap_new_impl<T,A1 const&,A2 const&,A3 const&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2 const& a2,A3 const& a3,A4 const& a4)
{
return heap_new_impl<T,A1&,A2 const&,A3 const&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2& a2,A3 const& a3,A4 const& a4)
{
return heap_new_impl<T,A1 const&,A2&,A3 const&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2& a2,A3 const& a3,A4 const& a4)
{
return heap_new_impl<T,A1&,A2&,A3 const&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2 const& a2,A3& a3,A4 const& a4)
{
return heap_new_impl<T,A1 const&,A2 const&,A3&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2 const& a2,A3& a3,A4 const& a4)
{
return heap_new_impl<T,A1&,A2 const&,A3&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2& a2,A3& a3,A4 const& a4)
{
return heap_new_impl<T,A1 const&,A2&,A3&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2& a2,A3& a3,A4 const& a4)
{
return heap_new_impl<T,A1&,A2&,A3&,A4 const&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2 const& a2,A3 const& a3,A4& a4)
{
return heap_new_impl<T,A1 const&,A2 const&,A3 const&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2 const& a2,A3 const& a3,A4& a4)
{
return heap_new_impl<T,A1&,A2 const&,A3 const&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2& a2,A3 const& a3,A4& a4)
{
return heap_new_impl<T,A1 const&,A2&,A3 const&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2& a2,A3 const& a3,A4& a4)
{
return heap_new_impl<T,A1&,A2&,A3 const&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2 const& a2,A3& a3,A4& a4)
{
return heap_new_impl<T,A1 const&,A2 const&,A3&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2 const& a2,A3& a3,A4& a4)
{
return heap_new_impl<T,A1&,A2 const&,A3&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1 const& a1,A2& a2,A3& a3,A4& a4)
{
return heap_new_impl<T,A1 const&,A2&,A3&,A4&>(a1,a2,a3,a4);
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1& a1,A2& a2,A3& a3,A4& a4)
{
return heap_new_impl<T,A1&,A2&,A3&,A4&>(a1,a2,a3,a4);
}
#endif
template<typename T>
inline void heap_delete(T* data)
{
data->~T();
free_raw_heap_memory(data);
}
template<typename T>
struct do_heap_delete
{
void operator()(T* data) const
{
detail::heap_delete(data);
}
};
}
}
#include <boost/config/abi_suffix.hpp>
#endif
@@ -0,0 +1,36 @@
subroutine sh65snr(x,nz,snr)
real x(nz)
ipk=0 !Shut up compiler warnings. -db
smax=-1.e30
do i=1,nz
if(x(i).gt.smax) then
ipk=i
smax=x(i)
endif
s=s+x(i)
enddo
s=0.
ns=0
do i=1,nz
if(abs(i-ipk).ge.3) then
s=s+x(i)
ns=ns+1
endif
enddo
ave=s/ns
sq=0.
do i=1,nz
if(abs(i-ipk).ge.3) then
sq=sq+(x(i)-ave)**2
ns=ns+1
endif
enddo
rms=sqrt(sq/(nz-2))
snr=(smax-ave)/rms
return
end subroutine sh65snr
@@ -0,0 +1,166 @@
subroutine hint65(s3,mrs,mrs2,nadd,nflip,mycall,hiscall,hisgrid,qual,decoded)
use packjt
use prog_args
parameter (MAXCALLS=10000,MAXRPT=63)
parameter (MAXMSG=2*MAXCALLS + 2 + MAXRPT)
real s3(64,63)
integer*1 sym1(0:62,MAXMSG)
integer*1 sym2(0:62,MAXMSG)
integer mrs(63),mrs2(63)
integer dgen(12),sym(0:62),sym_rev(0:62)
character*6 mycall,hiscall,hisgrid,call2(MAXCALLS)
character*4 grid2(MAXCALLS),rpt(MAXRPT)
character callsign*12,grid*4
character*180 line
character ceme*3,msg*22,msg00*22
character*22 msg0(MAXMSG),decoded
logical*1 eme(MAXCALLS)
logical first
data first/.true./
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 first,sym1,nused,msg0,sym2
first=.true. !### For now, at least: always recompute hypothetical messages
if(first) then
neme=0
open(23,file=trim(data_dir)//'/CALL3.TXT',status='unknown')
icall=0
j=0
do i=1,MAXCALLS
read(23,1002,end=10) line
1002 format(a80)
if(line(1:4).eq.'ZZZZ') cycle
if(line(1:2).eq.'//') cycle
i1=index(line,',')
if(i1.lt.4) cycle
i2=index(line(i1+1:),',')
if(i2.lt.5) cycle
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:i1+4)
ceme=line(i2+1:i3-1)
eme(i)=ceme.eq.'EME'
if(neme.eq.1 .and. (.not.eme(i))) cycle
j=j+1
call2(j)=callsign(1:6) !### Fix for compound callsigns!
grid2(j)=grid
enddo
10 ncalls=j
if(ncalls.lt.10) then
write(*,1010) ncalls
1010 format('CALL3.TXT very short (N =',i2,') or missing?')
endif
close(23)
! NB: generation of test messages is not yet complete!
j=0
do i=-1,ncalls
if(i.eq.0 .and. hiscall.eq.' ' .and. hisgrid(1:4).eq.' ') cycle
mz=2
if(i.eq.-1) mz=1
if(i.eq.0) mz=65
do m=1,mz
j=j+1
if(i.eq.-1) then
msg='0123456789ABC'
else if(i.eq.0) then
if(m.eq.1) msg=mycall//' '//hiscall//' '//hisgrid(1:4)
if(m.eq.2) msg='CQ '//hiscall//' '//hisgrid(1:4)
if(m.ge.3) msg=mycall//' '//hiscall//' '//rpt(m-2)
else
if(m.eq.1) msg=mycall//' '//call2(i)//' '//grid2(i)
if(m.eq.2) msg='CQ '//call2(i)//' '//grid2(i)
endif
call fmtmsg(msg,iz)
call packmsg(msg,dgen,itype) !Pack message into 72 bits
call rs_encode(dgen,sym_rev) !RS encode
sym(0:62)=sym_rev(62:0:-1)
sym1(0:62,j)=sym
call interleave63(sym_rev,1) !Interleave channel symbols
call graycode(sym_rev,63,1,sym_rev) !Apply Gray code
sym2(0:62,j)=sym_rev(0:62)
msg0(j)=msg
enddo
enddo
nused=j
first=.false.
endif
ref0=0.
do j=1,63
ref0=ref0 + s3(mrs(j)+1,j)
enddo
u1=0.
u1=-99.0
u2=u1
! Find u1 and u2 (best and second-best) codeword from a list, using
! a bank of matched filters on the symbol spectra s3(i,j).
ipk=1
ipk2=0
msg00=' '
do k=1,nused
if(k.ge.2 .and. k.le.64 .and. nflip.lt.0) cycle
! Test all messages if nflip=+1; skip the CQ messages if nflip=-1.
if(nflip.gt.0 .or. msg0(k)(1:3).ne.'CQ ') then
psum=0.
ref=ref0
do j=1,63
i=sym2(j-1,k)+1
psum=psum + s3(i,j)
if(i.eq.mrs(j)+1) ref=ref - s3(i,j) + s3(mrs2(j)+1,j)
enddo
p=psum/ref
if(p.gt.u1) then
if(msg0(k).ne.msg00) then
ipk2=ipk
u2=u1
endif
u1=p
ipk=k
msg00=msg0(k)
endif
if(msg0(k).ne.msg00 .and. p.gt.u2) then
u2=p
ipk2=k
endif
endif
enddo
!### Just in case ???
! rewind 77
! write(77,*) u1,u2,ipk,ipk2
! call flush(77)
!###
decoded=' '
bias=max(1.12*u2,0.35)
if(nadd.ge.4) bias=max(1.08*u2,0.45)
if(nadd.ge.8) bias=max(1.04*u2,0.60)
qual=100.0*(u1-bias)
! write(*,3301) u1,u2,u1/u2,bias,qual,nadd,ipk,ipk2
!3301 format(5f6.2,i3,2i6)
qmin=1.0
if(qual.ge.qmin) decoded=msg0(ipk)
return
end subroutine hint65
@@ -0,0 +1,502 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2012-2012.
// 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/move for documentation.
//
//////////////////////////////////////////////////////////////////////////////
//! \file
//! This header implements macros to define movable classes and
//! move-aware functions
#ifndef BOOST_MOVE_CORE_HPP
#define BOOST_MOVE_CORE_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/move/detail/config_begin.hpp>
#include <boost/move/detail/workaround.hpp>
// @cond
//boost_move_no_copy_constructor_or_assign typedef
//used to detect noncopyable types for other Boost libraries.
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
private:\
TYPE(TYPE &);\
TYPE& operator=(TYPE &);\
public:\
typedef int boost_move_no_copy_constructor_or_assign; \
private:\
//
#else
#define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
public:\
TYPE(TYPE const &) = delete;\
TYPE& operator=(TYPE const &) = delete;\
public:\
typedef int boost_move_no_copy_constructor_or_assign; \
private:\
//
#endif //BOOST_NO_CXX11_DELETED_FUNCTIONS
// @endcond
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
#include <boost/move/detail/type_traits.hpp>
#if defined(BOOST_MOVE_ADDRESS_SANITIZER_ON)
#define BOOST_MOVE_TO_RV_CAST(RV_TYPE, ARG) reinterpret_cast<RV_TYPE>(ARG)
#else
#define BOOST_MOVE_TO_RV_CAST(RV_TYPE, ARG) static_cast<RV_TYPE>(ARG)
#endif
//Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
#if defined(__GNUC__) && (__GNUC__ >= 4) && \
(\
defined(BOOST_GCC) || \
(defined(BOOST_INTEL) && (BOOST_INTEL_CXX_VERSION >= 1300)) \
)
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
#else
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
#endif
namespace boost {
//////////////////////////////////////////////////////////////////////////////
//
// struct rv
//
//////////////////////////////////////////////////////////////////////////////
template <class T>
class rv
: public ::boost::move_detail::if_c
< ::boost::move_detail::is_class<T>::value
, T
, ::boost::move_detail::nat
>::type
{
rv();
~rv() throw();
rv(rv const&);
void operator=(rv const&);
} BOOST_MOVE_ATTRIBUTE_MAY_ALIAS;
//////////////////////////////////////////////////////////////////////////////
//
// is_rv
//
//////////////////////////////////////////////////////////////////////////////
namespace move_detail {
template <class T>
struct is_rv
//Derive from integral constant because some Boost code assummes it has
//a "type" internal typedef
: integral_constant<bool, ::boost::move_detail::is_rv_impl<T>::value >
{};
template <class T>
struct is_not_rv
{
static const bool value = !is_rv<T>::value;
};
} //namespace move_detail {
//////////////////////////////////////////////////////////////////////////////
//
// has_move_emulation_enabled
//
//////////////////////////////////////////////////////////////////////////////
template<class T>
struct has_move_emulation_enabled
: ::boost::move_detail::has_move_emulation_enabled_impl<T>
{};
template<class T>
struct has_move_emulation_disabled
{
static const bool value = !::boost::move_detail::has_move_emulation_enabled_impl<T>::value;
};
} //namespace boost {
#define BOOST_RV_REF(TYPE)\
::boost::rv< TYPE >& \
//
#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
::boost::rv< TYPE<ARG1, ARG2> >& \
//
#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
//
#define BOOST_RV_REF_BEG\
::boost::rv< \
//
#define BOOST_RV_REF_END\
>& \
//
#define BOOST_RV_REF_BEG_IF_CXX11 \
\
//
#define BOOST_RV_REF_END_IF_CXX11 \
\
//
#define BOOST_FWD_REF(TYPE)\
const TYPE & \
//
#define BOOST_COPY_ASSIGN_REF(TYPE)\
const ::boost::rv< TYPE >& \
//
#define BOOST_COPY_ASSIGN_REF_BEG \
const ::boost::rv< \
//
#define BOOST_COPY_ASSIGN_REF_END \
>& \
//
#define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
const ::boost::rv< TYPE<ARG1, ARG2> >& \
//
#define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
const ::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
//
#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
const ::boost::rv< TYPE >& \
//
namespace boost {
namespace move_detail {
template <class Ret, class T>
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
< ::boost::move_detail::is_lvalue_reference<Ret>::value ||
!::boost::has_move_emulation_enabled<T>::value
, T&>::type
move_return(T& x) BOOST_NOEXCEPT
{
return x;
}
template <class Ret, class T>
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
< !::boost::move_detail::is_lvalue_reference<Ret>::value &&
::boost::has_move_emulation_enabled<T>::value
, ::boost::rv<T>&>::type
move_return(T& x) BOOST_NOEXCEPT
{
return *BOOST_MOVE_TO_RV_CAST(::boost::rv<T>*, ::boost::move_detail::addressof(x));
}
template <class Ret, class T>
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
< !::boost::move_detail::is_lvalue_reference<Ret>::value &&
::boost::has_move_emulation_enabled<T>::value
, ::boost::rv<T>&>::type
move_return(::boost::rv<T>& x) BOOST_NOEXCEPT
{
return x;
}
} //namespace move_detail {
} //namespace boost {
#define BOOST_MOVE_RET(RET_TYPE, REF)\
boost::move_detail::move_return< RET_TYPE >(REF)
//
#define BOOST_MOVE_BASE(BASE_TYPE, ARG) \
::boost::move((BASE_TYPE&)(ARG))
//
//////////////////////////////////////////////////////////////////////////////
//
// BOOST_MOVABLE_BUT_NOT_COPYABLE
//
//////////////////////////////////////////////////////////////////////////////
#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\
public:\
BOOST_MOVE_FORCEINLINE operator ::boost::rv<TYPE>&() \
{ return *BOOST_MOVE_TO_RV_CAST(::boost::rv<TYPE>*, this); }\
BOOST_MOVE_FORCEINLINE operator const ::boost::rv<TYPE>&() const \
{ return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv<TYPE>*, this); }\
private:\
//
//////////////////////////////////////////////////////////////////////////////
//
// BOOST_COPYABLE_AND_MOVABLE
//
//////////////////////////////////////////////////////////////////////////////
#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
public:\
BOOST_MOVE_FORCEINLINE TYPE& operator=(TYPE &t)\
{ this->operator=(const_cast<const TYPE&>(t)); return *this;}\
public:\
BOOST_MOVE_FORCEINLINE operator ::boost::rv<TYPE>&() \
{ return *BOOST_MOVE_TO_RV_CAST(::boost::rv<TYPE>*, this); }\
BOOST_MOVE_FORCEINLINE operator const ::boost::rv<TYPE>&() const \
{ return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv<TYPE>*, this); }\
private:\
//
#define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\
public:\
BOOST_MOVE_FORCEINLINE operator ::boost::rv<TYPE>&() \
{ return *BOOST_MOVE_TO_RV_CAST(::boost::rv<TYPE>*, this); }\
BOOST_MOVE_FORCEINLINE operator const ::boost::rv<TYPE>&() const \
{ return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv<TYPE>*, this); }\
private:\
//
namespace boost{
namespace move_detail{
template< class T>
struct forward_type
{ typedef const T &type; };
template< class T>
struct forward_type< boost::rv<T> >
{ typedef T type; };
}}
#else //BOOST_NO_CXX11_RVALUE_REFERENCES
//! This macro marks a type as movable but not copyable, disabling copy construction
//! and assignment. The user will need to write a move constructor/assignment as explained
//! in the documentation to fully write a movable but not copyable class.
#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\
public:\
typedef int boost_move_emulation_t;\
private:\
//
//! This macro marks a type as copyable and movable.
//! The user will need to write a move constructor/assignment and a copy assignment
//! as explained in the documentation to fully write a copyable and movable class.
#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
//
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
#define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\
//
#endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
namespace boost {
//!This trait yields to a compile-time true boolean if T was marked as
//!BOOST_MOVABLE_BUT_NOT_COPYABLE or BOOST_COPYABLE_AND_MOVABLE and
//!rvalue references are not available on the platform. False otherwise.
template<class T>
struct has_move_emulation_enabled
{
static const bool value = false;
};
template<class T>
struct has_move_emulation_disabled
{
static const bool value = true;
};
} //namespace boost{
//!This macro is used to achieve portable syntax in move
//!constructors and assignments for classes marked as
//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE
#define BOOST_RV_REF(TYPE)\
TYPE && \
//
//!This macro is used to achieve portable syntax in move
//!constructors and assignments for template classes marked as
//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
//!As macros have problems with comma-separated template arguments,
//!the template argument must be preceded with BOOST_RV_REF_BEG
//!and ended with BOOST_RV_REF_END
#define BOOST_RV_REF_BEG\
\
//
//!This macro is used to achieve portable syntax in move
//!constructors and assignments for template classes marked as
//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
//!As macros have problems with comma-separated template arguments,
//!the template argument must be preceded with BOOST_RV_REF_BEG
//!and ended with BOOST_RV_REF_END
#define BOOST_RV_REF_END\
&& \
//
//!This macro expands to BOOST_RV_REF_BEG if BOOST_NO_CXX11_RVALUE_REFERENCES
//!is not defined, empty otherwise
#define BOOST_RV_REF_BEG_IF_CXX11 \
BOOST_RV_REF_BEG \
//
//!This macro expands to BOOST_RV_REF_END if BOOST_NO_CXX11_RVALUE_REFERENCES
//!is not defined, empty otherwise
#define BOOST_RV_REF_END_IF_CXX11 \
BOOST_RV_REF_END \
//
//!This macro is used to achieve portable syntax in copy
//!assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.
#define BOOST_COPY_ASSIGN_REF(TYPE)\
const TYPE & \
//
//! This macro is used to implement portable perfect forwarding
//! as explained in the documentation.
#define BOOST_FWD_REF(TYPE)\
TYPE && \
//
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
TYPE<ARG1, ARG2> && \
//
#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
TYPE<ARG1, ARG2, ARG3> && \
//
#define BOOST_COPY_ASSIGN_REF_BEG \
const \
//
#define BOOST_COPY_ASSIGN_REF_END \
& \
//
#define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
const TYPE<ARG1, ARG2> & \
//
#define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
const TYPE<ARG1, ARG2, ARG3>& \
//
#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
const TYPE & \
//
#endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
#if !defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
//!This macro is used to achieve portable move return semantics.
//!The C++11 Standard allows implicit move returns when the object to be returned
//!is designated by a lvalue and:
//! - The criteria for elision of a copy operation are met OR
//! - The criteria would be met save for the fact that the source object is a function parameter
//!
//!For C++11 conforming compilers this macros only yields to REF:
//! <code>return BOOST_MOVE_RET(RET_TYPE, REF);</code> -> <code>return REF;</code>
//!
//!For compilers without rvalue references
//!this macro does an explicit move if the move emulation is activated
//!and the return type (RET_TYPE) is not a reference.
//!
//!For non-conforming compilers with rvalue references like Visual 2010 & 2012,
//!an explicit move is performed if RET_TYPE is not a reference.
//!
//! <b>Caution</b>: When using this macro in non-conforming or C++03
//!compilers, a move will be performed even if the C++11 standard does not allow it
//!(e.g. returning a static variable). The user is responsible for using this macro
//!only to return local objects that met C++11 criteria.
#define BOOST_MOVE_RET(RET_TYPE, REF)\
REF
//
#else //!defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
#include <boost/move/detail/meta_utils.hpp>
namespace boost {
namespace move_detail {
template <class Ret, class T>
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
< ::boost::move_detail::is_lvalue_reference<Ret>::value
, T&>::type
move_return(T& x) BOOST_NOEXCEPT
{
return x;
}
template <class Ret, class T>
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
< !::boost::move_detail::is_lvalue_reference<Ret>::value
, Ret && >::type
move_return(T&& t) BOOST_NOEXCEPT
{
return static_cast< Ret&& >(t);
}
} //namespace move_detail {
} //namespace boost {
#define BOOST_MOVE_RET(RET_TYPE, REF)\
boost::move_detail::move_return< RET_TYPE >(REF)
//
#endif //!defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
//!This macro is used to achieve portable optimal move constructors.
//!
//!When implementing the move constructor, in C++03 compilers the moved-from argument must be
//!cast to the base type before calling `::boost::move()` due to rvalue reference limitations.
//!
//!In C++11 compilers the cast from a rvalue reference of a derived type to a rvalue reference of
//!a base type is implicit.
#define BOOST_MOVE_BASE(BASE_TYPE, ARG) \
::boost::move((BASE_TYPE&)(ARG))
//
namespace boost {
namespace move_detail {
template< class T> struct forward_type { typedef T type; };
}}
#endif //BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/move/detail/config_end.hpp>
#endif //#ifndef BOOST_MOVE_CORE_HPP
@@ -0,0 +1,73 @@
/*=============================================================================
Copyright (c) 2011 Eric Niebler
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_SEGMENTED_SEQUENCE_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/fusion/support/tag_of.hpp>
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
namespace boost { namespace fusion { namespace detail
{
struct segment_sequence_tag {};
// Here, Sequence is a sequence of ranges (which may or may not be
// segmented).
template<typename Sequence>
struct segment_sequence
: sequence_base<segment_sequence<Sequence> >
{
typedef fusion_sequence_tag tag;
typedef segment_sequence_tag fusion_tag;
typedef typename Sequence::is_view is_view;
typedef typename Sequence::category category;
typedef Sequence sequence_type;
sequence_type sequence;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq)
: sequence(seq)
{}
};
}
namespace extension
{
template<typename Tag>
struct is_segmented_impl;
template<>
struct is_segmented_impl<detail::segment_sequence_tag>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct segments_impl;
template<>
struct segments_impl<detail::segment_sequence_tag>
{
template<typename Sequence>
struct apply
{
typedef typename Sequence::sequence_type type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence & seq)
{
return seq.sequence;
}
};
};
}}}
#endif
@@ -0,0 +1,27 @@
#ifndef BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
#define BOOST_MPL_AUX_STATIC_CAST_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_/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__GNUC__, < 3) \
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3001)
# define BOOST_MPL_AUX_STATIC_CAST(T, expr) (T)(expr)
#else
# define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
#endif
#endif // BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,406 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
// (C) Copyright Ion Gaztanaga 2006-2014
//
// 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/intrusive for documentation.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP
#define BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP
#include <cstddef>
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/common_slist_algorithms.hpp>
#include <boost/intrusive/detail/algo_type.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
namespace boost {
namespace intrusive {
//! circular_slist_algorithms provides basic algorithms to manipulate nodes
//! forming a circular singly linked list. An empty circular list is formed by a node
//! whose pointer to the next node points to itself.
//!
//! circular_slist_algorithms is configured with a NodeTraits class, which encapsulates the
//! information about the node to be manipulated. NodeTraits must support the
//! following interface:
//!
//! <b>Typedefs</b>:
//!
//! <tt>node</tt>: The type of the node that forms the circular list
//!
//! <tt>node_ptr</tt>: A pointer to a node
//!
//! <tt>const_node_ptr</tt>: A pointer to a const node
//!
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
//!
//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
template<class NodeTraits>
class circular_slist_algorithms
/// @cond
: public detail::common_slist_algorithms<NodeTraits>
/// @endcond
{
/// @cond
typedef detail::common_slist_algorithms<NodeTraits> base_t;
/// @endcond
public:
typedef typename NodeTraits::node node;
typedef typename NodeTraits::node_ptr node_ptr;
typedef typename NodeTraits::const_node_ptr const_node_ptr;
typedef NodeTraits node_traits;
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
//! <b>Effects</b>: Constructs an non-used list element, putting the next
//! pointer to null:
//! <tt>NodeTraits::get_next(this_node) == node_ptr()</tt>
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void init(node_ptr this_node);
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
//!
//! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
//! or it's a not inserted node:
//! <tt>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</tt>
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static bool unique(const_node_ptr this_node);
//! <b>Effects</b>: Returns true is "this_node" has the same state as
//! if it was inited using "init(node_ptr)"
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static bool inited(const_node_ptr this_node);
//! <b>Requires</b>: prev_node must be in a circular list or be an empty circular list.
//!
//! <b>Effects</b>: Unlinks the next node of prev_node from the circular list.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void unlink_after(node_ptr prev_node);
//! <b>Requires</b>: prev_node and last_node must be in a circular list
//! or be an empty circular list.
//!
//! <b>Effects</b>: Unlinks the range (prev_node, last_node) from the circular list.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void unlink_after(node_ptr prev_node, node_ptr last_node);
//! <b>Requires</b>: prev_node must be a node of a circular list.
//!
//! <b>Effects</b>: Links this_node after prev_node in the circular list.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void link_after(node_ptr prev_node, node_ptr this_node);
//! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
//! and p must be a node of a different circular list.
//!
//! <b>Effects</b>: Removes the nodes from (b, e] range from their circular list and inserts
//! them after p in p's circular list.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void transfer_after(node_ptr p, node_ptr b, node_ptr e);
#endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
//! <b>Effects</b>: Constructs an empty list, making this_node the only
//! node of the circular list:
//! <tt>NodeTraits::get_next(this_node) == this_node</tt>.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
BOOST_INTRUSIVE_FORCEINLINE static void init_header(const node_ptr &this_node)
{ NodeTraits::set_next(this_node, this_node); }
//! <b>Requires</b>: this_node and prev_init_node must be in the same circular list.
//!
//! <b>Effects</b>: Returns the previous node of this_node in the circular list starting.
//! the search from prev_init_node. The first node checked for equality
//! is NodeTraits::get_next(prev_init_node).
//!
//! <b>Complexity</b>: Linear to the number of elements between prev_init_node and this_node.
//!
//! <b>Throws</b>: Nothing.
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(const node_ptr &prev_init_node, const node_ptr &this_node)
{ return base_t::get_previous_node(prev_init_node, this_node); }
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
//!
//! <b>Effects</b>: Returns the previous node of this_node in the circular list.
//!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
//!
//! <b>Throws</b>: Nothing.
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(const node_ptr & this_node)
{ return base_t::get_previous_node(this_node, this_node); }
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
//!
//! <b>Effects</b>: Returns the previous node of the previous node of this_node in the circular list.
//!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
//!
//! <b>Throws</b>: Nothing.
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_previous_node(const node_ptr & this_node)
{ return get_previous_previous_node(this_node, this_node); }
//! <b>Requires</b>: this_node and p must be in the same circular list.
//!
//! <b>Effects</b>: Returns the previous node of the previous node of this_node in the
//! circular list starting. the search from p. The first node checked
//! for equality is NodeTraits::get_next((NodeTraits::get_next(p)).
//!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
//!
//! <b>Throws</b>: Nothing.
static node_ptr get_previous_previous_node(node_ptr p, const node_ptr & this_node)
{
node_ptr p_next = NodeTraits::get_next(p);
node_ptr p_next_next = NodeTraits::get_next(p_next);
while (this_node != p_next_next){
p = p_next;
p_next = p_next_next;
p_next_next = NodeTraits::get_next(p_next);
}
return p;
}
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
//!
//! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
//! is empty, returns 1.
//!
//! <b>Complexity</b>: Linear
//!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & this_node)
{
std::size_t result = 0;
const_node_ptr p = this_node;
do{
p = NodeTraits::get_next(p);
++result;
} while (p != this_node);
return result;
}
//! <b>Requires</b>: this_node must be in a circular list, be an empty circular list or be inited.
//!
//! <b>Effects</b>: Unlinks the node from the circular list.
//!
//! <b>Complexity</b>: Linear to the number of elements in the circular list
//!
//! <b>Throws</b>: Nothing.
BOOST_INTRUSIVE_FORCEINLINE static void unlink(const node_ptr & this_node)
{
if(NodeTraits::get_next(this_node))
base_t::unlink_after(get_previous_node(this_node));
}
//! <b>Requires</b>: nxt_node must be a node of a circular list.
//!
//! <b>Effects</b>: Links this_node before nxt_node in the circular list.
//!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
//!
//! <b>Throws</b>: Nothing.
BOOST_INTRUSIVE_FORCEINLINE static void link_before (const node_ptr & nxt_node, const node_ptr & this_node)
{ base_t::link_after(get_previous_node(nxt_node), this_node); }
//! <b>Requires</b>: this_node and other_node must be nodes inserted
//! in circular lists or be empty circular lists.
//!
//! <b>Effects</b>: Swaps the position of the nodes: this_node is inserted in
//! other_nodes position in the second circular list and the other_node is inserted
//! in this_node's position in the first circular list.
//!
//! <b>Complexity</b>: Linear to number of elements of both lists
//!
//! <b>Throws</b>: Nothing.
static void swap_nodes(const node_ptr & this_node, const node_ptr & other_node)
{
if (other_node == this_node)
return;
const node_ptr this_next = NodeTraits::get_next(this_node);
const node_ptr other_next = NodeTraits::get_next(other_node);
const bool this_null = !this_next;
const bool other_null = !other_next;
const bool this_empty = this_next == this_node;
const bool other_empty = other_next == other_node;
if(!(other_null || other_empty)){
NodeTraits::set_next(this_next == other_node ? other_node : get_previous_node(other_node), this_node );
}
if(!(this_null | this_empty)){
NodeTraits::set_next(other_next == this_node ? this_node : get_previous_node(this_node), other_node );
}
NodeTraits::set_next(this_node, other_empty ? this_node : (other_next == this_node ? other_node : other_next) );
NodeTraits::set_next(other_node, this_empty ? other_node : (this_next == other_node ? this_node : this_next ) );
}
//! <b>Effects</b>: Reverses the order of elements in the list.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: This function is linear to the contained elements.
static void reverse(const node_ptr & p)
{
node_ptr i = NodeTraits::get_next(p), e(p);
for (;;) {
node_ptr nxt(NodeTraits::get_next(i));
if (nxt == e)
break;
base_t::transfer_after(e, i, nxt);
}
}
//! <b>Effects</b>: Moves the node p n positions towards the end of the list.
//!
//! <b>Returns</b>: The previous node of p after the function if there has been any movement,
//! Null if n leads to no movement.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
static node_ptr move_backwards(const node_ptr & p, std::size_t n)
{
//Null shift, nothing to do
if(!n) return node_ptr();
node_ptr first = NodeTraits::get_next(p);
//count() == 1 or 2, nothing to do
if(NodeTraits::get_next(first) == p)
return node_ptr();
bool end_found = false;
node_ptr new_last = node_ptr();
//Now find the new last node according to the shift count.
//If we find p before finding the new last node
//unlink p, shortcut the search now that we know the size of the list
//and continue.
for(std::size_t i = 1; i <= n; ++i){
new_last = first;
first = NodeTraits::get_next(first);
if(first == p){
//Shortcut the shift with the modulo of the size of the list
n %= i;
if(!n)
return node_ptr();
i = 0;
//Unlink p and continue the new first node search
first = NodeTraits::get_next(p);
base_t::unlink_after(new_last);
end_found = true;
}
}
//If the p has not been found in the previous loop, find it
//starting in the new first node and unlink it
if(!end_found){
base_t::unlink_after(base_t::get_previous_node(first, p));
}
//Now link p after the new last node
base_t::link_after(new_last, p);
return new_last;
}
//! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
//!
//! <b>Returns</b>: The previous node of p after the function if there has been any movement,
//! Null if n leads equals to no movement.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
static node_ptr move_forward(const node_ptr & p, std::size_t n)
{
//Null shift, nothing to do
if(!n) return node_ptr();
node_ptr first = node_traits::get_next(p);
//count() == 1 or 2, nothing to do
if(node_traits::get_next(first) == p) return node_ptr();
//Iterate until p is found to know where the current last node is.
//If the shift count is less than the size of the list, we can also obtain
//the position of the new last node after the shift.
node_ptr old_last(first), next_to_it, new_last(p);
std::size_t distance = 1;
while(p != (next_to_it = node_traits::get_next(old_last))){
if(++distance > n)
new_last = node_traits::get_next(new_last);
old_last = next_to_it;
}
//If the shift was bigger or equal than the size, obtain the equivalent
//forward shifts and find the new last node.
if(distance <= n){
//Now find the equivalent forward shifts.
//Shortcut the shift with the modulo of the size of the list
std::size_t new_before_last_pos = (distance - (n % distance))% distance;
//If the shift is a multiple of the size there is nothing to do
if(!new_before_last_pos) return node_ptr();
for( new_last = p
; new_before_last_pos--
; new_last = node_traits::get_next(new_last)){
//empty
}
}
//Now unlink p and link it after the new last node
base_t::unlink_after(old_last);
base_t::link_after(new_last, p);
return new_last;
}
};
/// @cond
template<class NodeTraits>
struct get_algo<CircularSListAlgorithms, NodeTraits>
{
typedef circular_slist_algorithms<NodeTraits> type;
};
/// @endcond
} //namespace intrusive
} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
#endif //BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP
@@ -0,0 +1,33 @@
// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
//------------------------------------------------------------------------------
// no include guards, this file is intended for multiple inclusion
#if BOOST_FT_ARITY_LOOP_PREFIX
# ifndef BOOST_FT_DETAIL_CLASSIFIER_IMPL_MASTER_HPP_INCLUDED
# define BOOST_FT_DETAIL_CLASSIFIER_IMPL_MASTER_HPP_INCLUDED
# include <boost/preprocessor/facilities/identity.hpp>
# endif
# define BOOST_FT_type_name
#elif BOOST_FT_ARITY_LOOP_IS_ITERATING
template< BOOST_FT_tplargs(BOOST_PP_IDENTITY(typename)) >
typename encode_charr<BOOST_FT_flags,BOOST_FT_cc_id,BOOST_FT_arity>::type
classifier_impl(BOOST_FT_type);
#elif BOOST_FT_ARITY_LOOP_SUFFIX
# undef BOOST_FT_type_name
#else
# error "attempt to use arity loop master file without loop"
#endif
@@ -0,0 +1,106 @@
#include "Modes.hpp"
#include <algorithm>
#include <QString>
#include <QVariant>
#include <QModelIndex>
#include "moc_Modes.cpp"
namespace
{
// human readable strings for each Mode enumeration value
char const * const mode_names[] =
{
"All",
"JT65",
"JT9",
"JT4",
"WSPR",
"Echo",
"ISCAT",
"MSK144",
"QRA64",
"FreqCal",
"FT8"
};
std::size_t constexpr mode_names_size = sizeof (mode_names) / sizeof (mode_names[0]);
}
Modes::Modes (QObject * parent)
: QAbstractListModel {parent}
{
static_assert (mode_names_size == MODES_END_SENTINAL_AND_COUNT,
"mode_names array must match Mode enumeration");
}
char const * Modes::name (Mode m)
{
return mode_names[static_cast<int> (m)];
}
auto Modes::value (QString const& s) -> Mode
{
auto end = mode_names + mode_names_size;
auto p = std::find_if (mode_names, end
, [&s] (char const * const name) {
return name == s;
});
return p != end ? static_cast<Mode> (p - mode_names) : ALL;
}
QVariant Modes::data (QModelIndex const& index, int role) const
{
QVariant item;
if (index.isValid ())
{
auto const& row = index.row ();
switch (role)
{
case Qt::ToolTipRole:
case Qt::AccessibleDescriptionRole:
item = tr ("Mode");
break;
case Qt::EditRole:
item = static_cast<Mode> (row);
break;
case Qt::DisplayRole:
case Qt::AccessibleTextRole:
item = mode_names[row];
break;
case Qt::TextAlignmentRole:
item = Qt::AlignHCenter + Qt::AlignVCenter;
break;
}
}
return item;
}
QVariant Modes::headerData (int section, Qt::Orientation orientation, int role) const
{
QVariant result;
if (Qt::DisplayRole == role && Qt::Horizontal == orientation)
{
result = tr ("Mode");
}
else
{
result = QAbstractListModel::headerData (section, orientation, role);
}
return result;
}
#if !defined (QT_NO_DEBUG_STREAM)
ENUM_QDEBUG_OPS_IMPL (Modes, Mode);
#endif
ENUM_QDATASTREAM_OPS_IMPL (Modes, Mode);
ENUM_CONVERSION_OPS_IMPL (Modes, Mode);
@@ -0,0 +1,309 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2011 Christopher Schmidt
Copyright (c) 2013-2014 Damien Buhl
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_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/config.hpp>
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp>
#include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/tag.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/typeof/typeof.hpp>
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \
BOOST_PP_SEQ_HEAD(SEQ)<BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TAIL(SEQ))> \
BOOST_PP_EMPTY()
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \
BOOST_PP_IF( \
BOOST_PP_SEQ_HEAD(SEQ), \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS, \
BOOST_PP_SEQ_HEAD)(BOOST_PP_SEQ_TAIL(SEQ))
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C(R, _, ELEM) \
(typename ELEM)
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL(SEQ) \
BOOST_PP_SEQ_ENUM( \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C, \
_, \
BOOST_PP_SEQ_TAIL(SEQ)))
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(SEQ) \
BOOST_PP_IF( \
BOOST_PP_SEQ_HEAD(SEQ), \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \
BOOST_PP_TUPLE_EAT(1))(SEQ)
#ifdef BOOST_MSVC
# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
\
struct deduced_attr_type { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
0, ATTRIBUTE)) \
type; \
}; \
\
typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
deduced_attr_type::type attribute_type;
#else
# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\
struct deduced_attr_type { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef BOOST_TYPEOF( \
PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE)) \
type; \
}; \
\
typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
deduced_attr_type::type attribute_type;
#endif
#define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
typedef \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE) attribute_type;
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
struct tag_of< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) MODIFIER \
, void \
> \
{ \
typedef TAG type; \
};
#else
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
struct tag_of<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) MODIFIER> \
{ \
typedef TAG type; \
};
#endif
#define BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL(R,DATA,I,ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM(4,0,DATA)( \
BOOST_PP_TUPLE_ELEM(4,1,DATA), \
BOOST_PP_TUPLE_ELEM(4,2,DATA), \
BOOST_PP_TUPLE_ELEM(4,3,DATA), \
I, \
ATTRIBUTE)
#ifdef BOOST_MSVC
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM(R,_,ELEM) \
typedef ELEM ELEM;
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL(SEQ) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM, \
_, \
BOOST_PP_SEQ_TAIL(SEQ))
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ) \
BOOST_PP_IF( \
BOOST_PP_SEQ_HEAD(SEQ), \
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL, \
BOOST_PP_TUPLE_EAT(1))(SEQ)
#else
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ)
#endif
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \
I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, \
DEDUCE_TYPE) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
struct access::struct_member< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \
> \
{ \
BOOST_PP_IF(DEDUCE_TYPE, \
BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \
NAME_SEQ, \
ATTRIBUTE, \
ATTRIBUTE_TUPLE_SIZE, \
PREFIX, \
TEMPLATE_PARAMS_SEQ) \
\
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
\
typedef attribute_type type; \
\
template<typename Seq> \
struct apply \
{ \
typedef typename \
add_reference< \
typename mpl::eval_if< \
is_const<Seq> \
, add_const<attribute_type> \
, mpl::identity<attribute_type> \
>::type \
>::type \
type; \
\
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type \
call(Seq& seq) \
{ \
return seq.PREFIX() \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE); \
} \
}; \
}; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
struct struct_member_name< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \
> \
{ \
typedef char const* type; \
\
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type \
call() \
{ \
return BOOST_PP_STRINGIZE( \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE)); \
} \
};
#define BOOST_FUSION_ADAPT_STRUCT_BASE( \
TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \
TAG, \
IS_VIEW, \
ATTRIBUTES_SEQ, \
ATTRIBUTES_CALLBACK) \
\
namespace boost \
{ \
namespace fusion \
{ \
namespace traits \
{ \
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
BOOST_PP_EMPTY(), TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
const, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
} \
\
namespace extension \
{ \
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_PP_SEQ_FOR_EACH_I_R, \
BOOST_PP_TUPLE_EAT(4))( \
1, \
BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \
(ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ, IS_VIEW),\
BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ)) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct struct_size<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
: mpl::int_<BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ))> \
{}; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct struct_is_view< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
> \
: mpl::BOOST_PP_IIF(IS_VIEW,true_,false_) \
{}; \
} \
} \
\
namespace mpl \
{ \
template<typename> \
struct sequence_tag; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct sequence_tag<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
{ \
typedef fusion::fusion_sequence_tag type; \
}; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct sequence_tag< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const \
> \
{ \
typedef fusion::fusion_sequence_tag type; \
}; \
} \
}
#endif
@@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
template <
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_
>
struct vector;
}}
@@ -0,0 +1,295 @@
// (C) Copyright Joel de Guzman 2003.
// 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 INDEXING_SUITE_JDG20036_HPP
# define INDEXING_SUITE_JDG20036_HPP
# include <boost/python/class.hpp>
# include <boost/python/def_visitor.hpp>
# include <boost/python/register_ptr_to_python.hpp>
# include <boost/python/suite/indexing/detail/indexing_suite_detail.hpp>
# include <boost/python/return_internal_reference.hpp>
# include <boost/python/iterator.hpp>
# include <boost/mpl/or.hpp>
# include <boost/mpl/not.hpp>
# include <boost/type_traits/is_same.hpp>
namespace boost { namespace python {
// indexing_suite class. This class is the facade class for
// the management of C++ containers intended to be integrated
// to Python. The objective is make a C++ container look and
// feel and behave exactly as we'd expect a Python container.
// By default indexed elements are returned by proxy. This can be
// disabled by supplying *true* in the NoProxy template parameter.
//
// Derived classes provide the hooks needed by the indexing_suite
// to do its job:
//
// static data_type&
// get_item(Container& container, index_type i);
//
// static object
// get_slice(Container& container, index_type from, index_type to);
//
// static void
// set_item(Container& container, index_type i, data_type const& v);
//
// static void
// set_slice(
// Container& container, index_type from,
// index_type to, data_type const& v
// );
//
// template <class Iter>
// static void
// set_slice(Container& container, index_type from,
// index_type to, Iter first, Iter last
// );
//
// static void
// delete_item(Container& container, index_type i);
//
// static void
// delete_slice(Container& container, index_type from, index_type to);
//
// static size_t
// size(Container& container);
//
// template <class T>
// static bool
// contains(Container& container, T const& val);
//
// static index_type
// convert_index(Container& container, PyObject* i);
//
// static index_type
// adjust_index(index_type current, index_type from,
// index_type to, size_type len
// );
//
// Most of these policies are self explanatory. convert_index and
// adjust_index, however, deserves some explanation.
//
// convert_index converts an Python index into a C++ index that the
// container can handle. For instance, negative indexes in Python, by
// convention, indexes from the right (e.g. C[-1] indexes the rightmost
// element in C). convert_index should handle the necessary conversion
// for the C++ container (e.g. convert -1 to C.size()-1). convert_index
// should also be able to convert the type of the index (A dynamic Python
// type) to the actual type that the C++ container expects.
//
// When a container expands or contracts, held indexes to its elements
// must be adjusted to follow the movement of data. For instance, if
// we erase 3 elements, starting from index 0 from a 5 element vector,
// what used to be at index 4 will now be at index 1:
//
// [a][b][c][d][e] ---> [d][e]
// ^ ^
// 4 1
//
// adjust_index takes care of the adjustment. Given a current index,
// the function should return the adjusted index when data in the
// container at index from..to is replaced by *len* elements.
//
template <
class Container
, class DerivedPolicies
, bool NoProxy = false
, bool NoSlice = false
, class Data = typename Container::value_type
, class Index = typename Container::size_type
, class Key = typename Container::value_type
>
class indexing_suite
: public def_visitor<
indexing_suite<
Container
, DerivedPolicies
, NoProxy
, NoSlice
, Data
, Index
, Key
> >
{
private:
typedef mpl::or_<
mpl::bool_<NoProxy>
, mpl::not_<is_class<Data> >
, typename mpl::or_<
is_same<Data, std::string>
, is_same<Data, std::complex<float> >
, is_same<Data, std::complex<double> >
, is_same<Data, std::complex<long double> > >::type>
no_proxy;
typedef detail::container_element<Container, Index, DerivedPolicies>
container_element_t;
typedef return_internal_reference<> return_policy;
typedef typename mpl::if_<
no_proxy
, iterator<Container>
, iterator<Container, return_policy> >::type
def_iterator;
typedef typename mpl::if_<
no_proxy
, detail::no_proxy_helper<
Container
, DerivedPolicies
, container_element_t
, Index>
, detail::proxy_helper<
Container
, DerivedPolicies
, container_element_t
, Index> >::type
proxy_handler;
typedef typename mpl::if_<
mpl::bool_<NoSlice>
, detail::no_slice_helper<
Container
, DerivedPolicies
, proxy_handler
, Data
, Index>
, detail::slice_helper<
Container
, DerivedPolicies
, proxy_handler
, Data
, Index> >::type
slice_handler;
public:
template <class Class>
void visit(Class& cl) const
{
// Hook into the class_ generic visitation .def function
proxy_handler::register_container_element();
cl
.def("__len__", base_size)
.def("__setitem__", &base_set_item)
.def("__delitem__", &base_delete_item)
.def("__getitem__", &base_get_item)
.def("__contains__", &base_contains)
.def("__iter__", def_iterator())
;
DerivedPolicies::extension_def(cl);
}
template <class Class>
static void
extension_def(Class& cl)
{
// default.
// no more extensions
}
private:
static object
base_get_item(back_reference<Container&> container, PyObject* i)
{
if (PySlice_Check(i))
return slice_handler::base_get_slice(
container.get(), static_cast<PySliceObject*>(static_cast<void*>(i)));
return proxy_handler::base_get_item_(container, i);
}
static void
base_set_item(Container& container, PyObject* i, PyObject* v)
{
if (PySlice_Check(i))
{
slice_handler::base_set_slice(container,
static_cast<PySliceObject*>(static_cast<void*>(i)), v);
}
else
{
extract<Data&> elem(v);
// try if elem is an exact Data
if (elem.check())
{
DerivedPolicies::
set_item(container,
DerivedPolicies::
convert_index(container, i), elem());
}
else
{
// try to convert elem to Data
extract<Data> elem(v);
if (elem.check())
{
DerivedPolicies::
set_item(container,
DerivedPolicies::
convert_index(container, i), elem());
}
else
{
PyErr_SetString(PyExc_TypeError, "Invalid assignment");
throw_error_already_set();
}
}
}
}
static void
base_delete_item(Container& container, PyObject* i)
{
if (PySlice_Check(i))
{
slice_handler::base_delete_slice(
container, static_cast<PySliceObject*>(static_cast<void*>(i)));
return;
}
Index index = DerivedPolicies::convert_index(container, i);
proxy_handler::base_erase_index(container, index, mpl::bool_<NoSlice>());
DerivedPolicies::delete_item(container, index);
}
static size_t
base_size(Container& container)
{
return DerivedPolicies::size(container);
}
static bool
base_contains(Container& container, PyObject* key)
{
extract<Key const&> x(key);
// try if key is an exact Key type
if (x.check())
{
return DerivedPolicies::contains(container, x());
}
else
{
// try to convert key to Key type
extract<Key> x(key);
if (x.check())
return DerivedPolicies::contains(container, x());
else
return false;
}
}
};
}} // namespace boost::python
#endif // INDEXING_SUITE_JDG20036_HPP
@@ -0,0 +1,183 @@
// Status=review
=== Standard Exchange
By longstanding tradition, a minimally valid QSO requires the exchange
of callsigns, a signal report or some other information, and
acknowledgments. _WSJT-X_ is designed to facilitate making such
minimal QSOs using short, structured messages. The process works best
if you use these formats and follow standard operating practices. The
recommended basic QSO goes something like this:
CQ K1ABC FN42 #K1ABC calls CQ
K1ABC G0XYZ IO91 #G0XYZ answers
G0XYZ K1ABC 19 #K1ABC sends report
K1ABC G0XYZ R-22 #G0XYZ sends R+report
G0XYZ K1ABC RRR #K1ABC sends RRR
K1ABC G0XYZ 73 #G0XYZ sends 73
*Standard messages* consist of two callsigns (or CQ, QRZ, or DE and
one callsign) followed by the transmitting stations grid locator, a
signal report, R plus a signal report, or the final acknowledgements
RRR or 73. These messages are compressed and encoded in a highly
efficient and reliable way. In uncompressed form (as displayed
on-screen) they may contain as many as 22 characters.
*Signal reports* are specified as signal-to-noise ratio (S/N) in dB,
using a standard reference noise bandwidth of 2500 Hz. Thus, in the
example message above, K1ABC is telling G0XYZ that his
signal is 19 dB below the noise power in bandwidth 2500 Hz. In the
message at 0004, G0XYZ acknowledges receipt of that report and
responds with a 22 dB signal report. JT65 reports are constrained to
lie in the range 30 to 1 dB, and values are significantly compressed
above about -10 dB. JT9 supports the extended range 50 to +49 dB and
assigns more reliable numbers to relatively strong signals.
NOTE: Signals become visible on the waterfall around S/N = 26 dB and
audible (to someone with very good hearing) around 15 dB. Thresholds
for decodability are around -20 dB for FT8, -23 dB for JT4, 25 dB for
JT65, 27 dB for JT9.
=== Free-Text Messages
Users often add some friendly chit-chat at the end of a QSO.
Free-format messages such as "`TNX ROBERT 73`" or "`5W VERT 73 GL`"
are supported, up to a maximum of 13 characters, including spaces. In
general you should avoid the character / in free-text messages, as the
program may then try to interpret your construction as part of a
compound callsign. It should be obvious that the JT4, JT9, and JT65
protocols are not designed or well suited for extensive conversations
or rag-chewing.
=== Auto-Sequencing
The slow modes JT4, JT9, JT65, and QRA64 allow nearly 10 seconds at
the end of each one-minute receiving sequence -- enough time for you
to inspect decoded messages and decide how to reply. The 15-second
T/R cycles of FT8 allow only about two seconds for this task, which is
often not enough. For this reason a basic auto-sequencing feature is
offered. Check *Auto Seq* on the main window to enable this feature:
image::auto-seq.png[align="center",alt="AutoSeq"]
When calling CQ you may also choose to check the box *Call 1st*.
_WSJT-X_ will then respond automatically to the first decoded
responder to your CQ.
NOTE: When *Auto-Seq* is enabled the program de-activates *Enable
Tx* at the end of each QSO. We do not want _WSJT-X_ to make fully
automated QSOs.
[[COMP-CALL]]
=== Compound Callsigns
Compound callsigns such as xx/K1ABC or K1ABC/x are handled in
one of two possible ways:
.Messages containing Type 1 compound callsigns
A list of about 350 of the most common prefixes and suffixes can be
displayed from the *Help* menu. A single compound callsign involving
one item from this list can be used in place of the standard third
word of a message (normally a locator, signal report, RRR, or 73).
The following examples are all acceptable messages containing *Type 1*
compound callsigns:
CQ ZA/K1ABC
CQ K1ABC/4
ZA/K1ABC G0XYZ
G0XYZ K1ABC/4
The following messages are _not_ valid, because a third word is not
permitted in any message containing a *Type 1* compound callsign:
ZA/K1ABC G0XYZ -22 #These messages are invalid; each would
G0XYZ K1ABC/4 73 # be sent without its third "word"
A QSO between two stations using *Type 1* compound-callsign messages
might look like this:
CQ ZA/K1ABC
ZA/K1ABC G0XYZ
G0XYZ K1ABC 19
K1ABC G0XYZ R22
G0XYZ K1ABC RRR
K1ABC G0XYZ 73
Notice that the full compound callsign is sent and received in the
first two transmissions. After that, the operators omit the add-on
prefix or suffix and use the standard structured messages.
.Type 2 Compound-Callsign Messages
Prefixes and suffixes _not_ found in the displayable short list are
handled by using *Type 2* compound callsigns. In this case the
compound callsign must be the second word in a two- or three-word
message, and the first word must be CQ, DE, or QRZ. Prefixes can be 1
to 4 characters, suffixes 1 to 3 characters. A third word conveying a
locator, report, RRR, or 73 is permitted. The following are valid
messages containing *Type 2* compound callsigns:
CQ W4/G0XYZ FM07
QRZ K1ABC/VE6 DO33
DE W4/G0XYZ FM18
DE W4/G0XYZ -22
DE W4/G0XYZ R-22
DE W4/G0XYZ RRR
DE W4/G0XYZ 73
In each case, the compound callsign is treated as *Type 2* because the
add-on prefix or suffix is _not_ one of those in the fixed list. Note
that a second callsign is never permissible in these messages.
NOTE: During a transmission your outgoing message is displayed in the
first label on the *Status Bar* and shown exactly as another station
will receive it. You can check to see that you are actually
transmitting the message you wish to send.
QSOs involving *Type 2* compound callsigns might look like either
of the following sequences:
CQ K1ABC/VE1 FN75
K1ABC G0XYZ IO91
G0XYZ K1ABC 19
K1ABC G0XYZ R22
G0XYZ K1ABC RRR
K1ABC/VE1 73
CQ K1ABC FN42
DE G0XYZ/W4 FM18
G0XYZ K1ABC 19
K1ABC G0XYZ R22
G0XYZ K1ABC RRR
DE G0XYZ/W4 73
Operators with a compound callsign use its full form when calling CQ
and possibly also in a 73 transmission, as may be required by
licensing authorities. Other transmissions during a QSO may use the
standard structured messages without callsign prefix or suffix.
TIP: If you are using a compound callsign, you may want to
experiment with the option *Message generation for type 2 compound
callsign holders* on the *Settings | General* tab, so that messages
will be generated that best suit your needs.
=== Pre-QSO Checklist
Before attempting your first QSO with one of the WSJT modes, be sure
to go through the <<TUTORIAL,Basic Operating Tutorial>> above as well
as the following checklist:
- Your callsign and grid locator set to correct values
- PTT and CAT control (if used) properly configured and tested
- Computer clock properly synchronized to UTC within ±1 s
- Radio set to *USB* (upper sideband) mode
- Radio filters centered and set to widest available passband (up to 5 kHz).
TIP: Remember that in many circumstances FT8, JT4, JT9, JT65, and WSPR
do not require high power. Under most HF propagation conditions, QRP
is usually the norm.
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@@ -0,0 +1,38 @@
# Makefile for Windows in JTSDK-PY environment
# Re-direct stdout and stderr: cmd.exe bash
# make > junk 2>&1 make &> junk
CC = gcc
FC = gfortran
FFLAGS = -O2 -DWIN32 -fbounds-check -fno-second-underscore -Wall \
-Wno-conversion -Wno-character-truncation
CFLAGS = -I. -DWIN32 -DWin32 -DBIGSYM -DHAVE_STRUCT_TIMESPEC
# Default rules
%.o: %.c
${CC} ${CFLAGS} -c $<
%.o: %.f
${FC} ${FFLAGS} -c $<
%.o: %.F
${FC} ${FFLAGS} -c $<
%.o: %.f90
${FC} ${FFLAGS} -c $<
%.o: %.F90
${FC} ${FFLAGS} -c $<
all: rsdtest
# Build rsdtest
OBJS2 = rsdtest.o extract2.o demod64b.o sfrsd3.o
rsdtest: $(OBJS2) ../libjt.a
$(FC) -o rsdtest $(OBJS2) ../libjt.a ../libpthreadGC2.a
sfrsd: sfrsd.o encode_rs_int.o decode_rs_int.o init_rs_int.o
gcc -g -o $@ $^
.PHONY : clean
clean:
rm -rf *.o libjt.a rsdtest sfrsd
@@ -0,0 +1,82 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// 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).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/integral_constant.hpp>
#ifdef BOOST_HAS_NOTHROW_COPY
#if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__) || defined(__SUNPRO_CC)
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/is_copy_constructible.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/is_array.hpp>
#ifdef BOOST_INTEL
#include <boost/type_traits/is_pod.hpp>
#endif
#elif defined(BOOST_MSVC) || defined(BOOST_INTEL)
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/is_array.hpp>
#ifdef BOOST_INTEL
#include <boost/type_traits/add_lvalue_reference.hpp>
#include <boost/type_traits/add_const.hpp>
#endif
#endif
namespace boost {
template <class T> struct has_nothrow_copy_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_COPY(T)>{};
#elif !defined(BOOST_NO_CXX11_NOEXCEPT)
#include <boost/type_traits/declval.hpp>
#include <boost/type_traits/is_copy_constructible.hpp>
namespace boost{
namespace detail{
template <class T, bool b>
struct has_nothrow_copy_constructor_imp : public boost::integral_constant<bool, false>{};
template <class T>
struct has_nothrow_copy_constructor_imp<T, true> : public boost::integral_constant<bool, noexcept(T(boost::declval<const T&>()))>{};
}
template <class T> struct has_nothrow_copy_constructor : public detail::has_nothrow_copy_constructor_imp<T, boost::is_copy_constructible<T>::value>{};
#else
#include <boost/type_traits/has_trivial_copy.hpp>
namespace boost{
template <class T> struct has_nothrow_copy_constructor : public integral_constant<bool, ::boost::has_trivial_copy<T>::value>{};
#endif
template <> struct has_nothrow_copy_constructor<void> : public false_type{};
template <class T> struct has_nothrow_copy_constructor<T volatile> : public false_type{};
template <class T> struct has_nothrow_copy_constructor<T&> : public false_type{};
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class T> struct has_nothrow_copy_constructor<T&&> : public false_type{};
#endif
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template <> struct has_nothrow_copy_constructor<void const> : public false_type{};
template <> struct has_nothrow_copy_constructor<void volatile> : public false_type{};
template <> struct has_nothrow_copy_constructor<void const volatile> : public false_type{};
#endif
template <class T> struct has_nothrow_copy : public has_nothrow_copy_constructor<T>{};
} // namespace boost
#endif // BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
@@ -0,0 +1,719 @@
// (C) Copyright John Maddock 2006.
// (C) Copyright Jeremy William Murphy 2015.
// 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_POLYNOMIAL_HPP
#define BOOST_MATH_TOOLS_POLYNOMIAL_HPP
#ifdef _MSC_VER
#pragma once
#endif
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/config/suffix.hpp>
#include <boost/function.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/math/tools/rational.hpp>
#include <boost/math/tools/real_cast.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/binomial.hpp>
#include <boost/operators.hpp>
#include <vector>
#include <ostream>
#include <algorithm>
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
namespace boost{ namespace math{ namespace tools{
template <class T>
T chebyshev_coefficient(unsigned n, unsigned m)
{
BOOST_MATH_STD_USING
if(m > n)
return 0;
if((n & 1) != (m & 1))
return 0;
if(n == 0)
return 1;
T result = T(n) / 2;
unsigned r = n - m;
r /= 2;
BOOST_ASSERT(n - 2 * r == m);
if(r & 1)
result = -result;
result /= n - r;
result *= boost::math::binomial_coefficient<T>(n - r, r);
result *= ldexp(1.0f, m);
return result;
}
template <class Seq>
Seq polynomial_to_chebyshev(const Seq& s)
{
// Converts a Polynomial into Chebyshev form:
typedef typename Seq::value_type value_type;
typedef typename Seq::difference_type difference_type;
Seq result(s);
difference_type order = s.size() - 1;
difference_type even_order = order & 1 ? order - 1 : order;
difference_type odd_order = order & 1 ? order : order - 1;
for(difference_type i = even_order; i >= 0; i -= 2)
{
value_type val = s[i];
for(difference_type k = even_order; k > i; k -= 2)
{
val -= result[k] * chebyshev_coefficient<value_type>(static_cast<unsigned>(k), static_cast<unsigned>(i));
}
val /= chebyshev_coefficient<value_type>(static_cast<unsigned>(i), static_cast<unsigned>(i));
result[i] = val;
}
result[0] *= 2;
for(difference_type i = odd_order; i >= 0; i -= 2)
{
value_type val = s[i];
for(difference_type k = odd_order; k > i; k -= 2)
{
val -= result[k] * chebyshev_coefficient<value_type>(static_cast<unsigned>(k), static_cast<unsigned>(i));
}
val /= chebyshev_coefficient<value_type>(static_cast<unsigned>(i), static_cast<unsigned>(i));
result[i] = val;
}
return result;
}
template <class Seq, class T>
T evaluate_chebyshev(const Seq& a, const T& x)
{
// Clenshaw's formula:
typedef typename Seq::difference_type difference_type;
T yk2 = 0;
T yk1 = 0;
T yk = 0;
for(difference_type i = a.size() - 1; i >= 1; --i)
{
yk2 = yk1;
yk1 = yk;
yk = 2 * x * yk1 - yk2 + a[i];
}
return a[0] / 2 + yk * x - yk1;
}
template <typename T>
class polynomial;
namespace detail {
/**
* Knuth, The Art of Computer Programming: Volume 2, Third edition, 1998
* Chapter 4.6.1, Algorithm D: Division of polynomials over a field.
*
* @tparam T Coefficient type, must be not be an integer.
*
* Template-parameter T actually must be a field but we don't currently have that
* subtlety of distinction.
*/
template <typename T, typename N>
BOOST_DEDUCED_TYPENAME disable_if_c<std::numeric_limits<T>::is_integer, void >::type
division_impl(polynomial<T> &q, polynomial<T> &u, const polynomial<T>& v, N n, N k)
{
q[k] = u[n + k] / v[n];
for (N j = n + k; j > k;)
{
j--;
u[j] -= q[k] * v[j - k];
}
}
template <class T, class N>
T integer_power(T t, N n)
{
switch(n)
{
case 0:
return static_cast<T>(1u);
case 1:
return t;
case 2:
return t * t;
case 3:
return t * t * t;
}
T result = integer_power(t, n / 2);
result *= result;
if(n & 1)
result *= t;
return result;
}
/**
* Knuth, The Art of Computer Programming: Volume 2, Third edition, 1998
* Chapter 4.6.1, Algorithm R: Pseudo-division of polynomials.
*
* @tparam T Coefficient type, must be an integer.
*
* Template-parameter T actually must be a unique factorization domain but we
* don't currently have that subtlety of distinction.
*/
template <typename T, typename N>
BOOST_DEDUCED_TYPENAME enable_if_c<std::numeric_limits<T>::is_integer, void >::type
division_impl(polynomial<T> &q, polynomial<T> &u, const polynomial<T>& v, N n, N k)
{
q[k] = u[n + k] * integer_power(v[n], k);
for (N j = n + k; j > 0;)
{
j--;
u[j] = v[n] * u[j] - (j < k ? T(0) : u[n + k] * v[j - k]);
}
}
/**
* Knuth, The Art of Computer Programming: Volume 2, Third edition, 1998
* Chapter 4.6.1, Algorithm D and R: Main loop.
*
* @param u Dividend.
* @param v Divisor.
*/
template <typename T>
std::pair< polynomial<T>, polynomial<T> >
division(polynomial<T> u, const polynomial<T>& v)
{
BOOST_ASSERT(v.size() <= u.size());
BOOST_ASSERT(v);
BOOST_ASSERT(u);
typedef typename polynomial<T>::size_type N;
N const m = u.size() - 1, n = v.size() - 1;
N k = m - n;
polynomial<T> q;
q.data().resize(m - n + 1);
do
{
division_impl(q, u, v, n, k);
}
while (k-- != 0);
u.data().resize(n);
u.normalize(); // Occasionally, the remainder is zeroes.
return std::make_pair(q, u);
}
template <class T>
struct identity
{
T operator()(T const &x) const
{
return x;
}
};
} // namespace detail
/**
* Returns the zero element for multiplication of polynomials.
*/
template <class T>
polynomial<T> zero_element(std::multiplies< polynomial<T> >)
{
return polynomial<T>();
}
template <class T>
polynomial<T> identity_element(std::multiplies< polynomial<T> >)
{
return polynomial<T>(T(1));
}
/* Calculates a / b and a % b, returning the pair (quotient, remainder) together
* because the same amount of computation yields both.
* This function is not defined for division by zero: user beware.
*/
template <typename T>
std::pair< polynomial<T>, polynomial<T> >
quotient_remainder(const polynomial<T>& dividend, const polynomial<T>& divisor)
{
BOOST_ASSERT(divisor);
if (dividend.size() < divisor.size())
return std::make_pair(polynomial<T>(), dividend);
return detail::division(dividend, divisor);
}
template <class T>
class polynomial :
equality_comparable< polynomial<T>,
dividable< polynomial<T>,
dividable2< polynomial<T>, T,
modable< polynomial<T>,
modable2< polynomial<T>, T > > > > >
{
public:
// typedefs:
typedef typename std::vector<T>::value_type value_type;
typedef typename std::vector<T>::size_type size_type;
// construct:
polynomial(){}
template <class U>
polynomial(const U* data, unsigned order)
: m_data(data, data + order + 1)
{
normalize();
}
template <class I>
polynomial(I first, I last)
: m_data(first, last)
{
normalize();
}
template <class U>
explicit polynomial(const U& point)
{
if (point != U(0))
m_data.push_back(point);
}
// copy:
polynomial(const polynomial& p)
: m_data(p.m_data) { }
template <class U>
polynomial(const polynomial<U>& p)
{
for(unsigned i = 0; i < p.size(); ++i)
{
m_data.push_back(boost::math::tools::real_cast<T>(p[i]));
}
}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
polynomial(std::initializer_list<T> l) : polynomial(std::begin(l), std::end(l))
{
}
polynomial&
operator=(std::initializer_list<T> l)
{
m_data.assign(std::begin(l), std::end(l));
normalize();
return *this;
}
#endif
// access:
size_type size()const { return m_data.size(); }
size_type degree()const
{
if (size() == 0)
throw std::logic_error("degree() is undefined for the zero polynomial.");
return m_data.size() - 1;
}
value_type& operator[](size_type i)
{
return m_data[i];
}
const value_type& operator[](size_type i)const
{
return m_data[i];
}
T evaluate(T z)const
{
return m_data.size() > 0 ? boost::math::tools::evaluate_polynomial(&m_data[0], z, m_data.size()) : 0;
}
std::vector<T> chebyshev()const
{
return polynomial_to_chebyshev(m_data);
}
std::vector<T> const& data() const
{
return m_data;
}
std::vector<T> & data()
{
return m_data;
}
// operators:
template <class U>
polynomial& operator +=(const U& value)
{
addition(value);
normalize();
return *this;
}
template <class U>
polynomial& operator -=(const U& value)
{
subtraction(value);
normalize();
return *this;
}
template <class U>
polynomial& operator *=(const U& value)
{
multiplication(value);
normalize();
return *this;
}
template <class U>
polynomial& operator /=(const U& value)
{
division(value);
normalize();
return *this;
}
template <class U>
polynomial& operator %=(const U& /*value*/)
{
// We can always divide by a scalar, so there is no remainder:
this->set_zero();
return *this;
}
template <class U>
polynomial& operator +=(const polynomial<U>& value)
{
addition(value);
normalize();
return *this;
}
template <class U>
polynomial& operator -=(const polynomial<U>& value)
{
subtraction(value);
normalize();
return *this;
}
template <class U>
polynomial& operator *=(const polynomial<U>& value)
{
// TODO: FIXME: use O(N log(N)) algorithm!!!
if (!value)
{
this->set_zero();
return *this;
}
std::vector<T> prod(size() + value.size() - 1, T(0));
for (size_type i = 0; i < value.size(); ++i)
for (size_type j = 0; j < size(); ++j)
prod[i+j] += m_data[j] * value[i];
m_data.swap(prod);
return *this;
}
template <typename U>
polynomial& operator /=(const polynomial<U>& value)
{
*this = quotient_remainder(*this, value).first;
return *this;
}
template <typename U>
polynomial& operator %=(const polynomial<U>& value)
{
*this = quotient_remainder(*this, value).second;
return *this;
}
template <typename U>
polynomial& operator >>=(U const &n)
{
BOOST_ASSERT(n <= m_data.size());
m_data.erase(m_data.begin(), m_data.begin() + n);
return *this;
}
template <typename U>
polynomial& operator <<=(U const &n)
{
m_data.insert(m_data.begin(), n, static_cast<T>(0));
normalize();
return *this;
}
// Convenient and efficient query for zero.
bool is_zero() const
{
return m_data.empty();
}
// Conversion to bool.
#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
typedef bool (polynomial::*unmentionable_type)() const;
BOOST_FORCEINLINE operator unmentionable_type() const
{
return is_zero() ? false : &polynomial::is_zero;
}
#else
BOOST_FORCEINLINE explicit operator bool() const
{
return !m_data.empty();
}
#endif
// Fast way to set a polynomial to zero.
void set_zero()
{
m_data.clear();
}
/** Remove zero coefficients 'from the top', that is for which there are no
* non-zero coefficients of higher degree. */
void normalize()
{
using namespace boost::lambda;
m_data.erase(std::find_if(m_data.rbegin(), m_data.rend(), _1 != T(0)).base(), m_data.end());
}
private:
template <class U, class R1, class R2>
polynomial& addition(const U& value, R1 sign, R2 op)
{
if(m_data.size() == 0)
m_data.push_back(sign(value));
else
m_data[0] = op(m_data[0], value);
return *this;
}
template <class U>
polynomial& addition(const U& value)
{
return addition(value, detail::identity<U>(), std::plus<U>());
}
template <class U>
polynomial& subtraction(const U& value)
{
return addition(value, std::negate<U>(), std::minus<U>());
}
template <class U, class R1, class R2>
polynomial& addition(const polynomial<U>& value, R1 sign, R2 op)
{
size_type s1 = (std::min)(m_data.size(), value.size());
for(size_type i = 0; i < s1; ++i)
m_data[i] = op(m_data[i], value[i]);
for(size_type i = s1; i < value.size(); ++i)
m_data.push_back(sign(value[i]));
return *this;
}
template <class U>
polynomial& addition(const polynomial<U>& value)
{
return addition(value, detail::identity<U>(), std::plus<U>());
}
template <class U>
polynomial& subtraction(const polynomial<U>& value)
{
return addition(value, std::negate<U>(), std::minus<U>());
}
template <class U>
polynomial& multiplication(const U& value)
{
using namespace boost::lambda;
std::transform(m_data.begin(), m_data.end(), m_data.begin(), ret<T>(_1 * value));
return *this;
}
template <class U>
polynomial& division(const U& value)
{
using namespace boost::lambda;
std::transform(m_data.begin(), m_data.end(), m_data.begin(), ret<T>(_1 / value));
return *this;
}
std::vector<T> m_data;
};
template <class T>
inline polynomial<T> operator + (const polynomial<T>& a, const polynomial<T>& b)
{
polynomial<T> result(a);
result += b;
return result;
}
template <class T>
inline polynomial<T> operator - (const polynomial<T>& a, const polynomial<T>& b)
{
polynomial<T> result(a);
result -= b;
return result;
}
template <class T>
inline polynomial<T> operator * (const polynomial<T>& a, const polynomial<T>& b)
{
polynomial<T> result(a);
result *= b;
return result;
}
template <class T, class U>
inline polynomial<T> operator + (const polynomial<T>& a, const U& b)
{
polynomial<T> result(a);
result += b;
return result;
}
template <class T, class U>
inline polynomial<T> operator - (const polynomial<T>& a, const U& b)
{
polynomial<T> result(a);
result -= b;
return result;
}
template <class T, class U>
inline polynomial<T> operator * (const polynomial<T>& a, const U& b)
{
polynomial<T> result(a);
result *= b;
return result;
}
template <class U, class T>
inline polynomial<T> operator + (const U& a, const polynomial<T>& b)
{
polynomial<T> result(b);
result += a;
return result;
}
template <class U, class T>
inline polynomial<T> operator - (const U& a, const polynomial<T>& b)
{
polynomial<T> result(a);
result -= b;
return result;
}
template <class U, class T>
inline polynomial<T> operator * (const U& a, const polynomial<T>& b)
{
polynomial<T> result(b);
result *= a;
return result;
}
template <class T>
bool operator == (const polynomial<T> &a, const polynomial<T> &b)
{
return a.data() == b.data();
}
template <typename T, typename U>
polynomial<T> operator >> (const polynomial<T>& a, const U& b)
{
polynomial<T> result(a);
result >>= b;
return result;
}
template <typename T, typename U>
polynomial<T> operator << (const polynomial<T>& a, const U& b)
{
polynomial<T> result(a);
result <<= b;
return result;
}
// Unary minus (negate).
template <class T>
polynomial<T> operator - (polynomial<T> a)
{
std::transform(a.data().begin(), a.data().end(), a.data().begin(), std::negate<T>());
return a;
}
template <class T>
bool odd(polynomial<T> const &a)
{
return a.size() > 0 && a[0] != static_cast<T>(0);
}
template <class T>
bool even(polynomial<T> const &a)
{
return !odd(a);
}
template <class T>
polynomial<T> pow(polynomial<T> base, int exp)
{
if (exp < 0)
return policies::raise_domain_error(
"boost::math::tools::pow<%1%>",
"Negative powers are not supported for polynomials.",
base, policies::policy<>());
// if the policy is ignore_error or errno_on_error, raise_domain_error
// will return std::numeric_limits<polynomial<T>>::quiet_NaN(), which
// defaults to polynomial<T>(), which is the zero polynomial
polynomial<T> result(T(1));
if (exp & 1)
result = base;
/* "Exponentiation by squaring" */
while (exp >>= 1)
{
base *= base;
if (exp & 1)
result *= base;
}
return result;
}
template <class charT, class traits, class T>
inline std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& os, const polynomial<T>& poly)
{
os << "{ ";
for(unsigned i = 0; i < poly.size(); ++i)
{
if(i) os << ", ";
os << poly[i];
}
os << " }";
return os;
}
} // namespace tools
} // namespace math
} // namespace boost
#endif // BOOST_MATH_TOOLS_POLYNOMIAL_HPP
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,137 @@
#ifndef BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP
#define BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// mb_from_wchar.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// 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 http://www.boost.org for updates, documentation, and revision history.
#include <boost/assert.hpp>
#include <cstddef> // size_t
#include <cwchar> // mbstate_t
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::mbstate_t;
} // namespace std
#endif
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
namespace boost {
namespace archive {
namespace iterators {
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// class used by text archives to translate wide strings and to char
// strings of the currently selected locale
template<class Base> // the input iterator
class mb_from_wchar
: public boost::iterator_adaptor<
mb_from_wchar<Base>,
Base,
wchar_t,
single_pass_traversal_tag,
char
>
{
friend class boost::iterator_core_access;
typedef typename boost::iterator_adaptor<
mb_from_wchar<Base>,
Base,
wchar_t,
single_pass_traversal_tag,
char
> super_t;
typedef mb_from_wchar<Base> this_t;
char dereference_impl() {
if(! m_full){
fill();
m_full = true;
}
return m_buffer[m_bnext];
}
char dereference() const {
return (const_cast<this_t *>(this))->dereference_impl();
}
// test for iterator equality
bool equal(const mb_from_wchar<Base> & rhs) const {
// once the value is filled, the base_reference has been incremented
// so don't permit comparison anymore.
return
0 == m_bend
&& 0 == m_bnext
&& this->base_reference() == rhs.base_reference()
;
}
void fill(){
wchar_t value = * this->base_reference();
const wchar_t *wend;
char *bend;
std::codecvt_base::result r = m_codecvt_facet.out(
m_mbs,
& value, & value + 1, wend,
m_buffer, m_buffer + sizeof(m_buffer), bend
);
BOOST_ASSERT(std::codecvt_base::ok == r);
m_bnext = 0;
m_bend = bend - m_buffer;
}
void increment(){
if(++m_bnext < m_bend)
return;
m_bend =
m_bnext = 0;
++(this->base_reference());
m_full = false;
}
boost::archive::detail::utf8_codecvt_facet m_codecvt_facet;
std::mbstate_t m_mbs;
// buffer to handle pending characters
char m_buffer[9 /* MB_CUR_MAX */];
std::size_t m_bend;
std::size_t m_bnext;
bool m_full;
public:
// make composible buy using templated constructor
template<class T>
mb_from_wchar(T start) :
super_t(Base(static_cast< T >(start))),
m_mbs(std::mbstate_t()),
m_bend(0),
m_bnext(0),
m_full(false)
{}
// intel 7.1 doesn't like default copy constructor
mb_from_wchar(const mb_from_wchar & rhs) :
super_t(rhs.base_reference()),
m_bend(rhs.m_bend),
m_bnext(rhs.m_bnext),
m_full(rhs.m_full)
{}
};
} // namespace iterators
} // namespace archive
} // namespace boost
#endif // BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP
@@ -0,0 +1,45 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_MAP_DETAIL_END_IMPL_HPP
#define BOOST_FUSION_CONTAINER_MAP_DETAIL_END_IMPL_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/basic_iterator.hpp>
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct end_impl;
template <>
struct end_impl<map_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
map_iterator_tag
, typename Seq::category
, Seq
, Seq::size::value
>
type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
return type(seq,0);
}
};
};
}}}
#endif