Initial Commit
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Neil Groves 2010. 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_ADAPTOR_TYPE_ERASED_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ADAPTOR_TYPE_ERASED_HPP_INCLUDED
|
||||
|
||||
#include <boost/range/reference.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/range/iterator_range_core.hpp>
|
||||
#include <boost/range/any_range.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace adaptors
|
||||
{
|
||||
template<
|
||||
class Value = use_default
|
||||
, class Traversal = use_default
|
||||
, class Reference = use_default
|
||||
, class Difference = use_default
|
||||
, class Buffer = use_default
|
||||
>
|
||||
struct type_erased
|
||||
{
|
||||
};
|
||||
|
||||
template<
|
||||
class SinglePassRange
|
||||
, class Value
|
||||
, class Traversal
|
||||
, class Reference
|
||||
, class Difference
|
||||
, class Buffer
|
||||
>
|
||||
typename any_range_type_generator<
|
||||
SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type
|
||||
operator|(SinglePassRange& rng,
|
||||
type_erased<
|
||||
Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<SinglePassRange>));
|
||||
|
||||
typedef typename any_range_type_generator<
|
||||
SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type range_type;
|
||||
return range_type(boost::begin(rng), boost::end(rng));
|
||||
}
|
||||
|
||||
template<
|
||||
class SinglePassRange
|
||||
, class Value
|
||||
, class Traversal
|
||||
, class Reference
|
||||
, class Difference
|
||||
, class Buffer
|
||||
>
|
||||
typename any_range_type_generator<
|
||||
const SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type
|
||||
operator|(const SinglePassRange& rng,
|
||||
type_erased<
|
||||
Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<const SinglePassRange>));
|
||||
|
||||
typedef typename any_range_type_generator<
|
||||
const SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type range_type;
|
||||
return range_type(boost::begin(rng), boost::end(rng));
|
||||
}
|
||||
|
||||
template<
|
||||
class SinglePassRange
|
||||
, class Value
|
||||
, class Traversal
|
||||
, class Reference
|
||||
, class Difference
|
||||
, class Buffer
|
||||
>
|
||||
typename any_range_type_generator<
|
||||
SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type
|
||||
type_erase(SinglePassRange& rng
|
||||
, type_erased<
|
||||
Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
> = type_erased<>()
|
||||
)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<SinglePassRange>));
|
||||
|
||||
typedef typename any_range_type_generator<
|
||||
SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type range_type;
|
||||
|
||||
return range_type(boost::begin(rng), boost::end(rng));
|
||||
}
|
||||
|
||||
template<
|
||||
class SinglePassRange
|
||||
, class Value
|
||||
, class Traversal
|
||||
, class Reference
|
||||
, class Difference
|
||||
, class Buffer
|
||||
>
|
||||
typename any_range_type_generator<
|
||||
const SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type
|
||||
type_erase(const SinglePassRange& rng
|
||||
, type_erased<
|
||||
Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
> = type_erased<>()
|
||||
)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<const SinglePassRange>));
|
||||
|
||||
typedef typename any_range_type_generator<
|
||||
const SinglePassRange
|
||||
, Value
|
||||
, Traversal
|
||||
, Reference
|
||||
, Difference
|
||||
, Buffer
|
||||
>::type range_type;
|
||||
|
||||
return range_type(boost::begin(rng), boost::end(rng));
|
||||
}
|
||||
}
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,22 @@
|
||||
// (C) Copyright John Maddock 2003.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//
|
||||
// Boost binaries are built with the compiler's default ABI settings,
|
||||
// if the user changes their default alignment in the VS IDE then their
|
||||
// code will no longer be binary compatible with the bjam built binaries
|
||||
// unless this header is included to force Boost code into a consistent ABI.
|
||||
//
|
||||
// Note that inclusion of this header is only necessary for libraries with
|
||||
// separate source, header only libraries DO NOT need this as long as all
|
||||
// translation units are built with the same options.
|
||||
//
|
||||
#if defined(_M_X64)
|
||||
# pragma pack(push,16)
|
||||
#else
|
||||
# pragma pack(push,8)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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 REGISTERED_POINTEE_DWA2002710_HPP
|
||||
# define REGISTERED_POINTEE_DWA2002710_HPP
|
||||
# include <boost/python/converter/registered.hpp>
|
||||
# include <boost/python/converter/pointer_type_id.hpp>
|
||||
# include <boost/python/converter/registry.hpp>
|
||||
# include <boost/type_traits/transform_traits.hpp>
|
||||
# include <boost/type_traits/cv_traits.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace converter {
|
||||
|
||||
struct registration;
|
||||
|
||||
template <class T>
|
||||
struct registered_pointee
|
||||
: registered<
|
||||
typename remove_pointer<
|
||||
typename remove_cv<
|
||||
typename remove_reference<T>::type
|
||||
>::type
|
||||
>::type
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::python::converter
|
||||
|
||||
#endif // REGISTERED_POINTEE_DWA2002710_HPP
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
#ifndef BOOST_MPL_MAP_AUX_VALUE_TYPE_IMPL_HPP_INCLUDED
|
||||
#define BOOST_MPL_MAP_AUX_VALUE_TYPE_IMPL_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
// Copyright David Abrahams 2003-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/value_type_fwd.hpp>
|
||||
#include <boost/mpl/pair.hpp>
|
||||
#include <boost/mpl/map/aux_/tag.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace mpl {
|
||||
|
||||
template<>
|
||||
struct value_type_impl< aux::map_tag >
|
||||
{
|
||||
template< typename Map, typename T > struct apply
|
||||
: second<T>
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_MAP_AUX_VALUE_TYPE_IMPL_HPP_INCLUDED
|
||||
@@ -0,0 +1,172 @@
|
||||
module jt9_decode
|
||||
|
||||
type :: jt9_decoder
|
||||
procedure(jt9_decode_callback), pointer :: callback
|
||||
contains
|
||||
procedure :: decode
|
||||
end type jt9_decoder
|
||||
|
||||
abstract interface
|
||||
subroutine jt9_decode_callback (this, sync, snr, dt, freq, drift, &
|
||||
decoded)
|
||||
import jt9_decoder
|
||||
implicit none
|
||||
class(jt9_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
real, intent(in) :: freq
|
||||
integer, intent(in) :: drift
|
||||
character(len=22), intent(in) :: decoded
|
||||
end subroutine jt9_decode_callback
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine decode(this,callback,ss,id2,nfqso,newdat,npts8,nfa, &
|
||||
nfsplit,nfb,ntol,nzhsym,nagain,ndepth,nmode,nsubmode,nexp_decode)
|
||||
use timer_module, only: timer
|
||||
|
||||
include 'constants.f90'
|
||||
class(jt9_decoder), intent(inout) :: this
|
||||
procedure(jt9_decode_callback) :: callback
|
||||
real ss(184,NSMAX)
|
||||
logical, intent(in) :: newdat, nagain
|
||||
character*22 msg
|
||||
real*4 ccfred(NSMAX)
|
||||
real*4 red2(NSMAX)
|
||||
logical ccfok(NSMAX)
|
||||
logical done(NSMAX)
|
||||
integer*2 id2(NTMAX*12000)
|
||||
integer*1 i1SoftSymbols(207)
|
||||
common/decstats/ntry65a,ntry65b,n65a,n65b,num9,numfano
|
||||
save ccfred,red2
|
||||
|
||||
if(nexp_decode.eq.-99) stop !Silence compiler warning
|
||||
this%callback => callback
|
||||
if(nmode.eq.9 .and. nsubmode.ge.1) then
|
||||
call decode9w(nfqso,ntol,nsubmode,ss,id2,sync,nsnr,xdt,freq,msg)
|
||||
if (associated(this%callback)) then
|
||||
ndrift=0
|
||||
call this%callback(sync,nsnr,xdt,freq,ndrift,msg)
|
||||
end if
|
||||
go to 999
|
||||
endif
|
||||
|
||||
nsynced=0
|
||||
ndecoded=0
|
||||
nsps=6912 !Params for JT9-1
|
||||
df3=1500.0/2048.0
|
||||
|
||||
tstep=0.5*nsps/12000.0 !Half-symbol step (seconds)
|
||||
done=.false.
|
||||
|
||||
nf0=0
|
||||
nf1=nfa
|
||||
if(nmode.eq.65+9) nf1=nfsplit
|
||||
ia=max(1,nint((nf1-nf0)/df3))
|
||||
ib=min(NSMAX,nint((nfb-nf0)/df3))
|
||||
lag1=-int(2.5/tstep + 0.9999)
|
||||
lag2=int(5.0/tstep + 0.9999)
|
||||
if(newdat) then
|
||||
call timer('sync9 ',0)
|
||||
call sync9(ss,nzhsym,lag1,lag2,ia,ib,ccfred,red2,ipk)
|
||||
call timer('sync9 ',1)
|
||||
endif
|
||||
|
||||
nsps8=nsps/8
|
||||
df8=1500.0/nsps8
|
||||
dblim=db(864.0/nsps8) - 26.2
|
||||
|
||||
ia1=1 !quel compiler gripe
|
||||
ib1=1 !quel compiler gripe
|
||||
do nqd=1,0,-1
|
||||
limit=5000
|
||||
ccflim=3.0
|
||||
red2lim=1.6
|
||||
schklim=2.2
|
||||
if(iand(ndepth,7).eq.2) then
|
||||
limit=10000
|
||||
ccflim=2.7
|
||||
endif
|
||||
if(iand(ndepth,7).eq.3 .or. nqd.eq.1) then
|
||||
limit=30000
|
||||
ccflim=2.5
|
||||
schklim=2.0
|
||||
endif
|
||||
if(nagain) then
|
||||
limit=100000
|
||||
ccflim=2.4
|
||||
schklim=1.8
|
||||
endif
|
||||
ccfok=.false.
|
||||
|
||||
if(nqd.eq.1) then
|
||||
nfa1=nfqso-ntol
|
||||
nfb1=nfqso+ntol
|
||||
ia=max(1,nint((nfa1-nf0)/df3))
|
||||
ib=min(NSMAX,nint((nfb1-nf0)/df3))
|
||||
ccfok(ia:ib)=(ccfred(ia:ib).gt.(ccflim-2.0)) .and. &
|
||||
(red2(ia:ib).gt.(red2lim-1.0))
|
||||
ia1=ia
|
||||
ib1=ib
|
||||
else
|
||||
nfa1=nf1
|
||||
nfb1=nfb
|
||||
ia=max(1,nint((nfa1-nf0)/df3))
|
||||
ib=min(NSMAX,nint((nfb1-nf0)/df3))
|
||||
do i=ia,ib
|
||||
ccfok(i)=ccfred(i).gt.ccflim .and. red2(i).gt.red2lim
|
||||
enddo
|
||||
ccfok(ia1:ib1)=.false.
|
||||
endif
|
||||
|
||||
fgood=0.
|
||||
do i=ia,ib
|
||||
if(done(i) .or. (.not.ccfok(i))) cycle
|
||||
f=(i-1)*df3
|
||||
if(nqd.eq.1 .or. &
|
||||
(ccfred(i).ge.ccflim .and. abs(f-fgood).gt.10.0*df8)) then
|
||||
|
||||
call timer('softsym ',0)
|
||||
fpk=nf0 + df3*(i-1)
|
||||
call softsym(id2,npts8,nsps8,newdat,fpk,syncpk,snrdb,xdt, &
|
||||
freq,drift,a3,schk,i1SoftSymbols)
|
||||
call timer('softsym ',1)
|
||||
|
||||
sync=(syncpk+1)/4.0
|
||||
if(nqd.eq.1 .and. ((sync.lt.0.5) .or. (schk.lt.1.0))) cycle
|
||||
if(nqd.ne.1 .and. ((sync.lt.1.0) .or. (schk.lt.1.5))) cycle
|
||||
|
||||
call timer('jt9fano ',0)
|
||||
call jt9fano(i1SoftSymbols,limit,nlim,msg)
|
||||
call timer('jt9fano ',1)
|
||||
|
||||
if(sync.lt.0.0 .or. snrdb.lt.dblim-2.0) sync=0.0
|
||||
nsync=int(sync)
|
||||
if(nsync.gt.10) nsync=10
|
||||
nsnr=nint(snrdb)
|
||||
ndrift=nint(drift/df3)
|
||||
num9=num9+1
|
||||
|
||||
if(msg.ne.' ') then
|
||||
numfano=numfano+1
|
||||
if (associated(this%callback)) then
|
||||
call this%callback(sync,nsnr,xdt,freq,ndrift,msg)
|
||||
end if
|
||||
iaa=max(1,i-1)
|
||||
ibb=min(NSMAX,i+22)
|
||||
fgood=f
|
||||
nsynced=1
|
||||
ndecoded=1
|
||||
ccfok(iaa:ibb)=.false.
|
||||
done(iaa:ibb)=.true.
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
if(nagain) exit
|
||||
enddo
|
||||
|
||||
999 return
|
||||
end subroutine decode
|
||||
end module jt9_decode
|
||||
@@ -0,0 +1,56 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (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/container for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP
|
||||
#define BOOST_CONTAINER_DETAIL_STD_FWD_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Standard predeclarations
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/detail/std_ns_begin.hpp>
|
||||
BOOST_MOVE_STD_NS_BEG
|
||||
|
||||
template<class T>
|
||||
class allocator;
|
||||
|
||||
template<class T>
|
||||
struct less;
|
||||
|
||||
template<class T1, class T2>
|
||||
struct pair;
|
||||
|
||||
template<class T>
|
||||
struct char_traits;
|
||||
|
||||
struct input_iterator_tag;
|
||||
struct forward_iterator_tag;
|
||||
struct bidirectional_iterator_tag;
|
||||
struct random_access_iterator_tag;
|
||||
|
||||
template<class Container>
|
||||
class insert_iterator;
|
||||
|
||||
struct allocator_arg_t;
|
||||
|
||||
struct piecewise_construct_t;
|
||||
|
||||
BOOST_MOVE_STD_NS_END
|
||||
#include <boost/move/detail/std_ns_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
// (C) Copyright Tobias Schwinger
|
||||
//
|
||||
// Use modification and distribution are subject to the boost Software License,
|
||||
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_FT_DETAIL_CLASSIFIER_HPP_INCLUDED
|
||||
#define BOOST_FT_DETAIL_CLASSIFIER_HPP_INCLUDED
|
||||
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
#include <boost/function_types/config/config.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
|
||||
namespace boost { namespace function_types { namespace detail {
|
||||
|
||||
template<typename T> struct classifier;
|
||||
|
||||
template<std::size_t S> struct char_array { typedef char (&type)[S]; };
|
||||
|
||||
template<bits_t Flags, bits_t CCID, std::size_t Arity> struct encode_charr
|
||||
{
|
||||
typedef typename char_array<
|
||||
::boost::function_types::detail::encode_charr_impl<Flags,CCID,Arity>::value
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
|
||||
# define BOOST_FT_DECL __cdecl
|
||||
#else
|
||||
# define BOOST_FT_DECL /**/
|
||||
#endif
|
||||
|
||||
char BOOST_FT_DECL classifier_impl(...);
|
||||
|
||||
#define BOOST_FT_variations BOOST_FT_function|BOOST_FT_pointer|\
|
||||
BOOST_FT_member_pointer
|
||||
|
||||
#define BOOST_FT_type_function(cc,name) BOOST_FT_SYNTAX( \
|
||||
R BOOST_PP_EMPTY,BOOST_PP_LPAREN,cc,* BOOST_PP_EMPTY,name,BOOST_PP_RPAREN)
|
||||
|
||||
#define BOOST_FT_type_function_pointer(cc,name) BOOST_FT_SYNTAX( \
|
||||
R BOOST_PP_EMPTY,BOOST_PP_LPAREN,cc,** BOOST_PP_EMPTY,name,BOOST_PP_RPAREN)
|
||||
|
||||
#define BOOST_FT_type_member_function_pointer(cc,name) BOOST_FT_SYNTAX( \
|
||||
R BOOST_PP_EMPTY,BOOST_PP_LPAREN,cc,T0::** BOOST_PP_EMPTY,name,BOOST_PP_RPAREN)
|
||||
|
||||
#define BOOST_FT_al_path boost/function_types/detail/classifier_impl
|
||||
#include <boost/function_types/detail/pp_loop.hpp>
|
||||
|
||||
template<typename T> struct classifier_bits
|
||||
{
|
||||
static typename boost::add_reference<T>::type tester;
|
||||
|
||||
BOOST_STATIC_CONSTANT(bits_t,value = (bits_t)sizeof(
|
||||
boost::function_types::detail::classifier_impl(& tester)
|
||||
)-1);
|
||||
};
|
||||
|
||||
template<typename T> struct classifier
|
||||
{
|
||||
typedef detail::constant<
|
||||
::boost::function_types::detail::decode_bits<
|
||||
::boost::function_types::detail::classifier_bits<T>::value
|
||||
>::tag_bits >
|
||||
bits;
|
||||
|
||||
typedef detail::full_mask mask;
|
||||
|
||||
typedef detail::constant<
|
||||
::boost::function_types::detail::decode_bits<
|
||||
::boost::function_types::detail::classifier_bits<T>::value
|
||||
>::arity >
|
||||
function_arity;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} } } // namespace ::boost::function_types::detail
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
// Boost string_algo library util.hpp header file ---------------------------//
|
||||
|
||||
// Copyright Pavol Droba 2002-2003.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/ for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_STRING_UTIL_DETAIL_HPP
|
||||
#define BOOST_STRING_UTIL_DETAIL_HPP
|
||||
|
||||
#include <boost/algorithm/string/config.hpp>
|
||||
#include <functional>
|
||||
#include <boost/range/iterator_range_core.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace algorithm {
|
||||
namespace detail {
|
||||
|
||||
// empty container -----------------------------------------------//
|
||||
|
||||
// empty_container
|
||||
/*
|
||||
This class represents always empty container,
|
||||
containing elements of type CharT.
|
||||
|
||||
It is supposed to be used in a const version only
|
||||
*/
|
||||
template< typename CharT >
|
||||
struct empty_container
|
||||
{
|
||||
typedef empty_container<CharT> type;
|
||||
typedef CharT value_type;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef const value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef const value_type* iterator;
|
||||
typedef const value_type* const_iterator;
|
||||
|
||||
|
||||
// Operations
|
||||
const_iterator begin() const
|
||||
{
|
||||
return reinterpret_cast<const_iterator>(0);
|
||||
}
|
||||
|
||||
const_iterator end() const
|
||||
{
|
||||
return reinterpret_cast<const_iterator>(0);
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_type size() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// bounded copy algorithm -----------------------------------------------//
|
||||
|
||||
// Bounded version of the std::copy algorithm
|
||||
template<typename InputIteratorT, typename OutputIteratorT>
|
||||
inline OutputIteratorT bounded_copy(
|
||||
InputIteratorT First,
|
||||
InputIteratorT Last,
|
||||
OutputIteratorT DestFirst,
|
||||
OutputIteratorT DestLast )
|
||||
{
|
||||
InputIteratorT InputIt=First;
|
||||
OutputIteratorT OutputIt=DestFirst;
|
||||
for(; InputIt!=Last && OutputIt!=DestLast; InputIt++, OutputIt++ )
|
||||
{
|
||||
*OutputIt=*InputIt;
|
||||
}
|
||||
|
||||
return OutputIt;
|
||||
}
|
||||
|
||||
// iterator range utilities -----------------------------------------//
|
||||
|
||||
// copy range functor
|
||||
template<
|
||||
typename SeqT,
|
||||
typename IteratorT=BOOST_STRING_TYPENAME SeqT::const_iterator >
|
||||
struct copy_iterator_rangeF :
|
||||
public std::unary_function< iterator_range<IteratorT>, SeqT >
|
||||
{
|
||||
SeqT operator()( const iterator_range<IteratorT>& Range ) const
|
||||
{
|
||||
return copy_range<SeqT>(Range);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace algorithm
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_STRING_UTIL_DETAIL_HPP
|
||||
@@ -0,0 +1,23 @@
|
||||
# /* Copyright (C) 2001
|
||||
# * Housemarque Oy
|
||||
# * http://www.housemarque.com
|
||||
# *
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_FACILITIES_EMPTY_HPP
|
||||
# define BOOST_PREPROCESSOR_FACILITIES_EMPTY_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# /* BOOST_PP_EMPTY */
|
||||
#
|
||||
# define BOOST_PP_EMPTY()
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_ELECTRIC_POTENTIAL_HPP
|
||||
#define BOOST_UNITS_SI_ELECTRIC_POTENTIAL_HPP
|
||||
|
||||
#include <boost/units/systems/si/base.hpp>
|
||||
#include <boost/units/physical_dimensions/electric_potential.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
typedef unit<electric_potential_dimension,si::system> electric_potential;
|
||||
|
||||
BOOST_UNITS_STATIC_CONSTANT(volt,electric_potential);
|
||||
BOOST_UNITS_STATIC_CONSTANT(volts,electric_potential);
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_SI_ELECTRIC_POTENTIAL_HPP
|
||||
@@ -0,0 +1,79 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2015 Agustin K-ballo Berge
|
||||
Copyright (c) 2015 Kohei Takahashi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_SUPPORT_DETAIL_INDEX_SEQUENCE_06232015_1038
|
||||
#define BOOST_FUSION_SUPPORT_DETAIL_INDEX_SEQUENCE_06232015_1038
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
// GCC5 has O(logN) implementation, see https://gcc.gnu.org/PR66059 .
|
||||
#if (defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304) \
|
||||
|| (defined(BOOST_LIBSTDCXX_VERSION) \
|
||||
&& BOOST_LIBSTDCXX_VERSION >= 500000 && __cplusplus >= 201402)
|
||||
#include <utility>
|
||||
#define BOOST_FUSION_STDLIB_HAS_INTEGER_SEQUENCE
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
#ifdef BOOST_FUSION_STDLIB_HAS_INTEGER_SEQUENCE
|
||||
// Use aliasing templates without checking availability, the compiler should work.
|
||||
template <std::size_t ...Ints>
|
||||
using index_sequence = std::index_sequence<Ints...>;
|
||||
|
||||
template <std::size_t N>
|
||||
struct make_index_sequence
|
||||
{
|
||||
using type = std::make_index_sequence<N>;
|
||||
};
|
||||
#else
|
||||
template <std::size_t ...Ints>
|
||||
struct index_sequence
|
||||
{
|
||||
typedef std::size_t value_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static std::size_t size() BOOST_NOEXCEPT
|
||||
{ return sizeof...(Ints); }
|
||||
|
||||
// non standard extension
|
||||
typedef index_sequence type;
|
||||
};
|
||||
|
||||
template <typename Left, typename Right>
|
||||
struct _make_index_sequence_join;
|
||||
|
||||
template <std::size_t... Left, std::size_t... Right>
|
||||
struct _make_index_sequence_join<
|
||||
index_sequence<Left...>, index_sequence<Right...>
|
||||
> : index_sequence<Left..., (sizeof...(Left) + Right)...>
|
||||
{};
|
||||
|
||||
template <std::size_t N>
|
||||
struct make_index_sequence
|
||||
: _make_index_sequence_join<
|
||||
typename make_index_sequence<N / 2>::type
|
||||
, typename make_index_sequence<N - N / 2>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct make_index_sequence<1>
|
||||
: index_sequence<0>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct make_index_sequence<0>
|
||||
: index_sequence<>
|
||||
{};
|
||||
#endif
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_ARRAY_SIZE_HPP
|
||||
# define BOOST_PREPROCESSOR_ARRAY_SIZE_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
#
|
||||
# /* BOOST_PP_ARRAY_SIZE */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_ARRAY_SIZE(array) BOOST_PP_TUPLE_ELEM(2, 0, array)
|
||||
# else
|
||||
# define BOOST_PP_ARRAY_SIZE(array) BOOST_PP_ARRAY_SIZE_I(array)
|
||||
# define BOOST_PP_ARRAY_SIZE_I(array) BOOST_PP_ARRAY_SIZE_II array
|
||||
# define BOOST_PP_ARRAY_SIZE_II(size, data) size
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2013-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_ARCHITECTURE_BLACKFIN_H
|
||||
#define BOOST_PREDEF_ARCHITECTURE_BLACKFIN_H
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_ARCH_BLACKFIN`]
|
||||
|
||||
Blackfin Processors from Analog Devices.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`__bfin__`] [__predef_detection__]]
|
||||
[[`__BFIN__`] [__predef_detection__]]
|
||||
[[`bfin`] [__predef_detection__]]
|
||||
[[`BFIN`] [__predef_detection__]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_ARCH_BLACKFIN BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if defined(__bfin__) || defined(__BFIN__) || \
|
||||
defined(bfin) || defined(BFIN)
|
||||
# undef BOOST_ARCH_BLACKFIN
|
||||
# define BOOST_ARCH_BLACKFIN BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_BLACKFIN
|
||||
# define BOOST_ARCH_BLACKFIN_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_BLACKFIN_NAME "Blackfin"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_BLACKFIN,BOOST_ARCH_BLACKFIN_NAME)
|
||||
@@ -0,0 +1,20 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost variant/apply_visitor.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// 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_APPLY_VISITOR_HPP
|
||||
#define BOOST_VARIANT_APPLY_VISITOR_HPP
|
||||
|
||||
#include <boost/variant/detail/apply_visitor_unary.hpp>
|
||||
#include <boost/variant/detail/apply_visitor_binary.hpp>
|
||||
#include <boost/variant/detail/apply_visitor_delayed.hpp>
|
||||
|
||||
#endif // BOOST_VARIANT_APPLY_VISITOR_HPP
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,577 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:export-ydpi="90"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-filename="/home/bill/Dropbox/src/wsjtx-dev/icons/windows-icons/icon_1024x1024.png"
|
||||
version="1.1"
|
||||
width="1024"
|
||||
sodipodi:version="0.32"
|
||||
sodipodi:docname="wsjtx_globe_1024x1024.svg"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
id="svg1432"
|
||||
height="1024">
|
||||
<sodipodi:namedview
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
id="base"
|
||||
inkscape:current-layer="svg1432"
|
||||
inkscape:cx="512"
|
||||
inkscape:cy="512"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-height="858"
|
||||
inkscape:window-width="1114"
|
||||
inkscape:window-x="72"
|
||||
inkscape:window-y="31"
|
||||
inkscape:zoom="0.69433594"
|
||||
pagecolor="#ffffff"
|
||||
showborder="true"
|
||||
showguides="true"
|
||||
showgrid="false"
|
||||
inkscape:window-maximized="0"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:showpageshadow="false" />
|
||||
<metadata
|
||||
id="metadata3060">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:title></dc:title>
|
||||
<dc:description>Simple globe centered on North America</dc:description>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>earth globe northamerica</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<dc:publisher>
|
||||
<cc:Agent
|
||||
rdf:about="http://www.openclipart.org/">
|
||||
<dc:title>Open Clip Art Library</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Dan Gerhrads</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>Dan Gerhrads</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:date>May 1, 2005</dc:date>
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<cc:license
|
||||
rdf:resource="http://web.resource.org/cc/PublicDomain" />
|
||||
<dc:language>en</dc:language>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://web.resource.org/cc/PublicDomain">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs1759">
|
||||
<linearGradient
|
||||
id="linearGradient37658">
|
||||
<stop
|
||||
style="stop-color:#2f7aff;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop37660" />
|
||||
<stop
|
||||
style="stop-color:#0000b3;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop37662" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient20137">
|
||||
<stop
|
||||
style="stop-color:#00bf00;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop20139" />
|
||||
<stop
|
||||
style="stop-color:#007500;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop20141" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient20143"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient37658"
|
||||
r="112.3373"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient37664"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.806632,1.239722)"
|
||||
fy="270.08731"
|
||||
fx="221.61394"
|
||||
cy="270.08731"
|
||||
cx="221.61394" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1902"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1904"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1906"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1908"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1910"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1912"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1914"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1916"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1918"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1920"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient37658-427"
|
||||
r="112.3373"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient37664-403"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.806632,1.239722)"
|
||||
fy="270.08731"
|
||||
fx="221.61394"
|
||||
cy="270.08731"
|
||||
cx="221.61394" />
|
||||
<linearGradient
|
||||
id="linearGradient37658-427">
|
||||
<stop
|
||||
style="stop-color:#488afe;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7178" />
|
||||
<stop
|
||||
style="stop-color:#0000cc;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7180" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-396"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1902-893"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-396">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7184" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7186" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-527"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1904-666"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-527">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7190" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7192" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-774"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1906-717"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-774">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7196" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7198" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-253"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1908-922"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-253">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7202" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7204" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-972"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1910-261"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-972">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7208" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7210" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-945"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1912-713"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-945">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7214" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7216" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-600"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1914-146"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-600">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7220" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7222" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-196"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1916-817"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-196">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7226" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7228" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-388"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1918-23"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-388">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7232" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7234" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-202"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient1920-260"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-202">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7238" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7240" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient20137-151"
|
||||
r="188.61865"
|
||||
inkscape:collect="always"
|
||||
id="radialGradient20143-884"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(0.893959,1.11862)"
|
||||
fy="298.37747"
|
||||
fx="205.17723"
|
||||
cy="297.1124"
|
||||
cx="202.06305" />
|
||||
<linearGradient
|
||||
id="linearGradient20137-151">
|
||||
<stop
|
||||
style="stop-color:#00d800;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop7244" />
|
||||
<stop
|
||||
style="stop-color:#008e00;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop7246" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<desc
|
||||
id="desc1434">wmf2svg</desc>
|
||||
<polyline
|
||||
transform="matrix(2.2285926,-3.5745108,2.3232002,1.4484387,-677.00545,692.67468)"
|
||||
style="fill:url(#radialGradient37664-403);fill-opacity:1;stroke:#0c0c0c;stroke-width:0.6875;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4"
|
||||
points="103.191467,409.292114 100.730545,403.134064 98.525299,396.927094 96.543777,390.573547 94.785973,384.171082 93.219925,377.622009 91.909569,371.072968 90.790962,364.426147 89.928040,357.779327 89.256882,351.083649 88.777481,344.387970 88.521805,337.692261 88.489838,330.947693 88.681602,324.300873 89.033165,317.605194 89.640404,311.007263 90.407448,304.458221 91.398209,298.006897 92.580727,291.604431 93.986977,285.299744 95.553017,279.092804 97.342781,272.983582 99.324303,267.069916 101.465622,261.253937 103.830666,255.584595 106.387474,250.110733 109.104080,244.783508 112.012444,239.700668 115.112572,234.764420 118.404449,230.072571 121.856140,225.625061 125.499588,221.373062 129.302826,217.414291 133.265884,213.748779 137.260895,210.425354 141.351776,207.444077 145.506577,204.804901 149.725311,202.556717 153.975983,200.601776 158.258652,198.988937 162.573242,197.718231 166.919815,196.789627 171.266373,196.154266 175.644897,195.909912 179.991470,195.909912 184.338043,196.300888 188.652649,196.985123 192.967270,197.962585 197.217941,199.233307 201.468628,200.846130 205.623444,202.801071 209.746277,205.000397 213.805222,207.541809 217.768265,210.376495 221.667389,213.504395 225.470627,216.876678 229.177994,220.591064 232.789490,224.598709 236.273132,228.850708 239.628937,233.444839 242.856903,238.283325 245.957031,243.366180 248.929321,248.791153 251.709839,254.411621 254.362534,260.374207 256.791504,266.483398 258.996704,272.739227 261.010223,279.043915 262.768005,285.495270 264.302094,291.995453 265.644409,298.593384 266.731079,305.191315 267.625946,311.838104 268.297119,318.533813 268.744537,325.278351 269.000244,331.974030 269.032166,338.669739 268.872375,345.365448 268.488861,352.012238 267.913574,358.610168 267.114594,365.159241 266.123840,371.659424 264.941284,378.061890 263.567017,384.366577 261.969025,390.573547 260.211212,396.633850 258.229706,402.596436 256.056396,408.412384 253.723328,414.032837 251.166504,419.555603 248.449905,424.833923 245.509598,429.965668 242.409470,434.853027 239.149536,439.593750 235.697845,444.041260 232.054413,448.244385 228.219193,452.252045 224.288116,455.917542 220.261139,459.240967 216.170258,462.173401 212.015442,464.812561 207.828674,467.109589 203.577988,469.064545 199.263397,470.628510 194.948776,471.899200 190.634186,472.876678 186.255646,473.463196 181.909073,473.756439 177.562500,473.707550 173.215942,473.365448 168.869370,472.681213 164.586731,471.703735 160.304077,470.384155 156.085358,468.771332 151.898590,466.865265 147.807709,464.617065 143.748779,462.124512 139.753769,459.289856 135.854645,456.161926 132.051392,452.740753 128.344025,449.026367 124.764503,445.067596 121.280853,440.766724 117.893089,436.221466 114.665123,431.382996 111.565002,426.251282 108.624680,420.875153 105.812187,415.205811 103.191467,409.292114 "
|
||||
id="polyline1560" />
|
||||
<g
|
||||
transform="matrix(4.1610916,0,0,4.1610916,-268.34786,-716.6628)"
|
||||
style="fill:url(#radialGradient1902-893);fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:label="Continents"
|
||||
id="Continents">
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1904-666);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="132.818436,384.610931 131.827682,384.953064 128.184235,388.227600 126.074867,388.667450 123.422180,385.441803 120.417938,385.832794 117.126053,389.107300 116.838409,393.896912 116.902328,400.641479 115.655891,409.292114 114.409447,415.352448 115.432167,418.235992 113.578484,420.386444 111.053642,420.924042 109.903076,422.732361 109.871117,423.172241 116.295090,433.728943 123.262383,443.161530 130.836914,451.421204 140.904327,460.071808 151.195465,466.425385 153.528549,464.470428 157.683365,463.248596 162.509323,463.688446 165.321808,463.835083 165.577484,459.387573 165.066132,457.628113 162.381485,454.793457 158.162750,448.244385 155.094604,442.526184 156.884354,433.680054 153.496597,425.664764 151.738800,419.017975 150.811951,410.220703 147.743790,405.479980 144.579727,397.953430 142.438416,395.851868 141.447662,389.058441 138.858887,386.419281 135.886597,384.855316 133.968994,384.219940 133.201950,380.994293 131.667877,376.351288 131.923553,370.926331 132.850403,369.069122 135.407196,368.140533 137.292847,366.625458 137.452652,362.911041 136.557755,358.316925 134.736038,353.967194 135.886597,352.158844 138.123810,351.914490 141.255890,349.812927 141.223938,346.245178 139.050644,343.557098 136.973236,343.654846 135.471115,341.602142 134.863876,337.643402 135.407196,330.947693 138.219681,327.575439 141.191971,325.571625 145.890106,326.158081 148.510818,330.361237 149.469635,333.635773 149.565506,336.421570 150.588226,338.327637 152.314072,339.891571 153.656403,344.045837 154.135788,348.737701 152.665634,353.771698 151.578995,357.730469 152.985229,359.587646 155.094604,356.557495 156.468872,353.234070 159.153519,351.572388 161.870132,351.474609 165.865143,353.967194 168.517807,355.237885 171.458130,352.696472 175.389221,351.425751 178.457397,351.621246 179.416199,352.940857 181.301834,352.403229 184.497833,352.452087 185.968002,353.918335 186.095840,356.704102 187.949539,357.143951 190.602203,359.392151 192.551788,361.004974 193.670380,358.610168 191.912582,355.482269 191.561020,353.576202 193.095093,351.767883 192.583740,349.030945 190.442413,347.906860 188.620697,346.147400 189.259888,345.169952 191.976501,346.049652 195.044662,348.835449 196.259140,351.230255 198.624191,353.771698 200.733551,353.282928 202.363510,350.057312 203.609955,343.996979 204.153275,334.710999 202.906830,330.752228 202.331558,328.406281 203.258408,324.594147 202.459396,316.676605 201.053146,314.819397 198.496353,317.311981 195.300339,320.781982 194.788971,323.567780 192.871368,323.518921 189.739288,325.669373 186.894852,327.477692 187.342285,323.470032 188.524796,319.755646 190.666138,317.311981 190.314575,313.450958 189.132050,308.123718 190.090851,304.898071 193.734299,301.965637 197.601471,302.063385 202.107834,303.773987 205.559525,305.875519 207.796722,306.217651 208.435928,302.698761 206.678116,300.548309 206.038925,296.980560 207.796722,294.585724 209.490601,292.581909 208.627686,290.529205 205.783249,292.386414 203.961517,291.555573 204.057388,289.258514 207.189484,286.130615 208.787491,282.953796 208.627686,279.532684 209.874130,275.427277 208.276123,272.152740 206.198730,271.273010 205.783249,275.231781 204.185242,277.479980 203.929565,281.927460 201.788239,283.393677 202.715073,269.513580 203.546036,261.938171 204.888351,257.050812 206.997711,254.998108 209.426682,251.283707 209.171005,248.595657 207.541046,244.734634 206.262650,243.708313 205.687363,241.362366 204.600723,239.211929 202.715073,239.798416 201.276871,239.896149 200.030426,234.959930 197.697342,233.395966 194.916824,233.884705 192.743546,234.715546 191.976501,231.929764 192.264130,228.068741 190.698090,230.903412 191.145538,235.986282 191.912582,241.362366 192.104340,246.347473 190.154770,250.208496 187.406204,253.238663 182.548279,255.780090 177.338791,257.979401 173.695343,260.911804 171.745789,262.866760 169.956009,265.603668 166.696106,264.919464 162.924805,265.066071 158.290604,266.092438 153.464630,269.220306 146.944778,274.352051 145.091095,277.479980 141.671371,283.442566 138.954773,288.036682 135.918564,293.950378 135.119568,298.593384 135.503082,301.476929 136.334045,297.420410 138.091858,294.048126 140.361008,290.871338 142.310577,287.987793 143.365265,289.502869 141.959015,292.190948 138.283615,298.055786 135.087601,306.071045 132.946274,309.492188 130.900833,310.176422 129.686356,314.330688 130.069870,319.755646 128.919312,329.628113 129.494598,334.515503 130.677109,341.797638 131.603958,350.546021 131.540024,355.482269 130.964752,360.565125 128.280106,366.772064 129.047150,373.125641 129.654404,377.084412 131.476105,380.456665 132.818436,384.610931 "
|
||||
id="polyline1460" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1906-717);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="144.579727,355.237885 146.497345,357.241699 147.583984,362.324585 148.638672,368.384918 149.980988,372.539154 150.364502,377.035553 148.798477,377.279877 146.753021,373.467743 146.976746,368.433777 146.593216,362.959930 144.579727,355.237885 "
|
||||
id="polyline1464" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1908-922);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="150.108826,378.892731 148.830429,379.870209 149.309830,383.584595 150.172745,386.614777 152.633667,390.964508 152.505829,386.565887 153.336792,386.077148 153.017197,383.780090 150.108826,378.892731 "
|
||||
id="polyline1468" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1910-261);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="201.181000,353.820557 200.797470,356.459747 200.413956,361.053864 199.966507,365.990082 199.007706,368.238281 196.866379,363.204285 197.921066,357.681580 199.103592,354.895782 201.181000,353.820557 "
|
||||
id="polyline1472" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1912-713);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="204.632675,320.342133 203.993469,316.774353 202.906830,312.668976 206.230682,314.575043 208.883362,312.277985 209.842163,309.052338 208.915314,303.822876 208.563766,299.961853 209.874130,294.487976 212.430923,295.514343 213.261887,299.570862 213.581497,305.386810 213.837173,310.958405 212.111328,314.917175 211.951538,317.018738 212.335052,321.466217 210.800964,325.913727 208.691605,325.376099 206.454407,326.646820 205.016205,324.203125 204.632675,320.342133 "
|
||||
id="polyline1476" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1914-146);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="213.773254,334.955322 213.709335,340.820160 213.869125,343.263885 216.362015,346.636139 219.526062,350.594910 218.695099,344.632324 219.685867,341.406677 222.722061,339.060730 227.835663,334.662109 230.648163,335.786194 233.332809,333.147003 234.355515,326.011475 234.675125,319.218048 233.556534,312.522369 233.588486,306.071045 231.511078,300.646057 228.890350,297.420410 226.365509,296.980560 225.246902,294.830109 226.365509,293.461639 225.023193,290.235992 222.338547,287.401337 220.964264,289.698364 217.352783,290.675842 216.330063,294.292480 216.362015,299.375336 220.644653,297.469269 222.754028,297.958038 220.708588,301.623535 219.941544,306.852997 220.293106,310.714020 219.845657,317.654083 219.078629,323.909912 214.955765,329.237122 215.083618,333.000397 213.773254,334.955322 "
|
||||
id="polyline1480" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1916-817);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="232.533813,338.767487 230.200729,341.748779 229.401718,344.436798 229.721313,347.662476 233.460648,348.542206 237.040161,346.929382 237.231934,342.872864 235.378250,340.478088 233.620453,340.282562 232.533813,338.767487 "
|
||||
id="polyline1484" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1918-23);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="264.877380,375.813690 262.991730,379.919098 260.371002,382.167236 258.645172,385.148529 258.645172,389.693817 256.887360,391.062256 255.161514,388.911804 254.522308,386.956848 252.732559,385.197418 253.339798,391.697632 251.709839,392.332977 249.792236,387.738861 248.322067,389.840393 246.724060,393.017212 244.327072,395.412018 242.952774,399.664001 241.514587,403.329529 241.067139,407.337158 239.565018,407.190552 238.318573,407.777039 235.665894,409.096649 233.173004,407.679291 233.141052,401.570068 234.707092,399.712891 235.122574,395.705231 237.231934,393.652588 239.692856,394.434540 241.834183,392.039734 240.843414,387.152374 239.980499,385.099670 240.907349,382.265015 244.550781,379.332581 247.043671,372.685760 247.139542,368.384918 249.121078,365.110352 252.125320,361.151611 254.202728,353.967194 256.503845,350.399414 255.992477,346.684998 255.864655,342.335266 255.832672,339.744965 254.586243,339.353973 254.074875,342.139771 251.581985,340.722412 252.189240,343.654846 251.997467,347.760223 251.294357,352.647583 251.486115,357.632721 248.897354,354.993530 246.915833,355.335632 246.020950,351.670135 245.733307,346.489502 247.778748,340.233704 248.002472,336.763672 247.586990,329.774750 247.299347,324.545258 248.705597,319.315765 251.230438,321.319580 254.234680,326.451324 255.608963,324.154266 255.097595,321.417358 253.915070,321.612854 252.253159,317.702942 254.202728,316.774353 253.883118,313.548676 254.714081,310.469666 254.746033,303.969452 255.001724,293.999268 253.947052,293.070679 252.349030,292.777405 250.495346,290.382599 250.303589,287.938934 249.312836,284.077911 247.235428,279.679291 245.381744,278.261963 242.920822,273.912201 241.546539,269.122559 241.035172,265.408173 242.345535,263.502106 240.555771,258.761383 238.734055,257.979401 236.560776,253.336411 234.131805,249.573120 232.501846,251.185959 230.648163,249.768631 228.315079,245.272247 226.653152,244.343658 225.438675,246.494095 223.808701,245.174515 220.964264,239.896149 219.430176,240.775894 217.672379,242.193222 216.170258,241.069122 212.718582,239.945023 210.257645,239.114182 207.509079,237.647964 205.527557,234.422318 206.805954,234.471191 209.362778,234.520065 210.225693,233.004974 208.979248,230.072571 209.810211,226.993515 210.737045,224.109970 213.325806,224.794220 215.722824,225.967178 216.745544,227.873245 219.781738,227.531128 222.114822,224.549835 224.032425,226.553665 226.844925,229.241714 229.785248,226.700287 230.136795,223.425751 229.721313,220.933197 236.592728,229.290573 241.898102,236.768250 246.564270,244.490280 251.837677,254.704865 255.960541,264.332947 260.115326,276.258118 264.302094,291.995453 267.210449,308.514740 268.393005,320.537628 269.000244,333.538025 268.840424,345.169952 268.201202,356.557495 266.794983,367.358551 265.516571,374.933960 264.877380,375.813690 "
|
||||
id="polyline1488" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient1920-260);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="244.774506,357.779327 243.304337,356.313110 242.345535,358.512421 241.131058,362.666687 239.916580,364.817108 238.062897,367.945038 237.615448,372.930145 238.414459,375.324951 239.373245,373.125641 239.852661,368.727020 240.683624,367.602905 241.067139,371.121826 241.290848,375.129456 241.834183,378.452850 243.336304,376.986664 243.528061,376.937775 243.719818,376.888916 243.911591,376.791168 244.071396,376.644531 244.390976,376.351288 244.678635,376.009186 244.934311,375.618195 245.126068,375.324951 245.221939,375.129456 245.285858,375.031708 245.253906,372.490265 244.486862,365.159241 244.199219,361.884705 244.774506,357.779327 "
|
||||
id="polyline1492" />
|
||||
<polyline
|
||||
transform="matrix(0.535579,-0.859032,0.558315,0.348091,-98.20917,338.6942)"
|
||||
style="fill:url(#radialGradient20143-884);stroke:#0c0c0c;stroke-width:0.444585;stroke-linecap:round;stroke-linejoin:round"
|
||||
points="262.192749,389.449432 260.115326,391.160004 258.261658,394.287933 256.663635,394.532288 255.992477,392.968323 255.065643,395.802979 253.851151,400.885864 250.783005,404.209290 250.175766,401.276855 249.344803,399.810638 245.573502,402.889679 242.537292,406.213104 240.747543,406.995056 238.126801,409.878601 236.049423,409.976349 233.748291,411.002716 231.606964,415.010315 228.986237,420.826294 226.333542,423.123352 220.996231,428.059601 216.617691,433.680054 213.485611,439.349396 210.385483,446.582703 209.171005,453.278381 210.353516,458.605591 214.220703,458.654480 216.777496,458.752228 218.535294,460.560547 223.648911,456.504028 228.187241,452.252045 232.693619,447.511292 237.775253,441.402100 243.400223,433.386810 247.906586,425.811401 251.677872,418.529236 255.161514,410.611694 258.069885,403.134064 260.690613,394.923279 262.192749,389.449432 "
|
||||
id="polyline1496" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,742 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Copyright 2013 John Maddock. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
|
||||
|
||||
#ifndef BOOST_MP_FLOAT128_HPP
|
||||
#define BOOST_MP_FLOAT128_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/multiprecision/number.hpp>
|
||||
|
||||
#if defined(BOOST_INTEL) && !defined(BOOST_MP_USE_FLOAT128) && !defined(BOOST_MP_USE_QUAD)
|
||||
# if defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION >= 1310) && defined(__GNUC__)
|
||||
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
|
||||
# define BOOST_MP_USE_FLOAT128
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef BOOST_MP_USE_FLOAT128
|
||||
# define BOOST_MP_USE_QUAD
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(BOOST_MP_USE_FLOAT128) && !defined(BOOST_MP_USE_QUAD)
|
||||
# define BOOST_MP_USE_FLOAT128
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_MP_USE_FLOAT128) && !defined(BOOST_MP_USE_QUAD)
|
||||
# error "Sorry compiler is neither GCC, not Intel, don't know how to configure this header."
|
||||
#endif
|
||||
#if defined(BOOST_MP_USE_FLOAT128) && defined(BOOST_MP_USE_QUAD)
|
||||
# error "Oh dear, both BOOST_MP_USE_FLOAT128 and BOOST_MP_USE_QUAD are defined, which one should I be using?"
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MP_USE_FLOAT128)
|
||||
|
||||
extern "C" {
|
||||
#include <quadmath.h>
|
||||
}
|
||||
|
||||
typedef __float128 float128_type;
|
||||
|
||||
#elif defined(BOOST_MP_USE_QUAD)
|
||||
|
||||
#include <boost/multiprecision/detail/float_string_cvt.hpp>
|
||||
|
||||
typedef _Quad float128_type;
|
||||
|
||||
extern "C" {
|
||||
_Quad __ldexpq(_Quad, int);
|
||||
_Quad __frexpq(_Quad, int*);
|
||||
_Quad __fabsq(_Quad);
|
||||
_Quad __floorq(_Quad);
|
||||
_Quad __ceilq(_Quad);
|
||||
_Quad __sqrtq(_Quad);
|
||||
_Quad __truncq(_Quad);
|
||||
_Quad __expq(_Quad);
|
||||
_Quad __powq(_Quad, _Quad);
|
||||
_Quad __logq(_Quad);
|
||||
_Quad __log10q(_Quad);
|
||||
_Quad __sinq(_Quad);
|
||||
_Quad __cosq(_Quad);
|
||||
_Quad __tanq(_Quad);
|
||||
_Quad __asinq(_Quad);
|
||||
_Quad __acosq(_Quad);
|
||||
_Quad __atanq(_Quad);
|
||||
_Quad __sinhq(_Quad);
|
||||
_Quad __coshq(_Quad);
|
||||
_Quad __tanhq(_Quad);
|
||||
_Quad __fmodq(_Quad, _Quad);
|
||||
_Quad __atan2q(_Quad, _Quad);
|
||||
|
||||
#define ldexpq __ldexpq
|
||||
#define frexpq __frexpq
|
||||
#define fabsq __fabsq
|
||||
#define floorq __floorq
|
||||
#define ceilq __ceilq
|
||||
#define sqrtq __sqrtq
|
||||
#define truncq __truncq
|
||||
#define expq __expq
|
||||
#define powq __powq
|
||||
#define logq __logq
|
||||
#define log10q __log10q
|
||||
#define sinq __sinq
|
||||
#define cosq __cosq
|
||||
#define tanq __tanq
|
||||
#define asinq __asinq
|
||||
#define acosq __acosq
|
||||
#define atanq __atanq
|
||||
#define sinhq __sinhq
|
||||
#define coshq __coshq
|
||||
#define tanhq __tanhq
|
||||
#define fmodq __fmodq
|
||||
#define atan2q __atan2q
|
||||
}
|
||||
|
||||
inline _Quad isnanq(_Quad v)
|
||||
{
|
||||
return v != v;
|
||||
}
|
||||
inline _Quad isinfq(_Quad v)
|
||||
{
|
||||
return __fabsq(v) > 1.18973149535723176508575932662800702e4932Q;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace multiprecision{
|
||||
namespace backends{
|
||||
|
||||
struct float128_backend;
|
||||
|
||||
}
|
||||
|
||||
using backends::float128_backend;
|
||||
|
||||
template<>
|
||||
struct number_category<backends::float128_backend> : public mpl::int_<number_kind_floating_point> {};
|
||||
template<>
|
||||
struct number_category<float128_type> : public mpl::int_<number_kind_floating_point> {};
|
||||
|
||||
typedef number<float128_backend, et_off> float128;
|
||||
|
||||
namespace backends{
|
||||
|
||||
struct float128_backend
|
||||
{
|
||||
typedef mpl::list<signed char, short, int, long, boost::long_long_type> signed_types;
|
||||
typedef mpl::list<unsigned char, unsigned short,
|
||||
unsigned int, unsigned long, boost::ulong_long_type> unsigned_types;
|
||||
typedef mpl::list<float, double, long double> float_types;
|
||||
typedef int exponent_type;
|
||||
|
||||
private:
|
||||
float128_type m_value;
|
||||
public:
|
||||
BOOST_CONSTEXPR float128_backend() BOOST_NOEXCEPT : m_value(0) {}
|
||||
BOOST_CONSTEXPR float128_backend(const float128_backend& o) BOOST_NOEXCEPT : m_value(o.m_value) {}
|
||||
float128_backend& operator = (const float128_backend& o) BOOST_NOEXCEPT
|
||||
{
|
||||
m_value = o.m_value;
|
||||
return *this;
|
||||
}
|
||||
template <class T>
|
||||
BOOST_CONSTEXPR float128_backend(const T& i, const typename enable_if_c<is_convertible<T, float128_type>::value>::type* = 0) BOOST_NOEXCEPT_IF(noexcept(std::declval<float128_type&>() = std::declval<const T&>()))
|
||||
: m_value(i) {}
|
||||
template <class T>
|
||||
typename enable_if_c<is_arithmetic<T>::value || is_convertible<T, float128_type>::value, float128_backend&>::type operator = (const T& i) BOOST_NOEXCEPT_IF(noexcept(std::declval<float128_type&>() = std::declval<const T&>()))
|
||||
{
|
||||
m_value = i;
|
||||
return *this;
|
||||
}
|
||||
float128_backend(long double const& f)
|
||||
{
|
||||
if(boost::math::isinf(f))
|
||||
m_value = (f < 0) ? -1.0Q / 0.0Q : 1.0Q / 0.0Q;
|
||||
else
|
||||
m_value = f;
|
||||
}
|
||||
float128_backend& operator=(long double const& f)
|
||||
{
|
||||
if(boost::math::isinf(f))
|
||||
m_value = (f < 0) ? -1.0Q / 0.0Q : 1.0Q / 0.0Q;
|
||||
else
|
||||
m_value = f;
|
||||
return *this;
|
||||
}
|
||||
float128_backend& operator = (const char* s)
|
||||
{
|
||||
#ifndef BOOST_MP_USE_QUAD
|
||||
char* p_end;
|
||||
m_value = strtoflt128(s, &p_end);
|
||||
if(p_end - s != (std::ptrdiff_t)std::strlen(s))
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("Unable to interpret input string as a floating point value"));
|
||||
}
|
||||
#else
|
||||
boost::multiprecision::detail::convert_from_string(*this, s);
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
void swap(float128_backend& o) BOOST_NOEXCEPT
|
||||
{
|
||||
std::swap(m_value, o.value());
|
||||
}
|
||||
std::string str(std::streamsize digits, std::ios_base::fmtflags f)const
|
||||
{
|
||||
#ifndef BOOST_MP_USE_QUAD
|
||||
char buf[100];
|
||||
boost::scoped_array<char> buf2;
|
||||
std::string format = "%";
|
||||
if(f & std::ios_base::showpos)
|
||||
format += "+";
|
||||
if(f & std::ios_base::showpoint)
|
||||
format += "#";
|
||||
format += ".*";
|
||||
if(digits == 0)
|
||||
digits = 36;
|
||||
format += "Q";
|
||||
if(f & std::ios_base::scientific)
|
||||
format += "e";
|
||||
else if(f & std::ios_base::fixed)
|
||||
format += "f";
|
||||
else
|
||||
format += "g";
|
||||
|
||||
int v = quadmath_snprintf (buf, 100, format.c_str(), digits, m_value);
|
||||
|
||||
if((v < 0) || (v >= 99))
|
||||
{
|
||||
int v_max = v;
|
||||
buf2.reset(new char[v+3]);
|
||||
v = quadmath_snprintf (&buf2[0], v_max + 3, format.c_str(), digits, m_value);
|
||||
if(v >= v_max + 3)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("Formatting of float128_type failed."));
|
||||
}
|
||||
return &buf2[0];
|
||||
}
|
||||
return buf;
|
||||
#else
|
||||
return boost::multiprecision::detail::convert_to_string(*this, digits ? digits : 37, f);
|
||||
#endif
|
||||
}
|
||||
void negate() BOOST_NOEXCEPT
|
||||
{
|
||||
m_value = -m_value;
|
||||
}
|
||||
int compare(const float128_backend& o)const
|
||||
{
|
||||
return m_value == o.m_value ? 0 : m_value < o.m_value ? -1 : 1;
|
||||
}
|
||||
template <class T>
|
||||
int compare(const T& i)const
|
||||
{
|
||||
return m_value == i ? 0 : m_value < i ? -1 : 1;
|
||||
}
|
||||
float128_type& value()
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
const float128_type& value()const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
};
|
||||
|
||||
inline void eval_add(float128_backend& result, const float128_backend& a)
|
||||
{
|
||||
result.value() += a.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_add(float128_backend& result, const A& a)
|
||||
{
|
||||
result.value() += a;
|
||||
}
|
||||
inline void eval_subtract(float128_backend& result, const float128_backend& a)
|
||||
{
|
||||
result.value() -= a.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_subtract(float128_backend& result, const A& a)
|
||||
{
|
||||
result.value() -= a;
|
||||
}
|
||||
inline void eval_multiply(float128_backend& result, const float128_backend& a)
|
||||
{
|
||||
result.value() *= a.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_multiply(float128_backend& result, const A& a)
|
||||
{
|
||||
result.value() *= a;
|
||||
}
|
||||
inline void eval_divide(float128_backend& result, const float128_backend& a)
|
||||
{
|
||||
result.value() /= a.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_divide(float128_backend& result, const A& a)
|
||||
{
|
||||
result.value() /= a;
|
||||
}
|
||||
|
||||
inline void eval_add(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = a.value() + b.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_add(float128_backend& result, const float128_backend& a, const A& b)
|
||||
{
|
||||
result.value() = a.value() + b;
|
||||
}
|
||||
inline void eval_subtract(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = a.value() - b.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_subtract(float128_backend& result, const float128_backend& a, const A& b)
|
||||
{
|
||||
result.value() = a.value() - b;
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_subtract(float128_backend& result, const A& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = a - b.value();
|
||||
}
|
||||
inline void eval_multiply(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = a.value() * b.value();
|
||||
}
|
||||
template <class A>
|
||||
inline void eval_multiply(float128_backend& result, const float128_backend& a, const A& b)
|
||||
{
|
||||
result.value() = a.value() * b;
|
||||
}
|
||||
inline void eval_divide(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = a.value() / b.value();
|
||||
}
|
||||
|
||||
template <class R>
|
||||
inline void eval_convert_to(R* result, const float128_backend& val)
|
||||
{
|
||||
*result = static_cast<R>(val.value());
|
||||
}
|
||||
|
||||
inline void eval_frexp(float128_backend& result, const float128_backend& arg, int* exp)
|
||||
{
|
||||
result.value() = frexpq(arg.value(), exp);
|
||||
}
|
||||
|
||||
inline void eval_ldexp(float128_backend& result, const float128_backend& arg, int exp)
|
||||
{
|
||||
result.value() = ldexpq(arg.value(), exp);
|
||||
}
|
||||
|
||||
inline void eval_floor(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = floorq(arg.value());
|
||||
}
|
||||
inline void eval_ceil(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = ceilq(arg.value());
|
||||
}
|
||||
inline void eval_sqrt(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = sqrtq(arg.value());
|
||||
}
|
||||
inline int eval_fpclassify(const float128_backend& arg)
|
||||
{
|
||||
if(isnanq(arg.value()))
|
||||
return FP_NAN;
|
||||
else if(isinfq(arg.value()))
|
||||
return FP_INFINITE;
|
||||
else if(arg.value() == 0)
|
||||
return FP_ZERO;
|
||||
|
||||
float128_backend t(arg);
|
||||
if(t.value() < 0)
|
||||
t.negate();
|
||||
if(t.value() < 3.36210314311209350626267781732175260e-4932Q)
|
||||
return FP_SUBNORMAL;
|
||||
return FP_NORMAL;
|
||||
}
|
||||
|
||||
inline void eval_increment(float128_backend& arg)
|
||||
{
|
||||
++arg.value();
|
||||
}
|
||||
inline void eval_decrement(float128_backend& arg)
|
||||
{
|
||||
--arg.value();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* abs/fabs:
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
inline void eval_abs(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = fabsq(arg.value());
|
||||
}
|
||||
inline void eval_fabs(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = fabsq(arg.value());
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Floating point functions:
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
inline void eval_trunc(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
if(isnanq(arg.value()) || isinfq(arg.value()))
|
||||
{
|
||||
result = boost::math::policies::raise_rounding_error(
|
||||
"boost::multiprecision::trunc<%1%>(%1%)", 0,
|
||||
number<float128_backend, et_off>(arg),
|
||||
number<float128_backend, et_off>(arg),
|
||||
boost::math::policies::policy<>()).backend();
|
||||
return;
|
||||
}
|
||||
result.value() = truncq(arg.value());
|
||||
}
|
||||
/*
|
||||
//
|
||||
// This doesn't actually work... rely on our own default version instead.
|
||||
//
|
||||
inline void eval_round(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
if(isnanq(arg.value()) || isinf(arg.value()))
|
||||
{
|
||||
result = boost::math::policies::raise_rounding_error(
|
||||
"boost::multiprecision::trunc<%1%>(%1%)", 0,
|
||||
number<float128_backend, et_off>(arg),
|
||||
number<float128_backend, et_off>(arg),
|
||||
boost::math::policies::policy<>()).backend();
|
||||
return;
|
||||
}
|
||||
result.value() = roundq(arg.value());
|
||||
}
|
||||
*/
|
||||
|
||||
inline void eval_exp(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = expq(arg.value());
|
||||
}
|
||||
inline void eval_log(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = logq(arg.value());
|
||||
}
|
||||
inline void eval_log10(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = log10q(arg.value());
|
||||
}
|
||||
inline void eval_sin(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = sinq(arg.value());
|
||||
}
|
||||
inline void eval_cos(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = cosq(arg.value());
|
||||
}
|
||||
inline void eval_tan(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = tanq(arg.value());
|
||||
}
|
||||
inline void eval_asin(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = asinq(arg.value());
|
||||
}
|
||||
inline void eval_acos(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = acosq(arg.value());
|
||||
}
|
||||
inline void eval_atan(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = atanq(arg.value());
|
||||
}
|
||||
inline void eval_sinh(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = sinhq(arg.value());
|
||||
}
|
||||
inline void eval_cosh(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = coshq(arg.value());
|
||||
}
|
||||
inline void eval_tanh(float128_backend& result, const float128_backend& arg)
|
||||
{
|
||||
result.value() = tanhq(arg.value());
|
||||
}
|
||||
inline void eval_fmod(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = fmodq(a.value(), b.value());
|
||||
}
|
||||
inline void eval_pow(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = powq(a.value(), b.value());
|
||||
}
|
||||
inline void eval_atan2(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = atan2q(a.value(), b.value());
|
||||
}
|
||||
inline void eval_multiply_add(float128_backend& result, const float128_backend& a, const float128_backend& b, const float128_backend& c)
|
||||
{
|
||||
result.value() = fmaq(a.value(), b.value(), c.value());
|
||||
}
|
||||
|
||||
inline std::size_t hash_value(const float128_backend& val)
|
||||
{
|
||||
return boost::hash_value(static_cast<double>(val.value()));
|
||||
}
|
||||
|
||||
} // namespace backends
|
||||
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> asinh BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return asinhq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> acosh BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return acoshq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> atanh BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return atanhq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> cbrt BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return cbrtq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> erf BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return erfq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> erfc BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return erfcq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> expm1 BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return expm1q(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> lgamma BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return lgammaq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> tgamma BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return tgammaq(arg.backend().value());
|
||||
}
|
||||
template<boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<float128_backend, ExpressionTemplates> log1p BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return log1pq(arg.backend().value());
|
||||
}
|
||||
|
||||
template <multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline int signbit BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates>& arg)
|
||||
{
|
||||
return ::signbitq(arg.backend().value());
|
||||
}
|
||||
|
||||
template <multiprecision::expression_template_option ExpressionTemplates>
|
||||
inline boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> copysign BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates>& a, const boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates>& b)
|
||||
{
|
||||
return ::copysignq(a.backend().value(), b.backend().value());
|
||||
}
|
||||
|
||||
inline void eval_remainder(float128_backend& result, const float128_backend& a, const float128_backend& b)
|
||||
{
|
||||
result.value() = remainderq(a.value(), b.value());
|
||||
}
|
||||
inline void eval_remainder(float128_backend& result, const float128_backend& a, const float128_backend& b, int* pi)
|
||||
{
|
||||
result.value() = remquoq(a.value(), b.value(), pi);
|
||||
}
|
||||
|
||||
} // namespace multiprecision
|
||||
|
||||
namespace math {
|
||||
|
||||
using boost::multiprecision::signbit;
|
||||
using boost::multiprecision::copysign;
|
||||
|
||||
} // namespace math
|
||||
|
||||
} // namespace boost
|
||||
|
||||
namespace boost{
|
||||
namespace archive{
|
||||
|
||||
class binary_oarchive;
|
||||
class binary_iarchive;
|
||||
|
||||
}
|
||||
|
||||
namespace serialization{ namespace float128_detail{
|
||||
|
||||
template <class Archive>
|
||||
void do_serialize(Archive& ar, boost::multiprecision::backends::float128_backend& val, const mpl::false_&, const mpl::false_&)
|
||||
{
|
||||
// saving
|
||||
// non-binary
|
||||
std::string s(val.str(0, std::ios_base::scientific));
|
||||
ar & s;
|
||||
}
|
||||
template <class Archive>
|
||||
void do_serialize(Archive& ar, boost::multiprecision::backends::float128_backend& val, const mpl::true_&, const mpl::false_&)
|
||||
{
|
||||
// loading
|
||||
// non-binary
|
||||
std::string s;
|
||||
ar & s;
|
||||
val = s.c_str();
|
||||
}
|
||||
|
||||
template <class Archive>
|
||||
void do_serialize(Archive& ar, boost::multiprecision::backends::float128_backend& val, const mpl::false_&, const mpl::true_&)
|
||||
{
|
||||
// saving
|
||||
// binary
|
||||
ar.save_binary(&val, sizeof(val));
|
||||
}
|
||||
template <class Archive>
|
||||
void do_serialize(Archive& ar, boost::multiprecision::backends::float128_backend& val, const mpl::true_&, const mpl::true_&)
|
||||
{
|
||||
// loading
|
||||
// binary
|
||||
ar.load_binary(&val, sizeof(val));
|
||||
}
|
||||
|
||||
} // detail
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, boost::multiprecision::backends::float128_backend& val, unsigned int /*version*/)
|
||||
{
|
||||
typedef typename Archive::is_loading load_tag;
|
||||
typedef typename mpl::bool_<boost::is_same<Archive, boost::archive::binary_oarchive>::value || boost::is_same<Archive, boost::archive::binary_iarchive>::value> binary_tag;
|
||||
|
||||
float128_detail::do_serialize(ar, val, load_tag(), binary_tag());
|
||||
}
|
||||
|
||||
} // namepsace archive
|
||||
|
||||
} // namespace boost
|
||||
|
||||
namespace std{
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
class numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >
|
||||
{
|
||||
typedef boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> number_type;
|
||||
public:
|
||||
BOOST_STATIC_CONSTEXPR bool is_specialized = true;
|
||||
static number_type (min)() BOOST_NOEXCEPT { return 3.36210314311209350626267781732175260e-4932Q; }
|
||||
static number_type (max)() BOOST_NOEXCEPT { return 1.18973149535723176508575932662800702e4932Q; }
|
||||
static number_type lowest() BOOST_NOEXCEPT { return -(max)(); }
|
||||
BOOST_STATIC_CONSTEXPR int digits = 113;
|
||||
BOOST_STATIC_CONSTEXPR int digits10 = 33;
|
||||
BOOST_STATIC_CONSTEXPR int max_digits10 = 36;
|
||||
BOOST_STATIC_CONSTEXPR bool is_signed = true;
|
||||
BOOST_STATIC_CONSTEXPR bool is_integer = false;
|
||||
BOOST_STATIC_CONSTEXPR bool is_exact = false;
|
||||
BOOST_STATIC_CONSTEXPR int radix = 2;
|
||||
static number_type epsilon() { return 1.92592994438723585305597794258492732e-34Q; }
|
||||
static number_type round_error() { return 0.5; }
|
||||
BOOST_STATIC_CONSTEXPR int min_exponent = -16381;
|
||||
BOOST_STATIC_CONSTEXPR int min_exponent10 = min_exponent * 301L / 1000L;
|
||||
BOOST_STATIC_CONSTEXPR int max_exponent = 16384;
|
||||
BOOST_STATIC_CONSTEXPR int max_exponent10 = max_exponent * 301L / 1000L;
|
||||
BOOST_STATIC_CONSTEXPR bool has_infinity = true;
|
||||
BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = true;
|
||||
BOOST_STATIC_CONSTEXPR bool has_signaling_NaN = false;
|
||||
BOOST_STATIC_CONSTEXPR float_denorm_style has_denorm = denorm_present;
|
||||
BOOST_STATIC_CONSTEXPR bool has_denorm_loss = true;
|
||||
static number_type infinity() { return 1.0q / 0.0q; }
|
||||
static number_type quiet_NaN() { return number_type("nan"); }
|
||||
static number_type signaling_NaN() { return 0; }
|
||||
static number_type denorm_min() { return 6.475175119438025110924438958227646552e-4966Q; }
|
||||
BOOST_STATIC_CONSTEXPR bool is_iec559 = true;
|
||||
BOOST_STATIC_CONSTEXPR bool is_bounded = false;
|
||||
BOOST_STATIC_CONSTEXPR bool is_modulo = false;
|
||||
BOOST_STATIC_CONSTEXPR bool traps = false;
|
||||
BOOST_STATIC_CONSTEXPR bool tinyness_before = false;
|
||||
BOOST_STATIC_CONSTEXPR float_round_style round_style = round_to_nearest;
|
||||
};
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_specialized;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::digits;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::digits10;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::max_digits10;
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_signed;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_integer;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_exact;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::radix;
|
||||
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::min_exponent;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::max_exponent;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::min_exponent10;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST int numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::max_exponent10;
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::has_infinity;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::has_quiet_NaN;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::has_signaling_NaN;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::has_denorm_loss;
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_iec559;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_bounded;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::is_modulo;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::traps;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST bool numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::tinyness_before;
|
||||
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST float_round_style numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::round_style;
|
||||
template <boost::multiprecision::expression_template_option ExpressionTemplates>
|
||||
BOOST_CONSTEXPR_OR_CONST float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::has_denorm;
|
||||
|
||||
} // namespace std
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_GET_DIMENSION_HPP
|
||||
#define BOOST_UNITS_GET_DIMENSION_HPP
|
||||
|
||||
///
|
||||
/// \file
|
||||
/// \brief Get the dimension of a unit, absolute unit and quantity.
|
||||
/// \details
|
||||
///
|
||||
|
||||
#include <boost/units/units_fwd.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
template<class T>
|
||||
struct get_dimension {};
|
||||
|
||||
/// Get the dimension of a unit.
|
||||
template<class Dim,class System>
|
||||
struct get_dimension< unit<Dim,System> >
|
||||
{
|
||||
typedef Dim type;
|
||||
};
|
||||
|
||||
/// Get the dimension of an absolute unit.
|
||||
template<class Unit>
|
||||
struct get_dimension< absolute<Unit> >
|
||||
{
|
||||
typedef typename get_dimension<Unit>::type type;
|
||||
};
|
||||
|
||||
/// Get the dimension of a quantity.
|
||||
template<class Unit,class Y>
|
||||
struct get_dimension< quantity<Unit,Y> >
|
||||
{
|
||||
typedef typename get_dimension<Unit>::type type;
|
||||
};
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_GET_DIMENSION_HPP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
function stdmsg(msg0,bcontest,mygrid)
|
||||
|
||||
use iso_c_binding, only: c_bool
|
||||
use packjt
|
||||
character*22 msg0,msg
|
||||
character*6 mygrid
|
||||
integer dat(12)
|
||||
logical(c_bool), value :: bcontest
|
||||
logical(c_bool) :: stdmsg
|
||||
|
||||
call packmsg(msg0,dat,itype,logical(bcontest))
|
||||
call unpackmsg(dat,msg,logical(bcontest),mygrid)
|
||||
stdmsg=(msg.eq.msg0) .and. (itype.ge.0) .and. itype.ne.6
|
||||
|
||||
return
|
||||
end function stdmsg
|
||||
@@ -0,0 +1,590 @@
|
||||
|
||||
// Copyright Peter Dimov 2001
|
||||
// Copyright Aleksey Gurtovoy 2001-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/bind.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
namespace aux {
|
||||
template< bool >
|
||||
struct resolve_arg_impl
|
||||
{
|
||||
template<
|
||||
typename T, typename U1, typename U2, typename U3
|
||||
, typename U4, typename U5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct resolve_arg_impl<true>
|
||||
{
|
||||
template<
|
||||
typename T, typename U1, typename U2, typename U3
|
||||
, typename U4, typename U5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef typename apply_wrap5<
|
||||
T
|
||||
, U1, U2, U3, U4, U5
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
template< typename T > struct is_bind_template;
|
||||
|
||||
template<
|
||||
typename T, typename U1, typename U2, typename U3, typename U4
|
||||
, typename U5
|
||||
>
|
||||
struct resolve_bind_arg
|
||||
: resolve_arg_impl< is_bind_template<T>::value >
|
||||
::template result_< T,U1,U2,U3,U4,U5 >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
struct replace_unnamed_arg_impl
|
||||
{
|
||||
template< typename Arg > struct result_
|
||||
{
|
||||
typedef Arg next;
|
||||
typedef T type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct replace_unnamed_arg_impl< arg< -1 > >
|
||||
{
|
||||
template< typename Arg > struct result_
|
||||
{
|
||||
typedef typename next<Arg>::type next;
|
||||
typedef Arg type;
|
||||
};
|
||||
};
|
||||
|
||||
template< typename T, typename Arg >
|
||||
struct replace_unnamed_arg
|
||||
: replace_unnamed_arg_impl<T>::template result_<Arg>
|
||||
{
|
||||
};
|
||||
|
||||
template< int arity_ > struct bind_chooser;
|
||||
|
||||
aux::no_tag is_bind_helper(...);
|
||||
template< typename T > aux::no_tag is_bind_helper(protect<T>*);
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
aux::yes_tag is_bind_helper(bind< F,T1,T2,T3,T4,T5 >*);
|
||||
|
||||
template< int N >
|
||||
aux::yes_tag is_bind_helper(arg<N>*);
|
||||
|
||||
template< bool is_ref_ = true >
|
||||
struct is_bind_template_impl
|
||||
{
|
||||
template< typename T > struct result_
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct is_bind_template_impl<false>
|
||||
{
|
||||
template< typename T > struct result_
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
sizeof(aux::is_bind_helper(static_cast<T*>(0)))
|
||||
== sizeof(aux::yes_tag)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename T > struct is_bind_template
|
||||
: is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
|
||||
::template result_<T>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename F
|
||||
>
|
||||
struct bind0
|
||||
{
|
||||
template<
|
||||
typename U1 = na, typename U2 = na, typename U3 = na
|
||||
, typename U4 = na, typename U5 = na
|
||||
>
|
||||
struct apply
|
||||
{
|
||||
private:
|
||||
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
|
||||
typedef typename r0::type a0;
|
||||
typedef typename r0::next n1;
|
||||
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
|
||||
///
|
||||
public:
|
||||
typedef typename apply_wrap0<
|
||||
f_
|
||||
>::type type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<
|
||||
typename F
|
||||
>
|
||||
aux::yes_tag
|
||||
is_bind_helper(bind0<F>*);
|
||||
|
||||
} // namespace aux
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<>
|
||||
struct bind_chooser<0>
|
||||
{
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef bind0<F> type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename F, typename T1
|
||||
>
|
||||
struct bind1
|
||||
{
|
||||
template<
|
||||
typename U1 = na, typename U2 = na, typename U3 = na
|
||||
, typename U4 = na, typename U5 = na
|
||||
>
|
||||
struct apply
|
||||
{
|
||||
private:
|
||||
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
|
||||
typedef typename r0::type a0;
|
||||
typedef typename r0::next n1;
|
||||
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T1,n1 > r1;
|
||||
typedef typename r1::type a1;
|
||||
typedef typename r1::next n2;
|
||||
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
|
||||
///
|
||||
public:
|
||||
typedef typename apply_wrap1<
|
||||
f_
|
||||
, typename t1::type
|
||||
>::type type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<
|
||||
typename F, typename T1
|
||||
>
|
||||
aux::yes_tag
|
||||
is_bind_helper(bind1< F,T1 >*);
|
||||
|
||||
} // namespace aux
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<>
|
||||
struct bind_chooser<1>
|
||||
{
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef bind1< F,T1 > type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2
|
||||
>
|
||||
struct bind2
|
||||
{
|
||||
template<
|
||||
typename U1 = na, typename U2 = na, typename U3 = na
|
||||
, typename U4 = na, typename U5 = na
|
||||
>
|
||||
struct apply
|
||||
{
|
||||
private:
|
||||
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
|
||||
typedef typename r0::type a0;
|
||||
typedef typename r0::next n1;
|
||||
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T1,n1 > r1;
|
||||
typedef typename r1::type a1;
|
||||
typedef typename r1::next n2;
|
||||
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T2,n2 > r2;
|
||||
typedef typename r2::type a2;
|
||||
typedef typename r2::next n3;
|
||||
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
|
||||
///
|
||||
public:
|
||||
typedef typename apply_wrap2<
|
||||
f_
|
||||
, typename t1::type, typename t2::type
|
||||
>::type type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2
|
||||
>
|
||||
aux::yes_tag
|
||||
is_bind_helper(bind2< F,T1,T2 >*);
|
||||
|
||||
} // namespace aux
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<>
|
||||
struct bind_chooser<2>
|
||||
{
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef bind2< F,T1,T2 > type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3
|
||||
>
|
||||
struct bind3
|
||||
{
|
||||
template<
|
||||
typename U1 = na, typename U2 = na, typename U3 = na
|
||||
, typename U4 = na, typename U5 = na
|
||||
>
|
||||
struct apply
|
||||
{
|
||||
private:
|
||||
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
|
||||
typedef typename r0::type a0;
|
||||
typedef typename r0::next n1;
|
||||
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T1,n1 > r1;
|
||||
typedef typename r1::type a1;
|
||||
typedef typename r1::next n2;
|
||||
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T2,n2 > r2;
|
||||
typedef typename r2::type a2;
|
||||
typedef typename r2::next n3;
|
||||
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T3,n3 > r3;
|
||||
typedef typename r3::type a3;
|
||||
typedef typename r3::next n4;
|
||||
typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
|
||||
///
|
||||
public:
|
||||
typedef typename apply_wrap3<
|
||||
f_
|
||||
, typename t1::type, typename t2::type, typename t3::type
|
||||
>::type type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3
|
||||
>
|
||||
aux::yes_tag
|
||||
is_bind_helper(bind3< F,T1,T2,T3 >*);
|
||||
|
||||
} // namespace aux
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<>
|
||||
struct bind_chooser<3>
|
||||
{
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef bind3< F,T1,T2,T3 > type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
>
|
||||
struct bind4
|
||||
{
|
||||
template<
|
||||
typename U1 = na, typename U2 = na, typename U3 = na
|
||||
, typename U4 = na, typename U5 = na
|
||||
>
|
||||
struct apply
|
||||
{
|
||||
private:
|
||||
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
|
||||
typedef typename r0::type a0;
|
||||
typedef typename r0::next n1;
|
||||
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T1,n1 > r1;
|
||||
typedef typename r1::type a1;
|
||||
typedef typename r1::next n2;
|
||||
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T2,n2 > r2;
|
||||
typedef typename r2::type a2;
|
||||
typedef typename r2::next n3;
|
||||
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T3,n3 > r3;
|
||||
typedef typename r3::type a3;
|
||||
typedef typename r3::next n4;
|
||||
typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T4,n4 > r4;
|
||||
typedef typename r4::type a4;
|
||||
typedef typename r4::next n5;
|
||||
typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
|
||||
///
|
||||
public:
|
||||
typedef typename apply_wrap4<
|
||||
f_
|
||||
, typename t1::type, typename t2::type, typename t3::type
|
||||
, typename t4::type
|
||||
>::type type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
>
|
||||
aux::yes_tag
|
||||
is_bind_helper(bind4< F,T1,T2,T3,T4 >*);
|
||||
|
||||
} // namespace aux
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<>
|
||||
struct bind_chooser<4>
|
||||
{
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef bind4< F,T1,T2,T3,T4 > type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct bind5
|
||||
{
|
||||
template<
|
||||
typename U1 = na, typename U2 = na, typename U3 = na
|
||||
, typename U4 = na, typename U5 = na
|
||||
>
|
||||
struct apply
|
||||
{
|
||||
private:
|
||||
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
|
||||
typedef typename r0::type a0;
|
||||
typedef typename r0::next n1;
|
||||
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T1,n1 > r1;
|
||||
typedef typename r1::type a1;
|
||||
typedef typename r1::next n2;
|
||||
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T2,n2 > r2;
|
||||
typedef typename r2::type a2;
|
||||
typedef typename r2::next n3;
|
||||
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T3,n3 > r3;
|
||||
typedef typename r3::type a3;
|
||||
typedef typename r3::next n4;
|
||||
typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T4,n4 > r4;
|
||||
typedef typename r4::type a4;
|
||||
typedef typename r4::next n5;
|
||||
typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
|
||||
///
|
||||
typedef aux::replace_unnamed_arg< T5,n5 > r5;
|
||||
typedef typename r5::type a5;
|
||||
typedef typename r5::next n6;
|
||||
typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
|
||||
///
|
||||
public:
|
||||
typedef typename apply_wrap5<
|
||||
f_
|
||||
, typename t1::type, typename t2::type, typename t3::type
|
||||
, typename t4::type, typename t5::type
|
||||
>::type type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
aux::yes_tag
|
||||
is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);
|
||||
|
||||
} // namespace aux
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
|
||||
|
||||
namespace aux {
|
||||
|
||||
template<>
|
||||
struct bind_chooser<5>
|
||||
{
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct result_
|
||||
{
|
||||
typedef bind5< F,T1,T2,T3,T4,T5 > type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
namespace aux {
|
||||
|
||||
template< typename T >
|
||||
struct is_bind_arg
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template<>
|
||||
struct is_bind_arg<na>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template<
|
||||
typename T1, typename T2, typename T3, typename T4, typename T5
|
||||
>
|
||||
struct bind_count_args
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, value =
|
||||
is_bind_arg<T1>::value + is_bind_arg<T2>::value
|
||||
+ is_bind_arg<T3>::value + is_bind_arg<T4>::value
|
||||
+ is_bind_arg<T5>::value
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<
|
||||
typename F, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct bind
|
||||
: aux::bind_chooser<
|
||||
aux::bind_count_args< T1,T2,T3,T4,T5 >::value
|
||||
>::template result_< F,T1,T2,T3,T4,T5 >::type
|
||||
{
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_ARITY_SPEC(
|
||||
6
|
||||
, bind
|
||||
)
|
||||
|
||||
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
|
||||
6
|
||||
, bind
|
||||
)
|
||||
}}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
// -*- Mode: C++ -*-
|
||||
/*
|
||||
* Class to handle the formatted string as returned from the fortran decoder
|
||||
*
|
||||
* VK3ACF August 2013
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DECODEDTEXT_H
|
||||
#define DECODEDTEXT_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
012345678901234567890123456789012345678901
|
||||
^ ^ ^ ^ ^ ^
|
||||
2343 -11 0.8 1259 # CQ VP2X/GM4WJS GL33
|
||||
2343 -11 0.8 1259 # CQ 999 VP2V/GM4WJS
|
||||
2343 -11 0.8 1259 # YV6BFE F6GUU R-08
|
||||
2343 -19 0.3 718 # VE6WQ SQ2NIJ -14
|
||||
2343 -7 0.3 815 # KK4DSD W7VP -16
|
||||
2343 -13 0.1 3627 @ CT1FBK IK5YZT R+02
|
||||
|
||||
0605 Tx 1259 # CQ VK3ACF QF22
|
||||
*/
|
||||
|
||||
class DecodedText
|
||||
{
|
||||
public:
|
||||
explicit DecodedText (QString const& message, bool, QString const& my_grid);
|
||||
|
||||
QString string() const { return string_; };
|
||||
QStringList messageWords () const;
|
||||
int indexOf(QString s) const { return string_.indexOf(s); };
|
||||
int indexOf(QString s, int i) const { return string_.indexOf(s,i); };
|
||||
QString mid(int f, int t) const { return string_.mid(f,t); };
|
||||
QString left(int i) const { return string_.left(i); };
|
||||
|
||||
void clear() { string_.clear(); };
|
||||
|
||||
QString CQersCall() const;
|
||||
|
||||
bool isJT65() const;
|
||||
bool isJT9() const;
|
||||
bool isTX() const;
|
||||
bool isStandardMessage () const {return is_standard_;}
|
||||
bool isLowConfidence () const;
|
||||
int frequencyOffset() const; // hertz offset from the tuned dial or rx frequency, aka audio frequency
|
||||
int snr() const;
|
||||
float dt() const;
|
||||
|
||||
// find and extract any report. Returns true if this is a standard message
|
||||
bool report(QString const& myBaseCall, QString const& dxBaseCall, /*mod*/QString& report) const;
|
||||
|
||||
// get the first message text word, usually the call
|
||||
QString call() const;
|
||||
|
||||
// get the second word, most likely the de call and the third word, most likely grid
|
||||
void deCallAndGrid(/*out*/QString& call, QString& grid) const;
|
||||
|
||||
unsigned timeInSeconds() const;
|
||||
|
||||
// returns a string of the SNR field with a leading + or - followed by two digits
|
||||
QString report() const;
|
||||
|
||||
private:
|
||||
// These define the columns in the decoded text where fields are to be found.
|
||||
// We rely on these columns being the same in the fortran code (lib/decoder.f90) that formats the decoded text
|
||||
enum Columns {column_time = 0,
|
||||
column_snr = 5,
|
||||
column_dt = 9,
|
||||
column_freq = 14,
|
||||
column_mode = 19,
|
||||
column_qsoText = 22 };
|
||||
|
||||
QString string_;
|
||||
int padding_;
|
||||
bool contest_mode_;
|
||||
QString message_;
|
||||
bool is_standard_;
|
||||
};
|
||||
|
||||
#endif // DECODEDTEXT_H
|
||||
@@ -0,0 +1,46 @@
|
||||
// chrono.cpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2008
|
||||
// Copyright Vicente J. Botet Escriba 2009
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_CHRONO_DETAIL_INLINED_CHRONO_HPP
|
||||
#define BOOST_CHRONO_DETAIL_INLINED_CHRONO_HPP
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/chrono/chrono.hpp>
|
||||
#if defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING
|
||||
#include <boost/system/system_error.hpp>
|
||||
#endif
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/chrono/detail/system.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// //
|
||||
// Platform-specific Implementations //
|
||||
// //
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// Windows //
|
||||
//----------------------------------------------------------------------------//
|
||||
#if defined(BOOST_CHRONO_WINDOWS_API)
|
||||
#include <boost/chrono/detail/inlined/win/chrono.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// Mac //
|
||||
//----------------------------------------------------------------------------//
|
||||
#elif defined(BOOST_CHRONO_MAC_API)
|
||||
#include <boost/chrono/detail/inlined/mac/chrono.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// POSIX //
|
||||
//----------------------------------------------------------------------------//
|
||||
#elif defined(BOOST_CHRONO_POSIX_API)
|
||||
#include <boost/chrono/detail/inlined/posix/chrono.hpp>
|
||||
|
||||
#endif // POSIX
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,180 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// *Preprocessed* version of the main "fold_impl.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
/// forward declaration
|
||||
|
||||
template<
|
||||
int N
|
||||
, typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl;
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< 0,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef state0 state;
|
||||
typedef iter0 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< 1,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
|
||||
|
||||
typedef state1 state;
|
||||
typedef iter1 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< 2,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, state1, typename deref<iter1>::type >::type state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
|
||||
|
||||
typedef state2 state;
|
||||
typedef iter2 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< 3,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, state1, typename deref<iter1>::type >::type state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp, state2, typename deref<iter2>::type >::type state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
|
||||
|
||||
typedef state3 state;
|
||||
typedef iter3 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< 4,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp, state1, typename deref<iter1>::type >::type state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp, state2, typename deref<iter2>::type >::type state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
typedef typename apply2< ForwardOp, state3, typename deref<iter3>::type >::type state4;
|
||||
typedef typename mpl::next<iter3>::type iter4;
|
||||
|
||||
|
||||
typedef state4 state;
|
||||
typedef iter4 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
int N
|
||||
, typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl
|
||||
{
|
||||
typedef fold_impl<
|
||||
4
|
||||
, First
|
||||
, Last
|
||||
, State
|
||||
, ForwardOp
|
||||
> chunk_;
|
||||
|
||||
typedef fold_impl<
|
||||
( (N - 4) < 0 ? 0 : N - 4 )
|
||||
, typename chunk_::iterator
|
||||
, Last
|
||||
, typename chunk_::state
|
||||
, ForwardOp
|
||||
> res_;
|
||||
|
||||
typedef typename res_::state state;
|
||||
typedef typename res_::iterator iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< -1,First,Last,State,ForwardOp >
|
||||
: fold_impl<
|
||||
-1
|
||||
, typename mpl::next<First>::type
|
||||
, Last
|
||||
, typename apply2<ForwardOp,State, typename deref<First>::type>::type
|
||||
, ForwardOp
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
template<
|
||||
typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct fold_impl< -1,Last,Last,State,ForwardOp >
|
||||
{
|
||||
typedef State state;
|
||||
typedef Last iterator;
|
||||
};
|
||||
|
||||
}}}
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp
|
||||
|
||||
[begin_description]
|
||||
Implementation of the Runge Kutta Cash Karp 5(4) method. It uses the generic error stepper.
|
||||
[end_description]
|
||||
|
||||
Copyright 2011-2013 Mario Mulansky
|
||||
Copyright 2011-2013 Karsten Ahnert
|
||||
|
||||
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_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
|
||||
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
|
||||
#include <boost/numeric/odeint/algebra/default_operations.hpp>
|
||||
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
|
||||
#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/util/state_wrapper.hpp>
|
||||
#include <boost/numeric/odeint/util/is_resizeable.hpp>
|
||||
#include <boost/numeric/odeint/util/resizer.hpp>
|
||||
|
||||
#include <boost/array.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_a1 : boost::array< Value , 1 >
|
||||
{
|
||||
rk54_ck_coefficients_a1( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 5 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_a2 : boost::array< Value , 2 >
|
||||
{
|
||||
rk54_ck_coefficients_a2( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 40 );
|
||||
(*this)[1] = static_cast<Value>( 9 )/static_cast<Value>( 40 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_a3 : boost::array< Value , 3 >
|
||||
{
|
||||
rk54_ck_coefficients_a3( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 10 );
|
||||
(*this)[1] = static_cast<Value>( -9 )/static_cast<Value>( 10 );
|
||||
(*this)[2] = static_cast<Value>( 6 )/static_cast<Value>( 5 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_a4 : boost::array< Value , 4 >
|
||||
{
|
||||
rk54_ck_coefficients_a4( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>( -11 )/static_cast<Value>( 54 );
|
||||
(*this)[1] = static_cast<Value>( 5 )/static_cast<Value>( 2 );
|
||||
(*this)[2] = static_cast<Value>( -70 )/static_cast<Value>( 27 );
|
||||
(*this)[3] = static_cast<Value>( 35 )/static_cast<Value>( 27 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_a5 : boost::array< Value , 5 >
|
||||
{
|
||||
rk54_ck_coefficients_a5( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>( 1631 )/static_cast<Value>( 55296 );
|
||||
(*this)[1] = static_cast<Value>( 175 )/static_cast<Value>( 512 );
|
||||
(*this)[2] = static_cast<Value>( 575 )/static_cast<Value>( 13824 );
|
||||
(*this)[3] = static_cast<Value>( 44275 )/static_cast<Value>( 110592 );
|
||||
(*this)[4] = static_cast<Value>( 253 )/static_cast<Value>( 4096 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_b : boost::array< Value , 6 >
|
||||
{
|
||||
rk54_ck_coefficients_b( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 );
|
||||
(*this)[1] = static_cast<Value>( 0 );
|
||||
(*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 );
|
||||
(*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 );
|
||||
(*this)[4] = static_cast<Value>( 0 );
|
||||
(*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_db : boost::array< Value , 6 >
|
||||
{
|
||||
rk54_ck_coefficients_db( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 ) - static_cast<Value>( 2825 )/static_cast<Value>( 27648 );
|
||||
(*this)[1] = static_cast<Value>( 0 );
|
||||
(*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 ) - static_cast<Value>( 18575 )/static_cast<Value>( 48384 );
|
||||
(*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 ) - static_cast<Value>( 13525 )/static_cast<Value>( 55296 );
|
||||
(*this)[4] = static_cast<Value>( -277 )/static_cast<Value>( 14336 );
|
||||
(*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 ) - static_cast<Value>( 1 )/static_cast<Value>( 4 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template< class Value = double >
|
||||
struct rk54_ck_coefficients_c : boost::array< Value , 6 >
|
||||
{
|
||||
rk54_ck_coefficients_c( void )
|
||||
{
|
||||
(*this)[0] = static_cast<Value>(0);
|
||||
(*this)[1] = static_cast<Value>( 1 )/static_cast<Value>( 5 );
|
||||
(*this)[2] = static_cast<Value>( 3 )/static_cast<Value>( 10 );
|
||||
(*this)[3] = static_cast<Value>( 3 )/static_cast<Value>( 5 );
|
||||
(*this)[4] = static_cast<Value>( 1 );
|
||||
(*this)[5] = static_cast<Value>( 7 )/static_cast<Value>( 8 );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
template<
|
||||
class State ,
|
||||
class Value = double ,
|
||||
class Deriv = State ,
|
||||
class Time = Value ,
|
||||
class Algebra = typename algebra_dispatcher< State >::algebra_type ,
|
||||
class Operations = typename operations_dispatcher< State >::operations_type ,
|
||||
class Resizer = initially_resizer
|
||||
>
|
||||
#ifndef DOXYGEN_SKIP
|
||||
class runge_kutta_cash_karp54 : public explicit_error_generic_rk< 6 , 5 , 5 , 4 ,
|
||||
State , Value , Deriv , Time , Algebra , Operations , Resizer >
|
||||
#else
|
||||
class runge_kutta_cash_karp54 : public explicit_error_generic_rk
|
||||
#endif
|
||||
{
|
||||
|
||||
public:
|
||||
#ifndef DOXYGEN_SKIP
|
||||
typedef explicit_error_generic_rk< 6 , 5 , 5 , 4 , State , Value , Deriv , Time ,
|
||||
Algebra , Operations , Resizer > stepper_base_type;
|
||||
#endif
|
||||
typedef typename stepper_base_type::state_type state_type;
|
||||
typedef typename stepper_base_type::value_type value_type;
|
||||
typedef typename stepper_base_type::deriv_type deriv_type;
|
||||
typedef typename stepper_base_type::time_type time_type;
|
||||
typedef typename stepper_base_type::algebra_type algebra_type;
|
||||
typedef typename stepper_base_type::operations_type operations_type;
|
||||
typedef typename stepper_base_type::resizer_type resizer_typ;
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
typedef typename stepper_base_type::stepper_type stepper_type;
|
||||
typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
|
||||
typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
|
||||
#endif
|
||||
|
||||
|
||||
runge_kutta_cash_karp54( const algebra_type &algebra = algebra_type() ) : stepper_base_type(
|
||||
boost::fusion::make_vector( rk54_ck_coefficients_a1<Value>() ,
|
||||
rk54_ck_coefficients_a2<Value>() ,
|
||||
rk54_ck_coefficients_a3<Value>() ,
|
||||
rk54_ck_coefficients_a4<Value>() ,
|
||||
rk54_ck_coefficients_a5<Value>() ) ,
|
||||
rk54_ck_coefficients_b<Value>() , rk54_ck_coefficients_db<Value>() , rk54_ck_coefficients_c<Value>() ,
|
||||
algebra )
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
/********** DOXYGEN **********/
|
||||
|
||||
/**
|
||||
* \class runge_kutta_cash_karp54
|
||||
* \brief The Runge-Kutta Cash-Karp method.
|
||||
*
|
||||
* The Runge-Kutta Cash-Karp method is one of the standard methods for
|
||||
* solving ordinary differential equations, see
|
||||
* <a href="http://en.wikipedia.org/wiki/Cash%E2%80%93Karp_methods">en.wikipedia.org/wiki/Cash-Karp_methods</a>.
|
||||
* The method is explicit and fulfills the Error Stepper concept. Step size control
|
||||
* is provided but continuous output is not available for this method.
|
||||
*
|
||||
* This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring template pattern).
|
||||
* Furthermore, it derivs from explicit_error_generic_rk which is a generic Runge-Kutta algorithm with error estimation.
|
||||
* For more details see explicit_error_stepper_base and explicit_error_generic_rk.
|
||||
*
|
||||
* \tparam State The state type.
|
||||
* \tparam Value The value type.
|
||||
* \tparam Deriv The type representing the time derivative of the state.
|
||||
* \tparam Time The time representing the independent variable - the time.
|
||||
* \tparam Algebra The algebra type.
|
||||
* \tparam Operations The operations type.
|
||||
* \tparam Resizer The resizer policy type.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn runge_kutta_cash_karp54::runge_kutta_cash_karp54( const algebra_type &algebra )
|
||||
* \brief Constructs the runge_kutta_cash_karp54 class. This constructor can be used as a default
|
||||
* constructor if the algebra has a default constructor.
|
||||
* \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED
|
||||
@@ -0,0 +1,29 @@
|
||||
// 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_SYSTEM_HPP
|
||||
#define BOOST_CHRONO_DETAIL_SYSTEM_HPP
|
||||
|
||||
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
#if ((BOOST_VERSION / 100000) < 2) && ((BOOST_VERSION / 100 % 1000) < 44)
|
||||
#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category
|
||||
#else
|
||||
#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category()
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_SYSTEM_NO_DEPRECATED
|
||||
#define BOOST_CHRONO_THROWS boost::throws()
|
||||
#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::throws())
|
||||
#else
|
||||
#define BOOST_CHRONO_THROWS boost::system::throws
|
||||
#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::system::throws)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,97 @@
|
||||
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/proto/transform/detail/preprocessed/default_function_impl.hpp>
|
||||
|
||||
#elif !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
#define BOOST_PROTO_DEF_FUN_INVOKE_ARG(Z, M, DATA) \
|
||||
BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA)
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/default_function_impl.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file default_function_impl.hpp
|
||||
/// Contains definition of the default_function_impl, the implementation of the
|
||||
/// _default transform for function-like nodes.
|
||||
//
|
||||
// Copyright 2008 Eric Niebler. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/default_function_impl.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#undef BOOST_PROTO_DEF_FUN_INVOKE_ARG
|
||||
|
||||
#else
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
template<typename Grammar, typename Expr, typename State, typename Data>
|
||||
struct default_function_impl<Grammar, Expr, State, Data, N>
|
||||
: transform_impl<Expr, State, Data>
|
||||
{
|
||||
BOOST_PP_REPEAT(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr)
|
||||
|
||||
typedef
|
||||
typename proto::detail::result_of_fixup<r0>::type
|
||||
function_type;
|
||||
|
||||
typedef
|
||||
typename BOOST_PROTO_RESULT_OF<
|
||||
function_type(BOOST_PP_ENUM_SHIFTED_PARAMS(N, r))
|
||||
>::type
|
||||
result_type;
|
||||
|
||||
result_type operator ()(
|
||||
typename default_function_impl::expr_param e
|
||||
, typename default_function_impl::state_param s
|
||||
, typename default_function_impl::data_param d
|
||||
) const
|
||||
{
|
||||
return this->invoke(e, s, d, is_member_function_pointer<function_type>());
|
||||
}
|
||||
|
||||
private:
|
||||
result_type invoke(
|
||||
typename default_function_impl::expr_param e
|
||||
, typename default_function_impl::state_param s
|
||||
, typename default_function_impl::data_param d
|
||||
, mpl::false_
|
||||
) const
|
||||
{
|
||||
return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)(
|
||||
BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, e)
|
||||
);
|
||||
}
|
||||
|
||||
result_type invoke(
|
||||
typename default_function_impl::expr_param e
|
||||
, typename default_function_impl::state_param s
|
||||
, typename default_function_impl::data_param d
|
||||
, mpl::true_
|
||||
) const
|
||||
{
|
||||
BOOST_PROTO_USE_GET_POINTER();
|
||||
typedef typename detail::class_member_traits<function_type>::class_type class_type;
|
||||
return (
|
||||
BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, e))) ->*
|
||||
BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
|
||||
)(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEF_FUN_INVOKE_ARG, e));
|
||||
}
|
||||
};
|
||||
|
||||
#undef N
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,636 @@
|
||||
/* boost random/discrete_distribution.hpp header file
|
||||
*
|
||||
* Copyright Steven Watanabe 2009-2011
|
||||
* 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$
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RANDOM_DISCRETE_DISTRIBUTION_HPP_INCLUDED
|
||||
#define BOOST_RANDOM_DISCRETE_DISTRIBUTION_HPP_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/random/uniform_01.hpp>
|
||||
#include <boost/random/uniform_int_distribution.hpp>
|
||||
#include <boost/random/detail/config.hpp>
|
||||
#include <boost/random/detail/operators.hpp>
|
||||
#include <boost/random/detail/vector_io.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
|
||||
#include <boost/random/detail/disable_warnings.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace random {
|
||||
namespace detail {
|
||||
|
||||
template<class IntType, class WeightType>
|
||||
struct integer_alias_table {
|
||||
WeightType get_weight(IntType bin) const {
|
||||
WeightType result = _average;
|
||||
if(bin < _excess) ++result;
|
||||
return result;
|
||||
}
|
||||
template<class Iter>
|
||||
WeightType init_average(Iter begin, Iter end) {
|
||||
WeightType weight_average = 0;
|
||||
IntType excess = 0;
|
||||
IntType n = 0;
|
||||
// weight_average * n + excess == current partial sum
|
||||
// This is a bit messy, but it's guaranteed not to overflow
|
||||
for(Iter iter = begin; iter != end; ++iter) {
|
||||
++n;
|
||||
if(*iter < weight_average) {
|
||||
WeightType diff = weight_average - *iter;
|
||||
weight_average -= diff / n;
|
||||
if(diff % n > excess) {
|
||||
--weight_average;
|
||||
excess += n - diff % n;
|
||||
} else {
|
||||
excess -= diff % n;
|
||||
}
|
||||
} else {
|
||||
WeightType diff = *iter - weight_average;
|
||||
weight_average += diff / n;
|
||||
if(diff % n < n - excess) {
|
||||
excess += diff % n;
|
||||
} else {
|
||||
++weight_average;
|
||||
excess -= n - diff % n;
|
||||
}
|
||||
}
|
||||
}
|
||||
_alias_table.resize(static_cast<std::size_t>(n));
|
||||
_average = weight_average;
|
||||
_excess = excess;
|
||||
return weight_average;
|
||||
}
|
||||
void init_empty()
|
||||
{
|
||||
_alias_table.clear();
|
||||
_alias_table.push_back(std::make_pair(static_cast<WeightType>(1),
|
||||
static_cast<IntType>(0)));
|
||||
_average = static_cast<WeightType>(1);
|
||||
_excess = static_cast<IntType>(0);
|
||||
}
|
||||
bool operator==(const integer_alias_table& other) const
|
||||
{
|
||||
return _alias_table == other._alias_table &&
|
||||
_average == other._average && _excess == other._excess;
|
||||
}
|
||||
static WeightType normalize(WeightType val, WeightType average)
|
||||
{
|
||||
return val;
|
||||
}
|
||||
static void normalize(std::vector<WeightType>&) {}
|
||||
template<class URNG>
|
||||
WeightType test(URNG &urng) const
|
||||
{
|
||||
return uniform_int_distribution<WeightType>(0, _average)(urng);
|
||||
}
|
||||
bool accept(IntType result, WeightType val) const
|
||||
{
|
||||
return result < _excess || val < _average;
|
||||
}
|
||||
static WeightType try_get_sum(const std::vector<WeightType>& weights)
|
||||
{
|
||||
WeightType result = static_cast<WeightType>(0);
|
||||
for(typename std::vector<WeightType>::const_iterator
|
||||
iter = weights.begin(), end = weights.end();
|
||||
iter != end; ++iter)
|
||||
{
|
||||
if((std::numeric_limits<WeightType>::max)() - result > *iter) {
|
||||
return static_cast<WeightType>(0);
|
||||
}
|
||||
result += *iter;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
template<class URNG>
|
||||
static WeightType generate_in_range(URNG &urng, WeightType max)
|
||||
{
|
||||
return uniform_int_distribution<WeightType>(
|
||||
static_cast<WeightType>(0), max-1)(urng);
|
||||
}
|
||||
typedef std::vector<std::pair<WeightType, IntType> > alias_table_t;
|
||||
alias_table_t _alias_table;
|
||||
WeightType _average;
|
||||
IntType _excess;
|
||||
};
|
||||
|
||||
template<class IntType, class WeightType>
|
||||
struct real_alias_table {
|
||||
WeightType get_weight(IntType) const
|
||||
{
|
||||
return WeightType(1.0);
|
||||
}
|
||||
template<class Iter>
|
||||
WeightType init_average(Iter first, Iter last)
|
||||
{
|
||||
std::size_t size = std::distance(first, last);
|
||||
WeightType weight_sum =
|
||||
std::accumulate(first, last, static_cast<WeightType>(0));
|
||||
_alias_table.resize(size);
|
||||
return weight_sum / size;
|
||||
}
|
||||
void init_empty()
|
||||
{
|
||||
_alias_table.clear();
|
||||
_alias_table.push_back(std::make_pair(static_cast<WeightType>(1),
|
||||
static_cast<IntType>(0)));
|
||||
}
|
||||
bool operator==(const real_alias_table& other) const
|
||||
{
|
||||
return _alias_table == other._alias_table;
|
||||
}
|
||||
static WeightType normalize(WeightType val, WeightType average)
|
||||
{
|
||||
return val / average;
|
||||
}
|
||||
static void normalize(std::vector<WeightType>& weights)
|
||||
{
|
||||
WeightType sum =
|
||||
std::accumulate(weights.begin(), weights.end(),
|
||||
static_cast<WeightType>(0));
|
||||
for(typename std::vector<WeightType>::iterator
|
||||
iter = weights.begin(),
|
||||
end = weights.end();
|
||||
iter != end; ++iter)
|
||||
{
|
||||
*iter /= sum;
|
||||
}
|
||||
}
|
||||
template<class URNG>
|
||||
WeightType test(URNG &urng) const
|
||||
{
|
||||
return uniform_01<WeightType>()(urng);
|
||||
}
|
||||
bool accept(IntType, WeightType) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
static WeightType try_get_sum(const std::vector<WeightType>& weights)
|
||||
{
|
||||
return static_cast<WeightType>(1);
|
||||
}
|
||||
template<class URNG>
|
||||
static WeightType generate_in_range(URNG &urng, WeightType)
|
||||
{
|
||||
return uniform_01<WeightType>()(urng);
|
||||
}
|
||||
typedef std::vector<std::pair<WeightType, IntType> > alias_table_t;
|
||||
alias_table_t _alias_table;
|
||||
};
|
||||
|
||||
template<bool IsIntegral>
|
||||
struct select_alias_table;
|
||||
|
||||
template<>
|
||||
struct select_alias_table<true> {
|
||||
template<class IntType, class WeightType>
|
||||
struct apply {
|
||||
typedef integer_alias_table<IntType, WeightType> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct select_alias_table<false> {
|
||||
template<class IntType, class WeightType>
|
||||
struct apply {
|
||||
typedef real_alias_table<IntType, WeightType> type;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The class @c discrete_distribution models a \random_distribution.
|
||||
* It produces integers in the range [0, n) with the probability
|
||||
* of producing each value is specified by the parameters of the
|
||||
* distribution.
|
||||
*/
|
||||
template<class IntType = int, class WeightType = double>
|
||||
class discrete_distribution {
|
||||
public:
|
||||
typedef WeightType input_type;
|
||||
typedef IntType result_type;
|
||||
|
||||
class param_type {
|
||||
public:
|
||||
|
||||
typedef discrete_distribution distribution_type;
|
||||
|
||||
/**
|
||||
* Constructs a @c param_type object, representing a distribution
|
||||
* with \f$p(0) = 1\f$ and \f$p(k|k>0) = 0\f$.
|
||||
*/
|
||||
param_type() : _probabilities(1, static_cast<WeightType>(1)) {}
|
||||
/**
|
||||
* If @c first == @c last, equivalent to the default constructor.
|
||||
* Otherwise, the values of the range represent weights for the
|
||||
* possible values of the distribution.
|
||||
*/
|
||||
template<class Iter>
|
||||
param_type(Iter first, Iter last) : _probabilities(first, last)
|
||||
{
|
||||
normalize();
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
/**
|
||||
* If wl.size() == 0, equivalent to the default constructor.
|
||||
* Otherwise, the values of the @c initializer_list represent
|
||||
* weights for the possible values of the distribution.
|
||||
*/
|
||||
param_type(const std::initializer_list<WeightType>& wl)
|
||||
: _probabilities(wl)
|
||||
{
|
||||
normalize();
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* If the range is empty, equivalent to the default constructor.
|
||||
* Otherwise, the elements of the range represent
|
||||
* weights for the possible values of the distribution.
|
||||
*/
|
||||
template<class Range>
|
||||
explicit param_type(const Range& range)
|
||||
: _probabilities(boost::begin(range), boost::end(range))
|
||||
{
|
||||
normalize();
|
||||
}
|
||||
|
||||
/**
|
||||
* If nw is zero, equivalent to the default constructor.
|
||||
* Otherwise, the range of the distribution is [0, nw),
|
||||
* and the weights are found by calling fw with values
|
||||
* evenly distributed between \f$\mbox{xmin} + \delta/2\f$ and
|
||||
* \f$\mbox{xmax} - \delta/2\f$, where
|
||||
* \f$\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}\f$.
|
||||
*/
|
||||
template<class Func>
|
||||
param_type(std::size_t nw, double xmin, double xmax, Func fw)
|
||||
{
|
||||
std::size_t n = (nw == 0) ? 1 : nw;
|
||||
double delta = (xmax - xmin) / n;
|
||||
BOOST_ASSERT(delta > 0);
|
||||
for(std::size_t k = 0; k < n; ++k) {
|
||||
_probabilities.push_back(fw(xmin + k*delta + delta/2));
|
||||
}
|
||||
normalize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a vector containing the probabilities of each possible
|
||||
* value of the distribution.
|
||||
*/
|
||||
std::vector<WeightType> probabilities() const
|
||||
{
|
||||
return _probabilities;
|
||||
}
|
||||
|
||||
/** Writes the parameters to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm)
|
||||
{
|
||||
detail::print_vector(os, parm._probabilities);
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads the parameters from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm)
|
||||
{
|
||||
std::vector<WeightType> temp;
|
||||
detail::read_vector(is, temp);
|
||||
if(is) {
|
||||
parm._probabilities.swap(temp);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
/** Returns true if the two sets of parameters are the same. */
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs)
|
||||
{
|
||||
return lhs._probabilities == rhs._probabilities;
|
||||
}
|
||||
/** Returns true if the two sets of parameters are different. */
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type)
|
||||
private:
|
||||
/// @cond show_private
|
||||
friend class discrete_distribution;
|
||||
explicit param_type(const discrete_distribution& dist)
|
||||
: _probabilities(dist.probabilities())
|
||||
{}
|
||||
void normalize()
|
||||
{
|
||||
impl_type::normalize(_probabilities);
|
||||
}
|
||||
std::vector<WeightType> _probabilities;
|
||||
/// @endcond
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new @c discrete_distribution object that has
|
||||
* \f$p(0) = 1\f$ and \f$p(i|i>0) = 0\f$.
|
||||
*/
|
||||
discrete_distribution()
|
||||
{
|
||||
_impl.init_empty();
|
||||
}
|
||||
/**
|
||||
* Constructs a discrete_distribution from an iterator range.
|
||||
* If @c first == @c last, equivalent to the default constructor.
|
||||
* Otherwise, the values of the range represent weights for the
|
||||
* possible values of the distribution.
|
||||
*/
|
||||
template<class Iter>
|
||||
discrete_distribution(Iter first, Iter last)
|
||||
{
|
||||
init(first, last);
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
/**
|
||||
* Constructs a @c discrete_distribution from a @c std::initializer_list.
|
||||
* If the @c initializer_list is empty, equivalent to the default
|
||||
* constructor. Otherwise, the values of the @c initializer_list
|
||||
* represent weights for the possible values of the distribution.
|
||||
* For example, given the distribution
|
||||
*
|
||||
* @code
|
||||
* discrete_distribution<> dist{1, 4, 5};
|
||||
* @endcode
|
||||
*
|
||||
* The probability of a 0 is 1/10, the probability of a 1 is 2/5,
|
||||
* the probability of a 2 is 1/2, and no other values are possible.
|
||||
*/
|
||||
discrete_distribution(std::initializer_list<WeightType> wl)
|
||||
{
|
||||
init(wl.begin(), wl.end());
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* Constructs a discrete_distribution from a Boost.Range range.
|
||||
* If the range is empty, equivalent to the default constructor.
|
||||
* Otherwise, the values of the range represent weights for the
|
||||
* possible values of the distribution.
|
||||
*/
|
||||
template<class Range>
|
||||
explicit discrete_distribution(const Range& range)
|
||||
{
|
||||
init(boost::begin(range), boost::end(range));
|
||||
}
|
||||
/**
|
||||
* Constructs a discrete_distribution that approximates a function.
|
||||
* If nw is zero, equivalent to the default constructor.
|
||||
* Otherwise, the range of the distribution is [0, nw),
|
||||
* and the weights are found by calling fw with values
|
||||
* evenly distributed between \f$\mbox{xmin} + \delta/2\f$ and
|
||||
* \f$\mbox{xmax} - \delta/2\f$, where
|
||||
* \f$\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}\f$.
|
||||
*/
|
||||
template<class Func>
|
||||
discrete_distribution(std::size_t nw, double xmin, double xmax, Func fw)
|
||||
{
|
||||
std::size_t n = (nw == 0) ? 1 : nw;
|
||||
double delta = (xmax - xmin) / n;
|
||||
BOOST_ASSERT(delta > 0);
|
||||
std::vector<WeightType> weights;
|
||||
for(std::size_t k = 0; k < n; ++k) {
|
||||
weights.push_back(fw(xmin + k*delta + delta/2));
|
||||
}
|
||||
init(weights.begin(), weights.end());
|
||||
}
|
||||
/**
|
||||
* Constructs a discrete_distribution from its parameters.
|
||||
*/
|
||||
explicit discrete_distribution(const param_type& parm)
|
||||
{
|
||||
param(parm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a value distributed according to the parameters of the
|
||||
* discrete_distribution.
|
||||
*/
|
||||
template<class URNG>
|
||||
IntType operator()(URNG& urng) const
|
||||
{
|
||||
BOOST_ASSERT(!_impl._alias_table.empty());
|
||||
IntType result;
|
||||
WeightType test;
|
||||
do {
|
||||
result = uniform_int_distribution<IntType>((min)(), (max)())(urng);
|
||||
test = _impl.test(urng);
|
||||
} while(!_impl.accept(result, test));
|
||||
if(test < _impl._alias_table[static_cast<std::size_t>(result)].first) {
|
||||
return result;
|
||||
} else {
|
||||
return(_impl._alias_table[static_cast<std::size_t>(result)].second);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a value distributed according to the parameters
|
||||
* specified by param.
|
||||
*/
|
||||
template<class URNG>
|
||||
IntType operator()(URNG& urng, const param_type& parm) const
|
||||
{
|
||||
if(WeightType limit = impl_type::try_get_sum(parm._probabilities)) {
|
||||
WeightType val = impl_type::generate_in_range(urng, limit);
|
||||
WeightType sum = 0;
|
||||
std::size_t result = 0;
|
||||
for(typename std::vector<WeightType>::const_iterator
|
||||
iter = parm._probabilities.begin(),
|
||||
end = parm._probabilities.end();
|
||||
iter != end; ++iter, ++result)
|
||||
{
|
||||
sum += *iter;
|
||||
if(sum > val) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// This shouldn't be reachable, but round-off error
|
||||
// can prevent any match from being found when val is
|
||||
// very close to 1.
|
||||
return static_cast<IntType>(parm._probabilities.size() - 1);
|
||||
} else {
|
||||
// WeightType is integral and sum(parm._probabilities)
|
||||
// would overflow. Just use the easy solution.
|
||||
return discrete_distribution(parm)(urng);
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns the smallest value that the distribution can produce. */
|
||||
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
|
||||
/** Returns the largest value that the distribution can produce. */
|
||||
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{ return static_cast<result_type>(_impl._alias_table.size() - 1); }
|
||||
|
||||
/**
|
||||
* Returns a vector containing the probabilities of each
|
||||
* value of the distribution. For example, given
|
||||
*
|
||||
* @code
|
||||
* discrete_distribution<> dist = { 1, 4, 5 };
|
||||
* std::vector<double> p = dist.param();
|
||||
* @endcode
|
||||
*
|
||||
* the vector, p will contain {0.1, 0.4, 0.5}.
|
||||
*
|
||||
* If @c WeightType is integral, then the weights
|
||||
* will be returned unchanged.
|
||||
*/
|
||||
std::vector<WeightType> probabilities() const
|
||||
{
|
||||
std::vector<WeightType> result(_impl._alias_table.size(), static_cast<WeightType>(0));
|
||||
std::size_t i = 0;
|
||||
for(typename impl_type::alias_table_t::const_iterator
|
||||
iter = _impl._alias_table.begin(),
|
||||
end = _impl._alias_table.end();
|
||||
iter != end; ++iter, ++i)
|
||||
{
|
||||
WeightType val = iter->first;
|
||||
result[i] += val;
|
||||
result[static_cast<std::size_t>(iter->second)] += _impl.get_weight(i) - val;
|
||||
}
|
||||
impl_type::normalize(result);
|
||||
return(result);
|
||||
}
|
||||
|
||||
/** Returns the parameters of the distribution. */
|
||||
param_type param() const
|
||||
{
|
||||
return param_type(*this);
|
||||
}
|
||||
/** Sets the parameters of the distribution. */
|
||||
void param(const param_type& parm)
|
||||
{
|
||||
init(parm._probabilities.begin(), parm._probabilities.end());
|
||||
}
|
||||
|
||||
/**
|
||||
* Effects: Subsequent uses of the distribution do not depend
|
||||
* on values produced by any engine prior to invoking reset.
|
||||
*/
|
||||
void reset() {}
|
||||
|
||||
/** Writes a distribution to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, discrete_distribution, dd)
|
||||
{
|
||||
os << dd.param();
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads a distribution from a @c std::istream */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, discrete_distribution, dd)
|
||||
{
|
||||
param_type parm;
|
||||
if(is >> parm) {
|
||||
dd.param(parm);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the two distributions will return the
|
||||
* same sequence of values, when passed equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(discrete_distribution, lhs, rhs)
|
||||
{
|
||||
return lhs._impl == rhs._impl;
|
||||
}
|
||||
/**
|
||||
* Returns true if the two distributions may return different
|
||||
* sequences of values, when passed equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(discrete_distribution)
|
||||
|
||||
private:
|
||||
|
||||
/// @cond show_private
|
||||
|
||||
template<class Iter>
|
||||
void init(Iter first, Iter last, std::input_iterator_tag)
|
||||
{
|
||||
std::vector<WeightType> temp(first, last);
|
||||
init(temp.begin(), temp.end());
|
||||
}
|
||||
template<class Iter>
|
||||
void init(Iter first, Iter last, std::forward_iterator_tag)
|
||||
{
|
||||
std::vector<std::pair<WeightType, IntType> > below_average;
|
||||
std::vector<std::pair<WeightType, IntType> > above_average;
|
||||
WeightType weight_average = _impl.init_average(first, last);
|
||||
WeightType normalized_average = _impl.get_weight(0);
|
||||
std::size_t i = 0;
|
||||
for(; first != last; ++first, ++i) {
|
||||
WeightType val = impl_type::normalize(*first, weight_average);
|
||||
std::pair<WeightType, IntType> elem(val, static_cast<IntType>(i));
|
||||
if(val < normalized_average) {
|
||||
below_average.push_back(elem);
|
||||
} else {
|
||||
above_average.push_back(elem);
|
||||
}
|
||||
}
|
||||
|
||||
typename impl_type::alias_table_t::iterator
|
||||
b_iter = below_average.begin(),
|
||||
b_end = below_average.end(),
|
||||
a_iter = above_average.begin(),
|
||||
a_end = above_average.end()
|
||||
;
|
||||
while(b_iter != b_end && a_iter != a_end) {
|
||||
_impl._alias_table[static_cast<std::size_t>(b_iter->second)] =
|
||||
std::make_pair(b_iter->first, a_iter->second);
|
||||
a_iter->first -= (_impl.get_weight(b_iter->second) - b_iter->first);
|
||||
if(a_iter->first < normalized_average) {
|
||||
*b_iter = *a_iter++;
|
||||
} else {
|
||||
++b_iter;
|
||||
}
|
||||
}
|
||||
for(; b_iter != b_end; ++b_iter) {
|
||||
_impl._alias_table[static_cast<std::size_t>(b_iter->second)].first =
|
||||
_impl.get_weight(b_iter->second);
|
||||
}
|
||||
for(; a_iter != a_end; ++a_iter) {
|
||||
_impl._alias_table[static_cast<std::size_t>(a_iter->second)].first =
|
||||
_impl.get_weight(a_iter->second);
|
||||
}
|
||||
}
|
||||
template<class Iter>
|
||||
void init(Iter first, Iter last)
|
||||
{
|
||||
if(first == last) {
|
||||
_impl.init_empty();
|
||||
} else {
|
||||
typename std::iterator_traits<Iter>::iterator_category category;
|
||||
init(first, last, category);
|
||||
}
|
||||
}
|
||||
typedef typename detail::select_alias_table<
|
||||
(::boost::is_integral<WeightType>::value)
|
||||
>::template apply<IntType, WeightType>::type impl_type;
|
||||
impl_type _impl;
|
||||
/// @endcond
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/random/detail/enable_warnings.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
// (C) Copyright 2005 Matthias Troyer
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Authors: Matthias Troyer
|
||||
|
||||
#ifndef BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP
|
||||
#define BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP
|
||||
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/basic_archive.hpp>
|
||||
#include <boost/mpi/detail/ignore_skeleton_oarchive.hpp>
|
||||
#include <boost/mpi/detail/mpi_datatype_primitive.hpp>
|
||||
#include <boost/mpi/datatype.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
|
||||
namespace boost { namespace mpi {
|
||||
|
||||
namespace detail {
|
||||
// an archive wrapper that stores only the data members but not the
|
||||
// special types defined by the serialization library
|
||||
// to define the data skeletons (classes, pointers, container sizes, ...)
|
||||
|
||||
class BOOST_MPI_DECL content_oarchive
|
||||
: public mpi_datatype_primitive,
|
||||
public ignore_skeleton_oarchive<content_oarchive>
|
||||
{
|
||||
public:
|
||||
content_oarchive()
|
||||
: committed(false)
|
||||
{}
|
||||
|
||||
content get_content()
|
||||
{
|
||||
if (!committed)
|
||||
{
|
||||
// create the content holder only once
|
||||
c=this->get_mpi_datatype();
|
||||
committed=true;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
private:
|
||||
bool committed;
|
||||
content c;
|
||||
};
|
||||
} // end namespace detail
|
||||
|
||||
template <class T>
|
||||
const content get_content(const T& x)
|
||||
{
|
||||
detail::content_oarchive ar;
|
||||
ar << x;
|
||||
return ar.get_content();
|
||||
}
|
||||
|
||||
} } // end namespace boost::mpi
|
||||
|
||||
// required by export
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::content_oarchive)
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::content_oarchive>)
|
||||
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::detail::content_oarchive)
|
||||
#endif // BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Reads cty.dat file
|
||||
* Establishes a map between prefixes and their country names
|
||||
* VK3ACF July 2013
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __COUNTRYDAT_H
|
||||
#define __COUNTRYDAT_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QHash>
|
||||
|
||||
|
||||
class CountryDat
|
||||
{
|
||||
public:
|
||||
void init(const QString filename);
|
||||
void load();
|
||||
QString find(QString prefix) const; // return country name or ""
|
||||
QStringList getCountryNames() const { return _countryNames; };
|
||||
|
||||
private:
|
||||
QString _extractName(const QString line) const;
|
||||
void _removeBrackets(QString &line, const QString a, const QString b) const;
|
||||
QStringList _extractPrefix(QString &line, bool &more) const;
|
||||
QString fixup (QString country, QString const& call) const;
|
||||
|
||||
QString _filename;
|
||||
QStringList _countryNames;
|
||||
QHash<QString, QString> _data;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,504 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/interprocess for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP
|
||||
#define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
#
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/interprocess/detail/config_begin.hpp>
|
||||
#include <boost/interprocess/detail/workaround.hpp>
|
||||
|
||||
#include <boost/interprocess/detail/atomic.hpp>
|
||||
#include <boost/interprocess/detail/os_thread_functions.hpp>
|
||||
#include <boost/interprocess/exceptions.hpp>
|
||||
#include <boost/container/detail/type_traits.hpp> //alignment_of, aligned_storage
|
||||
#include <boost/interprocess/detail/mpl.hpp>
|
||||
#include <boost/interprocess/sync/spin/wait.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace boost{
|
||||
namespace interprocess{
|
||||
namespace ipcdetail{
|
||||
|
||||
namespace intermodule_singleton_helpers {
|
||||
|
||||
inline void get_pid_creation_time_str(std::string &s)
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << get_current_process_id() << '_';
|
||||
stream.precision(6);
|
||||
stream << std::fixed << get_current_process_creation_time();
|
||||
s = stream.str();
|
||||
}
|
||||
|
||||
inline const char *get_map_base_name()
|
||||
{ return "bip.gmem.map."; }
|
||||
|
||||
inline void get_map_name(std::string &map_name)
|
||||
{
|
||||
get_pid_creation_time_str(map_name);
|
||||
map_name.insert(0, get_map_base_name());
|
||||
}
|
||||
|
||||
inline std::size_t get_map_size()
|
||||
{ return 65536; }
|
||||
|
||||
template<class ThreadSafeGlobalMap>
|
||||
struct thread_safe_global_map_dependant;
|
||||
|
||||
} //namespace intermodule_singleton_helpers {
|
||||
|
||||
//This class contains common code for all singleton types, so that we instantiate this
|
||||
//code just once per module. This class also holds a thread soafe global map
|
||||
//to be used by all instances protected with a reference count
|
||||
template<class ThreadSafeGlobalMap>
|
||||
class intermodule_singleton_common
|
||||
{
|
||||
public:
|
||||
typedef void*(singleton_constructor_t)(ThreadSafeGlobalMap &);
|
||||
typedef void (singleton_destructor_t)(void *, ThreadSafeGlobalMap &);
|
||||
|
||||
static const ::boost::uint32_t Uninitialized = 0u;
|
||||
static const ::boost::uint32_t Initializing = 1u;
|
||||
static const ::boost::uint32_t Initialized = 2u;
|
||||
static const ::boost::uint32_t Broken = 3u;
|
||||
static const ::boost::uint32_t Destroyed = 4u;
|
||||
|
||||
//Initialize this_module_singleton_ptr, creates the global map if needed and also creates an unique
|
||||
//opaque type in global map through a singleton_constructor_t function call,
|
||||
//initializing the passed pointer to that unique instance.
|
||||
//
|
||||
//We have two concurrency types here. a)the global map/singleton creation must
|
||||
//be safe between threads of this process but in different modules/dlls. b)
|
||||
//the pointer to the singleton is per-module, so we have to protect this
|
||||
//initization between threads of the same module.
|
||||
//
|
||||
//All static variables declared here are shared between inside a module
|
||||
//so atomic operations will synchronize only threads of the same module.
|
||||
static void initialize_singleton_logic
|
||||
(void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_constructor_t constructor, bool phoenix)
|
||||
{
|
||||
//If current module is not initialized enter to lock free logic
|
||||
if(atomic_read32(&this_module_singleton_initialized) != Initialized){
|
||||
//Now a single thread of the module will succeed in this CAS.
|
||||
//trying to pass from Uninitialized to Initializing
|
||||
::boost::uint32_t previous_module_singleton_initialized = atomic_cas32
|
||||
(&this_module_singleton_initialized, Initializing, Uninitialized);
|
||||
//If the thread succeeded the CAS (winner) it will compete with other
|
||||
//winner threads from other modules to create the global map
|
||||
if(previous_module_singleton_initialized == Destroyed){
|
||||
//Trying to resurrect a dead Phoenix singleton. Just try to
|
||||
//mark it as uninitialized and start again
|
||||
if(phoenix){
|
||||
atomic_cas32(&this_module_singleton_initialized, Uninitialized, Destroyed);
|
||||
previous_module_singleton_initialized = atomic_cas32
|
||||
(&this_module_singleton_initialized, Initializing, Uninitialized);
|
||||
}
|
||||
//Trying to resurrect a non-Phoenix dead singleton is an error
|
||||
else{
|
||||
throw interprocess_exception("Boost.Interprocess: Dead reference on non-Phoenix singleton of type");
|
||||
}
|
||||
}
|
||||
if(previous_module_singleton_initialized == Uninitialized){
|
||||
try{
|
||||
//Now initialize the global map, this function must solve concurrency
|
||||
//issues between threads of several modules
|
||||
initialize_global_map_handle();
|
||||
//Now try to create the singleton in global map.
|
||||
//This function solves concurrency issues
|
||||
//between threads of several modules
|
||||
ThreadSafeGlobalMap *const pmap = get_map_ptr();
|
||||
void *tmp = constructor(*pmap);
|
||||
//Increment the module reference count that reflects how many
|
||||
//singletons this module holds, so that we can safely destroy
|
||||
//module global map object when no singleton is left
|
||||
atomic_inc32(&this_module_singleton_count);
|
||||
//Insert a barrier before assigning the pointer to
|
||||
//make sure this assignment comes after the initialization
|
||||
atomic_write32(&this_module_singleton_initialized, Initializing);
|
||||
//Assign the singleton address to the module-local pointer
|
||||
ptr = tmp;
|
||||
//Memory barrier inserted, all previous operations should complete
|
||||
//before this one. Now marked as initialized
|
||||
atomic_write32(&this_module_singleton_initialized, Initialized);
|
||||
}
|
||||
catch(...){
|
||||
//Mark singleton failed to initialize
|
||||
atomic_write32(&this_module_singleton_initialized, Broken);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
//If previous state was initializing, this means that another winner thread is
|
||||
//trying to initialize the singleton. Just wait until completes its work.
|
||||
else if(previous_module_singleton_initialized == Initializing){
|
||||
spin_wait swait;
|
||||
while(1){
|
||||
previous_module_singleton_initialized = atomic_read32(&this_module_singleton_initialized);
|
||||
if(previous_module_singleton_initialized >= Initialized){
|
||||
//Already initialized, or exception thrown by initializer thread
|
||||
break;
|
||||
}
|
||||
else if(previous_module_singleton_initialized == Initializing){
|
||||
swait.yield();
|
||||
}
|
||||
else{
|
||||
//This can't be happening!
|
||||
BOOST_ASSERT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(previous_module_singleton_initialized == Initialized){
|
||||
//Nothing to do here, the singleton is ready
|
||||
}
|
||||
//If previous state was greater than initialized, then memory is broken
|
||||
//trying to initialize the singleton.
|
||||
else{//(previous_module_singleton_initialized > Initialized)
|
||||
throw interprocess_exception("boost::interprocess::intermodule_singleton initialization failed");
|
||||
}
|
||||
}
|
||||
BOOST_ASSERT(ptr != 0);
|
||||
}
|
||||
|
||||
static void finalize_singleton_logic(void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_destructor_t destructor)
|
||||
{
|
||||
//Protect destruction against lazy singletons not initialized in this execution
|
||||
if(ptr){
|
||||
//Note: this destructor might provoke a Phoenix singleton
|
||||
//resurrection. This means that this_module_singleton_count
|
||||
//might change after this call.
|
||||
ThreadSafeGlobalMap * const pmap = get_map_ptr();
|
||||
destructor(ptr, *pmap);
|
||||
ptr = 0;
|
||||
|
||||
//Memory barrier to make sure pointer is nulled.
|
||||
//Mark this singleton as destroyed.
|
||||
atomic_write32(&this_module_singleton_initialized, Destroyed);
|
||||
|
||||
//If this is the last singleton of this module
|
||||
//apply map destruction.
|
||||
//Note: singletons are destroyed when the module is unloaded
|
||||
//so no threads should be executing or holding references
|
||||
//to this module
|
||||
if(1 == atomic_dec32(&this_module_singleton_count)){
|
||||
destroy_global_map_handle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static ThreadSafeGlobalMap *get_map_ptr()
|
||||
{
|
||||
return static_cast<ThreadSafeGlobalMap *>(static_cast<void*>(mem_holder.map_mem));
|
||||
}
|
||||
|
||||
static void initialize_global_map_handle()
|
||||
{
|
||||
//Obtain unique map name and size
|
||||
spin_wait swait;
|
||||
while(1){
|
||||
//Try to pass map state to initializing
|
||||
::boost::uint32_t tmp = atomic_cas32(&this_module_map_initialized, Initializing, Uninitialized);
|
||||
if(tmp == Initialized || tmp == Broken){
|
||||
break;
|
||||
}
|
||||
else if(tmp == Destroyed){
|
||||
tmp = atomic_cas32(&this_module_map_initialized, Uninitialized, Destroyed);
|
||||
continue;
|
||||
}
|
||||
//If some other thread is doing the work wait
|
||||
else if(tmp == Initializing){
|
||||
swait.yield();
|
||||
}
|
||||
else{ //(tmp == Uninitialized)
|
||||
//If not initialized try it again?
|
||||
try{
|
||||
//Remove old global map from the system
|
||||
intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::remove_old_gmem();
|
||||
//in-place construction of the global map class
|
||||
ThreadSafeGlobalMap * const pmap = get_map_ptr();
|
||||
intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::construct_map(static_cast<void*>(pmap));
|
||||
//Use global map's internal lock to initialize the lock file
|
||||
//that will mark this gmem as "in use".
|
||||
typename intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::
|
||||
lock_file_logic f(*pmap);
|
||||
//If function failed (maybe a competing process has erased the shared
|
||||
//memory between creation and file locking), retry with a new instance.
|
||||
if(f.retry()){
|
||||
pmap->~ThreadSafeGlobalMap();
|
||||
atomic_write32(&this_module_map_initialized, Destroyed);
|
||||
}
|
||||
else{
|
||||
//Locking succeeded, so this global map module-instance is ready
|
||||
atomic_write32(&this_module_map_initialized, Initialized);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(...){
|
||||
//
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void destroy_global_map_handle()
|
||||
{
|
||||
if(!atomic_read32(&this_module_singleton_count)){
|
||||
//This module is being unloaded, so destroy
|
||||
//the global map object of this module
|
||||
//and unlink the global map if it's the last
|
||||
ThreadSafeGlobalMap * const pmap = get_map_ptr();
|
||||
typename intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::
|
||||
unlink_map_logic f(*pmap);
|
||||
pmap->~ThreadSafeGlobalMap();
|
||||
atomic_write32(&this_module_map_initialized, Destroyed);
|
||||
//Do some cleanup for other processes old gmem instances
|
||||
intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::remove_old_gmem();
|
||||
}
|
||||
}
|
||||
|
||||
//Static data, zero-initalized without any dependencies
|
||||
//this_module_singleton_count is the number of singletons used by this module
|
||||
static volatile boost::uint32_t this_module_singleton_count;
|
||||
|
||||
//this_module_map_initialized is the state of this module's map class object.
|
||||
//Values: Uninitialized, Initializing, Initialized, Broken
|
||||
static volatile boost::uint32_t this_module_map_initialized;
|
||||
|
||||
//Raw memory to construct the global map manager
|
||||
static union mem_holder_t
|
||||
{
|
||||
unsigned char map_mem [sizeof(ThreadSafeGlobalMap)];
|
||||
::boost::container::container_detail::max_align_t aligner;
|
||||
} mem_holder;
|
||||
};
|
||||
|
||||
template<class ThreadSafeGlobalMap>
|
||||
volatile boost::uint32_t intermodule_singleton_common<ThreadSafeGlobalMap>::this_module_singleton_count;
|
||||
|
||||
template<class ThreadSafeGlobalMap>
|
||||
volatile boost::uint32_t intermodule_singleton_common<ThreadSafeGlobalMap>::this_module_map_initialized;
|
||||
|
||||
template<class ThreadSafeGlobalMap>
|
||||
typename intermodule_singleton_common<ThreadSafeGlobalMap>::mem_holder_t
|
||||
intermodule_singleton_common<ThreadSafeGlobalMap>::mem_holder;
|
||||
|
||||
//A reference count to be stored in global map holding the number
|
||||
//of singletons (one per module) attached to the instance pointed by
|
||||
//the internal ptr.
|
||||
struct ref_count_ptr
|
||||
{
|
||||
ref_count_ptr(void *p, boost::uint32_t count)
|
||||
: ptr(p), singleton_ref_count(count)
|
||||
{}
|
||||
void *ptr;
|
||||
//This reference count serves to count the number of attached
|
||||
//modules to this singleton
|
||||
volatile boost::uint32_t singleton_ref_count;
|
||||
};
|
||||
|
||||
|
||||
//Now this class is a singleton, initializing the singleton in
|
||||
//the first get() function call if LazyInit is true. If false
|
||||
//then the singleton will be initialized when loading the module.
|
||||
template<typename C, bool LazyInit, bool Phoenix, class ThreadSafeGlobalMap>
|
||||
class intermodule_singleton_impl
|
||||
{
|
||||
public:
|
||||
|
||||
static C& get() //Let's make inlining easy
|
||||
{
|
||||
if(!this_module_singleton_ptr){
|
||||
if(lifetime.dummy_function()){ //This forces lifetime instantiation, for reference counted destruction
|
||||
atentry_work();
|
||||
}
|
||||
}
|
||||
return *static_cast<C*>(this_module_singleton_ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static void atentry_work()
|
||||
{
|
||||
intermodule_singleton_common<ThreadSafeGlobalMap>::initialize_singleton_logic
|
||||
(this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor, Phoenix);
|
||||
}
|
||||
|
||||
static void atexit_work()
|
||||
{
|
||||
intermodule_singleton_common<ThreadSafeGlobalMap>::finalize_singleton_logic
|
||||
(this_module_singleton_ptr, this_module_singleton_initialized, singleton_destructor);
|
||||
}
|
||||
|
||||
//These statics will be zero-initialized without any constructor call dependency
|
||||
//this_module_singleton_ptr will be a module-local pointer to the singleton
|
||||
static void* this_module_singleton_ptr;
|
||||
|
||||
//this_module_singleton_count will be used to synchronize threads of the same module
|
||||
//for access to a singleton instance, and to flag the state of the
|
||||
//singleton.
|
||||
static volatile boost::uint32_t this_module_singleton_initialized;
|
||||
|
||||
//This class destructor will trigger singleton destruction
|
||||
struct lifetime_type_lazy
|
||||
{
|
||||
bool dummy_function()
|
||||
{ return m_dummy == 0; }
|
||||
|
||||
~lifetime_type_lazy()
|
||||
{
|
||||
//if(!Phoenix){
|
||||
//atexit_work();
|
||||
//}
|
||||
}
|
||||
|
||||
//Dummy volatile so that the compiler can't resolve its value at compile-time
|
||||
//and can't avoid lifetime_type instantiation if dummy_function() is called.
|
||||
static volatile int m_dummy;
|
||||
};
|
||||
|
||||
struct lifetime_type_static
|
||||
: public lifetime_type_lazy
|
||||
{
|
||||
lifetime_type_static()
|
||||
{ atentry_work(); }
|
||||
};
|
||||
|
||||
typedef typename if_c
|
||||
<LazyInit, lifetime_type_lazy, lifetime_type_static>::type lifetime_type;
|
||||
|
||||
static lifetime_type lifetime;
|
||||
|
||||
//A functor to be executed inside global map lock that just
|
||||
//searches for the singleton in map and if not present creates a new one.
|
||||
//If singleton constructor throws, the exception is propagated
|
||||
struct init_atomic_func
|
||||
{
|
||||
init_atomic_func(ThreadSafeGlobalMap &m)
|
||||
: m_map(m), ret_ptr()
|
||||
{}
|
||||
|
||||
void operator()()
|
||||
{
|
||||
ref_count_ptr *rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::find(m_map, typeid(C).name());
|
||||
if(!rcount){
|
||||
C *p = new C;
|
||||
try{
|
||||
ref_count_ptr val(p, 0u);
|
||||
rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::insert(m_map, typeid(C).name(), val);
|
||||
}
|
||||
catch(...){
|
||||
intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::erase(m_map, typeid(C).name());
|
||||
delete p;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
//if(Phoenix){
|
||||
std::atexit(&atexit_work);
|
||||
//}
|
||||
atomic_inc32(&rcount->singleton_ref_count);
|
||||
ret_ptr = rcount->ptr;
|
||||
}
|
||||
void *data() const
|
||||
{ return ret_ptr; }
|
||||
|
||||
private:
|
||||
ThreadSafeGlobalMap &m_map;
|
||||
void *ret_ptr;
|
||||
};
|
||||
|
||||
//A functor to be executed inside global map lock that just
|
||||
//deletes the singleton in map if the attached count reaches to zero
|
||||
struct fini_atomic_func
|
||||
{
|
||||
fini_atomic_func(ThreadSafeGlobalMap &m)
|
||||
: m_map(m)
|
||||
{}
|
||||
|
||||
void operator()()
|
||||
{
|
||||
ref_count_ptr *rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::find(m_map, typeid(C).name());
|
||||
//The object must exist
|
||||
BOOST_ASSERT(rcount);
|
||||
BOOST_ASSERT(rcount->singleton_ref_count > 0);
|
||||
//Check if last reference
|
||||
if(atomic_dec32(&rcount->singleton_ref_count) == 1){
|
||||
//If last, destroy the object
|
||||
BOOST_ASSERT(rcount->ptr != 0);
|
||||
C *pc = static_cast<C*>(rcount->ptr);
|
||||
//Now destroy map entry
|
||||
bool destroyed = intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::erase(m_map, typeid(C).name());
|
||||
(void)destroyed; BOOST_ASSERT(destroyed == true);
|
||||
delete pc;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ThreadSafeGlobalMap &m_map;
|
||||
};
|
||||
|
||||
//A wrapper to execute init_atomic_func
|
||||
static void *singleton_constructor(ThreadSafeGlobalMap &map)
|
||||
{
|
||||
init_atomic_func f(map);
|
||||
intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::atomic_func(map, f);
|
||||
return f.data();
|
||||
}
|
||||
|
||||
//A wrapper to execute fini_atomic_func
|
||||
static void singleton_destructor(void *p, ThreadSafeGlobalMap &map)
|
||||
{ (void)p;
|
||||
fini_atomic_func f(map);
|
||||
intermodule_singleton_helpers::thread_safe_global_map_dependant
|
||||
<ThreadSafeGlobalMap>::atomic_func(map, f);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
|
||||
volatile int intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::lifetime_type_lazy::m_dummy = 0;
|
||||
|
||||
//These will be zero-initialized by the loader
|
||||
template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
|
||||
void *intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::this_module_singleton_ptr = 0;
|
||||
|
||||
template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
|
||||
volatile boost::uint32_t intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::this_module_singleton_initialized = 0;
|
||||
|
||||
template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
|
||||
typename intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::lifetime_type
|
||||
intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::lifetime;
|
||||
|
||||
} //namespace ipcdetail{
|
||||
} //namespace interprocess{
|
||||
} //namespace boost{
|
||||
|
||||
#include <boost/interprocess/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP
|
||||
Reference in New Issue
Block a user