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,76 @@
#ifndef HAMLIB_TRANSCEIVER_HPP_
#define HAMLIB_TRANSCEIVER_HPP_
#include <tuple>
#include <QString>
#include <hamlib/rig.h>
#include "TransceiverFactory.hpp"
#include "PollingTransceiver.hpp"
extern "C"
{
typedef struct rig RIG;
struct rig_caps;
typedef int vfo_t;
}
// hamlib transceiver and PTT mostly delegated directly to hamlib Rig class
class HamlibTransceiver final
: public PollingTransceiver
{
Q_OBJECT; // for translation context
public:
static void register_transceivers (TransceiverFactory::Transceivers *);
static void unregister_transceivers ();
explicit HamlibTransceiver (int model_number, TransceiverFactory::ParameterPack const&,
QObject * parent = nullptr);
explicit HamlibTransceiver (TransceiverFactory::PTTMethod ptt_type, QString const& ptt_port,
QObject * parent = nullptr);
private:
int do_start () override;
void do_stop () override;
void do_frequency (Frequency, MODE, bool no_ignore) override;
void do_tx_frequency (Frequency, MODE, bool no_ignore) override;
void do_mode (MODE) override;
void do_ptt (bool) override;
void poll () override;
void error_check (int ret_code, QString const& doing) const;
void set_conf (char const * item, char const * value);
QByteArray get_conf (char const * item);
Transceiver::MODE map_mode (rmode_t) const;
rmode_t map_mode (Transceiver::MODE mode) const;
std::tuple<vfo_t, vfo_t> get_vfos (bool for_split) const;
struct RIGDeleter {static void cleanup (RIG *);};
QScopedPointer<RIG, RIGDeleter> rig_;
bool back_ptt_port_;
bool one_VFO_;
bool is_dummy_;
// these are saved on destruction so we can start new instances
// where the last one left off
static freq_t dummy_frequency_;
static rmode_t dummy_mode_;
bool mutable reversed_;
bool freq_query_works_;
bool mode_query_works_;
bool split_query_works_;
bool tickle_hamlib_; // Hamlib requires a
// rig_set_split_vfo() call to
// establish the Tx VFO
bool get_vfo_works_; // Net rigctl promises what it can't deliver
bool set_vfo_works_; // More rigctl promises which it can't deliver
};
#endif
@@ -0,0 +1,180 @@
/*=============================================================================
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_;
namespace result_of
{
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 Extra = void_
>
struct list_tie;
}
namespace result_of
{
template <typename T0>
struct list_tie< T0 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0&> type;
};
}
template <typename T0>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0&>
list_tie(T0 & arg0)
{
return list<T0&>(
arg0);
}
namespace result_of
{
template <typename T0 , typename T1>
struct list_tie< T0 , T1 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1&> type;
};
}
template <typename T0 , typename T1>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1&>
list_tie(T0 & arg0 , T1 & arg1)
{
return list<T0& , T1&>(
arg0 , arg1);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2>
struct list_tie< T0 , T1 , T2 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2&> type;
};
}
template <typename T0 , typename T1 , typename T2>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2)
{
return list<T0& , T1& , T2&>(
arg0 , arg1 , arg2);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3>
struct list_tie< T0 , T1 , T2 , T3 , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3)
{
return list<T0& , T1& , T2& , T3&>(
arg0 , arg1 , arg2 , arg3);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4>
struct list_tie< T0 , T1 , T2 , T3 , T4 , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4)
{
return list<T0& , T1& , T2& , T3& , T4&>(
arg0 , arg1 , arg2 , arg3 , arg4);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5)
{
return list<T0& , T1& , T2& , T3& , T4& , T5&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9);
}
}}
@@ -0,0 +1,46 @@
// Copyright Kevlin Henney, 2000-2005.
// Copyright Alexander Nasonov, 2006-2010.
// Copyright Antony Polukhin, 2011-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)
//
// what: lexical_cast custom keyword cast
// who: contributed by Kevlin Henney,
// enhanced with contributions from Terje Slettebo,
// with additional fixes and suggestions from Gennaro Prota,
// Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov,
// Alexander Nasonov, Antony Polukhin, Justin Viiret, Michael Hofmann,
// Cheng Yang, Matthew Bradbury, David W. Birdsall, Pavel Korzh and other Boosters
// when: November 2000, March 2003, June 2005, June 2006, March 2011 - 2014
#ifndef BOOST_LEXICAL_CAST_DETAIL_LCAST_CHAR_CONSTANTS_HPP
#define BOOST_LEXICAL_CAST_DETAIL_LCAST_CHAR_CONSTANTS_HPP
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif
namespace boost
{
namespace detail // '0', '-', '+', 'e', 'E' and '.' constants
{
template < typename Char >
struct lcast_char_constants {
// We check in tests assumption that static casted character is
// equal to correctly written C++ literal: U'0' == static_cast<char32_t>('0')
BOOST_STATIC_CONSTANT(Char, zero = static_cast<Char>('0'));
BOOST_STATIC_CONSTANT(Char, minus = static_cast<Char>('-'));
BOOST_STATIC_CONSTANT(Char, plus = static_cast<Char>('+'));
BOOST_STATIC_CONSTANT(Char, lowercase_e = static_cast<Char>('e'));
BOOST_STATIC_CONSTANT(Char, capital_e = static_cast<Char>('E'));
BOOST_STATIC_CONSTANT(Char, c_decimal_separator = static_cast<Char>('.'));
};
}
} // namespace boost
#endif // BOOST_LEXICAL_CAST_DETAIL_LCAST_CHAR_CONSTANTS_HPP
@@ -0,0 +1,81 @@
module jt65_test
! Test the JT65 decoder for WSJT-X
implicit none
public :: test
integer, parameter, public :: NZMAX=60*12000
integer, public :: nft
contains
subroutine test (dd,nutc,nflow,nfhigh,nfqso,ntol,nsubmode,n2pass,nrobust &
,ntrials,naggressive,ndepth,mycall,hiscall,hisgrid,nexp_decode)
use timer_module, only: timer
use jt65_decode
implicit none
include 'constants.f90'
real, intent(in) :: dd(NZMAX)
integer, intent(in) :: nutc, nflow, nfhigh, nfqso, ntol, nsubmode, n2pass &
, ntrials, naggressive, ndepth, nexp_decode
logical, intent(in) :: nrobust
character(len=12), intent(in) :: mycall, hiscall
character(len=6), intent(in) :: hisgrid
type(jt65_decoder) :: my_decoder
logical nclearave !### Should be a dummy arg?
nclearave=.false.
call timer('jt65a ',0)
call my_decoder%decode(my_callback,dd,npts=52*12000,newdat=.true., &
nutc=nutc,nf1=nflow,nf2=nfhigh,nfqso=nfqso,ntol=ntol, &
nsubmode=nsubmode, minsync=-1,nagain=.false.,n2pass=n2pass, &
nrobust=nrobust,ntrials=ntrials,naggressive=naggressive, &
ndepth=ndepth,emedelay=0.0,clearave=nclearave,mycall=mycall, &
hiscall=hiscall,hisgrid=hisgrid,nexp_decode=nexp_decode)
call timer('jt65a ',1)
end subroutine test
subroutine my_callback (this,sync,snr,dt,freq,drift,nflip,width, &
decoded,ft,qual,smo,sum,minsync)
use jt65_decode
implicit none
class(jt65_decoder), intent(inout) :: this
real, intent(in) :: sync
integer, intent(in) :: snr
real, intent(in) :: dt
integer, intent(in) :: freq
integer, intent(in) :: drift
integer, intent(in) :: nflip
real, intent(in) :: width
character(len=22), intent(in) :: decoded
integer, intent(in) :: ft
integer, intent(in) :: qual
integer, intent(in) :: smo
integer, intent(in) :: sum
integer, intent(in) :: minsync
integer nwidth
real t
if(minsync+nflip+qual.eq.-9999) stop !Silence compiler warning
t=max(0.0,width*width-7.2)
nwidth=max(nint(sqrt(t)),2)
!### deal with nflip here! ###
!### also single_decode, csync, etc... ###
write(*,1010) snr,dt,freq,decoded
1010 format(i4,f5.1,i5,1x,'#',1x,a22)
write(13,1012) nint(sync),snr,dt,freq,drift,nwidth, &
decoded,ft,sum,smo
1012 format(i4,i5,f6.2,i5,i4,i3,1x,a22,' JT65',3i3)
nft=ft
call flush(6)
! write(79,3001) sync,snr,dt,freq,candidates, &
! hard_min,total_min,rtt,tries,ft,qual,decoded
!3001 format(f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22)
end subroutine my_callback
end module jt65_test
@@ -0,0 +1,316 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
template <>
struct member_function_ptr_impl<1>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0>
RT operator()(Class& obj, A0 & a0) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0);
}
template <typename Class, typename A0>
RT operator()(Class* obj, A0 & a0) const
{
return (obj->*fp)(a0);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<2>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1>
RT operator()(Class& obj, A0 & a0 , A1 & a1) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1);
}
template <typename Class, typename A0 , typename A1>
RT operator()(Class* obj, A0 & a0 , A1 & a1) const
{
return (obj->*fp)(a0 , a1);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<3>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2);
}
template <typename Class, typename A0 , typename A1 , typename A2>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2) const
{
return (obj->*fp)(a0 , a1 , a2);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<4>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3) const
{
return (obj->*fp)(a0 , a1 , a2 , a3);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<5>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<6>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<7>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<8>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<9>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<10>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp_)
: fp(fp_) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8 , A9 & a9) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8 , A9 & a9) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
}
FP fp;
};
};
@@ -0,0 +1,122 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_TUPLE_10032005_0810)
#define FUSION_TUPLE_10032005_0810
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/tuple/detail/tuple_fwd.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/comparison.hpp>
#include <boost/fusion/sequence/io.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/config/no_tr1/utility.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/tuple/detail/preprocessed/tuple.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/tuple" FUSION_MAX_VECTOR_SIZE_STR ".hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
namespace boost { namespace fusion
{
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
struct tuple : vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
{
typedef vector<
BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>
base_type;
BOOST_FUSION_GPU_ENABLED tuple()
: base_type() {}
BOOST_FUSION_GPU_ENABLED tuple(tuple const& rhs)
: base_type(static_cast<base_type const&>(rhs)) {}
template <typename U1, typename U2>
BOOST_FUSION_GPU_ENABLED
tuple(std::pair<U1, U2> const& rhs)
: base_type(rhs) {}
#include <boost/fusion/tuple/detail/tuple_expand.hpp>
template <typename T>
BOOST_FUSION_GPU_ENABLED
tuple& operator=(T const& rhs)
{
base_type::operator=(rhs);
return *this;
}
BOOST_FUSION_GPU_ENABLED
tuple& operator=(tuple const& rhs)
{
base_type::operator=(static_cast<base_type const&>(rhs));
return *this;
}
template <typename U1, typename U2>
BOOST_FUSION_GPU_ENABLED
tuple& operator=(std::pair<U1, U2> const& rhs)
{
base_type::operator=(rhs);
return *this;
}
};
template <typename Tuple>
struct tuple_size : result_of::size<Tuple> {};
template <int N, typename Tuple>
struct tuple_element : result_of::value_at_c<Tuple, N> {};
template <int N, typename Tuple>
BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Tuple>
, result_of::at_c<Tuple, N>
>::type
get(Tuple& tup)
{
return at_c<N>(tup);
}
template <int N, typename Tuple>
BOOST_FUSION_GPU_ENABLED
inline typename result_of::at_c<Tuple const, N>::type
get(Tuple const& tup)
{
return at_c<N>(tup);
}
}}
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#endif
@@ -0,0 +1,78 @@
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file is machine generated, do not edit by hand
// Polynomial evaluation using Horners rule
#ifndef BOOST_MATH_TOOLS_POLY_RAT_5_HPP
#define BOOST_MATH_TOOLS_POLY_RAT_5_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(0);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
}
}
}}}} // namespaces
#endif // include guard
@@ -0,0 +1,33 @@
// (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.
//
// defines object traits classes:
// is_object, is_scalar, is_class, is_compound, is_pod,
// has_trivial_constructor, has_trivial_copy, has_trivial_assign,
// has_trivial_destructor, is_empty.
//
#ifndef BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED
#define BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED
#include <boost/type_traits/has_trivial_assign.hpp>
#include <boost/type_traits/has_trivial_constructor.hpp>
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/type_traits/has_nothrow_constructor.hpp>
#include <boost/type_traits/has_nothrow_copy.hpp>
#include <boost/type_traits/has_nothrow_assign.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_compound.hpp>
#include <boost/type_traits/is_empty.hpp>
#include <boost/type_traits/is_object.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/is_stateless.hpp>
#endif // BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED
@@ -0,0 +1,60 @@
// (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).
//------------------------------------------------------------------------------
#ifndef BOOST_FT_DETAIL_CLASS_TRANSFORM_HPP_INCLUDED
#define BOOST_FT_DETAIL_CLASS_TRANSFORM_HPP_INCLUDED
#include <boost/mpl/apply.hpp>
#include <boost/mpl/always.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/add_pointer.hpp>
#include <boost/type_traits/add_reference.hpp>
namespace boost { namespace function_types { namespace detail {
using mpl::placeholders::_;
// Transformation metafunction for the class type of member function pointers.
template<typename T, typename L>
struct class_transform
{ typedef typename mpl::apply1<L,T>::type type; };
// We can short-circuit the mechanism implemented in the primary template for
// the most common lambda expression and save both the "un-lambdaing" and the
// type traits invocation (we know that T can only be a class type).
template<typename T> struct class_transform< T, mpl::identity<_> >
{ typedef T type; };
template<typename T> struct class_transform< T, add_reference<_> >
{ typedef T & type; };
template<typename T> struct class_transform< T, add_pointer<_> >
{ typedef T * type; };
template<typename T> struct class_transform< T, remove_cv<_> >
{ typedef typename boost::remove_cv<T>::type type; };
template<typename T> struct class_transform< T, add_reference< remove_cv<_> > >
{ typedef typename boost::remove_cv<T>::type & type; };
template<typename T> struct class_transform< T, add_pointer< remove_cv<_> > >
{ typedef typename boost::remove_cv<T>::type * type; };
template<typename T, typename U> struct class_transform< T, mpl::always<U> >
{ typedef U type; };
} } } // namespace ::boost::function_types::detail
#endif
@@ -0,0 +1,76 @@
#ifndef BOOST_MPL_ADVANCE_HPP_INCLUDED
#define BOOST_MPL_ADVANCE_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/advance_fwd.hpp>
#include <boost/mpl/less.hpp>
#include <boost/mpl/negate.hpp>
#include <boost/mpl/long.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/tag.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/aux_/advance_forward.hpp>
#include <boost/mpl/aux_/advance_backward.hpp>
#include <boost/mpl/aux_/value_wknd.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/nttp_decl.hpp>
namespace boost { namespace mpl {
// default implementation for forward/bidirectional iterators
template< typename Tag >
struct advance_impl
{
template< typename Iterator, typename N > struct apply
{
typedef typename less< N,long_<0> >::type backward_;
typedef typename if_< backward_, negate<N>, N >::type offset_;
typedef typename if_<
backward_
, aux::advance_backward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
, aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
>::type f_;
typedef typename apply_wrap1<f_,Iterator>::type type;
};
};
template<
typename BOOST_MPL_AUX_NA_PARAM(Iterator)
, typename BOOST_MPL_AUX_NA_PARAM(N)
>
struct advance
: advance_impl< typename tag<Iterator>::type >
::template apply<Iterator,N>
{
};
template<
typename Iterator
, BOOST_MPL_AUX_NTTP_DECL(long, N)
>
struct advance_c
: advance_impl< typename tag<Iterator>::type >
::template apply<Iterator,long_<N> >
{
};
BOOST_MPL_AUX_NA_SPEC(2, advance)
}}
#endif // BOOST_MPL_ADVANCE_HPP_INCLUDED
@@ -0,0 +1,121 @@
/*
Copyright Rene Rivera 2011-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_LANGUAGE_STDCPP_H
#define BOOST_PREDEF_LANGUAGE_STDCPP_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_LANG_STDCPP`]
[@http://en.wikipedia.org/wiki/C%2B%2B Standard C++] language.
If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
Because of the way the C++ standardization process works the
defined version year will not be the commonly known year of the standard.
Specifically the defined versions are:
[table Detected Version Number vs. C++ Standard Year
[[Detected Version Number] [Standard Year] [C++ Standard]]
[[27.11.1] [1998] [ISO/IEC 14882:1998]]
[[41.12.1] [2011] [ISO/IEC 14882:2011]]
]
[table
[[__predef_symbol__] [__predef_version__]]
[[`__cplusplus`] [__predef_detection__]]
[[`__cplusplus`] [YYYY.MM.1]]
]
*/
#define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__cplusplus)
# undef BOOST_LANG_STDCPP
# if (__cplusplus > 100)
# define BOOST_LANG_STDCPP BOOST_PREDEF_MAKE_YYYYMM(__cplusplus)
# else
# define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#if BOOST_LANG_STDCPP
# define BOOST_LANG_STDCPP_AVAILABLE
#endif
#define BOOST_LANG_STDCPP_NAME "Standard C++"
/*`
[heading `BOOST_LANG_STDCPPCLI`]
[@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language.
If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__cplusplus_cli`] [__predef_detection__]]
[[`__cplusplus_cli`] [YYYY.MM.1]]
]
*/
#define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__cplusplus_cli)
# undef BOOST_LANG_STDCPPCLI
# if (__cplusplus_cli > 100)
# define BOOST_LANG_STDCPPCLI BOOST_PREDEF_MAKE_YYYYMM(__cplusplus_cli)
# else
# define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#if BOOST_LANG_STDCPPCLI
# define BOOST_LANG_STDCPPCLI_AVAILABLE
#endif
#define BOOST_LANG_STDCPPCLI_NAME "Standard C++/CLI"
/*`
[heading `BOOST_LANG_STDECPP`]
[@http://en.wikipedia.org/wiki/Embedded_C%2B%2B Standard Embedded C++] language.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__embedded_cplusplus`] [__predef_detection__]]
]
*/
#define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__embedded_cplusplus)
# undef BOOST_LANG_STDECPP
# define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_LANG_STDECPP
# define BOOST_LANG_STDECPP_AVAILABLE
#endif
#define BOOST_LANG_STDECPP_NAME "Standard Embedded C++"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME)
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME)
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDECPP,BOOST_LANG_STDECPP_NAME)
@@ -0,0 +1,25 @@
/*==============================================================================
Copyright (c) 2011 Hartmut Kaiser
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_PHOENIX_PREPROCESSED_ACTOR_OPERATOR)
#define BOOST_PHOENIX_PREPROCESSED_ACTOR_OPERATOR
#if BOOST_PHOENIX_LIMIT <= 10
#include <boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_10.hpp>
#elif BOOST_PHOENIX_LIMIT <= 20
#include <boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_20.hpp>
#elif BOOST_PHOENIX_LIMIT <= 30
#include <boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_30.hpp>
#elif BOOST_PHOENIX_LIMIT <= 40
#include <boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_40.hpp>
#elif BOOST_PHOENIX_LIMIT <= 50
#include <boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_50.hpp>
#else
#error "BOOST_PHOENIX_LIMIT out of bounds for preprocessed headers"
#endif
#endif
@@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if FUSION_MAX_SET_SIZE <= 10
#include <boost/fusion/container/set/detail/cpp03/preprocessed/set10_fwd.hpp>
#elif FUSION_MAX_SET_SIZE <= 20
#include <boost/fusion/container/set/detail/cpp03/preprocessed/set20_fwd.hpp>
#elif FUSION_MAX_SET_SIZE <= 30
#include <boost/fusion/container/set/detail/cpp03/preprocessed/set30_fwd.hpp>
#elif FUSION_MAX_SET_SIZE <= 40
#include <boost/fusion/container/set/detail/cpp03/preprocessed/set40_fwd.hpp>
#elif FUSION_MAX_SET_SIZE <= 50
#include <boost/fusion/container/set/detail/cpp03/preprocessed/set50_fwd.hpp>
#else
#error "FUSION_MAX_SET_SIZE out of bounds for preprocessed headers"
#endif
@@ -0,0 +1,323 @@
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// *Preprocessed* version of the main "vector.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename T0 = na, typename T1 = na, typename T2 = na, typename T3 = na
, typename T4 = na, typename T5 = na, typename T6 = na, typename T7 = na
, typename T8 = na, typename T9 = na, typename T10 = na, typename T11 = na
, typename T12 = na, typename T13 = na, typename T14 = na
, typename T15 = na, typename T16 = na, typename T17 = na
, typename T18 = na, typename T19 = na
>
struct vector;
template<
>
struct vector<
na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector0< >
{
typedef vector0< >::type type;
};
template<
typename T0
>
struct vector<
T0, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector1<T0>
{
typedef typename vector1<T0>::type type;
};
template<
typename T0, typename T1
>
struct vector<
T0, T1, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector2< T0,T1 >
{
typedef typename vector2< T0,T1 >::type type;
};
template<
typename T0, typename T1, typename T2
>
struct vector<
T0, T1, T2, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector3< T0,T1,T2 >
{
typedef typename vector3< T0,T1,T2 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3
>
struct vector<
T0, T1, T2, T3, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector4< T0,T1,T2,T3 >
{
typedef typename vector4< T0,T1,T2,T3 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
>
struct vector<
T0, T1, T2, T3, T4, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector5< T0,T1,T2,T3,T4 >
{
typedef typename vector5< T0,T1,T2,T3,T4 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct vector<
T0, T1, T2, T3, T4, T5, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector6< T0,T1,T2,T3,T4,T5 >
{
typedef typename vector6< T0,T1,T2,T3,T4,T5 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector7< T0,T1,T2,T3,T4,T5,T6 >
{
typedef typename vector7< T0,T1,T2,T3,T4,T5,T6 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector8< T0,T1,T2,T3,T4,T5,T6,T7 >
{
typedef typename vector8< T0,T1,T2,T3,T4,T5,T6,T7 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, na, na, na, na, na, na, na, na
, na, na, na
>
: vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >
{
typedef typename vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, na, na, na, na, na, na, na
, na, na, na
>
: vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >
{
typedef typename vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, na, na, na, na, na, na
, na, na, na
>
: vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >
{
typedef typename vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, na, na, na, na
, na, na, na, na
>
: vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >
{
typedef typename vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, na, na, na
, na, na, na, na
>
: vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >
{
typedef typename vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, na, na
, na, na, na, na
>
: vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >
{
typedef typename vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, na
, na, na, na, na
>
: vector15<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
>
{
typedef typename vector15< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, na, na, na, na
>
: vector16<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15
>
{
typedef typename vector16< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, na, na, na
>
: vector17<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16
>
{
typedef typename vector17< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, na, na
>
: vector18<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17
>
{
typedef typename vector18< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17, typename T18
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, T18, na
>
: vector19<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, T18
>
{
typedef typename vector19< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 >::type type;
};
/// primary template (not a specialization!)
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17, typename T18, typename T19
>
struct vector
: vector20<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, T18, T19
>
{
typedef typename vector20< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 >::type type;
};
}}
@@ -0,0 +1,132 @@
// Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_MATH_ROUND_HPP
#define BOOST_MATH_ROUND_HPP
#ifdef _MSC_VER
#pragma once
#endif
#include <boost/math/tools/config.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
namespace boost{ namespace math{
namespace detail{
template <class T, class Policy>
inline typename tools::promote_args<T>::type round(const T& v, const Policy& pol, const mpl::false_)
{
BOOST_MATH_STD_USING
typedef typename tools::promote_args<T>::type result_type;
if(!(boost::math::isfinite)(v))
return policies::raise_rounding_error("boost::math::round<%1%>(%1%)", 0, static_cast<result_type>(v), static_cast<result_type>(v), pol);
//
// The logic here is rather convoluted, but avoids a number of traps,
// see discussion here https://github.com/boostorg/math/pull/8
//
if (-0.5 < v && v < 0.5)
{
// special case to avoid rounding error on the direct
// predecessor of +0.5 resp. the direct successor of -0.5 in
// IEEE floating point types
return 0;
}
else if (v > 0)
{
// subtract v from ceil(v) first in order to avoid rounding
// errors on largest representable integer numbers
result_type c(ceil(v));
return 0.5 < c - v ? c - 1 : c;
}
else
{
// see former branch
result_type f(floor(v));
return 0.5 < v - f ? f + 1 : f;
}
}
template <class T, class Policy>
inline typename tools::promote_args<T>::type round(const T& v, const Policy&, const mpl::true_)
{
return v;
}
} // namespace detail
template <class T, class Policy>
inline typename tools::promote_args<T>::type round(const T& v, const Policy& pol)
{
return detail::round(v, pol, mpl::bool_<detail::is_integer_for_rounding<T>::value>());
}
template <class T>
inline typename tools::promote_args<T>::type round(const T& v)
{
return round(v, policies::policy<>());
}
//
// The following functions will not compile unless T has an
// implicit convertion to the integer types. For user-defined
// number types this will likely not be the case. In that case
// these functions should either be specialized for the UDT in
// question, or else overloads should be placed in the same
// namespace as the UDT: these will then be found via argument
// dependent lookup. See our concept archetypes for examples.
//
template <class T, class Policy>
inline int iround(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
T r = boost::math::round(v, pol);
if((r > (std::numeric_limits<int>::max)()) || (r < (std::numeric_limits<int>::min)()))
return static_cast<int>(policies::raise_rounding_error("boost::math::iround<%1%>(%1%)", 0, v, 0, pol));
return static_cast<int>(r);
}
template <class T>
inline int iround(const T& v)
{
return iround(v, policies::policy<>());
}
template <class T, class Policy>
inline long lround(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
T r = boost::math::round(v, pol);
if((r > (std::numeric_limits<long>::max)()) || (r < (std::numeric_limits<long>::min)()))
return static_cast<long int>(policies::raise_rounding_error("boost::math::lround<%1%>(%1%)", 0, v, 0L, pol));
return static_cast<long int>(r);
}
template <class T>
inline long lround(const T& v)
{
return lround(v, policies::policy<>());
}
#ifdef BOOST_HAS_LONG_LONG
template <class T, class Policy>
inline boost::long_long_type llround(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
T r = boost::math::round(v, pol);
if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, static_cast<boost::long_long_type>(0), pol));
return static_cast<boost::long_long_type>(r);
}
template <class T>
inline boost::long_long_type llround(const T& v)
{
return llround(v, policies::policy<>());
}
#endif
}} // namespaces
#endif // BOOST_MATH_ROUND_HPP
@@ -0,0 +1,50 @@
/*
* Reads an ADIF log file into memory
* Searches log for call, band and mode
* VK3ACF July 2013
*/
#ifndef __ADIF_H
#define __ADIF_H
#if defined (QT5)
#include <QList>
#include <QString>
#include <QMultiHash>
#else
#include <QtGui>
#endif
class ADIF
{
public:
void init(QString filename);
void load();
void add(const QString call, const QString band, const QString mode, const QString date);
bool match(const QString call, const QString band, const QString mode);
QList<QString> getCallList();
int getCount();
// open ADIF file and append the QSO details. Return true on success
bool addQSOToFile(const QString hisCall, const QString hisGrid, const QString mode, const QString rptSent, const QString rptRcvd, const QString dateOn, const QString timeOn, const QString dateOff, const QString timeOff, const QString band,
const QString comments, const QString name, const QString strDialFreq, const QString m_myCall, const QString m_myGrid, const QString m_txPower);
static QString bandFromFrequency(double dialFreq);
private:
struct QSO
{
QString call,band,mode,date;
};
QMultiHash<QString, QSO> _data;
QString _filename;
QString _extractField(const QString line, const QString fieldName);
};
#endif
@@ -0,0 +1,72 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_REVERSE_VIEW_07202005_0836)
#define FUSION_REVERSE_VIEW_07202005_0836
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/view/reverse_view/reverse_view_iterator.hpp>
#include <boost/fusion/view/reverse_view/detail/begin_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/end_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/at_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/value_at_impl.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/static_assert.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace fusion
{
struct reverse_view_tag;
struct fusion_sequence_tag;
template <typename Sequence>
struct reverse_view : sequence_base<reverse_view<Sequence> >
{
typedef reverse_view_tag fusion_tag;
typedef fusion_sequence_tag tag; // this gets picked up by MPL
typedef mpl::true_ is_view;
typedef Sequence seq_type;
typedef typename traits::category_of<Sequence>::type category;
typedef typename result_of::begin<Sequence>::type first_type;
typedef typename result_of::end<Sequence>::type last_type;
typedef typename result_of::size<Sequence>::type size;
BOOST_STATIC_ASSERT((
is_base_of<
bidirectional_traversal_tag
, typename traits::category_of<first_type>::type>::value));
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
reverse_view(Sequence& in_seq)
: seq(in_seq)
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
first_type first() const { return fusion::begin(seq); }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
last_type last() const { return fusion::end(seq); }
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
private:
// silence MSVC warning C4512: assignment operator could not be generated
reverse_view& operator= (reverse_view const&);
};
}}
#endif
@@ -0,0 +1,51 @@
/*
Copyright Franz Detro 2014
Copyright Rene Rivera 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_OS_IOS_H
#define BOOST_PREDEF_OS_IOS_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_OS_IOS`]
[@http://en.wikipedia.org/wiki/iOS iOS] operating system.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__APPLE__`] [__predef_detection__]]
[[`__MACH__`] [__predef_detection__]]
[[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]]
[[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]]
]
*/
#define BOOST_OS_IOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
defined(__APPLE__) && defined(__MACH__) && \
defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \
)
# undef BOOST_OS_IOS
# define BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000)
#endif
#if BOOST_OS_IOS
# define BOOST_OS_IOS_AVAILABLE
# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_IOS_NAME "iOS"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME)
@@ -0,0 +1,16 @@
/*=============================================================================
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_IS_TPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP
#include <boost/preprocessor/seq/seq.hpp>
#define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)
#endif
@@ -0,0 +1,35 @@
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_CAT_HPP
# define BOOST_PREPROCESSOR_CAT_HPP
#
# include <boost/preprocessor/config/config.hpp>
#
# /* BOOST_PP_CAT */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
# define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
# else
# define BOOST_PP_CAT(a, b) BOOST_PP_CAT_OO((a, b))
# define BOOST_PP_CAT_OO(par) BOOST_PP_CAT_I ## par
# endif
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
# define BOOST_PP_CAT_I(a, b) a ## b
# else
# define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
# define BOOST_PP_CAT_II(p, res) res
# endif
#
# endif
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2012-2014 Glen Joseph Fernandes
* glenfe at live dot com
*
* Distributed under the Boost Software License,
* Version 1.0. (See accompanying file LICENSE_1_0.txt
* or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
#define BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
#include <boost/type_traits/remove_cv.hpp>
namespace boost {
namespace detail {
template<class T>
struct array_base {
typedef typename boost::remove_cv<T>::type type;
};
template<class T>
struct array_base<T[]> {
typedef typename array_base<T>::type type;
};
template<class T, std::size_t N>
struct array_base<T[N]> {
typedef typename array_base<T>::type type;
};
template<class T>
struct array_total {
enum {
size = 1
};
};
template<class T, std::size_t N>
struct array_total<T[N]> {
enum {
size = N * array_total<T>::size
};
};
template<class T>
struct array_inner;
template<class T>
struct array_inner<T[]> {
typedef T type;
};
template<class T, std::size_t N>
struct array_inner<T[N]> {
typedef T type;
};
}
}
#endif
@@ -0,0 +1,23 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/range/
//
#ifndef BOOST_RANGE_HPP_27_07_04
#define BOOST_RANGE_HPP_27_07_04
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/range/functions.hpp>
#include <boost/range/metafunctions.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/sub_range.hpp>
#endif
@@ -0,0 +1,46 @@
// (C) Copyright 2007 Matthias Troyer
// 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)
// Authors: Matthias Troyer
/** @file is_bitwise_serializable.hpp
*
* This header provides a traits class for determining whether a class
* can be serialized (in a non-portable way) just by copying the bits.
*/
#ifndef BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
#define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/mpl/bool_fwd.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
namespace boost {
namespace serialization {
template<class T>
struct is_bitwise_serializable
: public is_arithmetic< T >
{};
} // namespace serialization
} // namespace boost
// define a macro to make explicit designation of this more transparent
#define BOOST_IS_BITWISE_SERIALIZABLE(T) \
namespace boost { \
namespace serialization { \
template<> \
struct is_bitwise_serializable< T > : mpl::true_ {}; \
}} \
/**/
#endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
@@ -0,0 +1,49 @@
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
# define BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
#
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/list/fold_right.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/tuple/rem.hpp>
#
# /* BOOST_PP_LIST_TRANSFORM */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_TRANSFORM(op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# else
# define BOOST_PP_LIST_TRANSFORM(op, data, list) BOOST_PP_LIST_TRANSFORM_I(op, data, list)
# define BOOST_PP_LIST_TRANSFORM_I(op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# endif
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_TRANSFORM_O(d, odr, elem) BOOST_PP_LIST_TRANSFORM_O_D(d, BOOST_PP_TUPLE_ELEM(3, 0, odr), BOOST_PP_TUPLE_ELEM(3, 1, odr), BOOST_PP_TUPLE_ELEM(3, 2, odr), elem)
# else
# define BOOST_PP_LIST_TRANSFORM_O(d, odr, elem) BOOST_PP_LIST_TRANSFORM_O_I(d, BOOST_PP_TUPLE_REM_3 odr, elem)
# define BOOST_PP_LIST_TRANSFORM_O_I(d, im, elem) BOOST_PP_LIST_TRANSFORM_O_D(d, im, elem)
# endif
#
# define BOOST_PP_LIST_TRANSFORM_O_D(d, op, data, res, elem) (op, data, (op(d, data, elem), res))
#
# /* BOOST_PP_LIST_TRANSFORM_D */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT_ ## d(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# else
# define BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) BOOST_PP_LIST_TRANSFORM_D_I(d, op, data, list)
# define BOOST_PP_LIST_TRANSFORM_D_I(d, op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT_ ## d(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# endif
#
# endif
@@ -0,0 +1,281 @@
/*
[auto_generated]
boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp
[begin_description]
Nested parallelized algebra for OpenMP.
[end_description]
Copyright 2013 Karsten Ahnert
Copyright 2013 Mario Mulansky
Copyright 2013 Pascal Germroth
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_NESTED_ALGEBRA_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_NESTED_ALGEBRA_HPP_INCLUDED
#include <boost/assert.hpp>
#include <boost/range.hpp>
#include <boost/numeric/odeint/algebra/norm_result_type.hpp>
#include <boost/numeric/odeint/util/n_ary_helper.hpp>
namespace boost {
namespace numeric {
namespace odeint {
/** \brief OpenMP-parallelized algebra, wrapping another, non-parallelized algebra.
*
* NestedState must be a model of Random Access Range, where the elements are sub-states
* which will be processed in parallel.
*/
template< class InnerAlgebra >
struct openmp_nested_algebra
{
#if __cplusplus >= 201103L // C++11 supports _Pragma
#define BOOST_ODEINT_GEN_LOCAL(z, n, unused) \
BOOST_ASSERT_MSG( len == boost::size(s ## n), "All nested state ranges must have the same size." ); \
typename boost::range_iterator<S ## n>::type beg ## n = boost::begin(s ## n);
#define BOOST_ODEINT_GEN_BODY(n) \
const size_t len = boost::size(s0); \
BOOST_PP_REPEAT(n, BOOST_ODEINT_GEN_LOCAL, ~) \
_Pragma("omp parallel for schedule(runtime)") \
for( size_t i = 0 ; i < len ; i++ ) \
InnerAlgebra::for_each##n( \
BOOST_PP_ENUM_BINARY_PARAMS(n, beg, [i] BOOST_PP_INTERCEPT) , \
op \
);
BOOST_ODEINT_GEN_FOR_EACH(BOOST_ODEINT_GEN_BODY)
#undef BOOST_ODEINT_GEN_BODY
#undef BOOST_ODEINT_GEN_LOCAL
#else
template< class S0 , class Op > static void for_each1 ( S0 &s0 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each1( beg0 [i] , op );
}
template< class S0 , class S1 , class Op > static void for_each2 ( S0 &s0 , S1 &s1 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each2( beg0 [i] , beg1 [i] , op );
}
template< class S0 , class S1 , class S2 , class Op > static void for_each3 ( S0 &s0 , S1 &s1 , S2 &s2 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each3( beg0 [i] , beg1 [i] , beg2 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class Op > static void for_each4 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each4( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class Op > static void for_each5 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each5( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class Op > static void for_each6 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each6( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > static void for_each7 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each7( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class Op > static void for_each8 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each8( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class Op > static void for_each9 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each9( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class Op > static void for_each10 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
typename boost::range_iterator<S9>::type beg9 = boost::begin(s9);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each10( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class Op > static void for_each11 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
typename boost::range_iterator<S9>::type beg9 = boost::begin(s9);
typename boost::range_iterator<S10>::type beg10 = boost::begin(s10);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each11( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class Op > static void for_each12 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
typename boost::range_iterator<S9>::type beg9 = boost::begin(s9);
typename boost::range_iterator<S10>::type beg10 = boost::begin(s10);
typename boost::range_iterator<S11>::type beg11 = boost::begin(s11);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each12( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > static void for_each13 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
typename boost::range_iterator<S9>::type beg9 = boost::begin(s9);
typename boost::range_iterator<S10>::type beg10 = boost::begin(s10);
typename boost::range_iterator<S11>::type beg11 = boost::begin(s11);
typename boost::range_iterator<S12>::type beg12 = boost::begin(s12);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each13( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > static void for_each14 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
typename boost::range_iterator<S9>::type beg9 = boost::begin(s9);
typename boost::range_iterator<S10>::type beg10 = boost::begin(s10);
typename boost::range_iterator<S11>::type beg11 = boost::begin(s11);
typename boost::range_iterator<S12>::type beg12 = boost::begin(s12);
typename boost::range_iterator<S13>::type beg13 = boost::begin(s13);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each14( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , beg13 [i] , op );
}
template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > static void for_each15 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) {
const size_t len = boost::size(s0);
typename boost::range_iterator<S0>::type beg0 = boost::begin(s0);
typename boost::range_iterator<S1>::type beg1 = boost::begin(s1);
typename boost::range_iterator<S2>::type beg2 = boost::begin(s2);
typename boost::range_iterator<S3>::type beg3 = boost::begin(s3);
typename boost::range_iterator<S4>::type beg4 = boost::begin(s4);
typename boost::range_iterator<S5>::type beg5 = boost::begin(s5);
typename boost::range_iterator<S6>::type beg6 = boost::begin(s6);
typename boost::range_iterator<S7>::type beg7 = boost::begin(s7);
typename boost::range_iterator<S8>::type beg8 = boost::begin(s8);
typename boost::range_iterator<S9>::type beg9 = boost::begin(s9);
typename boost::range_iterator<S10>::type beg10 = boost::begin(s10);
typename boost::range_iterator<S11>::type beg11 = boost::begin(s11);
typename boost::range_iterator<S12>::type beg12 = boost::begin(s12);
typename boost::range_iterator<S13>::type beg13 = boost::begin(s13);
typename boost::range_iterator<S14>::type beg14 = boost::begin(s14);
#pragma omp parallel for schedule(runtime)
for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each15( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , beg13 [i] , beg14 [i] , op );
}
#endif
template< class NestedState >
static typename norm_result_type< typename NestedState::value_type >::type norm_inf( const NestedState &s )
{
typedef typename boost::range_iterator<const NestedState>::type iterator;
typedef typename std::iterator_traits<iterator>::value_type value_type;
typedef typename norm_result_type<value_type>::type result_type;
result_type init = static_cast< result_type >( 0 );
const size_t len = boost::size(s);
iterator beg = boost::begin(s);
# pragma omp parallel for reduction(max: init) schedule(dynamic)
for( size_t i = 0 ; i < len ; i++ )
init = (std::max)( init , InnerAlgebra::norm_inf( beg[i] ) );
return init;
}
};
}
}
}
#endif
@@ -0,0 +1,401 @@
subroutine bpdecode174(llr,apmask,maxiterations,decoded,niterations)
!
! A log-domain belief propagation decoder for the (174,87) code.
!
integer, parameter:: N=174, K=87, M=N-K
integer*1 codeword(N),cw(N),apmask(N)
integer colorder(N)
integer*1 decoded(K)
integer Nm(7,M) ! 5, 6, or 7 bits per check
integer Mn(3,N) ! 3 checks per bit
integer synd(M)
real tov(3,N)
real toc(7,M)
real tanhtoc(7,M)
real zn(N)
real llr(N)
real Tmn
integer nrw(M)
data colorder/ &
0, 1, 2, 3, 30, 4, 5, 6, 7, 8, 9, 10, 11, 32, 12, 40, 13, 14, 15, 16,&
17, 18, 37, 45, 29, 19, 20, 21, 41, 22, 42, 31, 33, 34, 44, 35, 47, 51, 50, 43,&
36, 52, 63, 46, 25, 55, 27, 24, 23, 53, 39, 49, 59, 38, 48, 61, 60, 57, 28, 62,&
56, 58, 65, 66, 26, 70, 64, 69, 68, 67, 74, 71, 54, 76, 72, 75, 78, 77, 80, 79,&
73, 83, 84, 81, 82, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,&
100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,&
120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,&
140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,&
160,161,162,163,164,165,166,167,168,169,170,171,172,173/
data Mn/ &
1, 25, 69, &
2, 5, 73, &
3, 32, 68, &
4, 51, 61, &
6, 63, 70, &
7, 33, 79, &
8, 50, 86, &
9, 37, 43, &
10, 41, 65, &
11, 14, 64, &
12, 75, 77, &
13, 23, 81, &
15, 16, 82, &
17, 56, 66, &
18, 53, 60, &
19, 31, 52, &
20, 67, 84, &
21, 29, 72, &
22, 24, 44, &
26, 35, 76, &
27, 36, 38, &
28, 40, 42, &
30, 54, 55, &
34, 49, 87, &
39, 57, 58, &
45, 74, 83, &
46, 62, 80, &
47, 48, 85, &
59, 71, 78, &
1, 50, 53, &
2, 47, 84, &
3, 25, 79, &
4, 6, 14, &
5, 7, 80, &
8, 34, 55, &
9, 36, 69, &
10, 43, 83, &
11, 23, 74, &
12, 17, 44, &
13, 57, 76, &
15, 27, 56, &
16, 28, 29, &
18, 19, 59, &
20, 40, 63, &
21, 35, 52, &
22, 54, 64, &
24, 62, 78, &
26, 32, 77, &
30, 72, 85, &
31, 65, 87, &
33, 39, 51, &
37, 48, 75, &
38, 70, 71, &
41, 42, 68, &
45, 67, 86, &
46, 81, 82, &
49, 66, 73, &
58, 60, 66, &
61, 65, 85, &
1, 14, 21, &
2, 13, 59, &
3, 67, 82, &
4, 32, 73, &
5, 36, 54, &
6, 43, 46, &
7, 28, 75, &
8, 33, 71, &
9, 49, 76, &
10, 58, 64, &
11, 48, 68, &
12, 19, 45, &
15, 50, 61, &
16, 22, 26, &
17, 72, 80, &
18, 40, 55, &
20, 35, 51, &
23, 25, 34, &
24, 63, 87, &
27, 39, 74, &
29, 78, 83, &
30, 70, 77, &
31, 69, 84, &
22, 37, 86, &
38, 41, 81, &
42, 44, 57, &
47, 53, 62, &
52, 56, 79, &
60, 75, 81, &
1, 39, 77, &
2, 16, 41, &
3, 31, 54, &
4, 36, 78, &
5, 45, 65, &
6, 57, 85, &
7, 14, 49, &
8, 21, 46, &
9, 15, 72, &
10, 20, 62, &
11, 17, 71, &
12, 34, 47, &
13, 68, 86, &
18, 23, 43, &
19, 64, 73, &
24, 48, 79, &
25, 70, 83, &
26, 80, 87, &
27, 32, 40, &
28, 56, 69, &
29, 63, 66, &
30, 42, 50, &
33, 37, 82, &
35, 60, 74, &
38, 55, 84, &
44, 52, 61, &
51, 53, 72, &
58, 59, 67, &
47, 56, 76, &
1, 19, 37, &
2, 61, 75, &
3, 8, 66, &
4, 60, 84, &
5, 34, 39, &
6, 26, 53, &
7, 32, 57, &
9, 52, 67, &
10, 12, 15, &
11, 51, 69, &
13, 14, 65, &
16, 31, 43, &
17, 20, 36, &
18, 80, 86, &
21, 48, 59, &
22, 40, 46, &
23, 33, 62, &
24, 30, 74, &
25, 42, 64, &
27, 49, 85, &
28, 38, 73, &
29, 44, 81, &
35, 68, 70, &
41, 63, 76, &
45, 49, 71, &
50, 58, 87, &
48, 54, 83, &
13, 55, 79, &
77, 78, 82, &
1, 2, 24, &
3, 6, 75, &
4, 56, 87, &
5, 44, 53, &
7, 50, 83, &
8, 10, 28, &
9, 55, 62, &
11, 29, 67, &
12, 33, 40, &
14, 16, 20, &
15, 35, 73, &
17, 31, 39, &
18, 36, 57, &
19, 46, 76, &
21, 42, 84, &
22, 34, 59, &
23, 26, 61, &
25, 60, 65, &
27, 64, 80, &
30, 37, 66, &
32, 45, 72, &
38, 51, 86, &
41, 77, 79, &
43, 56, 68, &
47, 74, 82, &
40, 52, 78, &
54, 61, 71, &
46, 58, 69/
data Nm/ &
1, 30, 60, 89, 118, 147, 0, &
2, 31, 61, 90, 119, 147, 0, &
3, 32, 62, 91, 120, 148, 0, &
4, 33, 63, 92, 121, 149, 0, &
2, 34, 64, 93, 122, 150, 0, &
5, 33, 65, 94, 123, 148, 0, &
6, 34, 66, 95, 124, 151, 0, &
7, 35, 67, 96, 120, 152, 0, &
8, 36, 68, 97, 125, 153, 0, &
9, 37, 69, 98, 126, 152, 0, &
10, 38, 70, 99, 127, 154, 0, &
11, 39, 71, 100, 126, 155, 0, &
12, 40, 61, 101, 128, 145, 0, &
10, 33, 60, 95, 128, 156, 0, &
13, 41, 72, 97, 126, 157, 0, &
13, 42, 73, 90, 129, 156, 0, &
14, 39, 74, 99, 130, 158, 0, &
15, 43, 75, 102, 131, 159, 0, &
16, 43, 71, 103, 118, 160, 0, &
17, 44, 76, 98, 130, 156, 0, &
18, 45, 60, 96, 132, 161, 0, &
19, 46, 73, 83, 133, 162, 0, &
12, 38, 77, 102, 134, 163, 0, &
19, 47, 78, 104, 135, 147, 0, &
1, 32, 77, 105, 136, 164, 0, &
20, 48, 73, 106, 123, 163, 0, &
21, 41, 79, 107, 137, 165, 0, &
22, 42, 66, 108, 138, 152, 0, &
18, 42, 80, 109, 139, 154, 0, &
23, 49, 81, 110, 135, 166, 0, &
16, 50, 82, 91, 129, 158, 0, &
3, 48, 63, 107, 124, 167, 0, &
6, 51, 67, 111, 134, 155, 0, &
24, 35, 77, 100, 122, 162, 0, &
20, 45, 76, 112, 140, 157, 0, &
21, 36, 64, 92, 130, 159, 0, &
8, 52, 83, 111, 118, 166, 0, &
21, 53, 84, 113, 138, 168, 0, &
25, 51, 79, 89, 122, 158, 0, &
22, 44, 75, 107, 133, 155, 172, &
9, 54, 84, 90, 141, 169, 0, &
22, 54, 85, 110, 136, 161, 0, &
8, 37, 65, 102, 129, 170, 0, &
19, 39, 85, 114, 139, 150, 0, &
26, 55, 71, 93, 142, 167, 0, &
27, 56, 65, 96, 133, 160, 174, &
28, 31, 86, 100, 117, 171, 0, &
28, 52, 70, 104, 132, 144, 0, &
24, 57, 68, 95, 137, 142, 0, &
7, 30, 72, 110, 143, 151, 0, &
4, 51, 76, 115, 127, 168, 0, &
16, 45, 87, 114, 125, 172, 0, &
15, 30, 86, 115, 123, 150, 0, &
23, 46, 64, 91, 144, 173, 0, &
23, 35, 75, 113, 145, 153, 0, &
14, 41, 87, 108, 117, 149, 170, &
25, 40, 85, 94, 124, 159, 0, &
25, 58, 69, 116, 143, 174, 0, &
29, 43, 61, 116, 132, 162, 0, &
15, 58, 88, 112, 121, 164, 0, &
4, 59, 72, 114, 119, 163, 173, &
27, 47, 86, 98, 134, 153, 0, &
5, 44, 78, 109, 141, 0, 0, &
10, 46, 69, 103, 136, 165, 0, &
9, 50, 59, 93, 128, 164, 0, &
14, 57, 58, 109, 120, 166, 0, &
17, 55, 62, 116, 125, 154, 0, &
3, 54, 70, 101, 140, 170, 0, &
1, 36, 82, 108, 127, 174, 0, &
5, 53, 81, 105, 140, 0, 0, &
29, 53, 67, 99, 142, 173, 0, &
18, 49, 74, 97, 115, 167, 0, &
2, 57, 63, 103, 138, 157, 0, &
26, 38, 79, 112, 135, 171, 0, &
11, 52, 66, 88, 119, 148, 0, &
20, 40, 68, 117, 141, 160, 0, &
11, 48, 81, 89, 146, 169, 0, &
29, 47, 80, 92, 146, 172, 0, &
6, 32, 87, 104, 145, 169, 0, &
27, 34, 74, 106, 131, 165, 0, &
12, 56, 84, 88, 139, 0, 0, &
13, 56, 62, 111, 146, 171, 0, &
26, 37, 80, 105, 144, 151, 0, &
17, 31, 82, 113, 121, 161, 0, &
28, 49, 59, 94, 137, 0, 0, &
7, 55, 83, 101, 131, 168, 0, &
24, 50, 78, 106, 143, 149, 0/
data nrw/ &
6,6,6,6,6,6,6,6,6,6, &
6,6,6,6,6,6,6,6,6,6, &
6,6,6,6,6,6,6,6,6,6, &
6,6,6,6,6,6,6,6,6,7, &
6,6,6,6,6,7,6,6,6,6, &
6,6,6,6,6,7,6,6,6,6, &
7,6,5,6,6,6,6,6,6,5, &
6,6,6,6,6,6,6,6,6,6, &
5,6,6,6,5,6,6/
ncw=3
toc=0
tov=0
tanhtoc=0
! initialize messages to checks
do j=1,M
do i=1,nrw(j)
toc(i,j)=llr((Nm(i,j)))
enddo
enddo
ncnt=0
do iter=0,maxiterations
! Update bit log likelihood ratios (tov=0 in iteration 0).
do i=1,N
if( apmask(i) .ne. 1 ) then
zn(i)=llr(i)+sum(tov(1:ncw,i))
else
zn(i)=llr(i)
endif
enddo
! Check to see if we have a codeword (check before we do any iteration).
cw=0
where( zn .gt. 0. ) cw=1
ncheck=0
do i=1,M
synd(i)=sum(cw(Nm(1:nrw(i),i)))
if( mod(synd(i),2) .ne. 0 ) ncheck=ncheck+1
! if( mod(synd(i),2) .ne. 0 ) write(*,*) 'check ',i,' unsatisfied'
enddo
! write(*,*) 'number of unsatisfied parity checks ',ncheck
if( ncheck .eq. 0 ) then ! we have a codeword - reorder the columns and return it
! niterations=iter
codeword=cw(colorder+1)
decoded=codeword(M+1:N)
nerr=0
do i=1,N
if( (2*cw(i)-1)*llr(i) .lt. 0.0 ) nerr=nerr+1
enddo
niterations=nerr
return
endif
if( iter.gt.0 ) then ! this code block implements an early stopping criterion
! if( iter.gt.10000 ) then ! this code block implements an early stopping criterion
nd=ncheck-nclast
if( nd .lt. 0 ) then ! # of unsatisfied parity checks decreased
ncnt=0 ! reset counter
else
ncnt=ncnt+1
endif
! write(*,*) iter,ncheck,nd,ncnt
if( ncnt .ge. 5 .and. iter .ge. 10 .and. ncheck .gt. 15) then
niterations=-1
return
endif
endif
nclast=ncheck
! Send messages from bits to check nodes
do j=1,M
do i=1,nrw(j)
ibj=Nm(i,j)
toc(i,j)=zn(ibj)
do kk=1,ncw ! subtract off what the bit had received from the check
if( Mn(kk,ibj) .eq. j ) then
toc(i,j)=toc(i,j)-tov(kk,ibj)
endif
enddo
enddo
enddo
! send messages from check nodes to variable nodes
do i=1,M
tanhtoc(1:7,i)=tanh(-toc(1:7,i)/2)
enddo
do j=1,N
do i=1,ncw
ichk=Mn(i,j) ! Mn(:,j) are the checks that include bit j
Tmn=product(tanhtoc(1:nrw(ichk),ichk),mask=Nm(1:nrw(ichk),ichk).ne.j)
call platanh(-Tmn,y)
! y=atanh(-Tmn)
tov(i,j)=2*y
enddo
enddo
enddo
niterations=-1
return
end subroutine bpdecode174