Initial Commit
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Neil Groves 2009. 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_ALGORITHM_EXT_OVERWRITE_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_EXT_OVERWRITE_HPP_INCLUDED
|
||||
|
||||
#include <boost/range/config.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
{
|
||||
|
||||
template< class SinglePassRange1, class SinglePassRange2 >
|
||||
inline void overwrite( const SinglePassRange1& from, SinglePassRange2& to )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
|
||||
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type
|
||||
i = boost::begin(from), e = boost::end(from);
|
||||
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type
|
||||
out = boost::begin(to);
|
||||
|
||||
#ifndef NDEBUG
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type
|
||||
last_out = boost::end(to);
|
||||
#endif
|
||||
|
||||
for( ; i != e; ++out, ++i )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
BOOST_ASSERT( out != last_out
|
||||
&& "out of bounds in boost::overwrite()" );
|
||||
#endif
|
||||
*out = *i;
|
||||
}
|
||||
}
|
||||
|
||||
template< class SinglePassRange1, class SinglePassRange2 >
|
||||
inline void overwrite( const SinglePassRange1& from, const SinglePassRange2& to )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
|
||||
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type
|
||||
i = boost::begin(from), e = boost::end(from);
|
||||
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type
|
||||
out = boost::begin(to);
|
||||
|
||||
#ifndef NDEBUG
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type
|
||||
last_out = boost::end(to);
|
||||
#endif
|
||||
|
||||
for( ; i != e; ++out, ++i )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
BOOST_ASSERT( out != last_out
|
||||
&& "out of bounds in boost::overwrite()" );
|
||||
#endif
|
||||
*out = *i;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::overwrite;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,105 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-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_DETAIL_NODE_CLONER_DISPOSER_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_NODE_CLONER_DISPOSER_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/intrusive/detail/ebo_functor_holder.hpp>
|
||||
#include <boost/intrusive/detail/algo_type.hpp>
|
||||
#include <boost/intrusive/detail/assert.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
template<class F, class ValueTraits, algo_types AlgoType, bool IsConst = true>
|
||||
struct node_cloner
|
||||
//Use public inheritance to avoid MSVC bugs with closures
|
||||
: public ebo_functor_holder<F>
|
||||
{
|
||||
typedef ValueTraits value_traits;
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef ebo_functor_holder<F> base_t;
|
||||
typedef typename get_algo< AlgoType
|
||||
, node_traits>::type node_algorithms;
|
||||
static const bool safemode_or_autounlink =
|
||||
is_safe_autounlink<value_traits::link_mode>::value;
|
||||
typedef typename value_traits::value_type value_type;
|
||||
typedef typename value_traits::pointer pointer;
|
||||
typedef typename value_traits::const_pointer const_pointer;
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename value_traits::const_node_ptr const_node_ptr;
|
||||
typedef typename pointer_traits<pointer>::reference reference;
|
||||
typedef typename pointer_traits
|
||||
<const_pointer>::reference const_reference;
|
||||
typedef typename if_c<IsConst, const_reference, reference>::type reference_type;
|
||||
|
||||
node_cloner(F f, const ValueTraits *traits)
|
||||
: base_t(f), traits_(traits)
|
||||
{}
|
||||
|
||||
// tree-based containers use this method, which is proxy-reference friendly
|
||||
node_ptr operator()(const node_ptr & p)
|
||||
{
|
||||
reference_type v = *traits_->to_value_ptr(p);
|
||||
node_ptr n = traits_->to_node_ptr(*base_t::get()(v));
|
||||
//Cloned node must be in default mode if the linking mode requires it
|
||||
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(n));
|
||||
return n;
|
||||
}
|
||||
|
||||
const ValueTraits * const traits_;
|
||||
};
|
||||
|
||||
template<class F, class ValueTraits, algo_types AlgoType>
|
||||
struct node_disposer
|
||||
//Use public inheritance to avoid MSVC bugs with closures
|
||||
: public ebo_functor_holder<F>
|
||||
{
|
||||
typedef ValueTraits value_traits;
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef ebo_functor_holder<F> base_t;
|
||||
typedef typename get_algo< AlgoType
|
||||
, node_traits>::type node_algorithms;
|
||||
static const bool safemode_or_autounlink =
|
||||
is_safe_autounlink<value_traits::link_mode>::value;
|
||||
|
||||
node_disposer(F f, const ValueTraits *cont)
|
||||
: base_t(f), traits_(cont)
|
||||
{}
|
||||
|
||||
void operator()(const node_ptr & p)
|
||||
{
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(p);
|
||||
base_t::get()(traits_->to_value_ptr(p));
|
||||
}
|
||||
const ValueTraits * const traits_;
|
||||
};
|
||||
|
||||
} //namespace detail{
|
||||
} //namespace intrusive{
|
||||
} //namespace boost{
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_NODE_CLONER_DISPOSER_HPP
|
||||
@@ -0,0 +1,56 @@
|
||||
program t6
|
||||
|
||||
parameter (MAXFFT=1404)
|
||||
complex c(0:MAXFFT-1)
|
||||
real s(0:MAXFFT-1)
|
||||
|
||||
m1=45
|
||||
m2=67
|
||||
m3=89
|
||||
nsym=3*11 + m1 + m2 + m3
|
||||
nfft=6*nsym
|
||||
nh=nfft/2
|
||||
|
||||
best=9999.
|
||||
! do m1=22,67
|
||||
! do m2=37,97
|
||||
do m1=30,67
|
||||
do m2=26,100
|
||||
m3=201-m2-m1
|
||||
if(m3.lt.13) cycle
|
||||
c=0.
|
||||
n1=6*(11+m1)
|
||||
n2=n1+6*(11+m2)
|
||||
c(1:66)=1.
|
||||
c(1+n1:66+n1)=1.
|
||||
c(1+n2:66+n2)=1.
|
||||
|
||||
call four2a(c,nfft,1,-1,1) !c2c FFT
|
||||
|
||||
df=12000.0/nfft
|
||||
smax=0.
|
||||
do i=0,nfft-1
|
||||
s(i)=real(c(i))**2 + aimag(c(i))**2
|
||||
if(i.ne.0) smax=max(s(i),smax)
|
||||
enddo
|
||||
sidelobe=db(smax/s(0))
|
||||
|
||||
if(sidelobe.lt.best) then
|
||||
write(*,1000) m1,m2,m3,sidelobe
|
||||
1000 format(3i5,f8.2)
|
||||
best=sidelobe
|
||||
s=s/s(0)
|
||||
rewind 13
|
||||
do j=0,nfft-1
|
||||
i=mod(j+nh,nfft)
|
||||
f=i*df
|
||||
if(i.gt.nh) f=f-12000.0
|
||||
write(13,1020) f,s(i)
|
||||
1020 format(2f12.4)
|
||||
enddo
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
||||
end program t6
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
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_ITERATOR_EQUAL_TO_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_SEGMENTED_ITERATOR_EQUAL_TO_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nil_;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename Stack1, typename Stack2>
|
||||
struct segmented_equal_to
|
||||
: mpl::and_<
|
||||
segmented_equal_to<
|
||||
typename Stack1::cdr_type,
|
||||
typename Stack2::cdr_type
|
||||
>
|
||||
, result_of::equal_to<
|
||||
typename Stack1::car_type::begin_type,
|
||||
typename Stack2::car_type::begin_type
|
||||
>
|
||||
>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct segmented_equal_to<fusion::nil_, fusion::nil_>
|
||||
: mpl::true_
|
||||
{};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,137 @@
|
||||
module ft8_decode
|
||||
|
||||
type :: ft8_decoder
|
||||
procedure(ft8_decode_callback), pointer :: callback
|
||||
contains
|
||||
procedure :: decode
|
||||
end type ft8_decoder
|
||||
|
||||
abstract interface
|
||||
subroutine ft8_decode_callback (this,sync,snr,dt,freq,decoded,nap,qual)
|
||||
import ft8_decoder
|
||||
implicit none
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
real, intent(in) :: freq
|
||||
character(len=22), intent(in) :: decoded
|
||||
integer, intent(in) :: nap
|
||||
real, intent(in) :: qual
|
||||
end subroutine ft8_decode_callback
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine decode(this,callback,iwave,nQSOProgress,nfqso,nftx,newdat,nutc, &
|
||||
nfa,nfb,nagain,ndepth,lapon,napwid,nsubmode,mycall12,hiscall12,hisgrid6)
|
||||
! use wavhdr
|
||||
use timer_module, only: timer
|
||||
include 'fsk4hf/ft8_params.f90'
|
||||
! type(hdr) h
|
||||
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
procedure(ft8_decode_callback) :: callback
|
||||
real s(NH1,NHSYM)
|
||||
real candidate(3,200)
|
||||
real dd(15*12000)
|
||||
logical, intent(in) :: nagain,lapon
|
||||
logical newdat,lsubtract,ldupe
|
||||
character*12 mycall12, hiscall12
|
||||
character*6 hisgrid6
|
||||
integer*2 iwave(15*12000)
|
||||
integer apsym(KK)
|
||||
character datetime*13,message*22
|
||||
character*22 allmessages(100)
|
||||
integer allsnrs(100)
|
||||
save s,dd
|
||||
|
||||
this%callback => callback
|
||||
write(datetime,1001) nutc !### TEMPORARY ###
|
||||
1001 format("000000_",i6.6)
|
||||
|
||||
call ft8apset(mycall12,hiscall12,hisgrid6,apsym,iaptype)
|
||||
|
||||
dd=iwave
|
||||
|
||||
ndecodes=0
|
||||
allmessages=' '
|
||||
allsnrs=0
|
||||
|
||||
! For now:
|
||||
! ndepth=1: no subtraction, 1 pass, belief propagation only
|
||||
! ndepth=2: subtraction, 2 passes, belief propagation only
|
||||
! ndepth=3: subtraction, 2 passes, bp+osd2 at and near nfqso
|
||||
if(ndepth.eq.1) npass=1
|
||||
if(ndepth.ge.2) npass=2
|
||||
do ipass=1,npass
|
||||
newdat=.true. ! Is this a problem? I hijacked newdat.
|
||||
if(ipass.eq.1) then
|
||||
lsubtract=.true.
|
||||
if(ndepth.eq.1) lsubtract=.false.
|
||||
syncmin=1.5
|
||||
else
|
||||
lsubtract=.false.
|
||||
syncmin=1.5
|
||||
endif
|
||||
call timer('sync8 ',0)
|
||||
call sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand)
|
||||
call timer('sync8 ',1)
|
||||
do icand=1,ncand
|
||||
sync=candidate(3,icand)
|
||||
f1=candidate(1,icand)
|
||||
xdt=candidate(2,icand)
|
||||
nsnr0=min(99,nint(10.0*log10(sync) - 25.5)) !### empirical ###
|
||||
call timer('ft8b ',0)
|
||||
call ft8b(dd,newdat,nfqso,ndepth,lapon,napwid,lsubtract,iaptype,icand,sync,f1, &
|
||||
xdt,apsym,nharderrors,dmin,nbadcrc,iap,ipass,iera,message,xsnr)
|
||||
nsnr=nint(xsnr)
|
||||
xdt=xdt-0.5
|
||||
hd=nharderrors+dmin
|
||||
call timer('ft8b ',1)
|
||||
if(nbadcrc.eq.0) then
|
||||
call jtmsg(message,iflag)
|
||||
if(iand(iflag,16).ne.0) message(22:22)='?'
|
||||
if(iand(iflag,15).eq.0) then
|
||||
ldupe=.false.
|
||||
do id=1,ndecodes
|
||||
if(message.eq.allmessages(id).and.nsnr.le.allsnrs(id)) ldupe=.true.
|
||||
enddo
|
||||
if(.not.ldupe) then
|
||||
ndecodes=ndecodes+1
|
||||
allmessages(ndecodes)=message
|
||||
allsnrs(ndecodes)=nsnr
|
||||
endif
|
||||
! write(81,1004) nutc,ncand,icand,ipass,iaptype,iap,iera, &
|
||||
! iflag,nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||
! xdt,nint(f1),message
|
||||
! flush(81)
|
||||
if(.not.ldupe .and. associated(this%callback)) then
|
||||
! nap: 0=no ap, 1=CQ; 2=MyCall; 3=DxCall; 4=MyCall,DxCall
|
||||
if(iap.eq.0) then
|
||||
nap=0
|
||||
else
|
||||
nap=(iaptype-1)*2+iap
|
||||
endif
|
||||
qual=1.0-(nharderrors+dmin)/60.0 ! scale qual to [0.0,1.0]
|
||||
call this%callback(sync,nsnr,xdt,f1,message,nap,qual)
|
||||
endif
|
||||
else
|
||||
write(19,1004) nutc,ncand,icand,ipass,iaptype,iap,iera, &
|
||||
iflag,nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||
xdt,nint(f1),message
|
||||
1004 format(i6.6,2i4,4i2,2i3,3f6.1,i4,f6.2,i5,2x,a22)
|
||||
flush(19)
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
! h=default_header(12000,NMAX)
|
||||
! open(10,file='subtract.wav',status='unknown',access='stream')
|
||||
! iwave=nint(dd)
|
||||
! write(10) h,iwave
|
||||
! close(10)
|
||||
enddo
|
||||
return
|
||||
end subroutine decode
|
||||
|
||||
end module ft8_decode
|
||||
@@ -0,0 +1,380 @@
|
||||
subroutine bpdecode168(llr,apmask,maxiterations,decoded,niterations)
|
||||
!
|
||||
! A log-domain belief propagation decoder for the (168,84) code.
|
||||
!
|
||||
integer, parameter:: N=168, K=84, 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,28,4,5,6,7,8,9,10,11,34,12,32,13,14,15,16,17, &
|
||||
18,36,29,42,31,20,21,41,40,30,38,22,19,47,37,46,35,44,33,49,24, &
|
||||
43,51,25,26,27,50,52,57,69,54,55,45,59,58,56,61,60,53,48,23,62, &
|
||||
63,64,67,66,65,68,39,70,71,72,74,73,75,76,77,80,81,78,82,79,83, &
|
||||
84,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/
|
||||
|
||||
data Mn/ &
|
||||
1,24,67, &
|
||||
2,5,71, &
|
||||
3,31,66, &
|
||||
4,50,58, &
|
||||
6,60,65, &
|
||||
7,32,76, &
|
||||
8,49,83, &
|
||||
9,36,41, &
|
||||
10,40,63, &
|
||||
11,14,62, &
|
||||
12,72,75, &
|
||||
13,23,78, &
|
||||
15,16,80, &
|
||||
17,54,64, &
|
||||
18,51,59, &
|
||||
19,30,48, &
|
||||
20,68,81, &
|
||||
21,29,70, &
|
||||
22,25,43, &
|
||||
26,34,73, &
|
||||
27,35,37, &
|
||||
28,39,44, &
|
||||
33,53,55, &
|
||||
38,52,84, &
|
||||
42,56,57, &
|
||||
45,74,82, &
|
||||
46,69,79, &
|
||||
47,61,77, &
|
||||
1,4,5, &
|
||||
2,48,52, &
|
||||
3,47,82, &
|
||||
6,26,76, &
|
||||
7,9,16, &
|
||||
8,10,78, &
|
||||
11,36,56, &
|
||||
12,38,65, &
|
||||
13,43,81, &
|
||||
14,33,68, &
|
||||
15,18,44, &
|
||||
17,59,77, &
|
||||
19,27,69, &
|
||||
20,21,58, &
|
||||
22,45,79, &
|
||||
23,34,54, &
|
||||
24,28,40, &
|
||||
25,80,84, &
|
||||
29,37,51, &
|
||||
30,42,83, &
|
||||
31,63,72, &
|
||||
32,50,66, &
|
||||
35,67,73, &
|
||||
39,55,74, &
|
||||
41,61,71, &
|
||||
46,60,62, &
|
||||
49,70,74, &
|
||||
53,64,75, &
|
||||
25,57,67, &
|
||||
1,46,64, &
|
||||
2,51,63, &
|
||||
3,14,80, &
|
||||
4,15,78, &
|
||||
5,27,74, &
|
||||
6,13,70, &
|
||||
7,19,20, &
|
||||
8,38,77, &
|
||||
9,75,83, &
|
||||
10,36,69, &
|
||||
11,22,29, &
|
||||
12,58,82, &
|
||||
16,35,60, &
|
||||
17,32,43, &
|
||||
18,42,45, &
|
||||
21,53,84, &
|
||||
23,39,48, &
|
||||
24,52,68, &
|
||||
26,33,61, &
|
||||
28,56,76, &
|
||||
30,65,66, &
|
||||
31,34,49, &
|
||||
37,47,81, &
|
||||
16,40,54, &
|
||||
41,44,65, &
|
||||
50,73,79, &
|
||||
55,59,60, &
|
||||
54,57,71, &
|
||||
23,62,72, &
|
||||
1,36,47, &
|
||||
2,32,70, &
|
||||
3,28,69, &
|
||||
4,7,33, &
|
||||
5,20,26, &
|
||||
6,14,63, &
|
||||
8,22,68, &
|
||||
9,13,67, &
|
||||
10,55,71, &
|
||||
11,15,19, &
|
||||
12,51,56, &
|
||||
17,27,52, &
|
||||
18,34,46, &
|
||||
21,41,42, &
|
||||
24,50,80, &
|
||||
25,39,75, &
|
||||
29,54,76, &
|
||||
30,40,84, &
|
||||
31,35,58, &
|
||||
37,79,83, &
|
||||
38,43,73, &
|
||||
44,72,81, &
|
||||
7,45,62, &
|
||||
47,48,49, &
|
||||
53,57,78, &
|
||||
20,59,66, &
|
||||
28,61,64, &
|
||||
11,75,77, &
|
||||
33,54,82, &
|
||||
1,14,44, &
|
||||
2,62,73, &
|
||||
3,9,26, &
|
||||
4,37,84, &
|
||||
5,56,80, &
|
||||
6,45,71, &
|
||||
8,67,72, &
|
||||
10,76,81, &
|
||||
12,32,78, &
|
||||
13,59,82, &
|
||||
15,17,79, &
|
||||
16,42,69, &
|
||||
18,61,70, &
|
||||
19,31,64, &
|
||||
21,39,63, &
|
||||
22,30,58, &
|
||||
23,27,66, &
|
||||
24,41,49, &
|
||||
25,36,60, &
|
||||
29,65,67, &
|
||||
34,36,53, &
|
||||
35,48,76, &
|
||||
15,38,55, &
|
||||
40,43,74, &
|
||||
46,52,57, &
|
||||
50,63,77, &
|
||||
51,68,69, &
|
||||
2,44,83, &
|
||||
1,30,55, &
|
||||
3,29,78, &
|
||||
4,34,65, &
|
||||
5,31,38, &
|
||||
6,52,58, &
|
||||
7,25,51, &
|
||||
8,16,66, &
|
||||
9,46,74, &
|
||||
10,70,75, &
|
||||
11,32,84, &
|
||||
12,48,79, &
|
||||
13,50,64, &
|
||||
14,37,57, &
|
||||
17,42,72, &
|
||||
18,43,48, &
|
||||
19,24,60, &
|
||||
20,54,83, &
|
||||
21,47,62, &
|
||||
22,28,59, &
|
||||
23,61,80, &
|
||||
8,26,39, &
|
||||
27,44,53, &
|
||||
33,49,56, &
|
||||
35,68,71, &
|
||||
12,26,40/
|
||||
|
||||
data Nm/ &
|
||||
1,29,58,87,116,144,0,&
|
||||
2,30,59,88,117,143,0,&
|
||||
3,31,60,89,118,145,0,&
|
||||
4,29,61,90,119,146,0,&
|
||||
2,29,62,91,120,147,0,&
|
||||
5,32,63,92,121,148,0,&
|
||||
6,33,64,90,109,149,0,&
|
||||
7,34,65,93,122,150,164,&
|
||||
8,33,66,94,118,151,0,&
|
||||
9,34,67,95,123,152,0,&
|
||||
10,35,68,96,114,153,0,&
|
||||
11,36,69,97,124,154,168,&
|
||||
12,37,63,94,125,155,0,&
|
||||
10,38,60,92,116,156,0,&
|
||||
13,39,61,96,126,138,0,&
|
||||
13,33,70,81,127,150,0,&
|
||||
14,40,71,98,126,157,0,&
|
||||
15,39,72,99,128,158,0,&
|
||||
16,41,64,96,129,159,0,&
|
||||
17,42,64,91,112,160,0,&
|
||||
18,42,73,100,130,161,0,&
|
||||
19,43,68,93,131,162,0,&
|
||||
12,44,74,86,132,163,0,&
|
||||
1,45,75,101,133,159,0,&
|
||||
19,46,57,102,134,149,0,&
|
||||
20,32,76,91,118,164,168,&
|
||||
21,41,62,98,132,165,0,&
|
||||
22,45,77,89,113,162,0,&
|
||||
18,47,68,103,135,145,0,&
|
||||
16,48,78,104,131,144,0,&
|
||||
3,49,79,105,129,147,0,&
|
||||
6,50,71,88,124,153,0,&
|
||||
23,38,76,90,115,166,0,&
|
||||
20,44,79,99,136,146,0,&
|
||||
21,51,70,105,137,167,0,&
|
||||
8,35,67,87,134,136,0,&
|
||||
21,47,80,106,119,156,0,&
|
||||
24,36,65,107,138,147,0,&
|
||||
22,52,74,102,130,164,0,&
|
||||
9,45,81,104,139,168,0,&
|
||||
8,53,82,100,133,0,0,&
|
||||
25,48,72,100,127,157,0,&
|
||||
19,37,71,107,139,158,0,&
|
||||
22,39,82,108,116,143,165,&
|
||||
26,43,72,109,121,0,0,&
|
||||
27,54,58,99,140,151,0,&
|
||||
28,31,80,87,110,161,0,&
|
||||
16,30,74,110,137,154,158,&
|
||||
7,55,79,110,133,166,0,&
|
||||
4,50,83,101,141,155,0,&
|
||||
15,47,59,97,142,149,0,&
|
||||
24,30,75,98,140,148,0,&
|
||||
23,56,73,111,136,165,0,&
|
||||
14,44,81,85,103,115,160,&
|
||||
23,52,84,95,138,144,0,&
|
||||
25,35,77,97,120,166,0,&
|
||||
25,57,85,111,140,156,0,&
|
||||
4,42,69,105,131,148,0,&
|
||||
15,40,84,112,125,162,0,&
|
||||
5,54,70,84,134,159,0,&
|
||||
28,53,76,113,128,163,0,&
|
||||
10,54,86,109,117,161,0,&
|
||||
9,49,59,92,130,141,0,&
|
||||
14,56,58,113,129,155,0,&
|
||||
5,36,78,82,135,146,0,&
|
||||
3,50,78,112,132,150,0,&
|
||||
1,51,57,94,122,135,0,&
|
||||
17,38,75,93,142,167,0,&
|
||||
27,41,67,89,127,142,0,&
|
||||
18,55,63,88,128,152,0,&
|
||||
2,53,85,95,121,167,0,&
|
||||
11,49,86,108,122,157,0,&
|
||||
20,51,83,107,117,0,0,&
|
||||
26,52,55,62,139,151,0,&
|
||||
11,56,66,102,114,152,0,&
|
||||
6,32,77,103,123,137,0,&
|
||||
28,40,65,114,141,0,0,&
|
||||
12,34,61,111,124,145,0,&
|
||||
27,43,83,106,126,154,0,&
|
||||
13,46,60,101,120,163,0,&
|
||||
17,37,80,108,123,0,0,&
|
||||
26,31,69,115,125,0,0,&
|
||||
7,48,66,106,143,160,0,&
|
||||
24,46,73,104,119,153,0/
|
||||
|
||||
data nrw/ &
|
||||
6,6,6,6,6,6,6,7,6,6,6,7,6,6,6,6,6,6,6,6,6, &
|
||||
6,6,6,6,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,6, &
|
||||
6,7,5,6,6,7,6,6,6,6,6,7,6,6,6,6,6,6,6,6,6, &
|
||||
6,6,6,6,6,6,6,6,6,5,6,6,6,5,6,6,6,5,5,6,6/
|
||||
|
||||
ncw=3
|
||||
|
||||
toc=0
|
||||
tov=0
|
||||
tanhtoc=0
|
||||
!write(*,*) llr
|
||||
! 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)
|
||||
return
|
||||
endif
|
||||
|
||||
if( iter.gt.0 ) 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. 3 .and. iter .ge. 5 .and. ncheck .gt. 10) 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 bpdecode168
|
||||
@@ -0,0 +1,49 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// 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_MODULUS_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_MODULUS_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_modulus
|
||||
#define BOOST_TT_TRAIT_OP %
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
(\
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,247 @@
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org/libs/multi_index for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_VARTEMPL_SUPPORT_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_VARTEMPL_SUPPORT_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Utilities for emulation of variadic template functions. Variadic packs are
|
||||
* replaced by lists of BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS parameters:
|
||||
*
|
||||
* - typename... Args --> BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK
|
||||
* - Args&&... args --> BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK
|
||||
* - std::forward<Args>(args)... --> BOOST_MULTI_INDEX_FORWARD_PARAM_PACK
|
||||
*
|
||||
* Forwarding emulated with Boost.Move. A template functions foo_imp
|
||||
* defined in such way accepts *exactly* BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS
|
||||
* arguments: variable number of arguments is emulated by providing a set of
|
||||
* overloads foo forwarding to foo_impl with
|
||||
*
|
||||
* BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL
|
||||
* BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG (initial extra arg)
|
||||
*
|
||||
* which fill the extra args with boost::multi_index::detail::noarg's.
|
||||
* boost::multi_index::detail::vartempl_placement_new works the opposite
|
||||
* way: it acceps a full a pointer x to Value and a
|
||||
* BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK and forwards to
|
||||
* new(x) Value(args) where args is the argument pack after discarding
|
||||
* noarg's.
|
||||
*
|
||||
* Emulation decays to the real thing when the compiler supports variadic
|
||||
* templates and move semantics natively.
|
||||
*/
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)||\
|
||||
defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/move/utility.hpp>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/logical/and.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS)
|
||||
#define BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS 5
|
||||
#endif
|
||||
|
||||
#define BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,typename T)
|
||||
|
||||
#define BOOST_MULTI_INDEX_VARTEMPL_ARG(z,n,_) \
|
||||
BOOST_FWD_REF(BOOST_PP_CAT(T,n)) BOOST_PP_CAT(t,n)
|
||||
|
||||
#define BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS, \
|
||||
BOOST_MULTI_INDEX_VARTEMPL_ARG,~)
|
||||
|
||||
#define BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG(z,n,_) \
|
||||
boost::forward<BOOST_PP_CAT(T,n)>(BOOST_PP_CAT(t,n))
|
||||
|
||||
#define BOOST_MULTI_INDEX_FORWARD_PARAM_PACK \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS, \
|
||||
BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~)
|
||||
|
||||
namespace boost{namespace multi_index{namespace detail{
|
||||
struct noarg{};
|
||||
}}}
|
||||
|
||||
/* call vartempl function without args */
|
||||
|
||||
#define BOOST_MULTI_INDEX_NULL_PARAM_PACK \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS, \
|
||||
boost::multi_index::detail::noarg() BOOST_PP_INTERCEPT)
|
||||
|
||||
#define BOOST_MULTI_INDEX_TEMPLATE_N(n) \
|
||||
template<BOOST_PP_ENUM_PARAMS(n,typename T)>
|
||||
|
||||
#define BOOST_MULTI_INDEX_TEMPLATE_0(n)
|
||||
|
||||
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_AUX(z,n,data) \
|
||||
BOOST_PP_IF(n, \
|
||||
BOOST_MULTI_INDEX_TEMPLATE_N, \
|
||||
BOOST_MULTI_INDEX_TEMPLATE_0)(n) \
|
||||
BOOST_PP_SEQ_ELEM(0,data) /* ret */ \
|
||||
BOOST_PP_SEQ_ELEM(1,data) /* name_from */ ( \
|
||||
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_ARG,~)) \
|
||||
{ \
|
||||
return BOOST_PP_SEQ_ELEM(2,data) /* name_to */ ( \
|
||||
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~) \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_AND( \
|
||||
n,BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n))) \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n), \
|
||||
boost::multi_index::detail::noarg() BOOST_PP_INTERCEPT) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL( \
|
||||
ret,name_from,name_to) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
0,BOOST_PP_ADD(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,1), \
|
||||
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_AUX, \
|
||||
(ret)(name_from)(name_to))
|
||||
|
||||
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG_AUX( \
|
||||
z,n,data) \
|
||||
BOOST_PP_IF(n, \
|
||||
BOOST_MULTI_INDEX_TEMPLATE_N, \
|
||||
BOOST_MULTI_INDEX_TEMPLATE_0)(n) \
|
||||
BOOST_PP_SEQ_ELEM(0,data) /* ret */ \
|
||||
BOOST_PP_SEQ_ELEM(1,data) /* name_from */ ( \
|
||||
BOOST_PP_SEQ_ELEM(3,data) BOOST_PP_SEQ_ELEM(4,data) /* extra arg */\
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_ARG,~)) \
|
||||
{ \
|
||||
return BOOST_PP_SEQ_ELEM(2,data) /* name_to */ ( \
|
||||
BOOST_PP_SEQ_ELEM(4,data) /* extra_arg_name */ \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~) \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n)) \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n), \
|
||||
boost::multi_index::detail::noarg() BOOST_PP_INTERCEPT) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG( \
|
||||
ret,name_from,name_to,extra_arg_type,extra_arg_name) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
0,BOOST_PP_ADD(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,1), \
|
||||
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG_AUX, \
|
||||
(ret)(name_from)(name_to)(extra_arg_type)(extra_arg_name))
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
#define BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW_AUX(z,n,name) \
|
||||
template< \
|
||||
typename Value \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM_PARAMS(n,typename T) \
|
||||
> \
|
||||
Value* name( \
|
||||
Value* x \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_ARG,~) \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n)) \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n), \
|
||||
BOOST_FWD_REF(noarg) BOOST_PP_INTERCEPT)) \
|
||||
{ \
|
||||
return new(x) Value( \
|
||||
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~)); \
|
||||
}
|
||||
|
||||
#define BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW(name) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
0,BOOST_PP_ADD(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,1), \
|
||||
BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW_AUX, \
|
||||
name)
|
||||
|
||||
BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW(vartempl_placement_new)
|
||||
|
||||
#undef BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW_AUX
|
||||
#undef BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#else
|
||||
|
||||
/* native variadic templates support */
|
||||
|
||||
#include <utility>
|
||||
|
||||
#define BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK typename... Args
|
||||
#define BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK Args&&... args
|
||||
#define BOOST_MULTI_INDEX_FORWARD_PARAM_PACK std::forward<Args>(args)...
|
||||
#define BOOST_MULTI_INDEX_NULL_PARAM_PACK
|
||||
|
||||
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL( \
|
||||
ret,name_from,name_to) \
|
||||
template<typename... Args> ret name_from(Args&&... args) \
|
||||
{ \
|
||||
return name_to(std::forward<Args>(args)...); \
|
||||
}
|
||||
|
||||
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG( \
|
||||
ret,name_from,name_to,extra_arg_type,extra_arg_name) \
|
||||
template<typename... Args> ret name_from( \
|
||||
extra_arg_type extra_arg_name,Args&&... args) \
|
||||
{ \
|
||||
return name_to(extra_arg_name,std::forward<Args>(args)...); \
|
||||
}
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
template<typename Value,typename... Args>
|
||||
Value* vartempl_placement_new(Value*x,Args&&... args)
|
||||
{
|
||||
return new(x) Value(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/proto/transform/detail/preprocessed/construct_funop.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/construct_funop.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file construct_funop.hpp
|
||||
/// Overloads of construct_\<\>::operator().
|
||||
//
|
||||
// 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, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/construct_funop.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()
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(N, typename A)>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a)) const
|
||||
{
|
||||
return Type(BOOST_PP_ENUM_PARAMS(N, a));
|
||||
}
|
||||
|
||||
#undef N
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_PREDEF_OS_HPUX_H
|
||||
#define BOOST_PREDEF_OS_HPUX_H
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_OS_HPUX`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/HP-UX HP-UX] operating system.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`hpux`] [__predef_detection__]]
|
||||
[[`_hpux`] [__predef_detection__]]
|
||||
[[`__hpux`] [__predef_detection__]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_OS_HPUX BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
|
||||
defined(hpux) || defined(_hpux) || defined(__hpux) \
|
||||
)
|
||||
# undef BOOST_OS_HPUX
|
||||
# define BOOST_OS_HPUX BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_OS_HPUX
|
||||
# define BOOST_OS_HPUX_AVAILABLE
|
||||
# include <boost/predef/detail/os_detected.h>
|
||||
#endif
|
||||
|
||||
#define BOOST_OS_HPUX_NAME "HP-UX"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_HPUX,BOOST_OS_HPUX_NAME)
|
||||
@@ -0,0 +1,163 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file expr.hpp
|
||||
/// Contains definition of expr\<\> class template.
|
||||
//
|
||||
// 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)
|
||||
|
||||
#ifndef BOOST_PROTO_EXPR_HPP_EAN_04_01_2005
|
||||
#define BOOST_PROTO_EXPR_HPP_EAN_04_01_2005
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/selection/max.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
|
||||
#include <boost/utility/addressof.hpp>
|
||||
#include <boost/proto/proto_fwd.hpp>
|
||||
#include <boost/proto/args.hpp>
|
||||
#include <boost/proto/traits.hpp>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4510) // default constructor could not be generated
|
||||
# pragma warning(disable : 4512) // assignment operator could not be generated
|
||||
# pragma warning(disable : 4610) // user defined constructor required
|
||||
# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
|
||||
#endif
|
||||
|
||||
namespace boost { namespace proto
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
struct not_a_valid_type
|
||||
{
|
||||
private:
|
||||
not_a_valid_type()
|
||||
{}
|
||||
};
|
||||
|
||||
template<typename Tag, typename Arg>
|
||||
struct address_of_hack
|
||||
{
|
||||
typedef not_a_valid_type type;
|
||||
};
|
||||
|
||||
template<typename Expr>
|
||||
struct address_of_hack<proto::tag::address_of, Expr &>
|
||||
{
|
||||
typedef Expr *type;
|
||||
};
|
||||
|
||||
template<typename T, typename Expr, typename Arg0>
|
||||
BOOST_FORCEINLINE
|
||||
Expr make_terminal(T &t, Expr *, proto::term<Arg0> *)
|
||||
{
|
||||
Expr that = {t};
|
||||
return that;
|
||||
}
|
||||
|
||||
template<typename T, typename Expr, typename Arg0, std::size_t N>
|
||||
BOOST_FORCEINLINE
|
||||
Expr make_terminal(T (&t)[N], Expr *, proto::term<Arg0[N]> *)
|
||||
{
|
||||
Expr that;
|
||||
for(std::size_t i = 0; i < N; ++i)
|
||||
{
|
||||
that.child0[i] = t[i];
|
||||
}
|
||||
return that;
|
||||
}
|
||||
|
||||
template<typename T, typename Expr, typename Arg0, std::size_t N>
|
||||
BOOST_FORCEINLINE
|
||||
Expr make_terminal(T const(&t)[N], Expr *, proto::term<Arg0[N]> *)
|
||||
{
|
||||
Expr that;
|
||||
for(std::size_t i = 0; i < N; ++i)
|
||||
{
|
||||
that.child0[i] = t[i];
|
||||
}
|
||||
return that;
|
||||
}
|
||||
|
||||
// Work-around for:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/765449/codegen-stack-corruption-using-runtime-checks-when-aggregate-initializing-struct
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1700))
|
||||
template<typename T, typename Expr, typename C, typename U>
|
||||
BOOST_FORCEINLINE
|
||||
Expr make_terminal(T &t, Expr *, proto::term<U C::*> *)
|
||||
{
|
||||
Expr that;
|
||||
that.child0 = t;
|
||||
return that;
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename T, typename U>
|
||||
struct same_cv
|
||||
{
|
||||
typedef U type;
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
struct same_cv<T const, U>
|
||||
{
|
||||
typedef U const type;
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
/// \brief A helper metafunction for computing the
|
||||
/// return type of \c proto::expr\<\>::operator().
|
||||
template<typename Sig, typename This, typename Domain>
|
||||
struct funop;
|
||||
|
||||
#include <boost/proto/detail/funop.hpp>
|
||||
}
|
||||
|
||||
namespace exprns_
|
||||
{
|
||||
// This is where the basic_expr specializations are
|
||||
// actually defined:
|
||||
#include <boost/proto/detail/basic_expr.hpp>
|
||||
|
||||
// This is where the expr specialization are
|
||||
// actually defined:
|
||||
#include <boost/proto/detail/expr.hpp>
|
||||
}
|
||||
|
||||
/// \brief Lets you inherit the interface of an expression
|
||||
/// while hiding from Proto the fact that the type is a Proto
|
||||
/// expression.
|
||||
template<typename Expr>
|
||||
struct unexpr
|
||||
: Expr
|
||||
{
|
||||
BOOST_PROTO_UNEXPR()
|
||||
|
||||
BOOST_FORCEINLINE
|
||||
explicit unexpr(Expr const &e)
|
||||
: Expr(e)
|
||||
{}
|
||||
|
||||
using Expr::operator =;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_PROTO_EXPR_HPP_EAN_04_01_2005
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_INCLUDE_DEQUE)
|
||||
#define FUSION_INCLUDE_DEQUE
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/deque.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,176 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// alt_sstream.hpp : alternative stringstream
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Copyright Samuel Krempp 2003. 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/format for library home page
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#ifndef BOOST_SK_ALT_SSTREAM_HPP
|
||||
#define BOOST_SK_ALT_SSTREAM_HPP
|
||||
|
||||
#include <string>
|
||||
#include <boost/format/detail/compat_workarounds.hpp>
|
||||
#include <boost/utility/base_from_member.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace io {
|
||||
|
||||
template<class Ch, class Tr=::std::char_traits<Ch>,
|
||||
class Alloc=::std::allocator<Ch> >
|
||||
class basic_altstringbuf;
|
||||
|
||||
template<class Ch, class Tr =::std::char_traits<Ch>,
|
||||
class Alloc=::std::allocator<Ch> >
|
||||
class basic_oaltstringstream;
|
||||
|
||||
|
||||
template<class Ch, class Tr, class Alloc>
|
||||
class basic_altstringbuf
|
||||
: public ::std::basic_streambuf<Ch, Tr>
|
||||
{
|
||||
typedef ::std::basic_streambuf<Ch, Tr> streambuf_t;
|
||||
typedef typename CompatAlloc<Alloc>::compatible_type compat_allocator_type;
|
||||
typedef typename CompatTraits<Tr>::compatible_type compat_traits_type;
|
||||
public:
|
||||
typedef Ch char_type;
|
||||
typedef Tr traits_type;
|
||||
typedef typename compat_traits_type::int_type int_type;
|
||||
typedef typename compat_traits_type::pos_type pos_type;
|
||||
typedef typename compat_traits_type::off_type off_type;
|
||||
typedef Alloc allocator_type;
|
||||
typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
|
||||
typedef typename string_type::size_type size_type;
|
||||
|
||||
typedef ::std::streamsize streamsize;
|
||||
|
||||
|
||||
explicit basic_altstringbuf(std::ios_base::openmode mode
|
||||
= std::ios_base::in | std::ios_base::out)
|
||||
: putend_(NULL), is_allocated_(false), mode_(mode)
|
||||
{}
|
||||
explicit basic_altstringbuf(const string_type& s,
|
||||
::std::ios_base::openmode mode
|
||||
= ::std::ios_base::in | ::std::ios_base::out)
|
||||
: putend_(NULL), is_allocated_(false), mode_(mode)
|
||||
{ dealloc(); str(s); }
|
||||
virtual ~basic_altstringbuf()
|
||||
{ dealloc(); }
|
||||
using streambuf_t::pbase;
|
||||
using streambuf_t::pptr;
|
||||
using streambuf_t::epptr;
|
||||
using streambuf_t::eback;
|
||||
using streambuf_t::gptr;
|
||||
using streambuf_t::egptr;
|
||||
|
||||
void clear_buffer();
|
||||
void str(const string_type& s);
|
||||
|
||||
// 0-copy access :
|
||||
Ch * begin() const;
|
||||
size_type size() const;
|
||||
size_type cur_size() const; // stop at current pointer
|
||||
Ch * pend() const // the highest position reached by pptr() since creation
|
||||
{ return ((putend_ < pptr()) ? pptr() : putend_); }
|
||||
size_type pcount() const
|
||||
{ return static_cast<size_type>( pptr() - pbase()) ;}
|
||||
|
||||
// copy buffer to string :
|
||||
string_type str() const
|
||||
{ return string_type(begin(), size()); }
|
||||
string_type cur_str() const
|
||||
{ return string_type(begin(), cur_size()); }
|
||||
protected:
|
||||
explicit basic_altstringbuf (basic_altstringbuf * s,
|
||||
::std::ios_base::openmode mode
|
||||
= ::std::ios_base::in | ::std::ios_base::out)
|
||||
: putend_(NULL), is_allocated_(false), mode_(mode)
|
||||
{ dealloc(); str(s); }
|
||||
|
||||
virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way,
|
||||
::std::ios_base::openmode which
|
||||
= ::std::ios_base::in | ::std::ios_base::out);
|
||||
virtual pos_type seekpos (pos_type pos,
|
||||
::std::ios_base::openmode which
|
||||
= ::std::ios_base::in | ::std::ios_base::out);
|
||||
virtual int_type underflow();
|
||||
virtual int_type pbackfail(int_type meta = compat_traits_type::eof());
|
||||
virtual int_type overflow(int_type meta = compat_traits_type::eof());
|
||||
void dealloc();
|
||||
private:
|
||||
enum { alloc_min = 256}; // minimum size of allocations
|
||||
|
||||
Ch *putend_; // remembers (over seeks) the highest value of pptr()
|
||||
bool is_allocated_;
|
||||
::std::ios_base::openmode mode_;
|
||||
compat_allocator_type alloc_; // the allocator object
|
||||
};
|
||||
|
||||
|
||||
// --- class basic_oaltstringstream ----------------------------------------
|
||||
template <class Ch, class Tr, class Alloc>
|
||||
class basic_oaltstringstream
|
||||
: private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >,
|
||||
public ::std::basic_ostream<Ch, Tr>
|
||||
{
|
||||
class No_Op {
|
||||
// used as no-op deleter for (not-owner) shared_pointers
|
||||
public:
|
||||
template<class T>
|
||||
const T & operator()(const T & arg) { return arg; }
|
||||
};
|
||||
typedef ::std::basic_ostream<Ch, Tr> stream_t;
|
||||
typedef boost::base_from_member<boost::shared_ptr<
|
||||
basic_altstringbuf<Ch,Tr, Alloc> > >
|
||||
pbase_type;
|
||||
typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
|
||||
typedef typename string_type::size_type size_type;
|
||||
typedef basic_altstringbuf<Ch, Tr, Alloc> stringbuf_t;
|
||||
public:
|
||||
typedef Alloc allocator_type;
|
||||
basic_oaltstringstream()
|
||||
: pbase_type(new stringbuf_t), stream_t(rdbuf())
|
||||
{ }
|
||||
basic_oaltstringstream(::boost::shared_ptr<stringbuf_t> buf)
|
||||
: pbase_type(buf), stream_t(rdbuf())
|
||||
{ }
|
||||
basic_oaltstringstream(stringbuf_t * buf)
|
||||
: pbase_type(buf, No_Op() ), stream_t(rdbuf())
|
||||
{ }
|
||||
stringbuf_t * rdbuf() const
|
||||
{ return pbase_type::member.get(); }
|
||||
void clear_buffer()
|
||||
{ rdbuf()->clear_buffer(); }
|
||||
|
||||
// 0-copy access :
|
||||
Ch * begin() const
|
||||
{ return rdbuf()->begin(); }
|
||||
size_type size() const
|
||||
{ return rdbuf()->size(); }
|
||||
size_type cur_size() const // stops at current position
|
||||
{ return rdbuf()->cur_size(); }
|
||||
|
||||
// copy buffer to string :
|
||||
string_type str() const // [pbase, epptr[
|
||||
{ return rdbuf()->str(); }
|
||||
string_type cur_str() const // [pbase, pptr[
|
||||
{ return rdbuf()->cur_str(); }
|
||||
void str(const string_type& s)
|
||||
{ rdbuf()->str(s); }
|
||||
};
|
||||
|
||||
} // N.S. io
|
||||
} // N.S. boost
|
||||
|
||||
#include <boost/format/alt_sstream_impl.hpp>
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/external/compute/compute_resize.hpp
|
||||
|
||||
[begin_description]
|
||||
Enable resizing for Boost.Compute vector
|
||||
[end_description]
|
||||
|
||||
Copyright 2009-2011 Karsten Ahnert
|
||||
Copyright 2009-2011 Mario Mulansky
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED
|
||||
|
||||
#include <boost/compute/container/vector.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/util/copy.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
template< class T, class A >
|
||||
struct is_resizeable< boost::compute::vector< T , A > >
|
||||
{
|
||||
struct type : public boost::true_type { };
|
||||
const static bool value = type::value;
|
||||
};
|
||||
|
||||
template< class T, class A >
|
||||
struct same_size_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
|
||||
{
|
||||
static bool same_size( const boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y )
|
||||
{
|
||||
return x.size() == y.size();
|
||||
}
|
||||
};
|
||||
|
||||
template< class T, class A >
|
||||
struct resize_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
|
||||
{
|
||||
static void resize( boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y )
|
||||
{
|
||||
x.resize( y.size() );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template< class Container1, class T, class A >
|
||||
struct copy_impl< Container1 , boost::compute::vector< T, A > >
|
||||
{
|
||||
static void copy( const Container1 &from , boost::compute::vector< T, A > &to )
|
||||
{
|
||||
boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
|
||||
}
|
||||
};
|
||||
|
||||
template< class T, class A, class Container2 >
|
||||
struct copy_impl< boost::compute::vector< T, A > , Container2 >
|
||||
{
|
||||
static void copy( const boost::compute::vector< T, A > &from , Container2 &to )
|
||||
{
|
||||
boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
|
||||
}
|
||||
};
|
||||
|
||||
template< class T, class A >
|
||||
struct copy_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
|
||||
{
|
||||
static void copy( const boost::compute::vector< T, A > &from , boost::compute::vector< T, A > &to )
|
||||
{
|
||||
boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} // odeint
|
||||
} // numeric
|
||||
} // boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED
|
||||
@@ -0,0 +1,9 @@
|
||||
0; 0; 0
|
||||
63; 27; 0
|
||||
131; 63; 0
|
||||
199; 95; 0
|
||||
251;127; 11
|
||||
251;155; 71
|
||||
251;187;131
|
||||
251;219;191
|
||||
255;255;255
|
||||
@@ -0,0 +1,26 @@
|
||||
module jt4
|
||||
parameter (MAXAVE=64)
|
||||
integer iutc(MAXAVE)
|
||||
integer nfsave(MAXAVE)
|
||||
integer listutc(10)
|
||||
real ppsave(207,7,MAXAVE) !Accumulated data for message averaging
|
||||
real rsymbol(207,7)
|
||||
real dtsave(MAXAVE)
|
||||
real syncsave(MAXAVE)
|
||||
real flipsave(MAXAVE)
|
||||
real zz(1260,65,7)
|
||||
|
||||
integer nsave,nlist,ich1,ich2
|
||||
integer nch(7)
|
||||
integer npr(207)
|
||||
data rsymbol/1449*0.0/
|
||||
data nch/1,2,4,9,18,36,72/
|
||||
data npr/ &
|
||||
0,0,0,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0, &
|
||||
0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,1,1,1,1,1,0,1,0,0,0, &
|
||||
1,0,0,1,0,0,1,1,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,1,0,1,1,0,0,1, &
|
||||
0,0,0,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1, &
|
||||
0,1,1,1,0,0,1,0,1,1,0,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,1,1, &
|
||||
0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,0,1,1,1,1,1, &
|
||||
1,0,0,1,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,1,1,0,1,0,1/
|
||||
end module jt4
|
||||
@@ -0,0 +1,31 @@
|
||||
// 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
|
||||
// (C) Copyright 2011-2012 Vicente J. Botet Escriba
|
||||
|
||||
#ifndef BOOST_THREAD_LOCK_OPTIONS_HPP
|
||||
#define BOOST_THREAD_LOCK_OPTIONS_HPP
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
struct defer_lock_t
|
||||
{
|
||||
};
|
||||
struct try_to_lock_t
|
||||
{
|
||||
};
|
||||
struct adopt_lock_t
|
||||
{
|
||||
};
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST defer_lock_t defer_lock = {};
|
||||
BOOST_CONSTEXPR_OR_CONST try_to_lock_t try_to_lock = {};
|
||||
BOOST_CONSTEXPR_OR_CONST adopt_lock_t adopt_lock = {};
|
||||
|
||||
}
|
||||
#include <boost/config/abi_suffix.hpp>
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user