Initial Commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
$ qra64_nico -h
|
||||
|
||||
QRA64 Mode Tests
|
||||
2016, Nico Palermo - IV3NWV
|
||||
|
||||
---------------------------
|
||||
|
||||
Syntax: qra64 [-s<snrdb>] [-c<channel>] [-a<ap-type>] [-t<testtype>] [-h]
|
||||
Options:
|
||||
-s<snrdb> : set simulation SNR in 2500 Hz BW (default:-27.5 dB)
|
||||
-c<channel> : set channel type 0=AWGN (default) 1=Rayleigh
|
||||
-a<ap-type> : set decode type 0=NOAP 1=AUTOAP (default) 2=USERAP
|
||||
-t<testtype>: 0=simulate seq of msgs between IV3NWV and K1JT (default)
|
||||
1=simulate K1JT receiving K1JT IV3NWV JN66
|
||||
2=simulate fast-fading routines (option -c ignored)
|
||||
Options used only for fast-fading simulations:
|
||||
-b : 90% fading bandwidth in Hz [1..230 Hz] (default = 2.5 Hz)
|
||||
-m : fading model. 0=Gauss, 1=Lorentz (default = Lorentz)
|
||||
-q : qra64 submode. 0=QRA64A,... 4=QRA64E (default = QRA64A)
|
||||
-h: this help
|
||||
|
||||
|
||||
#############################################################################
|
||||
Usage example:
|
||||
|
||||
qra64 -c2 -t2 -a2 -b50 -m1 -q2 -s-26.0 -n50000
|
||||
|
||||
Simulate a fast-fading channel (-c2)
|
||||
Evaluate decoder performance (-t2) with
|
||||
USER_AP (-a2)
|
||||
B90 = 50 Hz (-b50)
|
||||
Lorentz model (-m1)
|
||||
submode QRA64C (-q2)
|
||||
Input SNR = -26.0 dB (-s-26.0)
|
||||
Simulate 50000 transmissions (-n50000)
|
||||
|
||||
(type qra64 -h for command syntax)
|
||||
|
||||
Command Output:
|
||||
|
||||
Input SNR = -26.0dB ap-mode=USER AP
|
||||
|
||||
Simulating the fast-fading channel
|
||||
B90=50.00 Hz - Fading Model=Lorentz - Submode=QRA64C
|
||||
Decoder metric = Matched to fast-fading signal
|
||||
|
||||
Encoding msg [K1JT IV3NWV JN66]
|
||||
50000 transmissions will be simulated
|
||||
|
||||
K1JT decoder enabled for [CQ ? ?/blank]
|
||||
K1JT decoder enabled for [K1JT ? ?/blank]
|
||||
K1JT decoder enabled for [? IV3NWV ?/blank]
|
||||
K1JT decoder enabled for [K1JT IV3NWV ?]
|
||||
K1JT decoder enabled for [K1JT IV3NWV JN66]
|
||||
K1JT decoder enabled for [CQ IV3NWV ?/b/JN66]
|
||||
|
||||
Now decoding with K1JT's decoder...
|
||||
5.5 %
|
||||
Undetected error with rc=6
|
||||
13.1 %
|
||||
Undetected error with rc=7
|
||||
70.8 %
|
||||
Undetected error with rc=1
|
||||
75.8 %
|
||||
Undetected error with rc=9
|
||||
88.9 %
|
||||
Undetected error with rc=6
|
||||
100.0 %
|
||||
|
||||
Msgs transmitted:50000
|
||||
Msg decoded:
|
||||
|
||||
rc= 0 0 with [? ? ?] AP0
|
||||
rc= 1 0 with [CQ ? ?] AP27
|
||||
rc= 2 0 with [CQ ? ] AP42
|
||||
rc= 3 145 with [CALL ? ?] AP29
|
||||
rc= 4 0 with [CALL ? ] AP44
|
||||
rc= 5 12085 with [CALL CALL ?] AP57
|
||||
rc= 6 0 with [? CALL ?] AP29
|
||||
rc= 7 0 with [? CALL ] AP44
|
||||
rc= 8 24307 with [CALL CALL G] AP72
|
||||
rc= 9 0 with [CQ CALL ?] AP55
|
||||
rc=10 0 with [CQ CALL ] AP70
|
||||
rc=11 0 with [CQ CALL G] AP70
|
||||
|
||||
Total: 36537/50000 (5 undetected errors)
|
||||
|
||||
Estimated SNR (average in dB) = -26.26 dB
|
||||
@@ -0,0 +1,232 @@
|
||||
subroutine ft8b(dd0,newdat,nfqso,f1,xdt,nharderrors,dmin,nbadcrc,message,xsnr)
|
||||
|
||||
use timer_module, only: timer
|
||||
include 'ft8_params.f90'
|
||||
parameter(NRECENT=10,NP2=2812)
|
||||
character message*22,msgsent*22
|
||||
character*12 recent_calls(NRECENT)
|
||||
real a(5)
|
||||
real s1(0:7,ND),s2(0:7,NN)
|
||||
real ps(0:7)
|
||||
real rxdata(3*ND),llr(3*ND) !Soft symbols
|
||||
real dd0(15*12000)
|
||||
integer*1 decoded(KK),apmask(3*ND),cw(3*ND)
|
||||
integer itone(NN)
|
||||
integer icos7(0:6)
|
||||
complex cd0(3125)
|
||||
complex csync(0:6,32)
|
||||
complex ctwk(32)
|
||||
complex csymb(32)
|
||||
logical newdat,first
|
||||
data icos7/2,5,6,0,4,1,3/
|
||||
data first/.true./
|
||||
save first,twopi,fs2,dt2,taus,baud,csync
|
||||
|
||||
if( first ) then
|
||||
twopi=8.0*atan(1.0)
|
||||
fs2=12000.0/64.0
|
||||
dt2=1/fs2
|
||||
taus=32*dt2
|
||||
baud=1/taus
|
||||
do i=0,6
|
||||
phi=0.0
|
||||
dphi=twopi*icos7(i)*baud*dt2
|
||||
do j=1,32
|
||||
csync(i,j)=cmplx(cos(phi),sin(phi))
|
||||
phi=mod(phi+dphi,twopi)
|
||||
enddo
|
||||
enddo
|
||||
first=.false.
|
||||
endif
|
||||
|
||||
max_iterations=40
|
||||
norder=2
|
||||
! if(abs(nfqso-f1).lt.10.0) norder=3
|
||||
call timer('ft8_down',0)
|
||||
call ft8_downsample(dd0,newdat,f1,cd0)
|
||||
call timer('ft8_down',1)
|
||||
|
||||
i0=xdt*fs2
|
||||
smax=0.0
|
||||
do idt=i0-16,i0+16
|
||||
sync=0
|
||||
do i=0,6
|
||||
i1=idt+i*32
|
||||
i2=i1+36*32
|
||||
i3=i1+72*32
|
||||
term1=0.0 ! this needs to be fixed...
|
||||
term2=0.0
|
||||
term3=0.0
|
||||
if( i1.ge.1 .and. i1+31.le.NP2 ) &
|
||||
term1=abs(sum(cd0(i1:i1+31)*conjg(csync(i,1:32))))
|
||||
if( i2.ge.1 .and. i2+31.le.NP2 ) &
|
||||
term2=abs(sum(cd0(i2:i2+31)*conjg(csync(i,1:32))))
|
||||
if( i3.ge.1 .and. i3+31.le.NP2 ) &
|
||||
term3=abs(sum(cd0(i3:i3+31)*conjg(csync(i,1:32))))
|
||||
sync=sync+term1+term2+term3
|
||||
enddo
|
||||
if( sync .gt. smax ) then
|
||||
smax=sync
|
||||
ibest=idt
|
||||
endif
|
||||
enddo
|
||||
xdt2=ibest*dt2
|
||||
|
||||
! peak up the frequency
|
||||
i0=xdt2*fs2
|
||||
smax=0.0
|
||||
do ifr=-5,5
|
||||
delf=ifr*0.5
|
||||
dphi=twopi*delf*dt2
|
||||
phi=0.0
|
||||
do i=1,32
|
||||
ctwk(i)=cmplx(cos(phi),sin(phi))
|
||||
phi=mod(phi+dphi,twopi)
|
||||
enddo
|
||||
sync=0.0
|
||||
do i=0,6
|
||||
i1=i0+i*32
|
||||
i2=i1+36*32
|
||||
i3=i1+72*32
|
||||
term1=0.0 ! this needs to be fixed...
|
||||
term2=0.0
|
||||
term3=0.0
|
||||
if( i1.ge.1 .and. i1+31.le.NP2 ) &
|
||||
term1=abs(sum(cd0(i1:i1+31)*conjg(ctwk*csync(i,1:32))))
|
||||
if( i2.ge.1 .and. i2+31.le.NP2 ) &
|
||||
term2=abs(sum(cd0(i2:i2+31)*conjg(ctwk*csync(i,1:32))))
|
||||
if( i3.ge.1 .and. i3+31.le.NP2 ) &
|
||||
term3=abs(sum(cd0(i3:i3+31)*conjg(ctwk*csync(i,1:32))))
|
||||
sync=sync+term1+term2+term3
|
||||
enddo
|
||||
if( sync .gt. smax ) then
|
||||
smax=sync
|
||||
delfbest=delf
|
||||
endif
|
||||
enddo
|
||||
a=0.0
|
||||
a(1)=-delfbest
|
||||
call twkfreq1(cd0,NP2,fs2,a,cd0)
|
||||
xdt=xdt2
|
||||
f1=f1+delfbest
|
||||
|
||||
j=0
|
||||
do k=1,NN
|
||||
i1=ibest+(k-1)*32
|
||||
csymb=cmplx(0.0,0.0)
|
||||
if( i1.ge.1 .and. i1+31 .le. NP2 ) csymb=cd0(i1:i1+31)
|
||||
call four2a(csymb,32,1,-1,1)
|
||||
s2(0:7,k)=abs(csymb(1:8))
|
||||
enddo
|
||||
j=0
|
||||
do k=1,NN
|
||||
if(k.le.7) cycle
|
||||
if(k.ge.37 .and. k.le.43) cycle
|
||||
if(k.gt.72) cycle
|
||||
j=j+1
|
||||
s1(0:7,j)=s2(0:7,k)
|
||||
enddo
|
||||
|
||||
do j=1,ND
|
||||
ps=s1(0:7,j)
|
||||
where (ps.gt.0.0) ps=log(ps)
|
||||
r1=max(ps(1),ps(3),ps(5),ps(7))-max(ps(0),ps(2),ps(4),ps(6))
|
||||
r2=max(ps(2),ps(3),ps(6),ps(7))-max(ps(0),ps(1),ps(4),ps(5))
|
||||
r4=max(ps(4),ps(5),ps(6),ps(7))-max(ps(0),ps(1),ps(2),ps(3))
|
||||
rxdata(3*j-2)=r4
|
||||
rxdata(3*j-1)=r2
|
||||
rxdata(3*j)=r1
|
||||
enddo
|
||||
|
||||
rxav=sum(rxdata)/(3.0*ND)
|
||||
rx2av=sum(rxdata*rxdata)/(3.0*ND)
|
||||
var=rx2av-rxav*rxav
|
||||
if( var .gt. 0.0 ) then
|
||||
rxsig=sqrt(var)
|
||||
else
|
||||
rxsig=sqrt(rx2av)
|
||||
endif
|
||||
rxdata=rxdata/rxsig
|
||||
ss=0.84
|
||||
llr=2.0*rxdata/(ss*ss)
|
||||
apmask=0
|
||||
cw=0
|
||||
call timer('bpd174 ',0)
|
||||
call bpdecode174(llr,apmask,max_iterations,decoded,cw,nharderrors)
|
||||
call timer('bpd174 ',1)
|
||||
dmin=0.0
|
||||
if(nharderrors.lt.0) then
|
||||
call timer('osd174 ',0)
|
||||
call osd174(llr,norder,decoded,cw,nharderrors,dmin)
|
||||
call timer('osd174 ',1)
|
||||
endif
|
||||
nbadcrc=1
|
||||
message=' '
|
||||
xsnr=-99.0
|
||||
if(count(cw.eq.0).eq.174) go to 900 !Reject the all-zero codeword
|
||||
if( nharderrors.ge.0 .and. dmin.le.30.0 .and. nharderrors .lt. 30) then
|
||||
call chkcrc12a(decoded,nbadcrc)
|
||||
else
|
||||
nharderrors=-1
|
||||
go to 900
|
||||
endif
|
||||
if(nbadcrc.eq.0) then
|
||||
call extractmessage174(decoded,message,ncrcflag,recent_calls,nrecent)
|
||||
call genft8(message,msgsent,itone)
|
||||
xsig=0.0
|
||||
xnoi=0.0
|
||||
do i=1,79
|
||||
xsig=xsig+s2(itone(i),i)**2
|
||||
ios=mod(itone(i)+4,7)
|
||||
xnoi=xnoi+s2(ios,i)**2
|
||||
enddo
|
||||
xsnr=0.001
|
||||
if( xnoi.gt.0 .and. xnoi.lt.xsig ) xsnr=xsig/xnoi-1.0
|
||||
xsnr=10.0*log10(xsnr)-27.0
|
||||
if( xsnr .lt. -24.0 ) xsnr=-24.0
|
||||
endif
|
||||
900 continue
|
||||
return
|
||||
end subroutine ft8b
|
||||
|
||||
subroutine ft8_downsample(dd,newdat,f0,c1)
|
||||
|
||||
! Downconvert to complex data sampled at 187.5 Hz, 32 samples/symbol
|
||||
|
||||
parameter (NMAX=15*12000)
|
||||
parameter (NFFT1=200000,NFFT2=3125) !200000/64 = 3125
|
||||
logical newdat
|
||||
complex c1(0:NFFT2-1)
|
||||
complex cx(0:NFFT1/2)
|
||||
real dd(NMAX),x(NFFT1)
|
||||
equivalence (x,cx)
|
||||
save cx
|
||||
|
||||
if(newdat) then
|
||||
! Data in dd have changed, recompute the long FFT
|
||||
x(1:NMAX)=dd
|
||||
x(NMAX+1:NFFT1)=0. !Zero-pad the x array
|
||||
call four2a(cx,NFFT1,1,-1,0) !r2c FFT to freq domain
|
||||
newdat=.false.
|
||||
endif
|
||||
|
||||
df=12000.0/NFFT1
|
||||
baud=12000.0/2048.0
|
||||
i0=nint(f0/df)
|
||||
ft=f0+8.0*baud
|
||||
it=min(nint(ft/df),NFFT1/2)
|
||||
fb=f0-1.0*baud
|
||||
ib=max(1,nint(fb/df))
|
||||
k=0
|
||||
c1=0.
|
||||
do i=ib,it
|
||||
c1(k)=cx(i)
|
||||
k=k+1
|
||||
enddo
|
||||
c1=cshift(c1,i0-ib)
|
||||
call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain
|
||||
fac=1.0/sqrt(float(NFFT1)*NFFT2)
|
||||
c1=fac*c1
|
||||
|
||||
return
|
||||
end subroutine ft8_downsample
|
||||
@@ -0,0 +1,32 @@
|
||||
// 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_REVERSE_RESULT_ITERATOR_HPP
|
||||
#define BOOST_RANGE_REVERSE_RESULT_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/range/reverse_iterator.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
//
|
||||
// This interface is deprecated, use range_reverse_iterator<T>
|
||||
//
|
||||
|
||||
template< typename C >
|
||||
struct range_reverse_result_iterator : range_reverse_iterator<C>
|
||||
{ };
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Boost.Function library
|
||||
#
|
||||
# Copyright (C) 2001-2003 Douglas Gregor (gregod@cs.rpi.edu)
|
||||
#
|
||||
# Permission to copy, use, sell and distribute this software is granted
|
||||
# provided this copyright notice appears in all copies.
|
||||
# Permission to modify the code and to distribute modified code is granted
|
||||
# provided this copyright notice appears in all copies, and a notice
|
||||
# that the code was modified is included with the copyright notice.
|
||||
#
|
||||
# This software is provided "as is" without express or implied warranty,
|
||||
# and with no claim as to its suitability for any purpose.
|
||||
#
|
||||
# For more information, see http://www.boost.org
|
||||
use English;
|
||||
|
||||
$max_args = $ARGV[0];
|
||||
|
||||
open (OUT, ">maybe_include.hpp") or die("Cannot write to maybe_include.hpp");
|
||||
for($on_arg = 0; $on_arg <= $max_args; ++$on_arg) {
|
||||
if ($on_arg == 0) {
|
||||
print OUT "#if";
|
||||
}
|
||||
else {
|
||||
print OUT "#elif";
|
||||
}
|
||||
print OUT " BOOST_FUNCTION_NUM_ARGS == $on_arg\n";
|
||||
print OUT "# ifndef BOOST_FUNCTION_$on_arg\n";
|
||||
print OUT "# define BOOST_FUNCTION_$on_arg\n";
|
||||
print OUT "# include <boost/function/function_template.hpp>\n";
|
||||
print OUT "# endif\n";
|
||||
}
|
||||
print OUT "#else\n";
|
||||
print OUT "# error Cannot handle Boost.Function objects that accept more than $max_args arguments!\n";
|
||||
print OUT "#endif\n";
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
|
||||
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base.hpp
|
||||
//
|
||||
// Copyright 2005-2013 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
|
||||
|
||||
#if defined( __clang__ ) && defined( __has_extension )
|
||||
# if __has_extension( __c_atomic__ )
|
||||
# define BOOST_SP_HAS_CLANG_C11_ATOMICS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_SP_DISABLE_THREADS )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_USE_STD_ATOMIC )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_USE_SPINLOCK )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_spin.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_USE_PTHREADS )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_pt.hpp>
|
||||
|
||||
#elif defined( BOOST_DISABLE_THREADS ) && !defined( BOOST_SP_ENABLE_THREADS ) && !defined( BOOST_DISABLE_WIN32 )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_HAS_CLANG_C11_ATOMICS )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_clang.hpp>
|
||||
|
||||
#elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
|
||||
|
||||
#elif defined( __SNC__ )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined(__PATHSCALE__)
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp>
|
||||
|
||||
#elif defined(__HP_aCC) && defined(__ia64)
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER ) && !defined(__PATHSCALE__)
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp>
|
||||
|
||||
#elif defined( __IBMCPP__ ) && defined( __powerpc )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp>
|
||||
|
||||
#elif defined( __MWERKS__ ) && defined( __POWERPC__ )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_HAS_SYNC )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_sync.hpp>
|
||||
|
||||
#elif defined(__GNUC__) && ( defined( __sparcv9 ) || ( defined( __sparcv8 ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 402 ) ) )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp>
|
||||
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_w32.hpp>
|
||||
|
||||
#elif defined( _AIX )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_aix.hpp>
|
||||
|
||||
#elif !defined( BOOST_HAS_THREADS )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
|
||||
|
||||
#else
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_spin.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
#undef BOOST_SP_HAS_CLANG_C11_ATOMICS
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) 2015 John Maddock
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_MATH_ELLINT_HL_HPP
|
||||
#define BOOST_MATH_ELLINT_HL_HPP
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/math_fwd.hpp>
|
||||
#include <boost/math/special_functions/ellint_rj.hpp>
|
||||
#include <boost/math/special_functions/ellint_rj.hpp>
|
||||
#include <boost/math/special_functions/ellint_1.hpp>
|
||||
#include <boost/math/special_functions/jacobi_zeta.hpp>
|
||||
#include <boost/math/constants/constants.hpp>
|
||||
#include <boost/math/policies/error_handling.hpp>
|
||||
#include <boost/math/tools/workaround.hpp>
|
||||
|
||||
// Elliptic integral the Jacobi Zeta function.
|
||||
|
||||
namespace boost { namespace math {
|
||||
|
||||
namespace detail{
|
||||
|
||||
// Elliptic integral - Jacobi Zeta
|
||||
template <typename T, typename Policy>
|
||||
T heuman_lambda_imp(T phi, T k, const Policy& pol)
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
using namespace boost::math::tools;
|
||||
using namespace boost::math::constants;
|
||||
|
||||
const char* function = "boost::math::heuman_lambda<%1%>(%1%, %1%)";
|
||||
|
||||
if(fabs(k) > 1)
|
||||
return policies::raise_domain_error<T>(function, "We require |k| <= 1 but got k = %1%", k, pol);
|
||||
|
||||
T result;
|
||||
T sinp = sin(phi);
|
||||
T cosp = cos(phi);
|
||||
T s2 = sinp * sinp;
|
||||
T k2 = k * k;
|
||||
T kp = 1 - k2;
|
||||
T delta = sqrt(1 - (kp * s2));
|
||||
if(fabs(phi) <= constants::half_pi<T>())
|
||||
{
|
||||
result = kp * sinp * cosp / (delta * constants::half_pi<T>());
|
||||
result *= ellint_rf_imp(T(0), kp, T(1), pol) + k2 * ellint_rj(T(0), kp, T(1), T(1 - k2 / (delta * delta)), pol) / (3 * delta * delta);
|
||||
}
|
||||
else
|
||||
{
|
||||
T rkp = sqrt(kp);
|
||||
T ratio;
|
||||
if(rkp == 1)
|
||||
{
|
||||
return policies::raise_domain_error<T>(function, "When 1-k^2 == 1 then phi must be < Pi/2, but got phi = %1%", phi, pol);
|
||||
}
|
||||
else
|
||||
ratio = ellint_f_imp(phi, rkp, pol) / ellint_k_imp(rkp, pol);
|
||||
result = ratio + ellint_k_imp(k, pol) * jacobi_zeta_imp(phi, rkp, pol) / constants::half_pi<T>();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} // detail
|
||||
|
||||
template <class T1, class T2, class Policy>
|
||||
inline typename tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi, const Policy& pol)
|
||||
{
|
||||
typedef typename tools::promote_args<T1, T2>::type result_type;
|
||||
typedef typename policies::evaluation<result_type, Policy>::type value_type;
|
||||
return policies::checked_narrowing_cast<result_type, Policy>(detail::heuman_lambda_imp(static_cast<value_type>(phi), static_cast<value_type>(k), pol), "boost::math::heuman_lambda<%1%>(%1%,%1%)");
|
||||
}
|
||||
|
||||
template <class T1, class T2>
|
||||
inline typename tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi)
|
||||
{
|
||||
return boost::math::heuman_lambda(k, phi, policies::policy<>());
|
||||
}
|
||||
|
||||
}} // namespaces
|
||||
|
||||
#endif // BOOST_MATH_ELLINT_D_HPP
|
||||
|
||||
@@ -0,0 +1,405 @@
|
||||
// Copyright John Maddock 2006.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// std_real_concept is an archetype for built-in Real types.
|
||||
|
||||
// The main purpose in providing this type is to verify
|
||||
// that std lib functions are found via a using declaration
|
||||
// bringing those functions into the current scope, and not
|
||||
// just because they happen to be in global scope.
|
||||
//
|
||||
// If ::pow is found rather than std::pow say, then the code
|
||||
// will silently compile, but truncation of long doubles to
|
||||
// double will cause a significant loss of precision.
|
||||
// A template instantiated with std_real_concept will *only*
|
||||
// compile if it std::whatever is in scope.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/math/policies/policy.hpp>
|
||||
#include <boost/math/special_functions/math_fwd.hpp>
|
||||
|
||||
#include <ostream>
|
||||
#include <istream>
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <math.h> // fmodl
|
||||
|
||||
#ifndef BOOST_MATH_STD_REAL_CONCEPT_HPP
|
||||
#define BOOST_MATH_STD_REAL_CONCEPT_HPP
|
||||
|
||||
namespace boost{ namespace math{
|
||||
|
||||
namespace concepts
|
||||
{
|
||||
|
||||
#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
typedef double std_real_concept_base_type;
|
||||
#else
|
||||
typedef long double std_real_concept_base_type;
|
||||
#endif
|
||||
|
||||
class std_real_concept
|
||||
{
|
||||
public:
|
||||
// Constructors:
|
||||
std_real_concept() : m_value(0){}
|
||||
std_real_concept(char c) : m_value(c){}
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
std_real_concept(wchar_t c) : m_value(c){}
|
||||
#endif
|
||||
std_real_concept(unsigned char c) : m_value(c){}
|
||||
std_real_concept(signed char c) : m_value(c){}
|
||||
std_real_concept(unsigned short c) : m_value(c){}
|
||||
std_real_concept(short c) : m_value(c){}
|
||||
std_real_concept(unsigned int c) : m_value(c){}
|
||||
std_real_concept(int c) : m_value(c){}
|
||||
std_real_concept(unsigned long c) : m_value(c){}
|
||||
std_real_concept(long c) : m_value(c){}
|
||||
#if defined(__DECCXX) || defined(__SUNPRO_CC)
|
||||
std_real_concept(unsigned long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
std_real_concept(long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
#elif defined(BOOST_HAS_LONG_LONG)
|
||||
std_real_concept(boost::ulong_long_type c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
std_real_concept(boost::long_long_type c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
#endif
|
||||
std_real_concept(float c) : m_value(c){}
|
||||
std_real_concept(double c) : m_value(c){}
|
||||
std_real_concept(long double c) : m_value(c){}
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
std_real_concept(BOOST_MATH_FLOAT128_TYPE c) : m_value(c){}
|
||||
#endif
|
||||
|
||||
// Assignment:
|
||||
std_real_concept& operator=(char c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(unsigned char c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(signed char c) { m_value = c; return *this; }
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
std_real_concept& operator=(wchar_t c) { m_value = c; return *this; }
|
||||
#endif
|
||||
std_real_concept& operator=(short c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(unsigned short c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(int c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(unsigned int c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(long c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(unsigned long c) { m_value = c; return *this; }
|
||||
#if defined(__DECCXX) || defined(__SUNPRO_CC)
|
||||
std_real_concept& operator=(unsigned long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
std_real_concept& operator=(long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
#elif defined(BOOST_HAS_LONG_LONG)
|
||||
std_real_concept& operator=(boost::long_long_type c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
std_real_concept& operator=(boost::ulong_long_type c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
#endif
|
||||
std_real_concept& operator=(float c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(double c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(long double c) { m_value = c; return *this; }
|
||||
|
||||
// Access:
|
||||
std_real_concept_base_type value()const{ return m_value; }
|
||||
|
||||
// Member arithmetic:
|
||||
std_real_concept& operator+=(const std_real_concept& other)
|
||||
{ m_value += other.value(); return *this; }
|
||||
std_real_concept& operator-=(const std_real_concept& other)
|
||||
{ m_value -= other.value(); return *this; }
|
||||
std_real_concept& operator*=(const std_real_concept& other)
|
||||
{ m_value *= other.value(); return *this; }
|
||||
std_real_concept& operator/=(const std_real_concept& other)
|
||||
{ m_value /= other.value(); return *this; }
|
||||
std_real_concept operator-()const
|
||||
{ return -m_value; }
|
||||
std_real_concept const& operator+()const
|
||||
{ return *this; }
|
||||
|
||||
private:
|
||||
std_real_concept_base_type m_value;
|
||||
};
|
||||
|
||||
// Non-member arithmetic:
|
||||
inline std_real_concept operator+(const std_real_concept& a, const std_real_concept& b)
|
||||
{
|
||||
std_real_concept result(a);
|
||||
result += b;
|
||||
return result;
|
||||
}
|
||||
inline std_real_concept operator-(const std_real_concept& a, const std_real_concept& b)
|
||||
{
|
||||
std_real_concept result(a);
|
||||
result -= b;
|
||||
return result;
|
||||
}
|
||||
inline std_real_concept operator*(const std_real_concept& a, const std_real_concept& b)
|
||||
{
|
||||
std_real_concept result(a);
|
||||
result *= b;
|
||||
return result;
|
||||
}
|
||||
inline std_real_concept operator/(const std_real_concept& a, const std_real_concept& b)
|
||||
{
|
||||
std_real_concept result(a);
|
||||
result /= b;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Comparison:
|
||||
inline bool operator == (const std_real_concept& a, const std_real_concept& b)
|
||||
{ return a.value() == b.value(); }
|
||||
inline bool operator != (const std_real_concept& a, const std_real_concept& b)
|
||||
{ return a.value() != b.value();}
|
||||
inline bool operator < (const std_real_concept& a, const std_real_concept& b)
|
||||
{ return a.value() < b.value(); }
|
||||
inline bool operator <= (const std_real_concept& a, const std_real_concept& b)
|
||||
{ return a.value() <= b.value(); }
|
||||
inline bool operator > (const std_real_concept& a, const std_real_concept& b)
|
||||
{ return a.value() > b.value(); }
|
||||
inline bool operator >= (const std_real_concept& a, const std_real_concept& b)
|
||||
{ return a.value() >= b.value(); }
|
||||
|
||||
} // namespace concepts
|
||||
} // namespace math
|
||||
} // namespace boost
|
||||
|
||||
namespace std{
|
||||
|
||||
// Non-member functions:
|
||||
inline boost::math::concepts::std_real_concept acos(boost::math::concepts::std_real_concept a)
|
||||
{ return std::acos(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept cos(boost::math::concepts::std_real_concept a)
|
||||
{ return std::cos(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept asin(boost::math::concepts::std_real_concept a)
|
||||
{ return std::asin(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept atan(boost::math::concepts::std_real_concept a)
|
||||
{ return std::atan(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept atan2(boost::math::concepts::std_real_concept a, boost::math::concepts::std_real_concept b)
|
||||
{ return std::atan2(a.value(), b.value()); }
|
||||
inline boost::math::concepts::std_real_concept ceil(boost::math::concepts::std_real_concept a)
|
||||
{ return std::ceil(a.value()); }
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
inline boost::math::concepts::std_real_concept fmod(boost::math::concepts::std_real_concept a, boost::math::concepts::std_real_concept b)
|
||||
{ return fmodl(a.value(), b.value()); }
|
||||
#else
|
||||
inline boost::math::concepts::std_real_concept fmod(boost::math::concepts::std_real_concept a, boost::math::concepts::std_real_concept b)
|
||||
{ return std::fmod(a.value(), b.value()); }
|
||||
#endif
|
||||
inline boost::math::concepts::std_real_concept cosh(boost::math::concepts::std_real_concept a)
|
||||
{ return std::cosh(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept exp(boost::math::concepts::std_real_concept a)
|
||||
{ return std::exp(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept fabs(boost::math::concepts::std_real_concept a)
|
||||
{ return std::fabs(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept abs(boost::math::concepts::std_real_concept a)
|
||||
{ return std::abs(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept floor(boost::math::concepts::std_real_concept a)
|
||||
{ return std::floor(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept modf(boost::math::concepts::std_real_concept a, boost::math::concepts::std_real_concept* ipart)
|
||||
{
|
||||
boost::math::concepts::std_real_concept_base_type ip;
|
||||
boost::math::concepts::std_real_concept_base_type result = std::modf(a.value(), &ip);
|
||||
*ipart = ip;
|
||||
return result;
|
||||
}
|
||||
inline boost::math::concepts::std_real_concept frexp(boost::math::concepts::std_real_concept a, int* expon)
|
||||
{ return std::frexp(a.value(), expon); }
|
||||
inline boost::math::concepts::std_real_concept ldexp(boost::math::concepts::std_real_concept a, int expon)
|
||||
{ return std::ldexp(a.value(), expon); }
|
||||
inline boost::math::concepts::std_real_concept log(boost::math::concepts::std_real_concept a)
|
||||
{ return std::log(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept log10(boost::math::concepts::std_real_concept a)
|
||||
{ return std::log10(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept tan(boost::math::concepts::std_real_concept a)
|
||||
{ return std::tan(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept pow(boost::math::concepts::std_real_concept a, boost::math::concepts::std_real_concept b)
|
||||
{ return std::pow(a.value(), b.value()); }
|
||||
#if !defined(__SUNPRO_CC)
|
||||
inline boost::math::concepts::std_real_concept pow(boost::math::concepts::std_real_concept a, int b)
|
||||
{ return std::pow(a.value(), b); }
|
||||
#else
|
||||
inline boost::math::concepts::std_real_concept pow(boost::math::concepts::std_real_concept a, int b)
|
||||
{ return std::pow(a.value(), static_cast<long double>(b)); }
|
||||
#endif
|
||||
inline boost::math::concepts::std_real_concept sin(boost::math::concepts::std_real_concept a)
|
||||
{ return std::sin(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept sinh(boost::math::concepts::std_real_concept a)
|
||||
{ return std::sinh(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept sqrt(boost::math::concepts::std_real_concept a)
|
||||
{ return std::sqrt(a.value()); }
|
||||
inline boost::math::concepts::std_real_concept tanh(boost::math::concepts::std_real_concept a)
|
||||
{ return std::tanh(a.value()); }
|
||||
|
||||
} // namespace std
|
||||
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
#include <boost/math/special_functions/trunc.hpp>
|
||||
#include <boost/math/special_functions/modf.hpp>
|
||||
#include <boost/math/tools/precision.hpp>
|
||||
|
||||
namespace boost{ namespace math{ namespace concepts{
|
||||
|
||||
//
|
||||
// Conversion and truncation routines:
|
||||
//
|
||||
template <class Policy>
|
||||
inline int iround(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::iround(v.value(), pol);
|
||||
}
|
||||
inline int iround(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::iround(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline long lround(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::lround(v.value(), pol);
|
||||
}
|
||||
inline long lround(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::lround(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
|
||||
template <class Policy>
|
||||
inline boost::long_long_type llround(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::llround(v.value(), pol);
|
||||
}
|
||||
inline boost::long_long_type llround(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::llround(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template <class Policy>
|
||||
inline int itrunc(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::itrunc(v.value(), pol);
|
||||
}
|
||||
inline int itrunc(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::itrunc(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline long ltrunc(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::ltrunc(v.value(), pol);
|
||||
}
|
||||
inline long ltrunc(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::ltrunc(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
|
||||
template <class Policy>
|
||||
inline boost::long_long_type lltrunc(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::lltrunc(v.value(), pol);
|
||||
}
|
||||
inline boost::long_long_type lltrunc(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::lltrunc(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Streaming:
|
||||
template <class charT, class traits>
|
||||
inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const std_real_concept& a)
|
||||
{
|
||||
return os << a.value();
|
||||
}
|
||||
template <class charT, class traits>
|
||||
inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, std_real_concept& a)
|
||||
{
|
||||
#if defined(__SGI_STL_PORT) || defined(_RWSTD_VER) || defined(__LIBCOMO__) || defined(_LIBCPP_VERSION)
|
||||
std::string s;
|
||||
std_real_concept_base_type d;
|
||||
is >> s;
|
||||
std::sscanf(s.c_str(), "%Lf", &d);
|
||||
a = d;
|
||||
return is;
|
||||
#else
|
||||
std_real_concept_base_type v;
|
||||
is >> v;
|
||||
a = v;
|
||||
return is;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace concepts
|
||||
}}
|
||||
|
||||
#include <boost/math/tools/precision.hpp>
|
||||
#include <boost/math/tools/big_constant.hpp>
|
||||
|
||||
namespace boost{ namespace math{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
template <>
|
||||
inline concepts::std_real_concept make_big_value<concepts::std_real_concept>(boost::math::tools::largest_float val, const char*, mpl::false_ const&, mpl::false_ const&)
|
||||
{
|
||||
return val; // Can't use lexical_cast here, sometimes it fails....
|
||||
}
|
||||
|
||||
template <>
|
||||
inline concepts::std_real_concept max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
|
||||
{
|
||||
return max_value<concepts::std_real_concept_base_type>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline concepts::std_real_concept min_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
|
||||
{
|
||||
return min_value<concepts::std_real_concept_base_type>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline concepts::std_real_concept log_max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
|
||||
{
|
||||
return log_max_value<concepts::std_real_concept_base_type>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline concepts::std_real_concept log_min_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
|
||||
{
|
||||
return log_min_value<concepts::std_real_concept_base_type>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline concepts::std_real_concept epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
|
||||
{
|
||||
return tools::epsilon<concepts::std_real_concept_base_type>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline BOOST_MATH_CONSTEXPR int digits<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept)) BOOST_NOEXCEPT
|
||||
{ // Assume number of significand bits is same as std_real_concept_base_type,
|
||||
// unless std::numeric_limits<T>::is_specialized to provide digits.
|
||||
return digits<concepts::std_real_concept_base_type>();
|
||||
}
|
||||
|
||||
} // namespace tools
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
|
||||
using concepts::itrunc;
|
||||
using concepts::ltrunc;
|
||||
using concepts::lltrunc;
|
||||
using concepts::iround;
|
||||
using concepts::lround;
|
||||
using concepts::llround;
|
||||
#endif
|
||||
|
||||
} // namespace math
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_MATH_STD_REAL_CONCEPT_HPP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_VALUE_AT_IMPL_20060124_2129)
|
||||
#define FUSION_VALUE_AT_IMPL_20060124_2129
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/vector/convert.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/transform.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/fusion/support/unused.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct zip_view_tag;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<typename N>
|
||||
struct poly_value_at
|
||||
{
|
||||
template<typename T>
|
||||
struct result;
|
||||
|
||||
template<typename N1, typename Seq>
|
||||
struct result<poly_value_at<N1>(Seq)>
|
||||
: mpl::eval_if<is_same<Seq, unused_type const&>,
|
||||
mpl::identity<unused_type>,
|
||||
result_of::value_at<typename remove_reference<Seq>::type, N> >
|
||||
{};
|
||||
|
||||
// never called, but needed for decltype-based result_of (C++0x)
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template<typename Seq>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
typename result<poly_value_at(Seq)>::type
|
||||
operator()(Seq&&) const;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct value_at_impl;
|
||||
|
||||
template<>
|
||||
struct value_at_impl<zip_view_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename result_of::transform<
|
||||
typename Sequence::sequences,
|
||||
detail::poly_value_at<N> >::type values;
|
||||
typedef typename result_of::as_vector<values>::type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,149 @@
|
||||
#ifndef BOOST_ARCHIVE_XML_WIARCHIVE_HPP
|
||||
#define BOOST_ARCHIVE_XML_WIARCHIVE_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// xml_wiarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_NO_STD_WSTREAMBUF
|
||||
#error "wide char i/o not supported on this platform"
|
||||
#else
|
||||
|
||||
#include <istream>
|
||||
|
||||
#include <boost/smart_ptr/scoped_ptr.hpp>
|
||||
#include <boost/archive/detail/auto_link_warchive.hpp>
|
||||
#include <boost/archive/basic_text_iprimitive.hpp>
|
||||
#include <boost/archive/basic_xml_iarchive.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
#include <boost/serialization/item_version_type.hpp>
|
||||
// #include <boost/archive/detail/utf8_codecvt_facet.hpp>
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
namespace detail {
|
||||
template<class Archive> class interface_iarchive;
|
||||
} // namespace detail
|
||||
|
||||
template<class CharType>
|
||||
class basic_xml_grammar;
|
||||
typedef basic_xml_grammar<wchar_t> xml_wgrammar;
|
||||
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE xml_wiarchive_impl :
|
||||
public basic_text_iprimitive<std::wistream>,
|
||||
public basic_xml_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
protected:
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_xml_iarchive<Archive>;
|
||||
friend class load_access;
|
||||
#endif
|
||||
boost::scoped_ptr<xml_wgrammar> gimpl;
|
||||
std::wistream & get_is(){
|
||||
return is;
|
||||
}
|
||||
template<class T>
|
||||
void
|
||||
load(T & t){
|
||||
basic_text_iprimitive<std::wistream>::load(t);
|
||||
}
|
||||
void
|
||||
load(version_type & t){
|
||||
unsigned int v;
|
||||
load(v);
|
||||
t = version_type(v);
|
||||
}
|
||||
void
|
||||
load(boost::serialization::item_version_type & t){
|
||||
unsigned int v;
|
||||
load(v);
|
||||
t = boost::serialization::item_version_type(v);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
#endif
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(std::wstring &ws);
|
||||
#endif
|
||||
template<class T>
|
||||
void load_override(T & t){
|
||||
basic_xml_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_WARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_wiarchive_impl(std::wistream & is, unsigned int flags) ;
|
||||
BOOST_WARCHIVE_DECL
|
||||
~xml_wiarchive_impl();
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE xml_wiarchive :
|
||||
public xml_wiarchive_impl<xml_wiarchive>{
|
||||
public:
|
||||
xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
xml_wiarchive_impl<xml_wiarchive>(is, flags)
|
||||
{}
|
||||
~xml_wiarchive(){}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// required by export
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_wiarchive)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_NO_STD_WSTREAMBUF
|
||||
#endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP
|
||||
@@ -0,0 +1,57 @@
|
||||
subroutine genqra64(msg0,ichk,msgsent,itone,itype)
|
||||
|
||||
! Encodes a QRA64 message to yield itone(1:84)
|
||||
|
||||
use packjt
|
||||
character*22 msg0
|
||||
character*22 message !Message to be generated
|
||||
character*22 msgsent !Message as it will be received
|
||||
integer itone(84)
|
||||
character*3 cok !' ' or 'OOO'
|
||||
logical old_qra_sync
|
||||
integer dgen(13)
|
||||
integer sent(63)
|
||||
integer icos7(0:6)
|
||||
data icos7/2,5,6,0,4,1,3/ !Defines a 7x7 Costas array
|
||||
save
|
||||
|
||||
if(msg0(1:1).eq.'@') then
|
||||
read(msg0(2:5),*,end=1,err=1) nfreq
|
||||
go to 2
|
||||
1 nfreq=1000
|
||||
2 itone(1)=nfreq
|
||||
write(msgsent,1000) nfreq
|
||||
1000 format(i5,' Hz')
|
||||
else
|
||||
message=msg0
|
||||
do i=1,22
|
||||
if(ichar(message(i:i)).eq.0) then
|
||||
message(i:)=' '
|
||||
exit
|
||||
endif
|
||||
enddo
|
||||
|
||||
do i=1,22 !Strip leading blanks
|
||||
if(message(1:1).ne.' ') exit
|
||||
message=message(i+1:)
|
||||
enddo
|
||||
|
||||
call chkmsg(message,cok,nspecial,flip)
|
||||
call packmsg(message,dgen,itype,.false.) !Pack message into 72 bits
|
||||
call unpackmsg(dgen,msgsent,.false.,' ') !Unpack to get message sent
|
||||
if(ichk.ne.0) go to 999 !Return if checking only
|
||||
call qra64_enc(dgen,sent) !Encode using QRA64
|
||||
|
||||
nsync=10
|
||||
inquire(file='old_qra_sync',exist=old_qra_sync)
|
||||
if(old_qra_sync) nsync=1
|
||||
|
||||
itone(1:7)=nsync*icos7 !Insert 7x7 Costas array in 3 places
|
||||
itone(8:39)=sent(1:32)
|
||||
itone(40:46)=nsync*icos7
|
||||
itone(47:77)=sent(33:63)
|
||||
itone(78:84)=nsync*icos7
|
||||
endif
|
||||
|
||||
999 return
|
||||
end subroutine genqra64
|
||||
@@ -0,0 +1,184 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (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_BSTREE_ALGORITHMS_BASE_HPP
|
||||
#define BOOST_INTRUSIVE_BSTREE_ALGORITHMS_BASE_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/detail/uncast.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
template<class NodeTraits>
|
||||
class bstree_algorithms_base
|
||||
{
|
||||
public:
|
||||
typedef typename NodeTraits::node node;
|
||||
typedef NodeTraits node_traits;
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node from the tree except the header.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the next node of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Average constant time.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr next_node(const node_ptr & node)
|
||||
{
|
||||
node_ptr const n_right(NodeTraits::get_right(node));
|
||||
if(n_right){
|
||||
return minimum(n_right);
|
||||
}
|
||||
else {
|
||||
node_ptr n(node);
|
||||
node_ptr p(NodeTraits::get_parent(n));
|
||||
while(n == NodeTraits::get_right(p)){
|
||||
n = p;
|
||||
p = NodeTraits::get_parent(p);
|
||||
}
|
||||
return NodeTraits::get_right(n) != p ? p : n;
|
||||
}
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node from the tree except the leftmost node.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the previous node of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Average constant time.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr prev_node(const node_ptr & node)
|
||||
{
|
||||
if(is_header(node)){
|
||||
//return NodeTraits::get_right(node);
|
||||
return maximum(NodeTraits::get_parent(node));
|
||||
}
|
||||
else if(NodeTraits::get_left(node)){
|
||||
return maximum(NodeTraits::get_left(node));
|
||||
}
|
||||
else {
|
||||
node_ptr p(node);
|
||||
node_ptr x = NodeTraits::get_parent(p);
|
||||
while(p == NodeTraits::get_left(x)){
|
||||
p = x;
|
||||
x = NodeTraits::get_parent(x);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node of a tree but not the header.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the minimum node of the subtree starting at p.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic to the size of the subtree.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr minimum(node_ptr node)
|
||||
{
|
||||
for(node_ptr p_left = NodeTraits::get_left(node)
|
||||
;p_left
|
||||
;p_left = NodeTraits::get_left(node)){
|
||||
node = p_left;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node of a tree but not the header.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the maximum node of the subtree starting at p.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic to the size of the subtree.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr maximum(node_ptr node)
|
||||
{
|
||||
for(node_ptr p_right = NodeTraits::get_right(node)
|
||||
;p_right
|
||||
;p_right = NodeTraits::get_right(node)){
|
||||
node = p_right;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: p is a node of a tree.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns true if p is the header of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static bool is_header(const const_node_ptr & p)
|
||||
{
|
||||
node_ptr p_left (NodeTraits::get_left(p));
|
||||
node_ptr p_right(NodeTraits::get_right(p));
|
||||
if(!NodeTraits::get_parent(p) || //Header condition when empty tree
|
||||
(p_left && p_right && //Header always has leftmost and rightmost
|
||||
(p_left == p_right || //Header condition when only node
|
||||
(NodeTraits::get_parent(p_left) != p ||
|
||||
NodeTraits::get_parent(p_right) != p ))
|
||||
//When tree size > 1 headers can't be leftmost's
|
||||
//and rightmost's parent
|
||||
)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node of the tree or a header node.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the header of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr get_header(const const_node_ptr & node)
|
||||
{
|
||||
node_ptr n(detail::uncast(node));
|
||||
node_ptr p(NodeTraits::get_parent(node));
|
||||
//If p is null, then n is the header of an empty tree
|
||||
if(p){
|
||||
//Non-empty tree, check if n is neither root nor header
|
||||
node_ptr pp(NodeTraits::get_parent(p));
|
||||
//If granparent is not equal to n, then n is neither root nor header,
|
||||
//the try the fast path
|
||||
if(n != pp){
|
||||
do{
|
||||
n = p;
|
||||
p = pp;
|
||||
pp = NodeTraits::get_parent(pp);
|
||||
}while(n != pp);
|
||||
n = p;
|
||||
}
|
||||
//Check if n is root or header when size() > 0
|
||||
else if(!bstree_algorithms_base::is_header(n)){
|
||||
n = p;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
} //namespace intrusive
|
||||
} //namespace boost
|
||||
|
||||
#endif //BOOST_INTRUSIVE_BSTREE_ALGORITHMS_BASE_HPP
|
||||
@@ -0,0 +1,73 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost variant/detail/make_variant_list.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2002-2003 Eric Friedman, Itay Maman
|
||||
// Copyright (c) 2013 Antony Polukhin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_VARIANT_DETAIL_MAKE_VARIANT_LIST_HPP
|
||||
#define BOOST_VARIANT_DETAIL_MAKE_VARIANT_LIST_HPP
|
||||
|
||||
#include <boost/variant/variant_fwd.hpp>
|
||||
|
||||
#include <boost/mpl/list.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/enum.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail { namespace variant {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// (detail) metafunction make_variant_list
|
||||
//
|
||||
// Provides a MPL-compatible sequence with the specified non-void types
|
||||
// as arguments.
|
||||
//
|
||||
// Rationale: see class template convert_void (variant_fwd.hpp) and using-
|
||||
// declaration workaround (below).
|
||||
//
|
||||
|
||||
#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
|
||||
|
||||
template < typename... T >
|
||||
struct make_variant_list
|
||||
{
|
||||
typedef typename mpl::list< T... >::type type;
|
||||
};
|
||||
|
||||
#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
|
||||
|
||||
template < BOOST_VARIANT_ENUM_PARAMS(typename T) >
|
||||
struct make_variant_list
|
||||
{
|
||||
public: // metafunction result
|
||||
|
||||
// [Define a macro to convert any void(NN) tags to mpl::void...]
|
||||
# define BOOST_VARIANT_AUX_CONVERT_VOID(z, N,_) \
|
||||
typename convert_void< BOOST_PP_CAT(T,N) >::type
|
||||
|
||||
// [...so that the specified types can be passed to mpl::list...]
|
||||
typedef typename mpl::list<
|
||||
BOOST_PP_ENUM(
|
||||
BOOST_VARIANT_LIMIT_TYPES
|
||||
, BOOST_VARIANT_AUX_CONVERT_VOID
|
||||
, _
|
||||
)
|
||||
>::type type;
|
||||
|
||||
// [...and, finally, the conversion macro can be undefined:]
|
||||
# undef BOOST_VARIANT_AUX_CONVERT_VOID
|
||||
|
||||
};
|
||||
|
||||
#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround
|
||||
|
||||
}} // namespace detail::variant
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_VARIANT_DETAIL_MAKE_VARIANT_LIST_HPP
|
||||
@@ -0,0 +1,613 @@
|
||||
/* boost random/subtract_with_carry.hpp header file
|
||||
*
|
||||
* Copyright Jens Maurer 2002
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org for most recent version including documentation.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Revision history
|
||||
* 2002-03-02 created
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
|
||||
#define BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
|
||||
|
||||
#include <boost/config/no_tr1/cmath.hpp> // std::pow
|
||||
#include <iostream>
|
||||
#include <algorithm> // std::equal
|
||||
#include <stdexcept>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/integer/static_log2.hpp>
|
||||
#include <boost/integer/integer_mask.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/random/detail/config.hpp>
|
||||
#include <boost/random/detail/seed.hpp>
|
||||
#include <boost/random/detail/operators.hpp>
|
||||
#include <boost/random/detail/seed_impl.hpp>
|
||||
#include <boost/random/detail/generator_seed_seq.hpp>
|
||||
#include <boost/random/linear_congruential.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace random {
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct subtract_with_carry_discard
|
||||
{
|
||||
template<class Engine>
|
||||
static void apply(Engine& eng, boost::uintmax_t z)
|
||||
{
|
||||
typedef typename Engine::result_type IntType;
|
||||
const std::size_t short_lag = Engine::short_lag;
|
||||
const std::size_t long_lag = Engine::long_lag;
|
||||
std::size_t k = eng.k;
|
||||
IntType carry = eng.carry;
|
||||
if(k != 0) {
|
||||
// increment k until it becomes 0.
|
||||
if(k < short_lag) {
|
||||
std::size_t limit = (short_lag - k) < z?
|
||||
short_lag : (k + static_cast<std::size_t>(z));
|
||||
for(std::size_t j = k; j < limit; ++j) {
|
||||
carry = eng.do_update(j, j + long_lag - short_lag, carry);
|
||||
}
|
||||
}
|
||||
std::size_t limit = (long_lag - k) < z?
|
||||
long_lag : (k + static_cast<std::size_t>(z));
|
||||
std::size_t start = (k < short_lag ? short_lag : k);
|
||||
for(std::size_t j = start; j < limit; ++j) {
|
||||
carry = eng.do_update(j, j - short_lag, carry);
|
||||
}
|
||||
}
|
||||
|
||||
k = ((z % long_lag) + k) % long_lag;
|
||||
|
||||
if(k < z) {
|
||||
// main loop: update full blocks from k = 0 to long_lag
|
||||
for(std::size_t i = 0; i < (z - k) / long_lag; ++i) {
|
||||
for(std::size_t j = 0; j < short_lag; ++j) {
|
||||
carry = eng.do_update(j, j + long_lag - short_lag, carry);
|
||||
}
|
||||
for(std::size_t j = short_lag; j < long_lag; ++j) {
|
||||
carry = eng.do_update(j, j - short_lag, carry);
|
||||
}
|
||||
}
|
||||
|
||||
// Update the last partial block
|
||||
std::size_t limit = short_lag < k? short_lag : k;
|
||||
for(std::size_t j = 0; j < limit; ++j) {
|
||||
carry = eng.do_update(j, j + long_lag - short_lag, carry);
|
||||
}
|
||||
for(std::size_t j = short_lag; j < k; ++j) {
|
||||
carry = eng.do_update(j, j - short_lag, carry);
|
||||
}
|
||||
}
|
||||
eng.carry = carry;
|
||||
eng.k = k;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiations of @c subtract_with_carry_engine model a
|
||||
* \pseudo_random_number_generator. The algorithm is
|
||||
* described in
|
||||
*
|
||||
* @blockquote
|
||||
* "A New Class of Random Number Generators", George
|
||||
* Marsaglia and Arif Zaman, Annals of Applied Probability,
|
||||
* Volume 1, Number 3 (1991), 462-480.
|
||||
* @endblockquote
|
||||
*/
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
class subtract_with_carry_engine
|
||||
{
|
||||
public:
|
||||
typedef IntType result_type;
|
||||
BOOST_STATIC_CONSTANT(std::size_t, word_size = w);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, long_lag = r);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, short_lag = s);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, default_seed = 19780503u);
|
||||
|
||||
// Required by the old Boost.Random concepts
|
||||
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
|
||||
// Backwards compatibility
|
||||
BOOST_STATIC_CONSTANT(result_type, modulus = (result_type(1) << w));
|
||||
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<result_type>::is_integer);
|
||||
|
||||
/**
|
||||
* Constructs a new @c subtract_with_carry_engine and seeds
|
||||
* it with the default seed.
|
||||
*/
|
||||
subtract_with_carry_engine() { seed(); }
|
||||
/**
|
||||
* Constructs a new @c subtract_with_carry_engine and seeds
|
||||
* it with @c value.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(subtract_with_carry_engine,
|
||||
IntType, value)
|
||||
{ seed(value); }
|
||||
/**
|
||||
* Constructs a new @c subtract_with_carry_engine and seeds
|
||||
* it with values produced by @c seq.generate().
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(subtract_with_carry_engine,
|
||||
SeedSeq, seq)
|
||||
{ seed(seq); }
|
||||
/**
|
||||
* Constructs a new @c subtract_with_carry_engine and seeds
|
||||
* it with values from a range. first is updated to point
|
||||
* one past the last value consumed. If there are not
|
||||
* enough elements in the range to fill the entire state of
|
||||
* the generator, throws @c std::invalid_argument.
|
||||
*/
|
||||
template<class It> subtract_with_carry_engine(It& first, It last)
|
||||
{ seed(first,last); }
|
||||
|
||||
// compiler-generated copy ctor and assignment operator are fine
|
||||
|
||||
/** Seeds the generator with the default seed. */
|
||||
void seed() { seed(default_seed); }
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry_engine,
|
||||
IntType, value)
|
||||
{
|
||||
typedef linear_congruential_engine<uint32_t,40014,0,2147483563> gen_t;
|
||||
gen_t intgen(static_cast<boost::uint32_t>(value == 0 ? default_seed : value));
|
||||
detail::generator_seed_seq<gen_t> gen(intgen);
|
||||
seed(gen);
|
||||
}
|
||||
|
||||
/** Seeds the generator with values produced by @c seq.generate(). */
|
||||
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(subtract_with_carry, SeedSeq, seq)
|
||||
{
|
||||
detail::seed_array_int<w>(seq, x);
|
||||
carry = (x[long_lag-1] == 0);
|
||||
k = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seeds the generator with values from a range. Updates @c first to
|
||||
* point one past the last consumed value. If the range does not
|
||||
* contain enough elements to fill the entire state of the generator,
|
||||
* throws @c std::invalid_argument.
|
||||
*/
|
||||
template<class It>
|
||||
void seed(It& first, It last)
|
||||
{
|
||||
detail::fill_array_int<w>(first, last, x);
|
||||
carry = (x[long_lag-1] == 0);
|
||||
k = 0;
|
||||
}
|
||||
|
||||
/** Returns the smallest value that the generator can produce. */
|
||||
static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{ return 0; }
|
||||
/** Returns the largest value that the generator can produce. */
|
||||
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{ return boost::low_bits_mask_t<w>::sig_bits; }
|
||||
|
||||
/** Returns the next value of the generator. */
|
||||
result_type operator()()
|
||||
{
|
||||
std::size_t short_index =
|
||||
(k < short_lag)?
|
||||
(k + long_lag - short_lag) :
|
||||
(k - short_lag);
|
||||
carry = do_update(k, short_index, carry);
|
||||
IntType result = x[k];
|
||||
++k;
|
||||
if(k >= long_lag)
|
||||
k = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Advances the state of the generator by @c z. */
|
||||
void discard(boost::uintmax_t z)
|
||||
{
|
||||
detail::subtract_with_carry_discard::apply(*this, z);
|
||||
}
|
||||
|
||||
/** Fills a range with random values. */
|
||||
template<class It>
|
||||
void generate(It first, It last)
|
||||
{ detail::generate_from_int(*this, first, last); }
|
||||
|
||||
/** Writes a @c subtract_with_carry_engine to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, subtract_with_carry_engine, f)
|
||||
{
|
||||
for(unsigned int j = 0; j < f.long_lag; ++j)
|
||||
os << f.compute(j) << ' ';
|
||||
os << f.carry;
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads a @c subtract_with_carry_engine from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, subtract_with_carry_engine, f)
|
||||
{
|
||||
for(unsigned int j = 0; j < f.long_lag; ++j)
|
||||
is >> f.x[j] >> std::ws;
|
||||
is >> f.carry;
|
||||
f.k = 0;
|
||||
return is;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the two generators will produce identical
|
||||
* sequences of values.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(subtract_with_carry_engine, x, y)
|
||||
{
|
||||
for(unsigned int j = 0; j < r; ++j)
|
||||
if(x.compute(j) != y.compute(j))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the two generators will produce different
|
||||
* sequences of values.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(subtract_with_carry_engine)
|
||||
|
||||
private:
|
||||
/// \cond show_private
|
||||
// returns x(i-r+index), where index is in 0..r-1
|
||||
IntType compute(unsigned int index) const
|
||||
{
|
||||
return x[(k+index) % long_lag];
|
||||
}
|
||||
|
||||
friend struct detail::subtract_with_carry_discard;
|
||||
|
||||
IntType do_update(std::size_t current, std::size_t short_index, IntType carry)
|
||||
{
|
||||
IntType delta;
|
||||
IntType temp = x[current] + carry;
|
||||
if (x[short_index] >= temp) {
|
||||
// x(n) >= 0
|
||||
delta = x[short_index] - temp;
|
||||
carry = 0;
|
||||
} else {
|
||||
// x(n) < 0
|
||||
delta = modulus - temp + x[short_index];
|
||||
carry = 1;
|
||||
}
|
||||
x[current] = delta;
|
||||
return carry;
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
// state representation; next output (state) is x(i)
|
||||
// x[0] ... x[k] x[k+1] ... x[long_lag-1] represents
|
||||
// x(i-k) ... x(i) x(i+1) ... x(i-k+long_lag-1)
|
||||
// speed: base: 20-25 nsec
|
||||
// ranlux_4: 230 nsec, ranlux_7: 430 nsec, ranlux_14: 810 nsec
|
||||
// This state representation makes operator== and save/restore more
|
||||
// difficult, because we've already computed "too much" and thus
|
||||
// have to undo some steps to get at x(i-r) etc.
|
||||
|
||||
// state representation: next output (state) is x(i)
|
||||
// x[0] ... x[k] x[k+1] ... x[long_lag-1] represents
|
||||
// x(i-k) ... x(i) x(i-long_lag+1) ... x(i-k-1)
|
||||
// speed: base 28 nsec
|
||||
// ranlux_4: 370 nsec, ranlux_7: 688 nsec, ranlux_14: 1343 nsec
|
||||
IntType x[long_lag];
|
||||
std::size_t k;
|
||||
IntType carry;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
// A definition is required even for integral static constants
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const bool subtract_with_carry_engine<IntType, w, s, r>::has_fixed_range;
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const IntType subtract_with_carry_engine<IntType, w, s, r>::modulus;
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const std::size_t subtract_with_carry_engine<IntType, w, s, r>::word_size;
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const std::size_t subtract_with_carry_engine<IntType, w, s, r>::long_lag;
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const std::size_t subtract_with_carry_engine<IntType, w, s, r>::short_lag;
|
||||
template<class IntType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const uint32_t subtract_with_carry_engine<IntType, w, s, r>::default_seed;
|
||||
#endif
|
||||
|
||||
|
||||
// use a floating-point representation to produce values in [0..1)
|
||||
/**
|
||||
* Instantiations of \subtract_with_carry_01_engine model a
|
||||
* \pseudo_random_number_generator. The algorithm is
|
||||
* described in
|
||||
*
|
||||
* @blockquote
|
||||
* "A New Class of Random Number Generators", George
|
||||
* Marsaglia and Arif Zaman, Annals of Applied Probability,
|
||||
* Volume 1, Number 3 (1991), 462-480.
|
||||
* @endblockquote
|
||||
*/
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
class subtract_with_carry_01_engine
|
||||
{
|
||||
public:
|
||||
typedef RealType result_type;
|
||||
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, word_size = w);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, long_lag = r);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, short_lag = s);
|
||||
BOOST_STATIC_CONSTANT(boost::uint32_t, default_seed = 19780503u);
|
||||
|
||||
BOOST_STATIC_ASSERT(!std::numeric_limits<result_type>::is_integer);
|
||||
|
||||
/** Creates a new \subtract_with_carry_01_engine using the default seed. */
|
||||
subtract_with_carry_01_engine() { init_modulus(); seed(); }
|
||||
/** Creates a new subtract_with_carry_01_engine and seeds it with value. */
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(subtract_with_carry_01_engine,
|
||||
boost::uint32_t, value)
|
||||
{ init_modulus(); seed(value); }
|
||||
/**
|
||||
* Creates a new \subtract_with_carry_01_engine and seeds with values
|
||||
* produced by seq.generate().
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(subtract_with_carry_01_engine,
|
||||
SeedSeq, seq)
|
||||
{ init_modulus(); seed(seq); }
|
||||
/**
|
||||
* Creates a new \subtract_with_carry_01_engine and seeds it with values
|
||||
* from a range. Advances first to point one past the last consumed
|
||||
* value. If the range does not contain enough elements to fill the
|
||||
* entire state, throws @c std::invalid_argument.
|
||||
*/
|
||||
template<class It> subtract_with_carry_01_engine(It& first, It last)
|
||||
{ init_modulus(); seed(first,last); }
|
||||
|
||||
private:
|
||||
/// \cond show_private
|
||||
void init_modulus()
|
||||
{
|
||||
#ifndef BOOST_NO_STDC_NAMESPACE
|
||||
// allow for Koenig lookup
|
||||
using std::pow;
|
||||
#endif
|
||||
_modulus = pow(RealType(2), RealType(word_size));
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
public:
|
||||
// compiler-generated copy ctor and assignment operator are fine
|
||||
|
||||
/** Seeds the generator with the default seed. */
|
||||
void seed() { seed(default_seed); }
|
||||
|
||||
/** Seeds the generator with @c value. */
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry_01_engine,
|
||||
boost::uint32_t, value)
|
||||
{
|
||||
typedef linear_congruential_engine<uint32_t, 40014, 0, 2147483563> gen_t;
|
||||
gen_t intgen(value == 0 ? default_seed : value);
|
||||
detail::generator_seed_seq<gen_t> gen(intgen);
|
||||
seed(gen);
|
||||
}
|
||||
|
||||
/** Seeds the generator with values produced by @c seq.generate(). */
|
||||
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(subtract_with_carry_01_engine,
|
||||
SeedSeq, seq)
|
||||
{
|
||||
detail::seed_array_real<w>(seq, x);
|
||||
carry = (x[long_lag-1] ? result_type(0) : result_type(1 / _modulus));
|
||||
k = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seeds the generator with values from a range. Updates first to
|
||||
* point one past the last consumed element. If there are not
|
||||
* enough elements in the range to fill the entire state, throws
|
||||
* @c std::invalid_argument.
|
||||
*/
|
||||
template<class It>
|
||||
void seed(It& first, It last)
|
||||
{
|
||||
detail::fill_array_real<w>(first, last, x);
|
||||
carry = (x[long_lag-1] ? result_type(0) : result_type(1 / _modulus));
|
||||
k = 0;
|
||||
}
|
||||
|
||||
/** Returns the smallest value that the generator can produce. */
|
||||
static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{ return result_type(0); }
|
||||
/** Returns the largest value that the generator can produce. */
|
||||
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{ return result_type(1); }
|
||||
|
||||
/** Returns the next value of the generator. */
|
||||
result_type operator()()
|
||||
{
|
||||
std::size_t short_index =
|
||||
(k < short_lag) ?
|
||||
(k + long_lag - short_lag) :
|
||||
(k - short_lag);
|
||||
carry = do_update(k, short_index, carry);
|
||||
RealType result = x[k];
|
||||
++k;
|
||||
if(k >= long_lag)
|
||||
k = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Advances the state of the generator by @c z. */
|
||||
void discard(boost::uintmax_t z)
|
||||
{ detail::subtract_with_carry_discard::apply(*this, z); }
|
||||
|
||||
/** Fills a range with random values. */
|
||||
template<class Iter>
|
||||
void generate(Iter first, Iter last)
|
||||
{ detail::generate_from_real(*this, first, last); }
|
||||
|
||||
/** Writes a \subtract_with_carry_01_engine to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, subtract_with_carry_01_engine, f)
|
||||
{
|
||||
std::ios_base::fmtflags oldflags =
|
||||
os.flags(os.dec | os.fixed | os.left);
|
||||
for(unsigned int j = 0; j < f.long_lag; ++j)
|
||||
os << (f.compute(j) * f._modulus) << ' ';
|
||||
os << (f.carry * f._modulus);
|
||||
os.flags(oldflags);
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads a \subtract_with_carry_01_engine from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, subtract_with_carry_01_engine, f)
|
||||
{
|
||||
RealType value;
|
||||
for(unsigned int j = 0; j < long_lag; ++j) {
|
||||
is >> value >> std::ws;
|
||||
f.x[j] = value / f._modulus;
|
||||
}
|
||||
is >> value;
|
||||
f.carry = value / f._modulus;
|
||||
f.k = 0;
|
||||
return is;
|
||||
}
|
||||
|
||||
/** Returns true if the two generators will produce identical sequences. */
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(subtract_with_carry_01_engine, x, y)
|
||||
{
|
||||
for(unsigned int j = 0; j < r; ++j)
|
||||
if(x.compute(j) != y.compute(j))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Returns true if the two generators will produce different sequences. */
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(subtract_with_carry_01_engine)
|
||||
|
||||
private:
|
||||
/// \cond show_private
|
||||
RealType compute(unsigned int index) const
|
||||
{
|
||||
return x[(k+index) % long_lag];
|
||||
}
|
||||
|
||||
friend struct detail::subtract_with_carry_discard;
|
||||
|
||||
RealType do_update(std::size_t current, std::size_t short_index, RealType carry)
|
||||
{
|
||||
RealType delta = x[short_index] - x[current] - carry;
|
||||
if(delta < 0) {
|
||||
delta += RealType(1);
|
||||
carry = RealType(1)/_modulus;
|
||||
} else {
|
||||
carry = 0;
|
||||
}
|
||||
x[current] = delta;
|
||||
return carry;
|
||||
}
|
||||
/// \endcond
|
||||
std::size_t k;
|
||||
RealType carry;
|
||||
RealType x[long_lag];
|
||||
RealType _modulus;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
// A definition is required even for integral static constants
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const bool subtract_with_carry_01_engine<RealType, w, s, r>::has_fixed_range;
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const std::size_t subtract_with_carry_01_engine<RealType, w, s, r>::word_size;
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const std::size_t subtract_with_carry_01_engine<RealType, w, s, r>::long_lag;
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const std::size_t subtract_with_carry_01_engine<RealType, w, s, r>::short_lag;
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
const uint32_t subtract_with_carry_01_engine<RealType, w, s, r>::default_seed;
|
||||
#endif
|
||||
|
||||
|
||||
/// \cond show_deprecated
|
||||
|
||||
template<class IntType, IntType m, unsigned s, unsigned r, IntType v>
|
||||
class subtract_with_carry :
|
||||
public subtract_with_carry_engine<IntType,
|
||||
boost::static_log2<m>::value, s, r>
|
||||
{
|
||||
typedef subtract_with_carry_engine<IntType,
|
||||
boost::static_log2<m>::value, s, r> base_type;
|
||||
public:
|
||||
subtract_with_carry() {}
|
||||
BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(subtract_with_carry, Gen, gen)
|
||||
{ seed(gen); }
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(subtract_with_carry,
|
||||
IntType, val)
|
||||
{ seed(val); }
|
||||
template<class It>
|
||||
subtract_with_carry(It& first, It last) : base_type(first, last) {}
|
||||
void seed() { base_type::seed(); }
|
||||
BOOST_RANDOM_DETAIL_GENERATOR_SEED(subtract_with_carry, Gen, gen)
|
||||
{
|
||||
detail::generator_seed_seq<Gen> seq(gen);
|
||||
base_type::seed(seq);
|
||||
}
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry, IntType, val)
|
||||
{ base_type::seed(val); }
|
||||
template<class It>
|
||||
void seed(It& first, It last) { base_type::seed(first, last); }
|
||||
};
|
||||
|
||||
template<class RealType, int w, unsigned s, unsigned r, int v = 0>
|
||||
class subtract_with_carry_01 :
|
||||
public subtract_with_carry_01_engine<RealType, w, s, r>
|
||||
{
|
||||
typedef subtract_with_carry_01_engine<RealType, w, s, r> base_type;
|
||||
public:
|
||||
subtract_with_carry_01() {}
|
||||
BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(subtract_with_carry_01, Gen, gen)
|
||||
{ seed(gen); }
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(subtract_with_carry_01,
|
||||
uint32_t, val)
|
||||
{ seed(val); }
|
||||
template<class It>
|
||||
subtract_with_carry_01(It& first, It last) : base_type(first, last) {}
|
||||
void seed() { base_type::seed(); }
|
||||
BOOST_RANDOM_DETAIL_GENERATOR_SEED(subtract_with_carry_01, Gen, gen)
|
||||
{
|
||||
detail::generator_seed_seq<Gen> seq(gen);
|
||||
base_type::seed(seq);
|
||||
}
|
||||
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry_01, uint32_t, val)
|
||||
{ base_type::seed(val); }
|
||||
template<class It>
|
||||
void seed(It& first, It last) { base_type::seed(first, last); }
|
||||
};
|
||||
|
||||
/// \endcond
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<class Engine>
|
||||
struct generator_bits;
|
||||
|
||||
template<class RealType, std::size_t w, std::size_t s, std::size_t r>
|
||||
struct generator_bits<subtract_with_carry_01_engine<RealType, w, s, r> > {
|
||||
static std::size_t value() { return w; }
|
||||
};
|
||||
|
||||
template<class RealType, int w, unsigned s, unsigned r, int v>
|
||||
struct generator_bits<subtract_with_carry_01<RealType, w, s, r, v> > {
|
||||
static std::size_t value() { return w; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace random
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
|
||||
@@ -0,0 +1,16 @@
|
||||
// Boost common_factor.hpp header file -------------------------------------//
|
||||
|
||||
// (C) Copyright Daryle Walker 2001-2002.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_MATH_COMMON_FACTOR_HPP
|
||||
#define BOOST_MATH_COMMON_FACTOR_HPP
|
||||
|
||||
#include <boost/math/common_factor_ct.hpp>
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
|
||||
#endif // BOOST_MATH_COMMON_FACTOR_HPP
|
||||
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105)
|
||||
#define FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
struct is_mpl_sequence
|
||||
: mpl::and_<
|
||||
mpl::not_<is_convertible<T, from_sequence_convertible_type> >
|
||||
, mpl::is_sequence<T> >
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,967 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
|
||||
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 <typename Try, typename A0, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A0
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A0
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a0
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A1
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A1
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a1
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A2
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A2
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a2
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A3
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A3
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a3
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A4
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A4
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a4
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A5
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A5
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a5
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A6
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A6
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a6
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A7
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A7
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a7
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A8
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A8
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a8
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A9
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A9
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a9
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A10
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A10
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a10
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A11
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A11
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a11
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A12
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A12
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a12
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A13
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A13
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a13
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A14
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A14
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a14
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A15
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A15
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a15
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A16
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A16
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a16
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A17
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A17 , 0 >::type >::type::type &e ) { eval_catch_body(a17, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A17
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a17
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A18
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17 , A18 const& a18, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A17 , 0 >::type >::type::type &e ) { eval_catch_body(a17, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A18 , 0 >::type >::type::type &e ) { eval_catch_body(a18, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A18
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17 , A18 const& a18, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A17 , 0 >::type >::type::type &e ) { eval_catch_body(a17, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a18
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19, typename Context>
|
||||
typename boost::enable_if<
|
||||
proto::matches<
|
||||
A19
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17 , A18 const& a18 , A19 const& a19, Context const & ctx
|
||||
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A17 , 0 >::type >::type::type &e ) { eval_catch_body(a17, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A18 , 0 >::type >::type::type &e ) { eval_catch_body(a18, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A19 , 0 >::type >::type::type &e ) { eval_catch_body(a19, e, ctx); }
|
||||
}
|
||||
template <typename Try, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19, typename Context>
|
||||
typename boost::disable_if<
|
||||
proto::matches<
|
||||
A19
|
||||
, rule::catch_
|
||||
>
|
||||
, result_type
|
||||
>::type
|
||||
operator()(Try const & try_, A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17 , A18 const& a18 , A19 const& a19, Context const & ctx) const
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::phoenix::eval(proto::child_c<0>(try_), ctx);
|
||||
}
|
||||
catch( typename proto::result_of::value< typename proto::result_of::child_c< A0 , 0 >::type >::type::type &e ) { eval_catch_body(a0, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A1 , 0 >::type >::type::type &e ) { eval_catch_body(a1, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A2 , 0 >::type >::type::type &e ) { eval_catch_body(a2, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A3 , 0 >::type >::type::type &e ) { eval_catch_body(a3, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A4 , 0 >::type >::type::type &e ) { eval_catch_body(a4, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A5 , 0 >::type >::type::type &e ) { eval_catch_body(a5, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A6 , 0 >::type >::type::type &e ) { eval_catch_body(a6, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A7 , 0 >::type >::type::type &e ) { eval_catch_body(a7, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A8 , 0 >::type >::type::type &e ) { eval_catch_body(a8, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A9 , 0 >::type >::type::type &e ) { eval_catch_body(a9, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A10 , 0 >::type >::type::type &e ) { eval_catch_body(a10, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A11 , 0 >::type >::type::type &e ) { eval_catch_body(a11, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A12 , 0 >::type >::type::type &e ) { eval_catch_body(a12, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A13 , 0 >::type >::type::type &e ) { eval_catch_body(a13, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A14 , 0 >::type >::type::type &e ) { eval_catch_body(a14, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A15 , 0 >::type >::type::type &e ) { eval_catch_body(a15, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A16 , 0 >::type >::type::type &e ) { eval_catch_body(a16, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A17 , 0 >::type >::type::type &e ) { eval_catch_body(a17, e, ctx); } catch( typename proto::result_of::value< typename proto::result_of::child_c< A18 , 0 >::type >::type::type &e ) { eval_catch_body(a18, e, ctx); }
|
||||
catch(...)
|
||||
{
|
||||
boost::phoenix::eval(
|
||||
proto::child_c<0>(
|
||||
a19
|
||||
)
|
||||
, ctx);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright David Abrahams 2002.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef HANDLE_FWD_DWA2002615_HPP
|
||||
# define HANDLE_FWD_DWA2002615_HPP
|
||||
|
||||
# include <boost/python/detail/prefix.hpp>
|
||||
|
||||
namespace boost { namespace python {
|
||||
|
||||
template <class T = PyObject> class handle;
|
||||
|
||||
}} // namespace boost::python
|
||||
|
||||
#endif // HANDLE_FWD_DWA2002615_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2012-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_BSD_BSDI_H
|
||||
#define BOOST_PREDEF_OS_BSD_BSDI_H
|
||||
|
||||
#include <boost/predef/os/bsd.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_OS_BSD_BSDI`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`__bsdi__`] [__predef_detection__]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
|
||||
defined(__bsdi__) \
|
||||
)
|
||||
# ifndef BOOST_OS_BSD_AVAILABLE
|
||||
# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# define BOOST_OS_BSD_AVAILABLE
|
||||
# endif
|
||||
# undef BOOST_OS_BSD_BSDI
|
||||
# define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_OS_BSD_BSDI
|
||||
# define BOOST_OS_BSD_BSDI_AVAILABLE
|
||||
# include <boost/predef/detail/os_detected.h>
|
||||
#endif
|
||||
|
||||
#define BOOST_OS_BSD_BSDI_NAME "BSDi BSD/OS"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_BSDI,BOOST_OS_BSD_BSDI_NAME)
|
||||
@@ -0,0 +1,16 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
template <
|
||||
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_
|
||||
>
|
||||
struct vector;
|
||||
}}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,144 @@
|
||||
// (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_EVAL_20_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((((a[18] * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<20>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((((((a[19] * x + a[18]) * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file construct_pod_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)
|
||||
template<typename A0>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0) const
|
||||
{
|
||||
Type that = {a0};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1) const
|
||||
{
|
||||
Type that = {a0 , a1};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3 , a4};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3 , a4 , a5};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8};
|
||||
return that;
|
||||
}
|
||||
template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
|
||||
BOOST_FORCEINLINE
|
||||
Type operator ()(A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8 , A9 &a9) const
|
||||
{
|
||||
Type that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9};
|
||||
return that;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
|
||||
// Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED
|
||||
#define BOOST_TT_REMOVE_CONST_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <cstddef> // size_t
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
// convert a type T to a non-cv-qualified type - remove_const<T>
|
||||
template <class T> struct remove_const{ typedef T type; };
|
||||
template <class T> struct remove_const<T const>{ typedef T type; };
|
||||
|
||||
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
||||
template <class T, std::size_t N> struct remove_const<T const[N]>{ typedef T type[N]; };
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
|
||||
template <class T> struct remove_const<T const[]>{ typedef T type[]; };
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED
|
||||
@@ -0,0 +1,385 @@
|
||||
// pdmath.c
|
||||
// Elementary math on probability distributions
|
||||
//
|
||||
// (c) 2016 - Nico Palermo, IV3NWV - Microtelecom Srl, Italy
|
||||
// ------------------------------------------------------------------------------
|
||||
// This file is part of the qracodes project, a Forward Error Control
|
||||
// encoding/decoding package based on Q-ary RA (Repeat and Accumulate) LDPC codes.
|
||||
//
|
||||
// qracodes is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
// qracodes is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with qracodes source distribution.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "pdmath.h"
|
||||
|
||||
typedef const float *ppd_uniform;
|
||||
typedef void (*ppd_imul)(float*,const float*);
|
||||
typedef float (*ppd_norm)(float*);
|
||||
|
||||
// define vector size in function of its logarithm in base 2
|
||||
static const int pd_log2dim[7] = {
|
||||
1,2,4,8,16,32,64
|
||||
};
|
||||
|
||||
// define uniform distributions of given size
|
||||
static const float pd_uniform1[1] = {
|
||||
1.
|
||||
};
|
||||
static const float pd_uniform2[2] = {
|
||||
1./2., 1./2.
|
||||
};
|
||||
static const float pd_uniform4[4] = {
|
||||
1./4., 1./4.,1./4., 1./4.
|
||||
};
|
||||
static const float pd_uniform8[8] = {
|
||||
1./8., 1./8.,1./8., 1./8.,1./8., 1./8.,1./8., 1./8.
|
||||
};
|
||||
static const float pd_uniform16[16] = {
|
||||
1./16., 1./16., 1./16., 1./16.,1./16., 1./16.,1./16., 1./16.,
|
||||
1./16., 1./16., 1./16., 1./16.,1./16., 1./16.,1./16., 1./16.
|
||||
};
|
||||
static const float pd_uniform32[32] = {
|
||||
1./32., 1./32., 1./32., 1./32.,1./32., 1./32.,1./32., 1./32.,
|
||||
1./32., 1./32., 1./32., 1./32.,1./32., 1./32.,1./32., 1./32.,
|
||||
1./32., 1./32., 1./32., 1./32.,1./32., 1./32.,1./32., 1./32.,
|
||||
1./32., 1./32., 1./32., 1./32.,1./32., 1./32.,1./32., 1./32.
|
||||
};
|
||||
static const float pd_uniform64[64] = {
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.,
|
||||
1./64., 1./64., 1./64., 1./64.,1./64., 1./64.,1./64., 1./64.
|
||||
|
||||
};
|
||||
|
||||
static const ppd_uniform pd_uniform_tab[7] = {
|
||||
pd_uniform1,
|
||||
pd_uniform2,
|
||||
pd_uniform4,
|
||||
pd_uniform8,
|
||||
pd_uniform16,
|
||||
pd_uniform32,
|
||||
pd_uniform64
|
||||
};
|
||||
|
||||
// returns a pointer to the uniform distribution of the given logsize
|
||||
const float *pd_uniform(int nlogdim)
|
||||
{
|
||||
return pd_uniform_tab[nlogdim];
|
||||
}
|
||||
|
||||
// in-place multiplication functions
|
||||
// compute dst = dst*src for any element of the distrib
|
||||
|
||||
static void pd_imul1(float *dst, const float *src)
|
||||
{
|
||||
dst[0] *= src[0];
|
||||
}
|
||||
|
||||
static void pd_imul2(float *dst, const float *src)
|
||||
{
|
||||
dst[0] *= src[0]; dst[1] *= src[1];
|
||||
}
|
||||
static void pd_imul4(float *dst, const float *src)
|
||||
{
|
||||
dst[0] *= src[0]; dst[1] *= src[1];
|
||||
dst[2] *= src[2]; dst[3] *= src[3];
|
||||
}
|
||||
static void pd_imul8(float *dst, const float *src)
|
||||
{
|
||||
dst[0] *= src[0]; dst[1] *= src[1]; dst[2] *= src[2]; dst[3] *= src[3];
|
||||
dst[4] *= src[4]; dst[5] *= src[5]; dst[6] *= src[6]; dst[7] *= src[7];
|
||||
}
|
||||
static void pd_imul16(float *dst, const float *src)
|
||||
{
|
||||
dst[0] *= src[0]; dst[1] *= src[1]; dst[2] *= src[2]; dst[3] *= src[3];
|
||||
dst[4] *= src[4]; dst[5] *= src[5]; dst[6] *= src[6]; dst[7] *= src[7];
|
||||
dst[8] *= src[8]; dst[9] *= src[9]; dst[10]*= src[10]; dst[11]*= src[11];
|
||||
dst[12]*= src[12]; dst[13]*= src[13]; dst[14]*= src[14]; dst[15]*= src[15];
|
||||
}
|
||||
static void pd_imul32(float *dst, const float *src)
|
||||
{
|
||||
pd_imul16(dst,src);
|
||||
pd_imul16(dst+16,src+16);
|
||||
}
|
||||
static void pd_imul64(float *dst, const float *src)
|
||||
{
|
||||
pd_imul16(dst, src);
|
||||
pd_imul16(dst+16, src+16);
|
||||
pd_imul16(dst+32, src+32);
|
||||
pd_imul16(dst+48, src+48);
|
||||
}
|
||||
|
||||
static const ppd_imul pd_imul_tab[7] = {
|
||||
pd_imul1,
|
||||
pd_imul2,
|
||||
pd_imul4,
|
||||
pd_imul8,
|
||||
pd_imul16,
|
||||
pd_imul32,
|
||||
pd_imul64
|
||||
};
|
||||
|
||||
// in place multiplication
|
||||
// compute dst = dst*src for any element of the distrib give their log2 size
|
||||
// arguments must be pointers to array of floats of the given size
|
||||
void pd_imul(float *dst, const float *src, int nlogdim)
|
||||
{
|
||||
pd_imul_tab[nlogdim](dst,src);
|
||||
}
|
||||
|
||||
static float pd_norm1(float *ppd)
|
||||
{
|
||||
float t = ppd[0];
|
||||
ppd[0] = 1.f;
|
||||
return t;
|
||||
}
|
||||
|
||||
static float pd_norm2(float *ppd)
|
||||
{
|
||||
float t,to;
|
||||
|
||||
t =ppd[0]; t +=ppd[1];
|
||||
|
||||
if (t<=0) {
|
||||
pd_init(ppd,pd_uniform(1),pd_log2dim[1]);
|
||||
return t;
|
||||
}
|
||||
|
||||
to = t;
|
||||
t = 1.f/t;
|
||||
ppd[0] *=t; ppd[1] *=t;
|
||||
return to;
|
||||
|
||||
}
|
||||
|
||||
static float pd_norm4(float *ppd)
|
||||
{
|
||||
float t,to;
|
||||
|
||||
t =ppd[0]; t +=ppd[1]; t +=ppd[2]; t +=ppd[3];
|
||||
|
||||
if (t<=0) {
|
||||
pd_init(ppd,pd_uniform(2),pd_log2dim[2]);
|
||||
return t;
|
||||
}
|
||||
|
||||
to = t;
|
||||
t = 1.f/t;
|
||||
ppd[0] *=t; ppd[1] *=t; ppd[2] *=t; ppd[3] *=t;
|
||||
return to;
|
||||
}
|
||||
|
||||
static float pd_norm8(float *ppd)
|
||||
{
|
||||
float t,to;
|
||||
|
||||
t =ppd[0]; t +=ppd[1]; t +=ppd[2]; t +=ppd[3];
|
||||
t +=ppd[4]; t +=ppd[5]; t +=ppd[6]; t +=ppd[7];
|
||||
|
||||
if (t<=0) {
|
||||
pd_init(ppd,pd_uniform(3),pd_log2dim[3]);
|
||||
return t;
|
||||
}
|
||||
|
||||
to = t;
|
||||
t = 1.f/t;
|
||||
ppd[0] *=t; ppd[1] *=t; ppd[2] *=t; ppd[3] *=t;
|
||||
ppd[4] *=t; ppd[5] *=t; ppd[6] *=t; ppd[7] *=t;
|
||||
return to;
|
||||
}
|
||||
static float pd_norm16(float *ppd)
|
||||
{
|
||||
float t,to;
|
||||
|
||||
t =ppd[0]; t +=ppd[1]; t +=ppd[2]; t +=ppd[3];
|
||||
t +=ppd[4]; t +=ppd[5]; t +=ppd[6]; t +=ppd[7];
|
||||
t +=ppd[8]; t +=ppd[9]; t +=ppd[10]; t +=ppd[11];
|
||||
t +=ppd[12]; t +=ppd[13]; t +=ppd[14]; t +=ppd[15];
|
||||
|
||||
if (t<=0) {
|
||||
pd_init(ppd,pd_uniform(4),pd_log2dim[4]);
|
||||
return t;
|
||||
}
|
||||
|
||||
to = t;
|
||||
t = 1.f/t;
|
||||
ppd[0] *=t; ppd[1] *=t; ppd[2] *=t; ppd[3] *=t;
|
||||
ppd[4] *=t; ppd[5] *=t; ppd[6] *=t; ppd[7] *=t;
|
||||
ppd[8] *=t; ppd[9] *=t; ppd[10] *=t; ppd[11] *=t;
|
||||
ppd[12] *=t; ppd[13] *=t; ppd[14] *=t; ppd[15] *=t;
|
||||
|
||||
return to;
|
||||
}
|
||||
static float pd_norm32(float *ppd)
|
||||
{
|
||||
float t,to;
|
||||
|
||||
t =ppd[0]; t +=ppd[1]; t +=ppd[2]; t +=ppd[3];
|
||||
t +=ppd[4]; t +=ppd[5]; t +=ppd[6]; t +=ppd[7];
|
||||
t +=ppd[8]; t +=ppd[9]; t +=ppd[10]; t +=ppd[11];
|
||||
t +=ppd[12]; t +=ppd[13]; t +=ppd[14]; t +=ppd[15];
|
||||
t +=ppd[16]; t +=ppd[17]; t +=ppd[18]; t +=ppd[19];
|
||||
t +=ppd[20]; t +=ppd[21]; t +=ppd[22]; t +=ppd[23];
|
||||
t +=ppd[24]; t +=ppd[25]; t +=ppd[26]; t +=ppd[27];
|
||||
t +=ppd[28]; t +=ppd[29]; t +=ppd[30]; t +=ppd[31];
|
||||
|
||||
if (t<=0) {
|
||||
pd_init(ppd,pd_uniform(5),pd_log2dim[5]);
|
||||
return t;
|
||||
}
|
||||
|
||||
to = t;
|
||||
t = 1.f/t;
|
||||
ppd[0] *=t; ppd[1] *=t; ppd[2] *=t; ppd[3] *=t;
|
||||
ppd[4] *=t; ppd[5] *=t; ppd[6] *=t; ppd[7] *=t;
|
||||
ppd[8] *=t; ppd[9] *=t; ppd[10] *=t; ppd[11] *=t;
|
||||
ppd[12] *=t; ppd[13] *=t; ppd[14] *=t; ppd[15] *=t;
|
||||
ppd[16] *=t; ppd[17] *=t; ppd[18] *=t; ppd[19] *=t;
|
||||
ppd[20] *=t; ppd[21] *=t; ppd[22] *=t; ppd[23] *=t;
|
||||
ppd[24] *=t; ppd[25] *=t; ppd[26] *=t; ppd[27] *=t;
|
||||
ppd[28] *=t; ppd[29] *=t; ppd[30] *=t; ppd[31] *=t;
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
static float pd_norm64(float *ppd)
|
||||
{
|
||||
float t,to;
|
||||
|
||||
t =ppd[0]; t +=ppd[1]; t +=ppd[2]; t +=ppd[3];
|
||||
t +=ppd[4]; t +=ppd[5]; t +=ppd[6]; t +=ppd[7];
|
||||
t +=ppd[8]; t +=ppd[9]; t +=ppd[10]; t +=ppd[11];
|
||||
t +=ppd[12]; t +=ppd[13]; t +=ppd[14]; t +=ppd[15];
|
||||
t +=ppd[16]; t +=ppd[17]; t +=ppd[18]; t +=ppd[19];
|
||||
t +=ppd[20]; t +=ppd[21]; t +=ppd[22]; t +=ppd[23];
|
||||
t +=ppd[24]; t +=ppd[25]; t +=ppd[26]; t +=ppd[27];
|
||||
t +=ppd[28]; t +=ppd[29]; t +=ppd[30]; t +=ppd[31];
|
||||
|
||||
t +=ppd[32]; t +=ppd[33]; t +=ppd[34]; t +=ppd[35];
|
||||
t +=ppd[36]; t +=ppd[37]; t +=ppd[38]; t +=ppd[39];
|
||||
t +=ppd[40]; t +=ppd[41]; t +=ppd[42]; t +=ppd[43];
|
||||
t +=ppd[44]; t +=ppd[45]; t +=ppd[46]; t +=ppd[47];
|
||||
t +=ppd[48]; t +=ppd[49]; t +=ppd[50]; t +=ppd[51];
|
||||
t +=ppd[52]; t +=ppd[53]; t +=ppd[54]; t +=ppd[55];
|
||||
t +=ppd[56]; t +=ppd[57]; t +=ppd[58]; t +=ppd[59];
|
||||
t +=ppd[60]; t +=ppd[61]; t +=ppd[62]; t +=ppd[63];
|
||||
|
||||
if (t<=0) {
|
||||
pd_init(ppd,pd_uniform(6),pd_log2dim[6]);
|
||||
return t;
|
||||
}
|
||||
|
||||
to = t;
|
||||
t = 1.0f/t;
|
||||
ppd[0] *=t; ppd[1] *=t; ppd[2] *=t; ppd[3] *=t;
|
||||
ppd[4] *=t; ppd[5] *=t; ppd[6] *=t; ppd[7] *=t;
|
||||
ppd[8] *=t; ppd[9] *=t; ppd[10] *=t; ppd[11] *=t;
|
||||
ppd[12] *=t; ppd[13] *=t; ppd[14] *=t; ppd[15] *=t;
|
||||
ppd[16] *=t; ppd[17] *=t; ppd[18] *=t; ppd[19] *=t;
|
||||
ppd[20] *=t; ppd[21] *=t; ppd[22] *=t; ppd[23] *=t;
|
||||
ppd[24] *=t; ppd[25] *=t; ppd[26] *=t; ppd[27] *=t;
|
||||
ppd[28] *=t; ppd[29] *=t; ppd[30] *=t; ppd[31] *=t;
|
||||
|
||||
ppd[32] *=t; ppd[33] *=t; ppd[34] *=t; ppd[35] *=t;
|
||||
ppd[36] *=t; ppd[37] *=t; ppd[38] *=t; ppd[39] *=t;
|
||||
ppd[40] *=t; ppd[41] *=t; ppd[42] *=t; ppd[43] *=t;
|
||||
ppd[44] *=t; ppd[45] *=t; ppd[46] *=t; ppd[47] *=t;
|
||||
ppd[48] *=t; ppd[49] *=t; ppd[50] *=t; ppd[51] *=t;
|
||||
ppd[52] *=t; ppd[53] *=t; ppd[54] *=t; ppd[55] *=t;
|
||||
ppd[56] *=t; ppd[57] *=t; ppd[58] *=t; ppd[59] *=t;
|
||||
ppd[60] *=t; ppd[61] *=t; ppd[62] *=t; ppd[63] *=t;
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
|
||||
static const ppd_norm pd_norm_tab[7] = {
|
||||
pd_norm1,
|
||||
pd_norm2,
|
||||
pd_norm4,
|
||||
pd_norm8,
|
||||
pd_norm16,
|
||||
pd_norm32,
|
||||
pd_norm64
|
||||
};
|
||||
|
||||
float pd_norm(float *pd, int nlogdim)
|
||||
{
|
||||
return pd_norm_tab[nlogdim](pd);
|
||||
}
|
||||
|
||||
void pd_memset(float *dst, const float *src, int ndim, int nitems)
|
||||
{
|
||||
int size = PD_SIZE(ndim);
|
||||
while(nitems--) {
|
||||
memcpy(dst,src,size);
|
||||
dst +=ndim;
|
||||
}
|
||||
}
|
||||
|
||||
void pd_fwdperm(float *dst, float *src, const int *perm, int ndim)
|
||||
{
|
||||
// TODO: non-loop implementation
|
||||
while (ndim--)
|
||||
dst[ndim] = src[perm[ndim]];
|
||||
}
|
||||
|
||||
void pd_bwdperm(float *dst, float *src, const int *perm, int ndim)
|
||||
{
|
||||
// TODO: non-loop implementation
|
||||
while (ndim--)
|
||||
dst[perm[ndim]] = src[ndim];
|
||||
}
|
||||
|
||||
float pd_max(float *src, int ndim)
|
||||
{
|
||||
// TODO: faster implementation
|
||||
|
||||
float cmax=0; // we assume that prob distributions are always positive
|
||||
float cval;
|
||||
|
||||
while (ndim--) {
|
||||
cval = src[ndim];
|
||||
if (cval>=cmax) {
|
||||
cmax = cval;
|
||||
}
|
||||
}
|
||||
|
||||
return cmax;
|
||||
}
|
||||
|
||||
int pd_argmax(float *pmax, float *src, int ndim)
|
||||
{
|
||||
// TODO: faster implementation
|
||||
|
||||
float cmax=0; // we assume that prob distributions are always positive
|
||||
float cval;
|
||||
int idxmax=-1; // indicates that all pd elements are <0
|
||||
|
||||
while (ndim--) {
|
||||
cval = src[ndim];
|
||||
if (cval>=cmax) {
|
||||
cmax = cval;
|
||||
idxmax = ndim;
|
||||
}
|
||||
}
|
||||
|
||||
if (pmax)
|
||||
*pmax = cmax;
|
||||
|
||||
return idxmax;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
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_EQUAL_TO)
|
||||
#define FUSION_INCLUDE_EQUAL_TO
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
// boost/chrono/round.hpp ------------------------------------------------------------//
|
||||
|
||||
// (C) Copyright Howard Hinnant
|
||||
// Copyright 2011 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/chrono for documentation.
|
||||
|
||||
#ifndef BOOST_CHRONO_CEIL_HPP
|
||||
#define BOOST_CHRONO_CEIL_HPP
|
||||
|
||||
#include <boost/chrono/duration.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace chrono
|
||||
{
|
||||
|
||||
/**
|
||||
* rounds up
|
||||
*/
|
||||
template <class To, class Rep, class Period>
|
||||
To ceil(const duration<Rep, Period>& d)
|
||||
{
|
||||
To t = duration_cast<To>(d);
|
||||
if (t < d)
|
||||
++t;
|
||||
return t;
|
||||
}
|
||||
|
||||
} // namespace chrono
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,99 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/slot/detail/shared.hpp>
|
||||
#
|
||||
# undef BOOST_PP_ITERATION_START_2
|
||||
#
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_1
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_2
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_3
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_4
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_5
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_6
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_7
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_8
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_9
|
||||
# undef BOOST_PP_ITERATION_START_2_DIGIT_10
|
||||
#
|
||||
# if BOOST_PP_SLOT_TEMP_3 == 0
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 0
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 1
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 1
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 2
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 2
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 3
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 3
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 4
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 4
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 5
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 5
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 6
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 6
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 7
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 7
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 8
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 8
|
||||
# elif BOOST_PP_SLOT_TEMP_3 == 9
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_3 9
|
||||
# endif
|
||||
#
|
||||
# if BOOST_PP_SLOT_TEMP_2 == 0
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 0
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 1
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 1
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 2
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 2
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 3
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 3
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 4
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 4
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 5
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 5
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 6
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 6
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 7
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 7
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 8
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 8
|
||||
# elif BOOST_PP_SLOT_TEMP_2 == 9
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_2 9
|
||||
# endif
|
||||
#
|
||||
# if BOOST_PP_SLOT_TEMP_1 == 0
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 0
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 1
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 1
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 2
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 2
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 3
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 3
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 4
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 4
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 5
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 5
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 6
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 6
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 7
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 7
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 8
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 8
|
||||
# elif BOOST_PP_SLOT_TEMP_1 == 9
|
||||
# define BOOST_PP_ITERATION_START_2_DIGIT_1 9
|
||||
# endif
|
||||
#
|
||||
# if BOOST_PP_ITERATION_START_2_DIGIT_3
|
||||
# define BOOST_PP_ITERATION_START_2 BOOST_PP_SLOT_CC_3(BOOST_PP_ITERATION_START_2_DIGIT_3, BOOST_PP_ITERATION_START_2_DIGIT_2, BOOST_PP_ITERATION_START_2_DIGIT_1)
|
||||
# elif BOOST_PP_ITERATION_START_2_DIGIT_2
|
||||
# define BOOST_PP_ITERATION_START_2 BOOST_PP_SLOT_CC_2(BOOST_PP_ITERATION_START_2_DIGIT_2, BOOST_PP_ITERATION_START_2_DIGIT_1)
|
||||
# else
|
||||
# define BOOST_PP_ITERATION_START_2 BOOST_PP_ITERATION_START_2_DIGIT_1
|
||||
# endif
|
||||
@@ -0,0 +1,16 @@
|
||||
/* OPEN.H - Interface to routine for opening file that might be stdin/stdout. */
|
||||
|
||||
/* Copyright (c) 1995-2012 by Radford M. Neal.
|
||||
*
|
||||
* Permission is granted for anyone to copy, use, modify, and distribute
|
||||
* these programs and accompanying documents for any purpose, provided
|
||||
* this copyright notice is retained and prominently displayed, and note
|
||||
* is made of any changes made to these programs. These programs and
|
||||
* documents are distributed without any warranty, express or implied.
|
||||
* As the programs were written for research purposes only, they have not
|
||||
* been tested to the degree that would be advisable in any important
|
||||
* application. All use of these programs is entirely at the user's own
|
||||
* risk.
|
||||
*/
|
||||
|
||||
FILE *open_file_std (char *, char *);
|
||||
@@ -0,0 +1,31 @@
|
||||
// is_evenly_divisible_by.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2009-2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
|
||||
#define BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
|
||||
|
||||
#include <boost/chrono/config.hpp>
|
||||
|
||||
#include <boost/mpl/logical.hpp>
|
||||
#include <boost/ratio/detail/overflow_helpers.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace chrono {
|
||||
namespace chrono_detail {
|
||||
|
||||
// template <class R1, class R2>
|
||||
// struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
|
||||
// {};
|
||||
template <class R1, class R2>
|
||||
struct is_evenly_divisible_by : public boost::ratio_detail::is_evenly_divisible_by<R1, R2>
|
||||
{};
|
||||
|
||||
} // namespace chrono_detail
|
||||
} // namespace detail
|
||||
} // namespace chrono
|
||||
|
||||
#endif // BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
|
||||
@@ -0,0 +1,123 @@
|
||||
|
||||
#ifndef BOOST_MPL_FOR_EACH_HPP_INCLUDED
|
||||
#define BOOST_MPL_FOR_EACH_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2008
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/begin_end.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/next_prior.hpp>
|
||||
#include <boost/mpl/deref.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/aux_/config/gpu.hpp>
|
||||
#include <boost/mpl/aux_/unwrap.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/utility/value_init.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
namespace aux {
|
||||
|
||||
template< bool done = true >
|
||||
struct for_each_impl
|
||||
{
|
||||
template<
|
||||
typename Iterator
|
||||
, typename LastIterator
|
||||
, typename TransformFunc
|
||||
, typename F
|
||||
>
|
||||
BOOST_MPL_CFG_GPU_ENABLED
|
||||
static void execute(
|
||||
Iterator*
|
||||
, LastIterator*
|
||||
, TransformFunc*
|
||||
, F
|
||||
)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct for_each_impl<false>
|
||||
{
|
||||
template<
|
||||
typename Iterator
|
||||
, typename LastIterator
|
||||
, typename TransformFunc
|
||||
, typename F
|
||||
>
|
||||
BOOST_MPL_CFG_GPU_ENABLED
|
||||
static void execute(
|
||||
Iterator*
|
||||
, LastIterator*
|
||||
, TransformFunc*
|
||||
, F f
|
||||
)
|
||||
{
|
||||
typedef typename deref<Iterator>::type item;
|
||||
typedef typename apply1<TransformFunc,item>::type arg;
|
||||
|
||||
// dwa 2002/9/10 -- make sure not to invoke undefined behavior
|
||||
// when we pass arg.
|
||||
value_initialized<arg> x;
|
||||
aux::unwrap(f, 0)(boost::get(x));
|
||||
|
||||
typedef typename mpl::next<Iterator>::type iter;
|
||||
for_each_impl<boost::is_same<iter,LastIterator>::value>
|
||||
::execute( static_cast<iter*>(0), static_cast<LastIterator*>(0), static_cast<TransformFunc*>(0), f);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
// agurt, 17/mar/02: pointer default parameters are necessary to workaround
|
||||
// MSVC 6.5 function template signature's mangling bug
|
||||
template<
|
||||
typename Sequence
|
||||
, typename TransformOp
|
||||
, typename F
|
||||
>
|
||||
BOOST_MPL_CFG_GPU_ENABLED
|
||||
inline
|
||||
void for_each(F f, Sequence* = 0, TransformOp* = 0)
|
||||
{
|
||||
BOOST_MPL_ASSERT(( is_sequence<Sequence> ));
|
||||
|
||||
typedef typename begin<Sequence>::type first;
|
||||
typedef typename end<Sequence>::type last;
|
||||
|
||||
aux::for_each_impl< boost::is_same<first,last>::value >
|
||||
::execute(static_cast<first*>(0), static_cast<last*>(0), static_cast<TransformOp*>(0), f);
|
||||
}
|
||||
|
||||
template<
|
||||
typename Sequence
|
||||
, typename F
|
||||
>
|
||||
BOOST_MPL_CFG_GPU_ENABLED
|
||||
inline
|
||||
void for_each(F f, Sequence* = 0)
|
||||
{
|
||||
// jfalcou: fully qualifying this call so it doesnt clash with phoenix::for_each
|
||||
// ons ome compilers -- done on 02/28/2011
|
||||
boost::mpl::for_each<Sequence, identity<> >(f);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_FOR_EACH_HPP_INCLUDED
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/util/is_resizeable.hpp
|
||||
|
||||
[begin_description]
|
||||
Metafunction to determine if a state type can resized. For usage in the steppers.
|
||||
[end_description]
|
||||
|
||||
Copyright 2011-2012 Karsten Ahnert
|
||||
Copyright 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_UTIL_IS_RESIZEABLE_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/fusion/include/front.hpp>
|
||||
#include <boost/fusion/include/is_sequence.hpp>
|
||||
|
||||
#include <boost/mpl/find_if.hpp>
|
||||
#include <boost/mpl/end.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
/*
|
||||
* by default any type is not resizable
|
||||
*/
|
||||
template< typename Container , typename Enabler = void >
|
||||
struct is_resizeable_sfinae : boost::false_type {};
|
||||
|
||||
template< typename Container >
|
||||
struct is_resizeable : is_resizeable_sfinae< Container > {};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* specialization for std::vector
|
||||
*/
|
||||
template< class V, class A >
|
||||
struct is_resizeable< std::vector< V , A > > : boost::true_type {};
|
||||
|
||||
|
||||
/*
|
||||
* sfinae specialization for fusion sequences
|
||||
*/
|
||||
template< typename FusionSequence >
|
||||
struct is_resizeable_sfinae<
|
||||
FusionSequence ,
|
||||
typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type >
|
||||
{
|
||||
typedef typename boost::mpl::find_if< FusionSequence , is_resizeable< boost::mpl::_1 > >::type iter;
|
||||
typedef typename boost::mpl::end< FusionSequence >::type last;
|
||||
|
||||
typedef typename boost::mpl::if_< boost::is_same< iter , last > , boost::false_type , boost::true_type >::type type;
|
||||
const static bool value = type::value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED
|
||||
@@ -0,0 +1,474 @@
|
||||
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#include <boost/proto/detail/preprocessed/expr_variadic.hpp>
|
||||
#else
|
||||
#include <boost/proto/detail/preprocessed/expr.hpp>
|
||||
#endif
|
||||
|
||||
#elif !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
#define BOOST_PROTO_CHILD(Z, N, DATA) \
|
||||
typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
|
||||
BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
|
||||
/**< INTERNAL ONLY */
|
||||
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
#define BOOST_PROTO_VOID(Z, N, DATA) \
|
||||
typedef void BOOST_PP_CAT(proto_child, N); \
|
||||
/**< INTERNAL ONLY */
|
||||
|
||||
// Generate variadic versions of expr
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/expr_variadic.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file expr_variadic.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)
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
// The expr<> specializations are actually defined here.
|
||||
#define BOOST_PROTO_DEFINE_TERMINAL
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, 0, <boost/proto/detail/expr.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_PROTO_DEFINE_TERMINAL
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
// Generate non-variadic versions of expr
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/expr.hpp")
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \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)
|
||||
|
||||
#pragma wave option(preserve: 1)
|
||||
|
||||
// The expr<> specializations are actually defined here.
|
||||
#define BOOST_PROTO_DEFINE_TERMINAL
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/proto/detail/expr.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_PROTO_DEFINE_TERMINAL
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/expr.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#pragma wave option(output: null)
|
||||
#undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#endif
|
||||
|
||||
#undef BOOST_PROTO_CHILD
|
||||
#undef BOOST_PROTO_VOID
|
||||
|
||||
#else
|
||||
|
||||
#define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION())
|
||||
|
||||
/// \brief Representation of a node in an expression tree.
|
||||
///
|
||||
/// \c proto::expr\<\> is a node in an expression template tree. It
|
||||
/// is a container for its child sub-trees. It also serves as
|
||||
/// the terminal nodes of the tree.
|
||||
///
|
||||
/// \c Tag is type that represents the operation encoded by
|
||||
/// this expression. It is typically one of the structs
|
||||
/// in the \c boost::proto::tag namespace, but it doesn't
|
||||
/// have to be.
|
||||
///
|
||||
/// \c Args is a type list representing the type of the children
|
||||
/// of this expression. It is an instantiation of one
|
||||
/// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The
|
||||
/// child types must all themselves be either \c expr\<\>
|
||||
/// or <tt>proto::expr\<\>&</tt>. If \c Args is an
|
||||
/// instantiation of \c proto::term\<\> then this
|
||||
/// \c expr\<\> type represents a terminal expression;
|
||||
/// the parameter to the \c proto::term\<\> template
|
||||
/// represents the terminal's value type.
|
||||
///
|
||||
/// \c Arity is an integral constant representing the number of child
|
||||
/// nodes this node contains. If \c Arity is 0, then this
|
||||
/// node is a terminal.
|
||||
///
|
||||
/// \c proto::expr\<\> is a valid Fusion random-access sequence, where
|
||||
/// the elements of the sequence are the child expressions.
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
template<typename Tag, typename Arg0>
|
||||
struct expr<Tag, term<Arg0>, 0>
|
||||
#else
|
||||
template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
|
||||
struct expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
|
||||
#endif
|
||||
{
|
||||
typedef Tag proto_tag;
|
||||
static const long proto_arity_c = BOOST_PP_ITERATION();
|
||||
typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
|
||||
typedef expr proto_base_expr;
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
typedef term<Arg0> proto_args;
|
||||
#else
|
||||
typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
|
||||
#endif
|
||||
typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar;
|
||||
typedef default_domain proto_domain;
|
||||
typedef default_generator proto_generator;
|
||||
typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
|
||||
typedef expr proto_derived_expr;
|
||||
typedef void proto_is_expr_; /**< INTERNAL ONLY */
|
||||
|
||||
BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~)
|
||||
BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~)
|
||||
|
||||
/// \return *this
|
||||
///
|
||||
BOOST_FORCEINLINE
|
||||
expr const &proto_base() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
BOOST_FORCEINLINE
|
||||
expr &proto_base()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
/// \return A new \c expr\<\> object initialized with the specified
|
||||
/// arguments.
|
||||
///
|
||||
template<typename A0>
|
||||
BOOST_FORCEINLINE
|
||||
static expr const make(A0 &a0)
|
||||
{
|
||||
return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename A0>
|
||||
BOOST_FORCEINLINE
|
||||
static expr const make(A0 const &a0)
|
||||
{
|
||||
return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
|
||||
}
|
||||
#else
|
||||
/// \return A new \c expr\<\> object initialized with the specified
|
||||
/// arguments.
|
||||
///
|
||||
template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)>
|
||||
BOOST_FORCEINLINE
|
||||
static expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a))
|
||||
{
|
||||
expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)};
|
||||
return that;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 1 == BOOST_PP_ITERATION()
|
||||
/// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is
|
||||
/// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>.
|
||||
/// Otherwise, it is some undefined type.
|
||||
typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
|
||||
|
||||
/// \return The address of <tt>this->child0</tt> if \c Tag is
|
||||
/// \c boost::proto::tag::address_of. Otherwise, this function will
|
||||
/// fail to compile.
|
||||
///
|
||||
/// \attention Proto overloads <tt>operator&</tt>, which means that
|
||||
/// proto-ified objects cannot have their addresses taken, unless we use
|
||||
/// the following hack to make \c &x implicitly convertible to \c X*.
|
||||
BOOST_FORCEINLINE
|
||||
operator address_of_hack_type_() const
|
||||
{
|
||||
return boost::addressof(this->child0);
|
||||
}
|
||||
#else
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
typedef detail::not_a_valid_type address_of_hack_type_;
|
||||
#endif
|
||||
|
||||
/// Assignment
|
||||
///
|
||||
/// \param a The rhs.
|
||||
/// \return A new \c expr\<\> node representing an assignment of \c that to \c *this.
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr &, expr const &>
|
||||
, 2
|
||||
> const
|
||||
operator =(expr const &a)
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr &, expr const &>
|
||||
, 2
|
||||
> that = {*this, a};
|
||||
return that;
|
||||
}
|
||||
|
||||
/// Assignment
|
||||
///
|
||||
/// \param a The rhs.
|
||||
/// \return A new \c expr\<\> node representing an assignment of \c a to \c *this.
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr const &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> const
|
||||
operator =(A &a) const
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr const &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr const &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> const
|
||||
operator =(A const &a) const
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr const &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
/// \overload
|
||||
///
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> const
|
||||
operator =(A &a)
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> const
|
||||
operator =(A const &a)
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::assign
|
||||
, list2<expr &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Subscript
|
||||
///
|
||||
/// \param a The rhs.
|
||||
/// \return A new \c expr\<\> node representing \c *this subscripted with \c a.
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr const &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> const
|
||||
operator [](A &a) const
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr const &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr const &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> const
|
||||
operator [](A const &a) const
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr const &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
/// \overload
|
||||
///
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> const
|
||||
operator [](A &a)
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr &, typename result_of::as_child<A>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename A>
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> const
|
||||
operator [](A const &a)
|
||||
{
|
||||
proto::expr<
|
||||
proto::tag::subscript
|
||||
, list2<expr &, typename result_of::as_child<A const>::type>
|
||||
, 2
|
||||
> that = {*this, proto::as_child(a)};
|
||||
return that;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Encodes the return type of \c expr\<\>::operator(), for use with \c boost::result_of\<\>
|
||||
///
|
||||
template<typename Sig>
|
||||
struct result
|
||||
{
|
||||
typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
/// \overload
|
||||
///
|
||||
template<typename ...A>
|
||||
BOOST_FORCEINLINE
|
||||
typename result_of::funop<
|
||||
expr const(A const &...)
|
||||
, expr
|
||||
, default_domain
|
||||
>::type const
|
||||
operator ()(A const &... a) const
|
||||
{
|
||||
return result_of::funop<
|
||||
expr const(A const &...)
|
||||
, expr
|
||||
, default_domain
|
||||
>::call(*this, a...);
|
||||
}
|
||||
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
/// \overload
|
||||
///
|
||||
template<typename ...A>
|
||||
BOOST_FORCEINLINE
|
||||
typename result_of::funop<
|
||||
expr(A const &...)
|
||||
, expr
|
||||
, default_domain
|
||||
>::type const
|
||||
operator ()(A const &... a)
|
||||
{
|
||||
return result_of::funop<
|
||||
expr(A const &...)
|
||||
, expr
|
||||
, default_domain
|
||||
>::call(*this, a...);
|
||||
}
|
||||
#endif
|
||||
|
||||
#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
|
||||
/// Function call
|
||||
///
|
||||
/// \return A new \c expr\<\> node representing the function invocation of \c (*this)().
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<proto::tag::function, list1<expr const &>, 1> const
|
||||
operator ()() const
|
||||
{
|
||||
proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
|
||||
return that;
|
||||
}
|
||||
|
||||
#ifdef BOOST_PROTO_DEFINE_TERMINAL
|
||||
/// \overload
|
||||
///
|
||||
BOOST_FORCEINLINE
|
||||
proto::expr<proto::tag::function, list1<expr &>, 1> const
|
||||
operator ()()
|
||||
{
|
||||
proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this};
|
||||
return that;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (1, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/expr_funop.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef ARG_COUNT
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
#ifndef BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED
|
||||
#define BOOST_MPL_LIST_LIST20_C_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$
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/list/list10_c.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER list20_c.hpp
|
||||
# include <boost/mpl/list/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(11, 20, <boost/mpl/list/aux_/numbered_c.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
|
||||
#endif // BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
* Copyright (c) 2014 Andrey Semashev
|
||||
*/
|
||||
/*!
|
||||
* \file atomic/detail/ops_emulated.hpp
|
||||
*
|
||||
* This header contains lockpool-based implementation of the \c operations template.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_ATOMIC_DETAIL_OPS_EMULATED_HPP_INCLUDED_
|
||||
#define BOOST_ATOMIC_DETAIL_OPS_EMULATED_HPP_INCLUDED_
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/memory_order.hpp>
|
||||
#include <boost/atomic/detail/config.hpp>
|
||||
#include <boost/atomic/detail/storage_type.hpp>
|
||||
#include <boost/atomic/detail/operations_fwd.hpp>
|
||||
#include <boost/atomic/detail/lockpool.hpp>
|
||||
#include <boost/atomic/capabilities.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace atomics {
|
||||
namespace detail {
|
||||
|
||||
template< typename T >
|
||||
struct emulated_operations
|
||||
{
|
||||
typedef T storage_type;
|
||||
|
||||
static BOOST_CONSTEXPR_OR_CONST bool is_always_lock_free = false;
|
||||
|
||||
static BOOST_FORCEINLINE void store(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
const_cast< storage_type& >(storage) = v;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type load(storage_type const volatile& storage, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
return const_cast< storage_type const& >(storage);
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
s += v;
|
||||
return old_val;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
s -= v;
|
||||
return old_val;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type exchange(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
s = v;
|
||||
return old_val;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE bool compare_exchange_strong(
|
||||
storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
const bool res = old_val == expected;
|
||||
if (res)
|
||||
s = desired;
|
||||
expected = old_val;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE bool compare_exchange_weak(
|
||||
storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
// Note: This function is the exact copy of compare_exchange_strong. The reason we're not just forwarding the call
|
||||
// is that MSVC-12 ICEs in this case.
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
const bool res = old_val == expected;
|
||||
if (res)
|
||||
s = desired;
|
||||
expected = old_val;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
s &= v;
|
||||
return old_val;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type fetch_or(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
s |= v;
|
||||
return old_val;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE storage_type fetch_xor(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
|
||||
{
|
||||
storage_type& s = const_cast< storage_type& >(storage);
|
||||
lockpool::scoped_lock lock(&storage);
|
||||
storage_type old_val = s;
|
||||
s ^= v;
|
||||
return old_val;
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE bool test_and_set(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
|
||||
{
|
||||
return !!exchange(storage, (storage_type)1, order);
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE void clear(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
|
||||
{
|
||||
store(storage, (storage_type)0, order);
|
||||
}
|
||||
|
||||
static BOOST_FORCEINLINE bool is_lock_free(storage_type const volatile&) BOOST_NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
template< std::size_t Size, bool Signed >
|
||||
struct operations :
|
||||
public emulated_operations< typename make_storage_type< Size, Signed >::type >
|
||||
{
|
||||
typedef typename make_storage_type< Size, Signed >::aligned aligned_storage_type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace atomics
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_ATOMIC_DETAIL_OPS_EMULATED_HPP_INCLUDED_
|
||||
@@ -0,0 +1,114 @@
|
||||
/* Copyright 2003-2015 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_ORDERED_INDEX_HPP
|
||||
#define BOOST_MULTI_INDEX_ORDERED_INDEX_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/multi_index/detail/ord_index_impl.hpp>
|
||||
#include <boost/multi_index/ordered_index_fwd.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
/* no augment policy for plain ordered indices */
|
||||
|
||||
struct null_augment_policy
|
||||
{
|
||||
template<typename OrderedIndexImpl>
|
||||
struct augmented_interface
|
||||
{
|
||||
typedef OrderedIndexImpl type;
|
||||
};
|
||||
|
||||
template<typename OrderedIndexNodeImpl>
|
||||
struct augmented_node
|
||||
{
|
||||
typedef OrderedIndexNodeImpl type;
|
||||
};
|
||||
|
||||
template<typename Pointer> static void add(Pointer,Pointer){}
|
||||
template<typename Pointer> static void remove(Pointer,Pointer){}
|
||||
template<typename Pointer> static void copy(Pointer,Pointer){}
|
||||
template<typename Pointer> static void rotate_left(Pointer,Pointer){}
|
||||
template<typename Pointer> static void rotate_right(Pointer,Pointer){}
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)
|
||||
/* invariant stuff */
|
||||
|
||||
template<typename Pointer> static bool invariant(Pointer){return true;}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
/* ordered_index specifiers */
|
||||
|
||||
template<typename Arg1,typename Arg2,typename Arg3>
|
||||
struct ordered_unique
|
||||
{
|
||||
typedef typename detail::ordered_index_args<
|
||||
Arg1,Arg2,Arg3> index_args;
|
||||
typedef typename index_args::tag_list_type::type tag_list_type;
|
||||
typedef typename index_args::key_from_value_type key_from_value_type;
|
||||
typedef typename index_args::compare_type compare_type;
|
||||
|
||||
template<typename Super>
|
||||
struct node_class
|
||||
{
|
||||
typedef detail::ordered_index_node<detail::null_augment_policy,Super> type;
|
||||
};
|
||||
|
||||
template<typename SuperMeta>
|
||||
struct index_class
|
||||
{
|
||||
typedef detail::ordered_index<
|
||||
key_from_value_type,compare_type,
|
||||
SuperMeta,tag_list_type,detail::ordered_unique_tag,
|
||||
detail::null_augment_policy> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<typename Arg1,typename Arg2,typename Arg3>
|
||||
struct ordered_non_unique
|
||||
{
|
||||
typedef detail::ordered_index_args<
|
||||
Arg1,Arg2,Arg3> index_args;
|
||||
typedef typename index_args::tag_list_type::type tag_list_type;
|
||||
typedef typename index_args::key_from_value_type key_from_value_type;
|
||||
typedef typename index_args::compare_type compare_type;
|
||||
|
||||
template<typename Super>
|
||||
struct node_class
|
||||
{
|
||||
typedef detail::ordered_index_node<detail::null_augment_policy,Super> type;
|
||||
};
|
||||
|
||||
template<typename SuperMeta>
|
||||
struct index_class
|
||||
{
|
||||
typedef detail::ordered_index<
|
||||
key_from_value_type,compare_type,
|
||||
SuperMeta,tag_list_type,detail::ordered_non_unique_tag,
|
||||
detail::null_augment_policy> type;
|
||||
};
|
||||
};
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
7
|
||||
2 3 4 5 7 14 15
|
||||
0.477081 0.280572 0.0349963 0.0963301 0.0090884 0.00137443 0.10055777
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
|
||||
// Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
|
||||
#define BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
// * convert a type T to volatile type - add_volatile<T>
|
||||
// this is not required since the result is always
|
||||
// the same as "T volatile", but it does suppress warnings
|
||||
// from some compilers:
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
// This bogus warning will appear when add_volatile is applied to a
|
||||
// const volatile reference because we can't detect const volatile
|
||||
// references with MSVC6.
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
|
||||
#endif
|
||||
|
||||
template <class T> struct add_volatile{ typedef T volatile type; };
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
template <class T> struct add_volatile<T&>{ typedef T& type; };
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef HINTED_SPIN_BOX_HPP_
|
||||
#define HINTED_SPIN_BOX_HPP_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QSpinBox>
|
||||
|
||||
//
|
||||
// HintedSpinBox - QSpinBox refinement with an optional sequence of
|
||||
// discrete hints
|
||||
//
|
||||
// The hint sequence values are used as step values and can
|
||||
// optionally define the minimum and maximum value. Intermediate
|
||||
// values are allowed but the step up/down arrows and accelerator
|
||||
// keys will only use the hints.
|
||||
//
|
||||
// Ensure that the default minimum and maximum values are sufficient
|
||||
// to allow initial initialization if done before the hints are set.
|
||||
//
|
||||
class HintedSpinBox
|
||||
: public QSpinBox
|
||||
{
|
||||
public:
|
||||
typedef std::vector<int> values_type;
|
||||
|
||||
HintedSpinBox (QWidget * parent = nullptr)
|
||||
: QSpinBox {parent}
|
||||
{
|
||||
}
|
||||
|
||||
// Initialize sequence of values allowed.
|
||||
//
|
||||
// This spin box behaves exactly as a standard QSpinBox if the
|
||||
// sequence of values is empty.
|
||||
//
|
||||
// The minimum and maximum are automatically set to the lowest and
|
||||
// highest value provided if required.
|
||||
//
|
||||
// Returns the previous sequence.
|
||||
values_type values (values_type values, bool set_min_max = true);
|
||||
|
||||
// Read access to the values.
|
||||
values_type const& values () const {return values_;}
|
||||
|
||||
protected:
|
||||
// override the QSpinBox stepping
|
||||
void stepBy (int steps) override;
|
||||
|
||||
private:
|
||||
std::vector<int> values_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
snr psuccess ntrials 1000, r6315, r6333
|
||||
-26.0 0.010 0.022
|
||||
-25.5 0.052 0.097
|
||||
-25.0 0.22 0.262
|
||||
-24.5 0.51 0.535
|
||||
-24.0 0.80 0.844
|
||||
-23.5 0.956 0.968
|
||||
-23.0 0.9958 0.9963
|
||||
-22.5 1.0 1.0
|
||||
Reference in New Issue
Block a user