Initial Commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
template <
|
||||
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_
|
||||
>
|
||||
struct tuple;
|
||||
}}
|
||||
@@ -0,0 +1,205 @@
|
||||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// (C) Copyright David Abrahams 2003.
|
||||
// (C) Copyright Boris Gubenko 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)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Rogue Wave std lib:
|
||||
|
||||
#define BOOST_RW_STDLIB 1
|
||||
|
||||
#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
# error This is not the Rogue Wave standard library
|
||||
# endif
|
||||
#endif
|
||||
//
|
||||
// figure out a consistent version number:
|
||||
//
|
||||
#ifndef _RWSTD_VER
|
||||
# define BOOST_RWSTD_VER 0x010000
|
||||
#elif _RWSTD_VER < 0x010000
|
||||
# define BOOST_RWSTD_VER (_RWSTD_VER << 8)
|
||||
#else
|
||||
# define BOOST_RWSTD_VER _RWSTD_VER
|
||||
#endif
|
||||
|
||||
#ifndef _RWSTD_VER
|
||||
# define BOOST_STDLIB "Rogue Wave standard library version (Unknown version)"
|
||||
#elif _RWSTD_VER < 0x04010200
|
||||
# define BOOST_STDLIB "Rogue Wave standard library version " BOOST_STRINGIZE(_RWSTD_VER)
|
||||
#else
|
||||
# ifdef _RWSTD_VER_STR
|
||||
# define BOOST_STDLIB "Apache STDCXX standard library version " _RWSTD_VER_STR
|
||||
# else
|
||||
# define BOOST_STDLIB "Apache STDCXX standard library version " BOOST_STRINGIZE(_RWSTD_VER)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Prior to version 2.2.0 the primary template for std::numeric_limits
|
||||
// does not have compile time constants, even though specializations of that
|
||||
// template do:
|
||||
//
|
||||
#if BOOST_RWSTD_VER < 0x020200
|
||||
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
#endif
|
||||
|
||||
// Sun CC 5.5 patch 113817-07 adds long long specialization, but does not change the
|
||||
// library version number (http://sunsolve6.sun.com/search/document.do?assetkey=1-21-113817):
|
||||
#if BOOST_RWSTD_VER <= 0x020101 && (!defined(__SUNPRO_CC) || (__SUNPRO_CC < 0x550))
|
||||
# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
|
||||
# endif
|
||||
|
||||
//
|
||||
// Borland version of numeric_limits lacks __int64 specialisation:
|
||||
//
|
||||
#ifdef __BORLANDC__
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
#endif
|
||||
|
||||
//
|
||||
// No std::iterator if it can't figure out default template args:
|
||||
//
|
||||
#if defined(_RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || defined(RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || (BOOST_RWSTD_VER < 0x020000)
|
||||
# define BOOST_NO_STD_ITERATOR
|
||||
#endif
|
||||
|
||||
//
|
||||
// No iterator traits without partial specialization:
|
||||
//
|
||||
#if defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) || defined(RWSTD_NO_CLASS_PARTIAL_SPEC)
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Prior to version 2.0, std::auto_ptr was buggy, and there were no
|
||||
// new-style iostreams, and no conformant std::allocator:
|
||||
//
|
||||
#if (BOOST_RWSTD_VER < 0x020000)
|
||||
# define BOOST_NO_AUTO_PTR
|
||||
# define BOOST_NO_STRINGSTREAM
|
||||
# define BOOST_NO_STD_ALLOCATOR
|
||||
# define BOOST_NO_STD_LOCALE
|
||||
#endif
|
||||
|
||||
//
|
||||
// No template iterator constructors without member template support:
|
||||
//
|
||||
#if defined(RWSTD_NO_MEMBER_TEMPLATES) || defined(_RWSTD_NO_MEMBER_TEMPLATES)
|
||||
# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
|
||||
#endif
|
||||
|
||||
//
|
||||
// RW defines _RWSTD_ALLOCATOR if the allocator is conformant and in use
|
||||
// (the or _HPACC_ part is a hack - the library seems to define _RWSTD_ALLOCATOR
|
||||
// on HP aCC systems even though the allocator is in fact broken):
|
||||
//
|
||||
#if !defined(_RWSTD_ALLOCATOR) || (defined(__HP_aCC) && __HP_aCC <= 33100)
|
||||
# define BOOST_NO_STD_ALLOCATOR
|
||||
#endif
|
||||
|
||||
//
|
||||
// If we have a std::locale, we still may not have std::use_facet:
|
||||
//
|
||||
#if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE) && !defined(BOOST_NO_STD_LOCALE)
|
||||
# define BOOST_NO_STD_USE_FACET
|
||||
# define BOOST_HAS_TWO_ARG_USE_FACET
|
||||
#endif
|
||||
|
||||
//
|
||||
// There's no std::distance prior to version 2, or without
|
||||
// partial specialization support:
|
||||
//
|
||||
#if (BOOST_RWSTD_VER < 0x020000) || defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
|
||||
#define BOOST_NO_STD_DISTANCE
|
||||
#endif
|
||||
|
||||
//
|
||||
// Some versions of the rogue wave library don't have assignable
|
||||
// OutputIterators:
|
||||
//
|
||||
#if BOOST_RWSTD_VER < 0x020100
|
||||
# define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
|
||||
#endif
|
||||
|
||||
//
|
||||
// Disable BOOST_HAS_LONG_LONG when the library has no support for it.
|
||||
//
|
||||
#if !defined(_RWSTD_LONG_LONG) && defined(BOOST_HAS_LONG_LONG)
|
||||
# undef BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
|
||||
//
|
||||
// check that on HP-UX, the proper RW library is used
|
||||
//
|
||||
#if defined(__HP_aCC) && !defined(_HP_NAMESPACE_STD)
|
||||
# error "Boost requires Standard RW library. Please compile and link with -AA"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Define macros specific to RW V2.2 on HP-UX
|
||||
//
|
||||
#if defined(__HP_aCC) && (BOOST_RWSTD_VER == 0x02020100)
|
||||
# ifndef __HP_TC1_MAKE_PAIR
|
||||
# define __HP_TC1_MAKE_PAIR
|
||||
# endif
|
||||
# ifndef _HP_INSTANTIATE_STD2_VL
|
||||
# define _HP_INSTANTIATE_STD2_VL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if _RWSTD_VER < 0x05000000
|
||||
# define BOOST_NO_CXX11_HDR_ARRAY
|
||||
#endif
|
||||
// type_traits header is incomplete:
|
||||
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
|
||||
//
|
||||
// C++0x headers not yet implemented
|
||||
//
|
||||
# define BOOST_NO_CXX11_HDR_CHRONO
|
||||
# define BOOST_NO_CXX11_HDR_CODECVT
|
||||
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
|
||||
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
|
||||
# define BOOST_NO_CXX11_HDR_FUTURE
|
||||
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
# define BOOST_NO_CXX11_HDR_MUTEX
|
||||
# define BOOST_NO_CXX11_HDR_RANDOM
|
||||
# define BOOST_NO_CXX11_HDR_RATIO
|
||||
# define BOOST_NO_CXX11_HDR_REGEX
|
||||
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
|
||||
# define BOOST_NO_CXX11_HDR_THREAD
|
||||
# define BOOST_NO_CXX11_HDR_TUPLE
|
||||
# define BOOST_NO_CXX11_HDR_TYPEINDEX
|
||||
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_CXX11_NUMERIC_LIMITS
|
||||
# define BOOST_NO_CXX11_ALLOCATOR
|
||||
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
|
||||
# define BOOST_NO_CXX11_SMART_PTR
|
||||
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
# define BOOST_NO_CXX14_HDR_SHARED_MUTEX
|
||||
#elif __cplusplus < 201402
|
||||
# define BOOST_NO_CXX14_HDR_SHARED_MUTEX
|
||||
#endif
|
||||
#else
|
||||
# define BOOST_NO_CXX14_HDR_SHARED_MUTEX
|
||||
#endif
|
||||
|
||||
// C++14 features
|
||||
# define BOOST_NO_CXX14_STD_EXCHANGE
|
||||
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
@@ -0,0 +1,42 @@
|
||||
subroutine ft8_downsample(dd,newdat,f0,c1)
|
||||
|
||||
! Downconvert to complex data sampled at 200 Hz ==> 32 samples/symbol
|
||||
|
||||
parameter (NMAX=15*12000,NSPS=1920)
|
||||
parameter (NFFT1=192000,NFFT2=3200) !192000/60 = 3200
|
||||
|
||||
logical newdat
|
||||
complex c1(0:NFFT2-1)
|
||||
complex cx(0:NFFT1/2)
|
||||
real dd(NMAX),x(NFFT1)
|
||||
equivalence (x,cx)
|
||||
save cx
|
||||
|
||||
if(newdat) then
|
||||
! Data in dd have changed, recompute the long FFT
|
||||
x(1:NMAX)=dd
|
||||
x(NMAX+1:NFFT1)=0. !Zero-pad the x array
|
||||
call four2a(cx,NFFT1,1,-1,0) !r2c FFT to freq domain
|
||||
newdat=.false.
|
||||
endif
|
||||
|
||||
df=12000.0/NFFT1
|
||||
baud=12000.0/NSPS
|
||||
i0=nint(f0/df)
|
||||
ft=f0+8.0*baud
|
||||
it=min(nint(ft/df),NFFT1/2)
|
||||
fb=f0-1.0*baud
|
||||
ib=max(1,nint(fb/df))
|
||||
k=0
|
||||
c1=0.
|
||||
do i=ib,it
|
||||
c1(k)=cx(i)
|
||||
k=k+1
|
||||
enddo
|
||||
c1=cshift(c1,i0-ib)
|
||||
call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain
|
||||
fac=1.0/sqrt(float(NFFT1)*NFFT2)
|
||||
c1=fac*c1
|
||||
|
||||
return
|
||||
end subroutine ft8_downsample
|
||||
@@ -0,0 +1,85 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2005-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_CREATION_TAGS_HPP
|
||||
#define BOOST_INTERPROCESS_CREATION_TAGS_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>
|
||||
|
||||
namespace boost {
|
||||
namespace interprocess {
|
||||
|
||||
//!Tag to indicate that the resource must
|
||||
//!be only created
|
||||
struct create_only_t {};
|
||||
|
||||
//!Tag to indicate that the resource must
|
||||
//!be only opened
|
||||
struct open_only_t {};
|
||||
|
||||
//!Tag to indicate that the resource must
|
||||
//!be only opened for reading
|
||||
struct open_read_only_t {};
|
||||
|
||||
//!Tag to indicate that the resource must
|
||||
//!be only opened privately for reading
|
||||
struct open_read_private_t {};
|
||||
|
||||
//!Tag to indicate that the resource must
|
||||
//!be only opened for reading
|
||||
struct open_copy_on_write_t {};
|
||||
|
||||
//!Tag to indicate that the resource must
|
||||
//!be created. If already created, it must be opened.
|
||||
struct open_or_create_t {};
|
||||
|
||||
//!Value to indicate that the resource must
|
||||
//!be only created
|
||||
static const create_only_t create_only = create_only_t();
|
||||
|
||||
//!Value to indicate that the resource must
|
||||
//!be only opened
|
||||
static const open_only_t open_only = open_only_t();
|
||||
|
||||
//!Value to indicate that the resource must
|
||||
//!be only opened for reading
|
||||
static const open_read_only_t open_read_only = open_read_only_t();
|
||||
|
||||
//!Value to indicate that the resource must
|
||||
//!be created. If already created, it must be opened.
|
||||
static const open_or_create_t open_or_create = open_or_create_t();
|
||||
|
||||
//!Value to indicate that the resource must
|
||||
//!be only opened for reading
|
||||
static const open_copy_on_write_t open_copy_on_write = open_copy_on_write_t();
|
||||
|
||||
namespace ipcdetail {
|
||||
|
||||
enum create_enum_t
|
||||
{ DoCreate, DoOpen, DoOpenOrCreate };
|
||||
|
||||
} //namespace ipcdetail {
|
||||
|
||||
} //namespace interprocess {
|
||||
} //namespace boost {
|
||||
|
||||
#include <boost/interprocess/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_INTERPROCESS_CREATION_TAGS_HPP
|
||||
|
||||
@@ -0,0 +1,350 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-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)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/map/map10.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct m_at_impl<0>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item0 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<1>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item0;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0
|
||||
>
|
||||
struct map1
|
||||
: m_item<
|
||||
1
|
||||
, typename P0::first
|
||||
, typename P0::second
|
||||
, map0< >
|
||||
>
|
||||
{
|
||||
typedef map1 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<1>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item1 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<2>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item1;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1
|
||||
>
|
||||
struct map2
|
||||
: m_item<
|
||||
2
|
||||
, typename P1::first
|
||||
, typename P1::second
|
||||
, map1<P0>
|
||||
>
|
||||
{
|
||||
typedef map2 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<2>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item2 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<3>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item2;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2
|
||||
>
|
||||
struct map3
|
||||
: m_item<
|
||||
3
|
||||
, typename P2::first
|
||||
, typename P2::second
|
||||
, map2< P0,P1 >
|
||||
>
|
||||
{
|
||||
typedef map3 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<3>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item3 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<4>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item3;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3
|
||||
>
|
||||
struct map4
|
||||
: m_item<
|
||||
4
|
||||
, typename P3::first
|
||||
, typename P3::second
|
||||
, map3< P0,P1,P2 >
|
||||
>
|
||||
{
|
||||
typedef map4 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<4>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item4 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<5>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item4;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
>
|
||||
struct map5
|
||||
: m_item<
|
||||
5
|
||||
, typename P4::first
|
||||
, typename P4::second
|
||||
, map4< P0,P1,P2,P3 >
|
||||
>
|
||||
{
|
||||
typedef map5 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<5>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item5 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<6>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item5;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5
|
||||
>
|
||||
struct map6
|
||||
: m_item<
|
||||
6
|
||||
, typename P5::first
|
||||
, typename P5::second
|
||||
, map5< P0,P1,P2,P3,P4 >
|
||||
>
|
||||
{
|
||||
typedef map6 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<6>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item6 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<7>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item6;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6
|
||||
>
|
||||
struct map7
|
||||
: m_item<
|
||||
7
|
||||
, typename P6::first
|
||||
, typename P6::second
|
||||
, map6< P0,P1,P2,P3,P4,P5 >
|
||||
>
|
||||
{
|
||||
typedef map7 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<7>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item7 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<8>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item7;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6, typename P7
|
||||
>
|
||||
struct map8
|
||||
: m_item<
|
||||
8
|
||||
, typename P7::first
|
||||
, typename P7::second
|
||||
, map7< P0,P1,P2,P3,P4,P5,P6 >
|
||||
>
|
||||
{
|
||||
typedef map8 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<8>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item8 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<9>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item8;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6, typename P7, typename P8
|
||||
>
|
||||
struct map9
|
||||
: m_item<
|
||||
9
|
||||
, typename P8::first
|
||||
, typename P8::second
|
||||
, map8< P0,P1,P2,P3,P4,P5,P6,P7 >
|
||||
>
|
||||
{
|
||||
typedef map9 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_at_impl<9>
|
||||
{
|
||||
template< typename Map > struct result_
|
||||
{
|
||||
typedef typename Map::item9 type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct m_item_impl<10>
|
||||
{
|
||||
template< typename Key, typename T, typename Base > struct result_
|
||||
: m_item_< Key,T,Base >
|
||||
{
|
||||
typedef pair< Key,T > item9;
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6, typename P7, typename P8, typename P9
|
||||
>
|
||||
struct map10
|
||||
: m_item<
|
||||
10
|
||||
, typename P9::first
|
||||
, typename P9::second
|
||||
, map9< P0,P1,P2,P3,P4,P5,P6,P7,P8 >
|
||||
>
|
||||
{
|
||||
typedef map10 type;
|
||||
};
|
||||
|
||||
}}
|
||||
@@ -0,0 +1,91 @@
|
||||
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
|
||||
#define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_iserializer.hpp: extenstion of type_info required for serialization.
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstdlib> // NULL
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/archive/basic_archive.hpp>
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
#include <boost/archive/detail/basic_serializer.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
class extended_type_info;
|
||||
} // namespace serialization
|
||||
|
||||
// forward declarations
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class basic_iarchive;
|
||||
class basic_pointer_iserializer;
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE basic_iserializer :
|
||||
public basic_serializer
|
||||
{
|
||||
private:
|
||||
basic_pointer_iserializer *m_bpis;
|
||||
protected:
|
||||
explicit BOOST_ARCHIVE_DECL basic_iserializer(
|
||||
const boost::serialization::extended_type_info & type
|
||||
);
|
||||
virtual BOOST_ARCHIVE_DECL ~basic_iserializer();
|
||||
public:
|
||||
bool serialized_as_pointer() const {
|
||||
return m_bpis != NULL;
|
||||
}
|
||||
void set_bpis(basic_pointer_iserializer *bpis){
|
||||
m_bpis = bpis;
|
||||
}
|
||||
const basic_pointer_iserializer * get_bpis_ptr() const {
|
||||
return m_bpis;
|
||||
}
|
||||
virtual void load_object_data(
|
||||
basic_iarchive & ar,
|
||||
void *x,
|
||||
const unsigned int file_version
|
||||
) const = 0;
|
||||
// returns true if class_info should be saved
|
||||
virtual bool class_info() const = 0 ;
|
||||
// returns true if objects should be tracked
|
||||
virtual bool tracking(const unsigned int) const = 0 ;
|
||||
// returns class version
|
||||
virtual version_type version() const = 0 ;
|
||||
// returns true if this class is polymorphic
|
||||
virtual bool is_polymorphic() const = 0;
|
||||
virtual void destroy(/*const*/ void *address) const = 0 ;
|
||||
};
|
||||
|
||||
} // namespae detail
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#endif // BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
|
||||
@@ -0,0 +1,431 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp
|
||||
|
||||
[begin_description]
|
||||
Base class for symplectic Runge-Kutta-Nystrom steppers.
|
||||
[end_description]
|
||||
|
||||
Copyright 2011-2013 Karsten Ahnert
|
||||
Copyright 2011-2013 Mario Mulansky
|
||||
Copyright 2012 Christoph Koke
|
||||
|
||||
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_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED
|
||||
|
||||
#include <boost/array.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/util/bind.hpp>
|
||||
#include <boost/numeric/odeint/util/unwrap_reference.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/util/copy.hpp>
|
||||
#include <boost/numeric/odeint/util/is_pair.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/util/state_wrapper.hpp>
|
||||
#include <boost/numeric/odeint/util/resizer.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
|
||||
template<
|
||||
size_t NumOfStages ,
|
||||
unsigned short Order ,
|
||||
class Coor ,
|
||||
class Momentum ,
|
||||
class Value ,
|
||||
class CoorDeriv ,
|
||||
class MomentumDeriv ,
|
||||
class Time ,
|
||||
class Algebra ,
|
||||
class Operations ,
|
||||
class Resizer
|
||||
>
|
||||
class symplectic_nystroem_stepper_base : public algebra_stepper_base< Algebra , Operations >
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
|
||||
typedef typename algebra_stepper_base_type::algebra_type algebra_type;
|
||||
typedef typename algebra_stepper_base_type::operations_type operations_type;
|
||||
|
||||
const static size_t num_of_stages = NumOfStages;
|
||||
typedef Coor coor_type;
|
||||
typedef Momentum momentum_type;
|
||||
typedef std::pair< coor_type , momentum_type > state_type;
|
||||
typedef CoorDeriv coor_deriv_type;
|
||||
typedef state_wrapper< coor_deriv_type> wrapped_coor_deriv_type;
|
||||
typedef MomentumDeriv momentum_deriv_type;
|
||||
typedef state_wrapper< momentum_deriv_type > wrapped_momentum_deriv_type;
|
||||
typedef std::pair< coor_deriv_type , momentum_deriv_type > deriv_type;
|
||||
typedef Value value_type;
|
||||
typedef Time time_type;
|
||||
typedef Resizer resizer_type;
|
||||
typedef stepper_tag stepper_category;
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
typedef symplectic_nystroem_stepper_base< NumOfStages , Order , Coor , Momentum , Value ,
|
||||
CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
|
||||
#endif
|
||||
typedef unsigned short order_type;
|
||||
|
||||
static const order_type order_value = Order;
|
||||
|
||||
typedef boost::array< value_type , num_of_stages > coef_type;
|
||||
|
||||
symplectic_nystroem_stepper_base( const coef_type &coef_a , const coef_type &coef_b , const algebra_type &algebra = algebra_type() )
|
||||
: algebra_stepper_base_type( algebra ) , m_coef_a( coef_a ) , m_coef_b( coef_b ) ,
|
||||
m_dqdt_resizer() , m_dpdt_resizer() , m_dqdt() , m_dpdt()
|
||||
{ }
|
||||
|
||||
|
||||
order_type order( void ) const
|
||||
{
|
||||
return order_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Version 1 : do_step( system , x , t , dt )
|
||||
*
|
||||
* This version does not solve the forwarding problem, boost.range can not be used.
|
||||
*/
|
||||
template< class System , class StateInOut >
|
||||
void do_step( System system , const StateInOut &state , time_type t , time_type dt )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< System >::type system_type;
|
||||
do_step_impl( system , state , t , state , dt , typename is_pair< system_type >::type() );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Same function as above. It differs only in a different const specifier in order
|
||||
* to solve the forwarding problem, can be used with Boost.Range.
|
||||
*/
|
||||
template< class System , class StateInOut >
|
||||
void do_step( System system , StateInOut &state , time_type t , time_type dt )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< System >::type system_type;
|
||||
do_step_impl( system , state , t , state , dt , typename is_pair< system_type >::type() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Version 2 : do_step( system , q , p , t , dt );
|
||||
*
|
||||
* For Convenience
|
||||
*
|
||||
* The two overloads are needed in order to solve the forwarding problem.
|
||||
*/
|
||||
template< class System , class CoorInOut , class MomentumInOut >
|
||||
void do_step( System system , CoorInOut &q , MomentumInOut &p , time_type t , time_type dt )
|
||||
{
|
||||
do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Same function as do_step( system , q , p , t , dt ). It differs only in a different const specifier in order
|
||||
* to solve the forwarding problem, can be called with Boost.Range.
|
||||
*/
|
||||
template< class System , class CoorInOut , class MomentumInOut >
|
||||
void do_step( System system , const CoorInOut &q , const MomentumInOut &p , time_type t , time_type dt )
|
||||
{
|
||||
do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Version 3 : do_step( system , in , t , out , dt )
|
||||
*
|
||||
* The forwarding problem is not solved in this version
|
||||
*/
|
||||
template< class System , class StateIn , class StateOut >
|
||||
void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< System >::type system_type;
|
||||
do_step_impl( system , in , t , out , dt , typename is_pair< system_type >::type() );
|
||||
}
|
||||
|
||||
|
||||
template< class StateType >
|
||||
void adjust_size( const StateType &x )
|
||||
{
|
||||
resize_dqdt( x );
|
||||
resize_dpdt( x );
|
||||
}
|
||||
|
||||
/** \brief Returns the coefficients a. */
|
||||
const coef_type& coef_a( void ) const { return m_coef_a; }
|
||||
|
||||
/** \brief Returns the coefficients b. */
|
||||
const coef_type& coef_b( void ) const { return m_coef_b; }
|
||||
|
||||
private:
|
||||
|
||||
// stepper for systems with function for dq/dt = f(p) and dp/dt = -f(q)
|
||||
template< class System , class StateIn , class StateOut >
|
||||
void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::true_ )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< System >::type system_type;
|
||||
typedef typename odeint::unwrap_reference< typename system_type::first_type >::type coor_deriv_func_type;
|
||||
typedef typename odeint::unwrap_reference< typename system_type::second_type >::type momentum_deriv_func_type;
|
||||
system_type &sys = system;
|
||||
coor_deriv_func_type &coor_func = sys.first;
|
||||
momentum_deriv_func_type &momentum_func = sys.second;
|
||||
|
||||
typedef typename odeint::unwrap_reference< StateIn >::type state_in_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type;
|
||||
const state_in_type &state_in = in;
|
||||
const coor_in_type &coor_in = state_in.first;
|
||||
const momentum_in_type &momentum_in = state_in.second;
|
||||
|
||||
typedef typename odeint::unwrap_reference< StateOut >::type state_out_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_out_type::first_type >::type coor_out_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_out_type::second_type >::type momentum_out_type;
|
||||
state_out_type &state_out = out;
|
||||
coor_out_type &coor_out = state_out.first;
|
||||
momentum_out_type &momentum_out = state_out.second;
|
||||
|
||||
m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) );
|
||||
m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) );
|
||||
|
||||
// ToDo: check sizes?
|
||||
|
||||
for( size_t l=0 ; l<num_of_stages ; ++l )
|
||||
{
|
||||
if( l == 0 )
|
||||
{
|
||||
coor_func( momentum_in , m_dqdt.m_v );
|
||||
this->m_algebra.for_each3( coor_out , coor_in , m_dqdt.m_v ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
|
||||
momentum_func( coor_out , m_dpdt.m_v );
|
||||
this->m_algebra.for_each3( momentum_out , momentum_in , m_dpdt.m_v ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
coor_func( momentum_out , m_dqdt.m_v );
|
||||
this->m_algebra.for_each3( coor_out , coor_out , m_dqdt.m_v ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
|
||||
momentum_func( coor_out , m_dpdt.m_v );
|
||||
this->m_algebra.for_each3( momentum_out , momentum_out , m_dpdt.m_v ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// stepper for systems with only function dp /dt = -f(q), dq/dt = p, time not required but still expected for compatibility reasons
|
||||
template< class System , class StateIn , class StateOut >
|
||||
void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::false_ )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< System >::type momentum_deriv_func_type;
|
||||
momentum_deriv_func_type &momentum_func = system;
|
||||
|
||||
typedef typename odeint::unwrap_reference< StateIn >::type state_in_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type;
|
||||
const state_in_type &state_in = in;
|
||||
const coor_in_type &coor_in = state_in.first;
|
||||
const momentum_in_type &momentum_in = state_in.second;
|
||||
|
||||
typedef typename odeint::unwrap_reference< StateOut >::type state_out_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_out_type::first_type >::type coor_out_type;
|
||||
typedef typename odeint::unwrap_reference< typename state_out_type::second_type >::type momentum_out_type;
|
||||
state_out_type &state_out = out;
|
||||
coor_out_type &coor_out = state_out.first;
|
||||
momentum_out_type &momentum_out = state_out.second;
|
||||
|
||||
|
||||
// m_dqdt not required when called with momentum_func only - don't resize
|
||||
// m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) );
|
||||
m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) );
|
||||
|
||||
|
||||
// ToDo: check sizes?
|
||||
|
||||
// step 0
|
||||
this->m_algebra.for_each3( coor_out , coor_in , momentum_in ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[0] * dt ) );
|
||||
momentum_func( coor_out , m_dpdt.m_v );
|
||||
this->m_algebra.for_each3( momentum_out , momentum_in , m_dpdt.m_v ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[0] * dt ) );
|
||||
|
||||
for( size_t l=1 ; l<num_of_stages ; ++l )
|
||||
{
|
||||
this->m_algebra.for_each3( coor_out , coor_out , momentum_out ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
|
||||
momentum_func( coor_out , m_dpdt.m_v );
|
||||
this->m_algebra.for_each3( momentum_out , momentum_out , m_dpdt.m_v ,
|
||||
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
|
||||
}
|
||||
}
|
||||
|
||||
template< class StateIn >
|
||||
bool resize_dqdt( const StateIn &x )
|
||||
{
|
||||
return adjust_size_by_resizeability( m_dqdt , x , typename is_resizeable<coor_deriv_type>::type() );
|
||||
}
|
||||
|
||||
template< class StateIn >
|
||||
bool resize_dpdt( const StateIn &x )
|
||||
{
|
||||
return adjust_size_by_resizeability( m_dpdt , x , typename is_resizeable<momentum_deriv_type>::type() );
|
||||
}
|
||||
|
||||
|
||||
const coef_type m_coef_a;
|
||||
const coef_type m_coef_b;
|
||||
|
||||
resizer_type m_dqdt_resizer;
|
||||
resizer_type m_dpdt_resizer;
|
||||
wrapped_coor_deriv_type m_dqdt;
|
||||
wrapped_momentum_deriv_type m_dpdt;
|
||||
|
||||
};
|
||||
|
||||
/********* DOXYGEN *********/
|
||||
|
||||
/**
|
||||
* \class symplectic_nystroem_stepper_base
|
||||
* \brief Base class for all symplectic steppers of Nystroem type.
|
||||
*
|
||||
* This class is the base class for the symplectic Runge-Kutta-Nystroem steppers. Symplectic steppers are usually
|
||||
* used to solve Hamiltonian systems and they conserve the phase space volume, see
|
||||
* <a href="http://en.wikipedia.org/wiki/Symplectic_integrator">en.wikipedia.org/wiki/Symplectic_integrator</a>.
|
||||
* Furthermore, the energy is conserved
|
||||
* in average. In detail this class of steppers can be used to solve separable Hamiltonian systems which can be written
|
||||
* in the form H(q,p) = H1(p) + H2(q). q is usually called the coordinate, while p is the momentum. The equations of motion
|
||||
* are dq/dt = dH1/dp, dp/dt = -dH2/dq.
|
||||
*
|
||||
* ToDo : add formula for solver and explanation of the coefficients
|
||||
*
|
||||
* symplectic_nystroem_stepper_base uses odeints algebra and operation system. Step size and error estimation are not
|
||||
* provided for this class of solvers. It derives from algebra_stepper_base. Several `do_step` variants are provided:
|
||||
*
|
||||
* - `do_step( sys , x , t , dt )` - The classical `do_step` method. The sys can be either a pair of function objects
|
||||
* for the coordinate or the momentum part or one function object for the momentum part. `x` is a pair of coordinate
|
||||
* and momentum. The state is updated in-place.
|
||||
* - `do_step( sys , q , p , t , dt )` - This method is similar to the method above with the difference that the coordinate
|
||||
* and the momentum are passed explicitly and not packed into a pair.
|
||||
* - `do_step( sys , x_in , t , x_out , dt )` - This method transforms the state out-of-place. `x_in` and `x_out` are here pairs
|
||||
* of coordinate and momentum.
|
||||
*
|
||||
* \tparam NumOfStages Number of stages.
|
||||
* \tparam Order The order of the stepper.
|
||||
* \tparam Coor The type representing the coordinates q.
|
||||
* \tparam Momentum The type representing the coordinates p.
|
||||
* \tparam Value The basic value type. Should be something like float, double or a high-precision type.
|
||||
* \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt.
|
||||
* \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt.
|
||||
* \tparam Time The type representing the time t.
|
||||
* \tparam Algebra The algebra.
|
||||
* \tparam Operations The operations.
|
||||
* \tparam Resizer The resizer policy.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn symplectic_nystroem_stepper_base::symplectic_nystroem_stepper_base( const coef_type &coef_a , const coef_type &coef_b , const algebra_type &algebra )
|
||||
* \brief Constructs a symplectic_nystroem_stepper_base class. The parameters of the specific Nystroem method and the
|
||||
* algebra have to be passed.
|
||||
* \param coef_a The coefficients a.
|
||||
* \param coef_b The coefficients b.
|
||||
* \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn symplectic_nystroem_stepper_base::order( void ) const
|
||||
* \return Returns the order of the stepper.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn symplectic_nystroem_stepper_base::do_step( System system , const StateInOut &state , time_type t , time_type dt )
|
||||
* \brief This method performs one step. The system can be either a pair of two function object
|
||||
* describing the momentum part and the coordinate part or one function object describing only
|
||||
* the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state
|
||||
* is updated in-place.
|
||||
*
|
||||
* \note boost::ref or std::ref can be used for the system as well as for the state. So, it is correct
|
||||
* to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , make_pair( std::ref( q ) , std::ref( p ) ) , t , dt )`.
|
||||
*
|
||||
* \note This method solves the forwarding problem.
|
||||
*
|
||||
* \param system The system, can be represented as a pair of two function object or one function object. See above.
|
||||
* \param state The state of the ODE. It is a pair of Coor and Momentum. The state is updated in-place, therefore, the
|
||||
* new value of the state will be written into this variable.
|
||||
* \param t The time of the ODE. It is not advanced by this method.
|
||||
* \param dt The time step.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn symplectic_nystroem_stepper_base::do_step( System system , CoorInOut &q , MomentumInOut &p , time_type t , time_type dt )
|
||||
* \brief This method performs one step. The system can be either a pair of two function object
|
||||
* describing the momentum part and the coordinate part or one function object describing only
|
||||
* the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state
|
||||
* is updated in-place.
|
||||
*
|
||||
* \note boost::ref or std::ref can be used for the system. So, it is correct
|
||||
* to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , q , p , t , dt )`.
|
||||
*
|
||||
* \note This method solves the forwarding problem.
|
||||
*
|
||||
* \param system The system, can be represented as a pair of two function object or one function object. See above.
|
||||
* \param q The coordinate of the ODE. It is updated in-place. Therefore, the new value of the coordinate will be written
|
||||
* into this variable.
|
||||
* \param p The momentum of the ODE. It is updated in-place. Therefore, the new value of the momentum will be written info
|
||||
* this variable.
|
||||
* \param t The time of the ODE. It is not advanced by this method.
|
||||
* \param dt The time step.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn symplectic_nystroem_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
|
||||
* \brief This method performs one step. The system can be either a pair of two function object
|
||||
* describing the momentum part and the coordinate part or one function object describing only
|
||||
* the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state
|
||||
* is updated out-of-place.
|
||||
*
|
||||
* \note boost::ref or std::ref can be used for the system. So, it is correct
|
||||
* to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , x_in , t , x_out , dt )`.
|
||||
*
|
||||
* \note This method NOT solve the forwarding problem.
|
||||
*
|
||||
* \param system The system, can be represented as a pair of two function object or one function object. See above.
|
||||
* \param in The state of the ODE, which is a pair of coordinate and momentum. The state is updated out-of-place, therefore the
|
||||
* new value is written into out
|
||||
* \param t The time of the ODE. It is not advanced by this method.
|
||||
* \param out The new state of the ODE.
|
||||
* \param dt The time step.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn symplectic_nystroem_stepper_base::adjust_size( const StateType &x )
|
||||
* \brief Adjust the size of all temporaries in the stepper manually.
|
||||
* \param x A state from which the size of the temporaries to be resized is deduced.
|
||||
*/
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED
|
||||
@@ -0,0 +1,21 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PHOENIX_PHOENIX_HPP
|
||||
#define BOOST_PHOENIX_PHOENIX_HPP
|
||||
|
||||
#include <boost/phoenix/core.hpp>
|
||||
#include <boost/phoenix/function.hpp>
|
||||
#include <boost/phoenix/operator.hpp>
|
||||
#include <boost/phoenix/statement.hpp>
|
||||
#include <boost/phoenix/object.hpp>
|
||||
#include <boost/phoenix/scope.hpp>
|
||||
#include <boost/phoenix/bind.hpp>
|
||||
#include <boost/phoenix/stl.hpp>
|
||||
#include <boost/phoenix/fusion.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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_FREQUENCY_HPP
|
||||
#define BOOST_UNITS_SI_FREQUENCY_HPP
|
||||
|
||||
#include <boost/units/systems/si/base.hpp>
|
||||
#include <boost/units/physical_dimensions/frequency.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
typedef unit<frequency_dimension,si::system> frequency;
|
||||
|
||||
BOOST_UNITS_STATIC_CONSTANT(hertz,frequency);
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_SI_FREQUENCY_HPP
|
||||
@@ -0,0 +1,229 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// 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_
|
||||
//
|
||||
// Comparison operators for cpp_int_backend:
|
||||
//
|
||||
#ifndef BOOST_MP_DETAIL_BITSCAN_HPP
|
||||
#define BOOST_MP_DETAIL_BITSCAN_HPP
|
||||
|
||||
#if (defined(BOOST_MSVC) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64))
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
namespace boost{ namespace multiprecision{ namespace detail{
|
||||
|
||||
template <class Unsigned>
|
||||
inline unsigned find_lsb(Unsigned mask, const mpl::int_<0>&)
|
||||
{
|
||||
unsigned result = 0;
|
||||
while(!(mask & 1u))
|
||||
{
|
||||
mask >>= 1;
|
||||
++result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class Unsigned>
|
||||
inline unsigned find_msb(Unsigned mask, const mpl::int_<0>&)
|
||||
{
|
||||
unsigned index = 0;
|
||||
while(mask)
|
||||
{
|
||||
++index;
|
||||
mask >>= 1;
|
||||
}
|
||||
return --index;
|
||||
}
|
||||
|
||||
#if (defined(BOOST_MSVC) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64))
|
||||
|
||||
#pragma intrinsic(_BitScanForward,_BitScanReverse)
|
||||
|
||||
BOOST_FORCEINLINE unsigned find_lsb(unsigned long mask, const mpl::int_<1>&)
|
||||
{
|
||||
unsigned long result;
|
||||
_BitScanForward(&result, mask);
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE unsigned find_msb(unsigned long mask, const mpl::int_<1>&)
|
||||
{
|
||||
unsigned long result;
|
||||
_BitScanReverse(&result, mask);
|
||||
return result;
|
||||
}
|
||||
#ifdef _M_X64
|
||||
|
||||
#pragma intrinsic(_BitScanForward64,_BitScanReverse64)
|
||||
|
||||
BOOST_FORCEINLINE unsigned find_lsb(unsigned __int64 mask, const mpl::int_<2>&)
|
||||
{
|
||||
unsigned long result;
|
||||
_BitScanForward64(&result, mask);
|
||||
return result;
|
||||
}
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_msb(Unsigned mask, const mpl::int_<2>&)
|
||||
{
|
||||
unsigned long result;
|
||||
_BitScanReverse64(&result, mask);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_lsb(Unsigned mask)
|
||||
{
|
||||
typedef typename make_unsigned<Unsigned>::type ui_type;
|
||||
typedef typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned long),
|
||||
mpl::int_<1>,
|
||||
#ifdef _M_X64
|
||||
typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(__int64),
|
||||
mpl::int_<2>,
|
||||
mpl::int_<0>
|
||||
>::type
|
||||
#else
|
||||
mpl::int_<0>
|
||||
#endif
|
||||
>::type tag_type;
|
||||
return find_lsb(static_cast<ui_type>(mask), tag_type());
|
||||
}
|
||||
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_msb(Unsigned mask)
|
||||
{
|
||||
typedef typename make_unsigned<Unsigned>::type ui_type;
|
||||
typedef typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned long),
|
||||
mpl::int_<1>,
|
||||
#ifdef _M_X64
|
||||
typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(__int64),
|
||||
mpl::int_<2>,
|
||||
mpl::int_<0>
|
||||
>::type
|
||||
#else
|
||||
mpl::int_<0>
|
||||
#endif
|
||||
>::type tag_type;
|
||||
return find_msb(static_cast<ui_type>(mask), tag_type());
|
||||
}
|
||||
|
||||
#elif defined(BOOST_GCC) || defined(__clang__) || (defined(BOOST_INTEL) && defined(__GNUC__))
|
||||
|
||||
BOOST_FORCEINLINE unsigned find_lsb(unsigned mask, mpl::int_<1> const&)
|
||||
{
|
||||
return __builtin_ctz(mask);
|
||||
}
|
||||
BOOST_FORCEINLINE unsigned find_lsb(unsigned long mask, mpl::int_<2> const&)
|
||||
{
|
||||
return __builtin_ctzl(mask);
|
||||
}
|
||||
BOOST_FORCEINLINE unsigned find_lsb(boost::ulong_long_type mask, mpl::int_<3> const&)
|
||||
{
|
||||
return __builtin_ctzll(mask);
|
||||
}
|
||||
BOOST_FORCEINLINE unsigned find_msb(unsigned mask, mpl::int_<1> const&)
|
||||
{
|
||||
return sizeof(unsigned) * CHAR_BIT - 1 - __builtin_clz(mask);
|
||||
}
|
||||
BOOST_FORCEINLINE unsigned find_msb(unsigned long mask, mpl::int_<2> const&)
|
||||
{
|
||||
return sizeof(unsigned long) * CHAR_BIT - 1 - __builtin_clzl(mask);
|
||||
}
|
||||
BOOST_FORCEINLINE unsigned find_msb(boost::ulong_long_type mask, mpl::int_<3> const&)
|
||||
{
|
||||
return sizeof(boost::ulong_long_type) * CHAR_BIT - 1 - __builtin_clzll(mask);
|
||||
}
|
||||
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_lsb(Unsigned mask)
|
||||
{
|
||||
typedef typename make_unsigned<Unsigned>::type ui_type;
|
||||
typedef typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned),
|
||||
mpl::int_<1>,
|
||||
typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned long),
|
||||
mpl::int_<2>,
|
||||
typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(boost::ulong_long_type),
|
||||
mpl::int_<3>,
|
||||
mpl::int_<0>
|
||||
>::type
|
||||
>::type
|
||||
>::type tag_type;
|
||||
return find_lsb(static_cast<ui_type>(mask), tag_type());
|
||||
}
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_msb(Unsigned mask)
|
||||
{
|
||||
typedef typename make_unsigned<Unsigned>::type ui_type;
|
||||
typedef typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned),
|
||||
mpl::int_<1>,
|
||||
typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned long),
|
||||
mpl::int_<2>,
|
||||
typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(boost::ulong_long_type),
|
||||
mpl::int_<3>,
|
||||
mpl::int_<0>
|
||||
>::type
|
||||
>::type
|
||||
>::type tag_type;
|
||||
return find_msb(static_cast<ui_type>(mask), tag_type());
|
||||
}
|
||||
#elif defined(BOOST_INTEL)
|
||||
BOOST_FORCEINLINE unsigned find_lsb(unsigned mask, mpl::int_<1> const&)
|
||||
{
|
||||
return _bit_scan_forward(mask);
|
||||
}
|
||||
BOOST_FORCEINLINE unsigned find_msb(unsigned mask, mpl::int_<1> const&)
|
||||
{
|
||||
return _bit_scan_reverse(mask);
|
||||
}
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_lsb(Unsigned mask)
|
||||
{
|
||||
typedef typename make_unsigned<Unsigned>::type ui_type;
|
||||
typedef typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned),
|
||||
mpl::int_<1>,
|
||||
mpl::int_<0>
|
||||
>::type tag_type;
|
||||
return find_lsb(static_cast<ui_type>(mask), tag_type());
|
||||
}
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_msb(Unsigned mask)
|
||||
{
|
||||
typedef typename make_unsigned<Unsigned>::type ui_type;
|
||||
typedef typename mpl::if_c<
|
||||
sizeof(Unsigned) <= sizeof(unsigned),
|
||||
mpl::int_<1>,
|
||||
mpl::int_<0>
|
||||
>::type tag_type;
|
||||
return find_msb(static_cast<ui_type>(mask), tag_type());
|
||||
}
|
||||
#else
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_lsb(Unsigned mask)
|
||||
{
|
||||
return find_lsb(mask, mpl::int_<0>());
|
||||
}
|
||||
template <class Unsigned>
|
||||
BOOST_FORCEINLINE unsigned find_msb(Unsigned mask)
|
||||
{
|
||||
return find_msb(mask, mpl::int_<0>());
|
||||
}
|
||||
#endif
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
|
||||
#ifndef BOOST_RANGE_DETAIL_EMPTY_HPP
|
||||
#define BOOST_RANGE_DETAIL_EMPTY_HPP
|
||||
|
||||
#include <boost/range/detail/common.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
template< typename T >
|
||||
struct range_empty;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// default
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_empty<std_container_>
|
||||
{
|
||||
template< typename C >
|
||||
static bool fun( C& c )
|
||||
{
|
||||
return c.empty();
|
||||
};
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// pair
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_empty<std_pair_>
|
||||
{
|
||||
template< typename P >
|
||||
static bool fun( const P& p )
|
||||
{
|
||||
return p.first == p.second;
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// array
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_empty<array_>
|
||||
{
|
||||
template< typename T, std::size_t sz >
|
||||
static bool fun( T BOOST_ARRAY_REF[sz] )
|
||||
{
|
||||
if( boost_range_array == 0 )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// string
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_empty<char_ptr_>
|
||||
{
|
||||
static bool fun( const char* s )
|
||||
{
|
||||
return s == 0 || s[0] == 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_empty<const_char_ptr_>
|
||||
{
|
||||
static bool fun( const char* s )
|
||||
{
|
||||
return s == 0 || s[0] == 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_empty<wchar_t_ptr_>
|
||||
{
|
||||
static bool fun( const wchar_t* s )
|
||||
{
|
||||
return s == 0 || s[0] == 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_empty<const_wchar_t_ptr_>
|
||||
{
|
||||
static bool fun( const wchar_t* s )
|
||||
{
|
||||
return s == 0 || s[0] == 0;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace 'range_detail'
|
||||
|
||||
|
||||
template< typename C >
|
||||
inline bool
|
||||
empty( const C& c )
|
||||
{
|
||||
return range_detail::range_empty< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
|
||||
}
|
||||
|
||||
} // namespace 'boost'
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
// 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 SLICE_NIL_DWA2002620_HPP
|
||||
# define SLICE_NIL_DWA2002620_HPP
|
||||
|
||||
# include <boost/python/detail/prefix.hpp>
|
||||
# include <boost/python/object_core.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace api {
|
||||
|
||||
class slice_nil : public object
|
||||
{
|
||||
public:
|
||||
slice_nil() : object() {}
|
||||
};
|
||||
|
||||
# ifndef _ // Watch out for GNU gettext users, who #define _(x)
|
||||
static const slice_nil _ = slice_nil();
|
||||
# endif
|
||||
|
||||
template <class T>
|
||||
struct slice_bound
|
||||
{
|
||||
typedef object type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct slice_bound<slice_nil>
|
||||
{
|
||||
typedef slice_nil type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
using api::slice_nil;
|
||||
# ifndef _ // Watch out for GNU gettext users, who #define _(x)
|
||||
using api::_;
|
||||
# endif
|
||||
|
||||
}} // namespace boost::python
|
||||
|
||||
#endif // SLICE_NIL_DWA2002620_HPP
|
||||
@@ -0,0 +1,847 @@
|
||||
// Copyright John Maddock 2007.
|
||||
// Copyright Paul A. Bristow 2007.
|
||||
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_MATH_POLICY_ERROR_HANDLING_HPP
|
||||
#define BOOST_MATH_POLICY_ERROR_HANDLING_HPP
|
||||
|
||||
#include <stdexcept>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <typeinfo>
|
||||
#include <cerrno>
|
||||
#include <boost/config/no_tr1/complex.hpp>
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <stdexcept>
|
||||
#include <boost/math/tools/config.hpp>
|
||||
#include <boost/math/policies/policy.hpp>
|
||||
#include <boost/math/tools/precision.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push) // Quiet warnings in boost/format.hpp
|
||||
# pragma warning(disable: 4996) // _SCL_SECURE_NO_DEPRECATE
|
||||
# pragma warning(disable: 4512) // assignment operator could not be generated.
|
||||
# pragma warning(disable: 4127) // conditional expression is constant
|
||||
// And warnings in error handling:
|
||||
# pragma warning(disable: 4702) // unreachable code.
|
||||
// Note that this only occurs when the compiler can deduce code is unreachable,
|
||||
// for example when policy macros are used to ignore errors rather than throw.
|
||||
#endif
|
||||
#include <sstream>
|
||||
|
||||
namespace boost{ namespace math{
|
||||
|
||||
class evaluation_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
evaluation_error(const std::string& s) : std::runtime_error(s){}
|
||||
};
|
||||
|
||||
class rounding_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
rounding_error(const std::string& s) : std::runtime_error(s){}
|
||||
};
|
||||
|
||||
namespace policies{
|
||||
//
|
||||
// Forward declarations of user error handlers,
|
||||
// it's up to the user to provide the definition of these:
|
||||
//
|
||||
template <class T>
|
||||
T user_domain_error(const char* function, const char* message, const T& val);
|
||||
template <class T>
|
||||
T user_pole_error(const char* function, const char* message, const T& val);
|
||||
template <class T>
|
||||
T user_overflow_error(const char* function, const char* message, const T& val);
|
||||
template <class T>
|
||||
T user_underflow_error(const char* function, const char* message, const T& val);
|
||||
template <class T>
|
||||
T user_denorm_error(const char* function, const char* message, const T& val);
|
||||
template <class T>
|
||||
T user_evaluation_error(const char* function, const char* message, const T& val);
|
||||
template <class T, class TargetType>
|
||||
T user_rounding_error(const char* function, const char* message, const T& val, const TargetType& t);
|
||||
template <class T>
|
||||
T user_indeterminate_result_error(const char* function, const char* message, const T& val);
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <class T>
|
||||
std::string prec_format(const T& val)
|
||||
{
|
||||
typedef typename boost::math::policies::precision<T, boost::math::policies::policy<> >::type prec_type;
|
||||
std::stringstream ss;
|
||||
if(prec_type::value)
|
||||
{
|
||||
int prec = 2 + (prec_type::value * 30103UL) / 100000UL;
|
||||
ss << std::setprecision(prec);
|
||||
}
|
||||
ss << val;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
inline void replace_all_in_string(std::string& result, const char* what, const char* with)
|
||||
{
|
||||
std::string::size_type pos = 0;
|
||||
std::string::size_type slen = std::strlen(what);
|
||||
std::string::size_type rlen = std::strlen(with);
|
||||
while((pos = result.find(what, pos)) != std::string::npos)
|
||||
{
|
||||
result.replace(pos, slen, with);
|
||||
pos += rlen;
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline const char* name_of()
|
||||
{
|
||||
#ifndef BOOST_NO_RTTI
|
||||
return typeid(T).name();
|
||||
#else
|
||||
return "unknown";
|
||||
#endif
|
||||
}
|
||||
template <> inline const char* name_of<float>(){ return "float"; }
|
||||
template <> inline const char* name_of<double>(){ return "double"; }
|
||||
template <> inline const char* name_of<long double>(){ return "long double"; }
|
||||
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
template <>
|
||||
inline const char* name_of<BOOST_MATH_FLOAT128_TYPE>()
|
||||
{
|
||||
return "__float128";
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class E, class T>
|
||||
void raise_error(const char* pfunction, const char* message)
|
||||
{
|
||||
if(pfunction == 0)
|
||||
pfunction = "Unknown function operating on type %1%";
|
||||
if(message == 0)
|
||||
message = "Cause unknown";
|
||||
|
||||
std::string function(pfunction);
|
||||
std::string msg("Error in function ");
|
||||
#ifndef BOOST_NO_RTTI
|
||||
replace_all_in_string(function, "%1%", boost::math::policies::detail::name_of<T>());
|
||||
#else
|
||||
replace_all_in_string(function, "%1%", "Unknown");
|
||||
#endif
|
||||
msg += function;
|
||||
msg += ": ";
|
||||
msg += message;
|
||||
|
||||
E e(msg);
|
||||
boost::throw_exception(e);
|
||||
}
|
||||
|
||||
template <class E, class T>
|
||||
void raise_error(const char* pfunction, const char* pmessage, const T& val)
|
||||
{
|
||||
if(pfunction == 0)
|
||||
pfunction = "Unknown function operating on type %1%";
|
||||
if(pmessage == 0)
|
||||
pmessage = "Cause unknown: error caused by bad argument with value %1%";
|
||||
|
||||
std::string function(pfunction);
|
||||
std::string message(pmessage);
|
||||
std::string msg("Error in function ");
|
||||
#ifndef BOOST_NO_RTTI
|
||||
replace_all_in_string(function, "%1%", boost::math::policies::detail::name_of<T>());
|
||||
#else
|
||||
replace_all_in_string(function, "%1%", "Unknown");
|
||||
#endif
|
||||
msg += function;
|
||||
msg += ": ";
|
||||
|
||||
std::string sval = prec_format(val);
|
||||
replace_all_in_string(message, "%1%", sval.c_str());
|
||||
msg += message;
|
||||
|
||||
E e(msg);
|
||||
boost::throw_exception(e);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_domain_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::domain_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<std::domain_error, T>(function, message, val);
|
||||
// we never get here:
|
||||
return std::numeric_limits<T>::quiet_NaN();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_domain_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& ,
|
||||
const ::boost::math::policies::domain_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return std::numeric_limits<T>::quiet_NaN();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_domain_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& ,
|
||||
const ::boost::math::policies::domain_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = EDOM;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return std::numeric_limits<T>::quiet_NaN();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_domain_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::domain_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_domain_error(function, message, val);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_pole_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::pole_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
return boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::throw_on_error>());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_pole_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::pole_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
return ::boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::ignore_error>());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_pole_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::pole_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
return ::boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::errno_on_error>());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_pole_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::pole_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_pole_error(function, message, val);
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
inline T raise_overflow_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<std::overflow_error, T>(function, message ? message : "numeric overflow");
|
||||
// We should never get here:
|
||||
return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_overflow_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<std::overflow_error, T>(function, message ? message : "numeric overflow", val);
|
||||
// We should never get here:
|
||||
return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_overflow_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_overflow_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T&,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_overflow_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = ERANGE;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_overflow_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T&,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = ERANGE;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_overflow_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_overflow_error(function, message, std::numeric_limits<T>::infinity());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_overflow_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::overflow_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
std::string m(message ? message : "");
|
||||
std::string sval = prec_format(val);
|
||||
replace_all_in_string(m, "%1%", sval.c_str());
|
||||
|
||||
return user_overflow_error(function, m.c_str(), std::numeric_limits<T>::infinity());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_underflow_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const ::boost::math::policies::underflow_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<std::underflow_error, T>(function, message ? message : "numeric underflow");
|
||||
// We should never get here:
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_underflow_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const ::boost::math::policies::underflow_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return T(0);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_underflow_error(
|
||||
const char* /* function */,
|
||||
const char* /* message */,
|
||||
const ::boost::math::policies::underflow_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = ERANGE;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return T(0);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_underflow_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const ::boost::math::policies::underflow_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_underflow_error(function, message, T(0));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_denorm_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& /* val */,
|
||||
const ::boost::math::policies::denorm_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<std::underflow_error, T>(function, message ? message : "denormalised result");
|
||||
// we never get here:
|
||||
return T(0);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_denorm_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const ::boost::math::policies::denorm_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return val;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_denorm_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const ::boost::math::policies::denorm_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = ERANGE;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return val;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_denorm_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::denorm_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_denorm_error(function, message, val);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_evaluation_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::evaluation_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<boost::math::evaluation_error, T>(function, message, val);
|
||||
// we never get here:
|
||||
return T(0);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_evaluation_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const ::boost::math::policies::evaluation_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return val;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_evaluation_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const ::boost::math::policies::evaluation_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = EDOM;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return val;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_evaluation_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const ::boost::math::policies::evaluation_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_evaluation_error(function, message, val);
|
||||
}
|
||||
|
||||
template <class T, class TargetType>
|
||||
inline TargetType raise_rounding_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const TargetType&,
|
||||
const ::boost::math::policies::rounding_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<boost::math::rounding_error, T>(function, message, val);
|
||||
// we never get here:
|
||||
return TargetType(0);
|
||||
}
|
||||
|
||||
template <class T, class TargetType>
|
||||
inline BOOST_MATH_CONSTEXPR TargetType raise_rounding_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const TargetType&,
|
||||
const ::boost::math::policies::rounding_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<TargetType>::is_specialized);
|
||||
return val > 0 ? (std::numeric_limits<TargetType>::max)() : (std::numeric_limits<TargetType>::is_integer ? (std::numeric_limits<TargetType>::min)() : -(std::numeric_limits<TargetType>::max)());
|
||||
}
|
||||
|
||||
template <class T, class TargetType>
|
||||
inline TargetType raise_rounding_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const TargetType&,
|
||||
const ::boost::math::policies::rounding_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = ERANGE;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
BOOST_STATIC_ASSERT(std::numeric_limits<TargetType>::is_specialized);
|
||||
return val > 0 ? (std::numeric_limits<TargetType>::max)() : (std::numeric_limits<TargetType>::is_integer ? (std::numeric_limits<TargetType>::min)() : -(std::numeric_limits<TargetType>::max)());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T raise_rounding_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& val,
|
||||
const T&,
|
||||
const ::boost::math::policies::rounding_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
errno = ERANGE;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return val > 0 ? boost::math::tools::max_value<T>() : -boost::math::tools::max_value<T>();
|
||||
}
|
||||
|
||||
template <class T, class TargetType>
|
||||
inline TargetType raise_rounding_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const TargetType& t,
|
||||
const ::boost::math::policies::rounding_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_rounding_error(function, message, val, t);
|
||||
}
|
||||
|
||||
template <class T, class R>
|
||||
inline T raise_indeterminate_result_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const R& ,
|
||||
const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::throw_on_error>&)
|
||||
{
|
||||
raise_error<std::domain_error, T>(function, message, val);
|
||||
// we never get here:
|
||||
return std::numeric_limits<T>::quiet_NaN();
|
||||
}
|
||||
|
||||
template <class T, class R>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_indeterminate_result_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& ,
|
||||
const R& result,
|
||||
const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::ignore_error>&) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be ignored so here we go anyway:
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class T, class R>
|
||||
inline T raise_indeterminate_result_error(
|
||||
const char* ,
|
||||
const char* ,
|
||||
const T& ,
|
||||
const R& result,
|
||||
const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::errno_on_error>&)
|
||||
{
|
||||
errno = EDOM;
|
||||
// This may or may not do the right thing, but the user asked for the error
|
||||
// to be silent so here we go anyway:
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class T, class R>
|
||||
inline T raise_indeterminate_result_error(
|
||||
const char* function,
|
||||
const char* message,
|
||||
const T& val,
|
||||
const R& ,
|
||||
const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::user_error>&)
|
||||
{
|
||||
return user_indeterminate_result_error(function, message, val);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_domain_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::domain_error_type policy_type;
|
||||
return detail::raise_domain_error(
|
||||
function, message ? message : "Domain Error evaluating function at %1%",
|
||||
val, policy_type());
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_pole_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::pole_error_type policy_type;
|
||||
return detail::raise_pole_error(
|
||||
function, message ? message : "Evaluation of function at pole %1%",
|
||||
val, policy_type());
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_overflow_error(const char* function, const char* message, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::overflow_error_type policy_type;
|
||||
return detail::raise_overflow_error<T>(
|
||||
function, message ? message : "Overflow Error",
|
||||
policy_type());
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_overflow_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::overflow_error_type policy_type;
|
||||
return detail::raise_overflow_error(
|
||||
function, message ? message : "Overflow evaluating function at %1%",
|
||||
val, policy_type());
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_underflow_error(const char* function, const char* message, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::underflow_error_type policy_type;
|
||||
return detail::raise_underflow_error<T>(
|
||||
function, message ? message : "Underflow Error",
|
||||
policy_type());
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_denorm_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::denorm_error_type policy_type;
|
||||
return detail::raise_denorm_error<T>(
|
||||
function, message ? message : "Denorm Error",
|
||||
val,
|
||||
policy_type());
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_evaluation_error(const char* function, const char* message, const T& val, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::evaluation_error_type policy_type;
|
||||
return detail::raise_evaluation_error(
|
||||
function, message ? message : "Internal Evaluation Error, best value so far was %1%",
|
||||
val, policy_type());
|
||||
}
|
||||
|
||||
template <class T, class TargetType, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR TargetType raise_rounding_error(const char* function, const char* message, const T& val, const TargetType& t, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::rounding_error_type policy_type;
|
||||
return detail::raise_rounding_error(
|
||||
function, message ? message : "Value %1% can not be represented in the target integer type.",
|
||||
val, t, policy_type());
|
||||
}
|
||||
|
||||
template <class T, class R, class Policy>
|
||||
inline BOOST_MATH_CONSTEXPR T raise_indeterminate_result_error(const char* function, const char* message, const T& val, const R& result, const Policy&) BOOST_NOEXCEPT_IF(is_noexcept_error_policy<Policy>::value && BOOST_MATH_IS_FLOAT(T))
|
||||
{
|
||||
typedef typename Policy::indeterminate_result_error_type policy_type;
|
||||
return detail::raise_indeterminate_result_error(
|
||||
function, message ? message : "Indeterminate result with value %1%",
|
||||
val, result, policy_type());
|
||||
}
|
||||
|
||||
//
|
||||
// checked_narrowing_cast:
|
||||
//
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <class R, class T, class Policy>
|
||||
inline bool check_overflow(T val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error))
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
if(fabs(val) > tools::max_value<R>())
|
||||
{
|
||||
boost::math::policies::detail::raise_overflow_error<R>(function, 0, pol);
|
||||
*result = static_cast<R>(val);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
template <class R, class T, class Policy>
|
||||
inline bool check_overflow(std::complex<T> val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error))
|
||||
{
|
||||
typedef typename R::value_type r_type;
|
||||
r_type re, im;
|
||||
bool r = check_overflow<r_type>(val.real(), &re, function, pol);
|
||||
r = check_overflow<r_type>(val.imag(), &im, function, pol) || r;
|
||||
*result = R(re, im);
|
||||
return r;
|
||||
}
|
||||
template <class R, class T, class Policy>
|
||||
inline bool check_underflow(T val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error))
|
||||
{
|
||||
if((val != 0) && (static_cast<R>(val) == 0))
|
||||
{
|
||||
*result = static_cast<R>(boost::math::policies::detail::raise_underflow_error<R>(function, 0, pol));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
template <class R, class T, class Policy>
|
||||
inline bool check_underflow(std::complex<T> val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error))
|
||||
{
|
||||
typedef typename R::value_type r_type;
|
||||
r_type re, im;
|
||||
bool r = check_underflow<r_type>(val.real(), &re, function, pol);
|
||||
r = check_underflow<r_type>(val.imag(), &im, function, pol) || r;
|
||||
*result = R(re, im);
|
||||
return r;
|
||||
}
|
||||
template <class R, class T, class Policy>
|
||||
inline bool check_denorm(T val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error))
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
if((fabs(val) < static_cast<T>(tools::min_value<R>())) && (static_cast<R>(val) != 0))
|
||||
{
|
||||
*result = static_cast<R>(boost::math::policies::detail::raise_denorm_error<R>(function, 0, static_cast<R>(val), pol));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
template <class R, class T, class Policy>
|
||||
inline bool check_denorm(std::complex<T> val, R* result, const char* function, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && (Policy::value != throw_on_error) && (Policy::value != user_error))
|
||||
{
|
||||
typedef typename R::value_type r_type;
|
||||
r_type re, im;
|
||||
bool r = check_denorm<r_type>(val.real(), &re, function, pol);
|
||||
r = check_denorm<r_type>(val.imag(), &im, function, pol) || r;
|
||||
*result = R(re, im);
|
||||
return r;
|
||||
}
|
||||
|
||||
// Default instantiations with ignore_error policy.
|
||||
template <class R, class T>
|
||||
inline BOOST_MATH_CONSTEXPR bool check_overflow(T /* val */, R* /* result */, const char* /* function */, const overflow_error<ignore_error>&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T))
|
||||
{ return false; }
|
||||
template <class R, class T>
|
||||
inline BOOST_MATH_CONSTEXPR bool check_overflow(std::complex<T> /* val */, R* /* result */, const char* /* function */, const overflow_error<ignore_error>&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T))
|
||||
{ return false; }
|
||||
template <class R, class T>
|
||||
inline BOOST_MATH_CONSTEXPR bool check_underflow(T /* val */, R* /* result */, const char* /* function */, const underflow_error<ignore_error>&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T))
|
||||
{ return false; }
|
||||
template <class R, class T>
|
||||
inline BOOST_MATH_CONSTEXPR bool check_underflow(std::complex<T> /* val */, R* /* result */, const char* /* function */, const underflow_error<ignore_error>&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T))
|
||||
{ return false; }
|
||||
template <class R, class T>
|
||||
inline BOOST_MATH_CONSTEXPR bool check_denorm(T /* val */, R* /* result*/, const char* /* function */, const denorm_error<ignore_error>&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T))
|
||||
{ return false; }
|
||||
template <class R, class T>
|
||||
inline BOOST_MATH_CONSTEXPR bool check_denorm(std::complex<T> /* val */, R* /* result*/, const char* /* function */, const denorm_error<ignore_error>&) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T))
|
||||
{ return false; }
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class R, class Policy, class T>
|
||||
inline R checked_narrowing_cast(T val, const char* function) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(R) && BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy<Policy>::value)
|
||||
{
|
||||
typedef typename Policy::overflow_error_type overflow_type;
|
||||
typedef typename Policy::underflow_error_type underflow_type;
|
||||
typedef typename Policy::denorm_error_type denorm_type;
|
||||
//
|
||||
// Most of what follows will evaluate to a no-op:
|
||||
//
|
||||
R result = 0;
|
||||
if(detail::check_overflow<R>(val, &result, function, overflow_type()))
|
||||
return result;
|
||||
if(detail::check_underflow<R>(val, &result, function, underflow_type()))
|
||||
return result;
|
||||
if(detail::check_denorm<R>(val, &result, function, denorm_type()))
|
||||
return result;
|
||||
|
||||
return static_cast<R>(val);
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline void check_series_iterations(const char* function, boost::uintmax_t max_iter, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy<Policy>::value)
|
||||
{
|
||||
if(max_iter >= policies::get_max_series_iterations<Policy>())
|
||||
raise_evaluation_error<T>(
|
||||
function,
|
||||
"Series evaluation exceeded %1% iterations, giving up now.", static_cast<T>(static_cast<double>(max_iter)), pol);
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline void check_root_iterations(const char* function, boost::uintmax_t max_iter, const Policy& pol) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && is_noexcept_error_policy<Policy>::value)
|
||||
{
|
||||
if(max_iter >= policies::get_max_root_iterations<Policy>())
|
||||
raise_evaluation_error<T>(
|
||||
function,
|
||||
"Root finding evaluation exceeded %1% iterations, giving up now.", static_cast<T>(static_cast<double>(max_iter)), pol);
|
||||
}
|
||||
|
||||
} //namespace policies
|
||||
|
||||
namespace detail{
|
||||
|
||||
//
|
||||
// Simple helper function to assist in returning a pair from a single value,
|
||||
// that value usually comes from one of the error handlers above:
|
||||
//
|
||||
template <class T>
|
||||
std::pair<T, T> pair_from_single(const T& val) BOOST_MATH_NOEXCEPT(T)
|
||||
{
|
||||
return std::make_pair(val, val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
}} // namespaces boost/math
|
||||
|
||||
#endif // BOOST_MATH_POLICY_ERROR_HANDLING_HPP
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
// Copyright John Maddock 2006, 2007.
|
||||
// Copyright Paul A. Bristow 2006, 2007, 2012.
|
||||
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_MATH_DISTRIBUTIONS_COMMON_ERROR_HANDLING_HPP
|
||||
#define BOOST_MATH_DISTRIBUTIONS_COMMON_ERROR_HANDLING_HPP
|
||||
|
||||
#include <boost/math/policies/error_handling.hpp>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
// using boost::math::isfinite;
|
||||
// using boost::math::isnan;
|
||||
|
||||
namespace boost{ namespace math{ namespace detail
|
||||
{
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_probability(const char* function, RealType const& prob, RealType* result, const Policy& pol)
|
||||
{
|
||||
if((prob < 0) || (prob > 1) || !(boost::math::isfinite)(prob))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Probability argument is %1%, but must be >= 0 and <= 1 !", prob, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_df(const char* function, RealType const& df, RealType* result, const Policy& pol)
|
||||
{ // df > 0 but NOT +infinity allowed.
|
||||
if((df <= 0) || !(boost::math::isfinite)(df))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Degrees of freedom argument is %1%, but must be > 0 !", df, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_df_gt0_to_inf(const char* function, RealType const& df, RealType* result, const Policy& pol)
|
||||
{ // df > 0 or +infinity are allowed.
|
||||
if( (df <= 0) || (boost::math::isnan)(df) )
|
||||
{ // is bad df <= 0 or NaN or -infinity.
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Degrees of freedom argument is %1%, but must be > 0 !", df, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} // check_df_gt0_to_inf
|
||||
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_scale(
|
||||
const char* function,
|
||||
RealType scale,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
if((scale <= 0) || !(boost::math::isfinite)(scale))
|
||||
{ // Assume scale == 0 is NOT valid for any distribution.
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Scale parameter is %1%, but must be > 0 !", scale, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_location(
|
||||
const char* function,
|
||||
RealType location,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
if(!(boost::math::isfinite)(location))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Location parameter is %1%, but must be finite!", location, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_x(
|
||||
const char* function,
|
||||
RealType x,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
// Note that this test catches both infinity and NaN.
|
||||
// Some distributions permit x to be infinite, so these must be tested 1st and return,
|
||||
// leaving this test to catch any NaNs.
|
||||
// See Normal, Logistic, Laplace and Cauchy for example.
|
||||
if(!(boost::math::isfinite)(x))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Random variate x is %1%, but must be finite!", x, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} // bool check_x
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_x_gt0(
|
||||
const char* function,
|
||||
RealType x,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
if(x <= 0)
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Random variate x is %1%, but must be > 0!", x, pol);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
// Note that this test catches both infinity and NaN.
|
||||
// Some special cases permit x to be infinite, so these must be tested 1st,
|
||||
// leaving this test to catch any NaNs. See Normal and cauchy for example.
|
||||
} // bool check_x_gt0
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_positive_x(
|
||||
const char* function,
|
||||
RealType x,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
if(!(boost::math::isfinite)(x) || (x < 0))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Random variate x is %1%, but must be finite and >= 0!", x, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
// Note that this test catches both infinity and NaN.
|
||||
// Some special cases permit x to be infinite, so these must be tested 1st,
|
||||
// leaving this test to catch any NaNs. see Normal and cauchy for example.
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_non_centrality(
|
||||
const char* function,
|
||||
RealType ncp,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
if((ncp < 0) || !(boost::math::isfinite)(ncp))
|
||||
{ // Assume scale == 0 is NOT valid for any distribution.
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Non centrality parameter is %1%, but must be > 0 !", ncp, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_finite(
|
||||
const char* function,
|
||||
RealType x,
|
||||
RealType* result,
|
||||
const Policy& pol)
|
||||
{
|
||||
if(!(boost::math::isfinite)(x))
|
||||
{ // Assume scale == 0 is NOT valid for any distribution.
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Parameter is %1%, but must be finite !", x, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace math
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_MATH_DISTRIBUTIONS_COMMON_ERROR_HANDLING_HPP
|
||||
@@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_CONVERT_09232005_1341)
|
||||
#define FUSION_CONVERT_09232005_1341
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/set/detail/as_set.hpp>
|
||||
#include <boost/fusion/container/set/detail/convert_impl.hpp>
|
||||
#include <boost/fusion/container/set/set.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct as_set
|
||||
{
|
||||
typedef typename detail::as_set<result_of::size<Sequence>::value> gen;
|
||||
typedef typename gen::
|
||||
template apply<typename result_of::begin<Sequence>::type>::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::as_set<Sequence>::type
|
||||
as_set(Sequence& seq)
|
||||
{
|
||||
typedef typename result_of::as_set<Sequence>::gen gen;
|
||||
return gen::call(fusion::begin(seq));
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::as_set<Sequence const>::type
|
||||
as_set(Sequence const& seq)
|
||||
{
|
||||
typedef typename result_of::as_set<Sequence const>::gen gen;
|
||||
return gen::call(fusion::begin(seq));
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef WSJTX_MESSAGE_AGGREGATOR_MAIN_WINDOW_MODEL_HPP__
|
||||
#define WSJTX_MESSAGE_AGGREGATOR_MAIN_WINDOW_MODEL_HPP__
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
#include "MessageServer.hpp"
|
||||
|
||||
class QDateTime;
|
||||
class QStandardItemModel;
|
||||
class QMenu;
|
||||
class DecodesModel;
|
||||
class BeaconsModel;
|
||||
class QLineEdit;
|
||||
class QTableView;
|
||||
class ClientWidget;
|
||||
|
||||
using Frequency = MessageServer::Frequency;
|
||||
|
||||
class MessageAggregatorMainWindow
|
||||
: public QMainWindow
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MessageAggregatorMainWindow ();
|
||||
|
||||
Q_SLOT void log_qso (QString const& /*id*/, QDateTime timeOff, QString const& dx_call, QString const& dx_grid
|
||||
, Frequency dial_frequency, QString const& mode, QString const& report_sent
|
||||
, QString const& report_received, QString const& tx_power, QString const& comments
|
||||
, QString const& name, QDateTime timeOn);
|
||||
|
||||
private:
|
||||
void add_client (QString const& id, QString const& version, QString const& revision);
|
||||
void remove_client (QString const& id);
|
||||
|
||||
QStandardItemModel * log_;
|
||||
QMenu * view_menu_;
|
||||
DecodesModel * decodes_model_;
|
||||
BeaconsModel * beacons_model_;
|
||||
MessageServer * server_;
|
||||
QLineEdit * multicast_group_line_edit_;
|
||||
QTableView * log_table_view_;
|
||||
|
||||
// maps client id to widgets
|
||||
using ClientsDictionary = QHash<QString, ClientWidget *>;
|
||||
ClientsDictionary dock_widgets_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2006 Daniel Wallin
|
||||
Copyright (c) 2005 Dan Marsden
|
||||
Copyright (c) 2007 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PHOENIX_STL_HPP
|
||||
#define BOOST_PHOENIX_STL_HPP
|
||||
|
||||
#include <boost/phoenix/stl/algorithm.hpp>
|
||||
#include <boost/phoenix/stl/container.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,107 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_SET_09162005_1104)
|
||||
#define FUSION_SET_09162005_1104
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/void.hpp>
|
||||
#include <boost/fusion/support/detail/enabler.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/container/set/set_fwd.hpp>
|
||||
#include <boost/fusion/container/set/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/container/set/detail/end_impl.hpp>
|
||||
#include <boost/fusion/container/set/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/container/set/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/container/set/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/container/set/detail/key_of_impl.hpp>
|
||||
#include <boost/fusion/container/set/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/set/detail/cpp03/preprocessed/set.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/set" FUSION_MAX_SET_SIZE_STR ".hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, typename T)>
|
||||
struct set : sequence_base<set<BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, T)> >
|
||||
{
|
||||
struct category : forward_traversal_tag, associative_tag {};
|
||||
|
||||
typedef set_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::false_ is_view;
|
||||
|
||||
typedef vector<
|
||||
BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, T)>
|
||||
storage_type;
|
||||
|
||||
typedef typename storage_type::size size;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
set()
|
||||
: data() {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
set(Sequence const& rhs
|
||||
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
|
||||
: data(rhs) {}
|
||||
|
||||
#include <boost/fusion/container/set/detail/cpp03/set_forward_ctor.hpp>
|
||||
|
||||
template <typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
set&
|
||||
operator=(T const& rhs)
|
||||
{
|
||||
data = rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
storage_type& get_data() { return data; }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
storage_type const& get_data() const { return data; }
|
||||
|
||||
private:
|
||||
|
||||
storage_type data;
|
||||
};
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,112 @@
|
||||
subroutine subtract65(dd,npts,f0,dt)
|
||||
|
||||
! Subtract a jt65 signal
|
||||
!
|
||||
! Measured signal : dd(t) = a(t)cos(2*pi*f0*t+theta(t))
|
||||
! Reference signal : cref(t) = exp( j*(2*pi*f0*t+phi(t)) )
|
||||
! Complex amp : cfilt(t) = LPF[ dd(t)*CONJG(cref(t)) ]
|
||||
! Subtract : dd(t) = dd(t) - 2*REAL{cref*cfilt}
|
||||
|
||||
use packjt
|
||||
use timer_module, only: timer
|
||||
|
||||
integer correct(63)
|
||||
parameter (NMAX=60*12000) !Samples per 60 s
|
||||
parameter (NFILT=1600)
|
||||
real*4 dd(NMAX), window(-NFILT/2:NFILT/2)
|
||||
complex cref,camp,cfilt,cw
|
||||
integer nprc(126)
|
||||
real*8 dphi,phi
|
||||
logical first
|
||||
data nprc/ &
|
||||
1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0, &
|
||||
0,1,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,1, &
|
||||
0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1, &
|
||||
0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1, &
|
||||
1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1, &
|
||||
0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, &
|
||||
1,1,1,1,1,1/
|
||||
data first/.true./
|
||||
common/chansyms65/correct
|
||||
common/heap1/cref(NMAX),camp(NMAX),cfilt(NMAX),cw(NMAX)
|
||||
save first
|
||||
|
||||
pi=4.0*atan(1.0)
|
||||
|
||||
! Symbol duration is 4096/11025 s.
|
||||
! Sample rate is 12000/s, so 12000*(4096/11025)=4458.23 samples/symbol.
|
||||
! For now, call it 4458 samples/symbol. Over the message duration, we'll be off
|
||||
! by about (4458.23-4458)*126=28.98 samples; 29 samples, or 0.7% of 1 symbol.
|
||||
! Could eliminate accumulated error by injecting one extra sample every
|
||||
! 5 or so symbols... Maybe try this later.
|
||||
|
||||
nstart=dt*12000+1;
|
||||
nsym=126
|
||||
ns=4458
|
||||
nref=nsym*ns
|
||||
nend=nstart+nref-1
|
||||
phi=0.0
|
||||
iref=1
|
||||
ind=1
|
||||
isym=1
|
||||
call timer('subtr_1 ',0)
|
||||
do k=1,nsym
|
||||
if( nprc(k) .eq. 1 ) then
|
||||
omega=2*pi*f0
|
||||
else
|
||||
omega=2*pi*(f0+2.6917*(correct(isym)+2))
|
||||
isym=isym+1
|
||||
endif
|
||||
dphi=omega/12000.0
|
||||
do i=1,ns
|
||||
cref(ind)=cexp(cmplx(0.0,phi))
|
||||
phi=modulo(phi+dphi,2*pi)
|
||||
id=nstart-1+ind
|
||||
if(id.ge.1) camp(ind)=dd(id)*conjg(cref(ind))
|
||||
ind=ind+1
|
||||
enddo
|
||||
enddo
|
||||
call timer('subtr_1 ',1)
|
||||
|
||||
call timer('subtr_2 ',0)
|
||||
! Smoothing filter: do the convolution by means of FFTs. Ignore end-around
|
||||
! cyclic effects for now.
|
||||
|
||||
nfft=564480
|
||||
|
||||
if(first) then
|
||||
! Create and normalize the filter
|
||||
sum=0.0
|
||||
do j=-NFILT/2,NFILT/2
|
||||
window(j)=cos(pi*j/NFILT)**2
|
||||
sum=sum+window(j)
|
||||
enddo
|
||||
cw=0.
|
||||
do i=-NFILT/2,NFILT/2
|
||||
j=i+1
|
||||
if(j.lt.1) j=j+nfft
|
||||
cw(j)=window(i)/sum
|
||||
enddo
|
||||
call four2a(cw,nfft,1,-1,1)
|
||||
first=.false.
|
||||
endif
|
||||
|
||||
nz=561708
|
||||
cfilt(1:nz)=camp(1:nz)
|
||||
cfilt(nz+1:nfft)=0.
|
||||
call four2a(cfilt,nfft,1,-1,1)
|
||||
fac=1.0/float(nfft)
|
||||
cfilt(1:nfft)=fac*cfilt(1:nfft)*cw(1:nfft)
|
||||
call four2a(cfilt,nfft,1,1,1)
|
||||
call timer('subtr_2 ',1)
|
||||
|
||||
! Subtract the reconstructed signal
|
||||
call timer('subtr_3 ',0)
|
||||
do i=1,nref
|
||||
j=nstart+i-1
|
||||
if(j.ge.1 .and. j.le.npts) dd(j)=dd(j)-2*REAL(cfilt(i)*cref(i))
|
||||
enddo
|
||||
call timer('subtr_3 ',1)
|
||||
|
||||
return
|
||||
end subroutine subtract65
|
||||
@@ -0,0 +1,68 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED
|
||||
#define BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/spinlock.hpp
|
||||
//
|
||||
// Copyright (c) 2008 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// struct spinlock
|
||||
// {
|
||||
// void lock();
|
||||
// bool try_lock();
|
||||
// void unlock();
|
||||
//
|
||||
// class scoped_lock;
|
||||
// };
|
||||
//
|
||||
// #define BOOST_DETAIL_SPINLOCK_INIT <unspecified>
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
|
||||
|
||||
#if defined( BOOST_SP_USE_STD_ATOMIC )
|
||||
# if !defined( __clang__ )
|
||||
# include <boost/smart_ptr/detail/spinlock_std_atomic.hpp>
|
||||
# else
|
||||
// Clang (at least up to 3.4) can't compile spinlock_pool when
|
||||
// using std::atomic, so substitute the __sync implementation instead.
|
||||
# include <boost/smart_ptr/detail/spinlock_sync.hpp>
|
||||
# endif
|
||||
|
||||
#elif defined( BOOST_SP_USE_PTHREADS )
|
||||
# include <boost/smart_ptr/detail/spinlock_pt.hpp>
|
||||
|
||||
#elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
|
||||
# include <boost/smart_ptr/detail/spinlock_std_atomic.hpp>
|
||||
|
||||
#elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
|
||||
# include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_HAS_SYNC )
|
||||
# include <boost/smart_ptr/detail/spinlock_sync.hpp>
|
||||
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# include <boost/smart_ptr/detail/spinlock_w32.hpp>
|
||||
|
||||
#elif defined(BOOST_HAS_PTHREADS)
|
||||
# include <boost/smart_ptr/detail/spinlock_pt.hpp>
|
||||
|
||||
#elif !defined(BOOST_HAS_THREADS)
|
||||
# include <boost/smart_ptr/detail/spinlock_nt.hpp>
|
||||
|
||||
#else
|
||||
# error Unrecognized threading platform
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED
|
||||
@@ -0,0 +1,5 @@
|
||||
kern.sysv.shmmax=33554432
|
||||
kern.sysv.shmmin=1
|
||||
kern.sysv.shmmni=128
|
||||
kern.sysv.shmseg=32
|
||||
kern.sysv.shmall=8192
|
||||
@@ -0,0 +1,54 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2007 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_FOR_EACH_20070527_0943)
|
||||
#define BOOST_FUSION_FOR_EACH_20070527_0943
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/detail/for_each.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp>
|
||||
#include <boost/fusion/support/is_segmented.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename F>
|
||||
struct for_each
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename F>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename
|
||||
enable_if<
|
||||
traits::is_sequence<Sequence>
|
||||
, void
|
||||
>::type
|
||||
for_each(Sequence& seq, F const& f)
|
||||
{
|
||||
detail::for_each(seq, f, typename traits::is_segmented<Sequence>::type());
|
||||
}
|
||||
|
||||
template <typename Sequence, typename F>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename
|
||||
enable_if<
|
||||
traits::is_sequence<Sequence>
|
||||
, void
|
||||
>::type
|
||||
for_each(Sequence const& seq, F const& f)
|
||||
{
|
||||
detail::for_each(seq, f, typename traits::is_segmented<Sequence>::type());
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
kvasd with xlambda=12.000
|
||||
-26.0 0.017
|
||||
-25.5 0.085
|
||||
-25.0 0.282
|
||||
-24.5 0.600
|
||||
-24.0 0.865
|
||||
-23.5 0.975
|
||||
-23.0 0.9988
|
||||
@@ -0,0 +1,56 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_FWD_HPP
|
||||
#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_FWD_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template<typename Seq, typename State, typename F>
|
||||
struct fold;
|
||||
}
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq
|
||||
, State const
|
||||
, F
|
||||
>::type
|
||||
fold(Seq& seq, State const& state, F f);
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq const
|
||||
, State const
|
||||
, F
|
||||
>::type
|
||||
fold(Seq const& seq, State const& state, F f);
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq
|
||||
, State
|
||||
, F
|
||||
>::type
|
||||
fold(Seq& seq, State& state, F f);
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq const
|
||||
, State
|
||||
, F
|
||||
>::type
|
||||
fold(Seq const& seq, State& state, F f);
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,219 @@
|
||||
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
|
||||
* Use, modification and distribution is subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
* Author: Jeff Garland, Bart Garst
|
||||
* $Date$
|
||||
*/
|
||||
|
||||
#ifndef NO_BOOST_DATE_TIME_INLINE
|
||||
#undef BOOST_DATE_TIME_INLINE
|
||||
#define BOOST_DATE_TIME_INLINE inline
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace date_time {
|
||||
//! Return the day of the week (0==Sunday, 1==Monday, etc)
|
||||
/*! Converts a year-month-day into a day of the week number
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
unsigned short
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::day_of_week(const ymd_type& ymd) {
|
||||
unsigned short a = static_cast<unsigned short>((14-ymd.month)/12);
|
||||
unsigned short y = static_cast<unsigned short>(ymd.year - a);
|
||||
unsigned short m = static_cast<unsigned short>(ymd.month + 12*a - 2);
|
||||
unsigned short d = static_cast<unsigned short>((ymd.day + y + (y/4) - (y/100) + (y/400) + (31*m)/12) % 7);
|
||||
//std::cout << year << "-" << month << "-" << day << " is day: " << d << "\n";
|
||||
return d;
|
||||
}
|
||||
|
||||
//!Return the iso week number for the date
|
||||
/*!Implements the rules associated with the iso 8601 week number.
|
||||
Basically the rule is that Week 1 of the year is the week that contains
|
||||
January 4th or the week that contains the first Thursday in January.
|
||||
Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000.
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
int
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::week_number(const ymd_type& ymd) {
|
||||
unsigned long julianbegin = julian_day_number(ymd_type(ymd.year,1,1));
|
||||
unsigned long juliantoday = julian_day_number(ymd);
|
||||
unsigned long day = (julianbegin + 3) % 7;
|
||||
unsigned long week = (juliantoday + day - julianbegin + 4)/7;
|
||||
|
||||
if ((week >= 1) && (week <= 52)) {
|
||||
return static_cast<int>(week);
|
||||
}
|
||||
|
||||
if (week == 53) {
|
||||
if((day==6) ||(day == 5 && is_leap_year(ymd.year))) {
|
||||
return static_cast<int>(week); //under these circumstances week == 53.
|
||||
} else {
|
||||
return 1; //monday - wednesday is in week 1 of next year
|
||||
}
|
||||
}
|
||||
//if the week is not in current year recalculate using the previous year as the beginning year
|
||||
else if (week == 0) {
|
||||
julianbegin = julian_day_number(ymd_type(static_cast<unsigned short>(ymd.year-1),1,1));
|
||||
juliantoday = julian_day_number(ymd);
|
||||
day = (julianbegin + 3) % 7;
|
||||
week = (juliantoday + day - julianbegin + 4)/7;
|
||||
return static_cast<int>(week);
|
||||
}
|
||||
|
||||
return static_cast<int>(week); //not reachable -- well except if day == 5 and is_leap_year != true
|
||||
|
||||
}
|
||||
|
||||
//! Convert a ymd_type into a day number
|
||||
/*! The day number is an absolute number of days since the start of count
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
date_int_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::day_number(const ymd_type& ymd)
|
||||
{
|
||||
unsigned short a = static_cast<unsigned short>((14-ymd.month)/12);
|
||||
unsigned short y = static_cast<unsigned short>(ymd.year + 4800 - a);
|
||||
unsigned short m = static_cast<unsigned short>(ymd.month + 12*a - 3);
|
||||
unsigned long d = ymd.day + ((153*m + 2)/5) + 365*y + (y/4) - (y/100) + (y/400) - 32045;
|
||||
return static_cast<date_int_type>(d);
|
||||
}
|
||||
|
||||
//! Convert a year-month-day into the julian day number
|
||||
/*! Since this implementation uses julian day internally, this is the same as the day_number.
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
date_int_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::julian_day_number(const ymd_type& ymd)
|
||||
{
|
||||
return day_number(ymd);
|
||||
}
|
||||
|
||||
//! Convert year-month-day into a modified julian day number
|
||||
/*! The day number is an absolute number of days.
|
||||
* MJD 0 thus started on 17 Nov 1858(Gregorian) at 00:00:00 UTC
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
date_int_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::modjulian_day_number(const ymd_type& ymd)
|
||||
{
|
||||
return julian_day_number(ymd)-2400001; //prerounded
|
||||
}
|
||||
|
||||
//! Change a day number into a year-month-day
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
ymd_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::from_day_number(date_int_type dayNumber)
|
||||
{
|
||||
date_int_type a = dayNumber + 32044;
|
||||
date_int_type b = (4*a + 3)/146097;
|
||||
date_int_type c = a-((146097*b)/4);
|
||||
date_int_type d = (4*c + 3)/1461;
|
||||
date_int_type e = c - (1461*d)/4;
|
||||
date_int_type m = (5*e + 2)/153;
|
||||
unsigned short day = static_cast<unsigned short>(e - ((153*m + 2)/5) + 1);
|
||||
unsigned short month = static_cast<unsigned short>(m + 3 - 12 * (m/10));
|
||||
year_type year = static_cast<unsigned short>(100*b + d - 4800 + (m/10));
|
||||
//std::cout << year << "-" << month << "-" << day << "\n";
|
||||
|
||||
return ymd_type(static_cast<unsigned short>(year),month,day);
|
||||
}
|
||||
|
||||
//! Change a day number into a year-month-day
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
ymd_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::from_julian_day_number(date_int_type dayNumber)
|
||||
{
|
||||
date_int_type a = dayNumber + 32044;
|
||||
date_int_type b = (4*a+3)/146097;
|
||||
date_int_type c = a - ((146097*b)/4);
|
||||
date_int_type d = (4*c + 3)/1461;
|
||||
date_int_type e = c - ((1461*d)/4);
|
||||
date_int_type m = (5*e + 2)/153;
|
||||
unsigned short day = static_cast<unsigned short>(e - ((153*m + 2)/5) + 1);
|
||||
unsigned short month = static_cast<unsigned short>(m + 3 - 12 * (m/10));
|
||||
year_type year = static_cast<year_type>(100*b + d - 4800 + (m/10));
|
||||
//std::cout << year << "-" << month << "-" << day << "\n";
|
||||
|
||||
return ymd_type(year,month,day);
|
||||
}
|
||||
|
||||
//! Change a modified julian day number into a year-month-day
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
ymd_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::from_modjulian_day_number(date_int_type dayNumber) {
|
||||
date_int_type jd = dayNumber + 2400001; //is 2400000.5 prerounded
|
||||
return from_julian_day_number(jd);
|
||||
}
|
||||
|
||||
//! Determine if the provided year is a leap year
|
||||
/*!
|
||||
*@return true if year is a leap year, false otherwise
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
bool
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::is_leap_year(year_type year)
|
||||
{
|
||||
//divisible by 4, not if divisible by 100, but true if divisible by 400
|
||||
return (!(year % 4)) && ((year % 100) || (!(year % 400)));
|
||||
}
|
||||
|
||||
//! Calculate the last day of the month
|
||||
/*! Find the day which is the end of the month given year and month
|
||||
* No error checking is performed.
|
||||
*/
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
unsigned short
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::end_of_month_day(year_type year,
|
||||
month_type month)
|
||||
{
|
||||
switch (month) {
|
||||
case 2:
|
||||
if (is_leap_year(year)) {
|
||||
return 29;
|
||||
} else {
|
||||
return 28;
|
||||
};
|
||||
case 4:
|
||||
case 6:
|
||||
case 9:
|
||||
case 11:
|
||||
return 30;
|
||||
default:
|
||||
return 31;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//! Provide the ymd_type specification for the calandar start
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
ymd_type_
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::epoch()
|
||||
{
|
||||
return ymd_type(1400,1,1);
|
||||
}
|
||||
|
||||
//! Defines length of a week for week calculations
|
||||
template<typename ymd_type_, typename date_int_type_>
|
||||
BOOST_DATE_TIME_INLINE
|
||||
unsigned short
|
||||
gregorian_calendar_base<ymd_type_,date_int_type_>::days_in_week()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
|
||||
} } //namespace gregorian
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
subroutine astro(nyear,month,nday,uth,freq8,Mygrid, &
|
||||
NStation,MoonDX,AzSun,ElSun,AzMoon0,ElMoon0, &
|
||||
ntsky,doppler00,doppler,dbMoon,RAMoon,DecMoon,HA,Dgrd,sd, &
|
||||
poloffset,xnr,day,lon,lat,LST,techo)
|
||||
|
||||
! Computes astronomical quantities for display and tracking.
|
||||
! NB: may want to smooth the Tsky map to 10 degrees or so.
|
||||
|
||||
character*6 MyGrid,HisGrid
|
||||
real*8 freq8
|
||||
real LST
|
||||
real lat,lon
|
||||
integer*2 nt144(180)
|
||||
|
||||
! common/echo/xdop(2),techo,AzMoon,ElMoon,mjd
|
||||
real xdop(2)
|
||||
|
||||
data rad/57.2957795/
|
||||
data nt144/ &
|
||||
234, 246, 257, 267, 275, 280, 283, 286, 291, 298, &
|
||||
305, 313, 322, 331, 341, 351, 361, 369, 376, 381, &
|
||||
383, 382, 379, 374, 370, 366, 363, 361, 363, 368, &
|
||||
376, 388, 401, 415, 428, 440, 453, 467, 487, 512, &
|
||||
544, 579, 607, 618, 609, 588, 563, 539, 512, 482, &
|
||||
450, 422, 398, 379, 363, 349, 334, 319, 302, 282, &
|
||||
262, 242, 226, 213, 205, 200, 198, 197, 196, 197, &
|
||||
200, 202, 204, 205, 204, 203, 202, 201, 203, 206, &
|
||||
212, 218, 223, 227, 231, 236, 240, 243, 247, 257, &
|
||||
276, 301, 324, 339, 346, 344, 339, 331, 323, 316, &
|
||||
312, 310, 312, 317, 327, 341, 358, 375, 392, 407, &
|
||||
422, 437, 451, 466, 480, 494, 511, 530, 552, 579, &
|
||||
612, 653, 702, 768, 863,1008,1232,1557,1966,2385, &
|
||||
2719,2924,3018,3038,2986,2836,2570,2213,1823,1461, &
|
||||
1163, 939, 783, 677, 602, 543, 494, 452, 419, 392, &
|
||||
373, 360, 353, 350, 350, 350, 350, 350, 350, 348, &
|
||||
344, 337, 329, 319, 307, 295, 284, 276, 272, 272, &
|
||||
273, 274, 274, 271, 266, 260, 252, 245, 238, 231/
|
||||
save
|
||||
|
||||
call grid2deg(MyGrid,elon,lat)
|
||||
lon=-elon
|
||||
call sun(nyear,month,nday,uth,lon,lat,RASun,DecSun,LST, &
|
||||
AzSun,ElSun,mjd,day)
|
||||
|
||||
call MoonDopJPL(nyear,month,nday,uth,lon,lat,RAMoon,DecMoon, &
|
||||
LST,HA,AzMoon,ElMoon,vr,techo)
|
||||
RAMoon=rad*RAMoon
|
||||
DecMoon=rad*DecMoon
|
||||
dist=2.99792458d5*techo/2.d0
|
||||
|
||||
! Compute spatial polarization offset
|
||||
xx=sin(lat/rad)*cos(ElMoon/rad) - cos(lat/rad)* &
|
||||
cos(AzMoon/rad)*sin(ElMoon/rad)
|
||||
yy=cos(lat/rad)*sin(AzMoon/rad)
|
||||
if(NStation.eq.1) poloffset1=rad*atan2(yy,xx)
|
||||
if(NStation.eq.2) poloffset2=rad*atan2(yy,xx)
|
||||
|
||||
doppler=-freq8*vr/2.99792458e5 !One-way Doppler
|
||||
|
||||
call coord(0.,0.,-1.570796,1.161639,RAMoon/rad,DecMoon/rad,el,eb)
|
||||
longecl_half=nint(rad*el/2.0)
|
||||
if(longecl_half.lt.1 .or. longecl_half.gt.180) longecl_half=180
|
||||
t144=nt144(longecl_half)
|
||||
tsky=(t144-2.7)*(144.0d6/freq8)**2.6 + 2.7 !Tsky for obs freq
|
||||
|
||||
xdop(NStation)=doppler
|
||||
if(NStation.eq.2) then
|
||||
HisGrid=MyGrid
|
||||
go to 900
|
||||
endif
|
||||
|
||||
doppler00=2.0*xdop(1)
|
||||
doppler=xdop(1)+xdop(2)
|
||||
! if(mode.eq.3) doppler=2.0*xdop(1)
|
||||
dBMoon=-40.0*log10(dist/356903.)
|
||||
sd=16.23*370152.0/dist
|
||||
|
||||
! if(NStation.eq.1 .and. MoonDX.ne.0 .and.
|
||||
! + (mode.eq.2 .or. mode.eq.5)) then
|
||||
if(NStation.eq.1 .and. MoonDX.ne.0) then
|
||||
poloffset=mod(poloffset2-poloffset1+720.0,180.0)
|
||||
if(poloffset.gt.90.0) poloffset=poloffset-180.0
|
||||
x1=abs(cos(2*poloffset/rad))
|
||||
if(x1.lt.0.056234) x1=0.056234
|
||||
xnr=-20.0*log10(x1)
|
||||
if(HisGrid(1:1).lt.'A' .or. HisGrid(1:1).gt.'R') xnr=0
|
||||
endif
|
||||
|
||||
tr=80.0 !Good preamp
|
||||
tskymin=13.0*(408.0d6/freq8)**2.6 !Cold sky temperature
|
||||
tsysmin=tskymin+tr
|
||||
tsys=tsky+tr
|
||||
dgrd=-10.0*log10(tsys/tsysmin) + dbMoon
|
||||
900 AzMoon0=Azmoon
|
||||
ElMoon0=Elmoon
|
||||
ntsky=nint(tsky)
|
||||
|
||||
! auxHA = 15.0*(LST-auxra) !HA in degrees
|
||||
! pi=3.14159265
|
||||
! pio2=0.5*pi
|
||||
! call coord(pi,pio2-lat/rad,0.0,lat/rad,auxha*pi/180.0,
|
||||
! + auxdec/rad,azaux,elaux)
|
||||
! AzAux=azaux*rad
|
||||
! ElAux=ElAux*rad
|
||||
|
||||
return
|
||||
end subroutine astro
|
||||
@@ -0,0 +1,76 @@
|
||||
# Set paths
|
||||
EXE_DIR = C:/JTSDK/wsjtx_exp/install/Debug/bin
|
||||
QT_DIR = /usr/include/qt5
|
||||
INCPATH = -I${QT_DIR} -I${QT_DIR}/QtCore
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
FC = gfortran
|
||||
AR = ar cr
|
||||
MKDIR = mkdir -p
|
||||
CP = cp
|
||||
RANLIB = ranlib
|
||||
RM = rm -f
|
||||
|
||||
FFLAGS = -O2 -Wall -Wno-conversion -fno-second-underscore
|
||||
CFLAGS = -I. -fbounds-check -fPIE -DBIGSYM
|
||||
|
||||
# Default rules
|
||||
%.o: %.c
|
||||
${CC} ${CFLAGS} -c $<
|
||||
%.o: %.f
|
||||
${FC} ${FFLAGS} -c $<
|
||||
%.o: %.F
|
||||
${FC} ${FFLAGS} -c $<
|
||||
%.o: %.f90
|
||||
${FC} ${FFLAGS} -c $<
|
||||
%.o: %.F90
|
||||
${FC} ${FFLAGS} -c $<
|
||||
|
||||
all: libjt9.a jt65 jt65sim
|
||||
|
||||
OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \
|
||||
fmtmsg.o deg2grid.o\
|
||||
prog_args.o options.o pctile.o graycode.o sort.o chkmsg.o \
|
||||
igray.o fftw3mod.o packjt.o\
|
||||
four2a.o grid2deg.o wisdom.o \
|
||||
symspec.o analytic.o db.o \
|
||||
encode232.o interleave9.o \
|
||||
entail.o fano232.o gran.o sync9.o decjt9.o \
|
||||
fil3.o decoder.o timer.o exp_decode65.o fqso_first.o \
|
||||
twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\
|
||||
fillcom.o chkss2.o zplot9.o flat1.o flat2.o \
|
||||
jt65a.o symspec65.o flat65.o ccf65.o decode65a.o \
|
||||
filbig.o fil6521.o afc65b.o decode65b.o setup65.o \
|
||||
extract.o fchisq65.o demod64a.o chkhist.o interleave63.o ccf2.o \
|
||||
move.o indexx.o graycode65.o twkfreq65.o smo.o smo121.o \
|
||||
wrapkarn.o init_rs.o encode_rs.o decode_rs.o gen65.o fil4.o \
|
||||
flat4.o determ.o baddata.o subtract65.o
|
||||
|
||||
libjt9.a: $(OBJS1)
|
||||
$(AR) libjt9.a $(OBJS1)
|
||||
$(RANLIB) libjt9.a
|
||||
|
||||
OBJS7 = jt65.o
|
||||
jt65: $(OBJS7) libjt9.a libsfrsd.a
|
||||
$(FC) -o jt65 $(OBJS7) -L. -L./sfrsd2 -ljt9 -lsfrsd \
|
||||
C:\JTSDK\fftw3f\libfftw3f-3.dll
|
||||
|
||||
OBJS2 = jt65sim.o wavhdr.o
|
||||
jt65sim: $(OBJS2) libjt9.a
|
||||
$(FC) -o jt65sim $(OBJS2) -L. -ljt9 C:\JTSDK\fftw3f\libfftw3f-3.dll
|
||||
$(CP) jt65sim.exe $(EXE_DIR)
|
||||
|
||||
init_rs.o: init_rs.c
|
||||
$(CC) -c -DBIGSYM=1 -o init_rs.o init_rs.c
|
||||
|
||||
encode_rs.o: encode_rs.c
|
||||
$(CC) -c -DBIGSYM=1 -o encode_rs.o encode_rs.c
|
||||
|
||||
decode_rs.o: decode_rs.c
|
||||
$(CC) -c -DBIGSYM=1 -o decode_rs.o decode_rs.c
|
||||
|
||||
.PHONY : clean
|
||||
|
||||
clean:
|
||||
$(RM) *.o libjt9.a jt65
|
||||
@@ -0,0 +1,288 @@
|
||||
# /* 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_LOGICAL_BOOL_HPP
|
||||
# define BOOST_PREPROCESSOR_LOGICAL_BOOL_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# /* BOOST_PP_BOOL */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# define BOOST_PP_BOOL(x) BOOST_PP_BOOL_I(x)
|
||||
# else
|
||||
# define BOOST_PP_BOOL(x) BOOST_PP_BOOL_OO((x))
|
||||
# define BOOST_PP_BOOL_OO(par) BOOST_PP_BOOL_I ## par
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_BOOL_I(x) BOOST_PP_BOOL_ ## x
|
||||
#
|
||||
# define BOOST_PP_BOOL_0 0
|
||||
# define BOOST_PP_BOOL_1 1
|
||||
# define BOOST_PP_BOOL_2 1
|
||||
# define BOOST_PP_BOOL_3 1
|
||||
# define BOOST_PP_BOOL_4 1
|
||||
# define BOOST_PP_BOOL_5 1
|
||||
# define BOOST_PP_BOOL_6 1
|
||||
# define BOOST_PP_BOOL_7 1
|
||||
# define BOOST_PP_BOOL_8 1
|
||||
# define BOOST_PP_BOOL_9 1
|
||||
# define BOOST_PP_BOOL_10 1
|
||||
# define BOOST_PP_BOOL_11 1
|
||||
# define BOOST_PP_BOOL_12 1
|
||||
# define BOOST_PP_BOOL_13 1
|
||||
# define BOOST_PP_BOOL_14 1
|
||||
# define BOOST_PP_BOOL_15 1
|
||||
# define BOOST_PP_BOOL_16 1
|
||||
# define BOOST_PP_BOOL_17 1
|
||||
# define BOOST_PP_BOOL_18 1
|
||||
# define BOOST_PP_BOOL_19 1
|
||||
# define BOOST_PP_BOOL_20 1
|
||||
# define BOOST_PP_BOOL_21 1
|
||||
# define BOOST_PP_BOOL_22 1
|
||||
# define BOOST_PP_BOOL_23 1
|
||||
# define BOOST_PP_BOOL_24 1
|
||||
# define BOOST_PP_BOOL_25 1
|
||||
# define BOOST_PP_BOOL_26 1
|
||||
# define BOOST_PP_BOOL_27 1
|
||||
# define BOOST_PP_BOOL_28 1
|
||||
# define BOOST_PP_BOOL_29 1
|
||||
# define BOOST_PP_BOOL_30 1
|
||||
# define BOOST_PP_BOOL_31 1
|
||||
# define BOOST_PP_BOOL_32 1
|
||||
# define BOOST_PP_BOOL_33 1
|
||||
# define BOOST_PP_BOOL_34 1
|
||||
# define BOOST_PP_BOOL_35 1
|
||||
# define BOOST_PP_BOOL_36 1
|
||||
# define BOOST_PP_BOOL_37 1
|
||||
# define BOOST_PP_BOOL_38 1
|
||||
# define BOOST_PP_BOOL_39 1
|
||||
# define BOOST_PP_BOOL_40 1
|
||||
# define BOOST_PP_BOOL_41 1
|
||||
# define BOOST_PP_BOOL_42 1
|
||||
# define BOOST_PP_BOOL_43 1
|
||||
# define BOOST_PP_BOOL_44 1
|
||||
# define BOOST_PP_BOOL_45 1
|
||||
# define BOOST_PP_BOOL_46 1
|
||||
# define BOOST_PP_BOOL_47 1
|
||||
# define BOOST_PP_BOOL_48 1
|
||||
# define BOOST_PP_BOOL_49 1
|
||||
# define BOOST_PP_BOOL_50 1
|
||||
# define BOOST_PP_BOOL_51 1
|
||||
# define BOOST_PP_BOOL_52 1
|
||||
# define BOOST_PP_BOOL_53 1
|
||||
# define BOOST_PP_BOOL_54 1
|
||||
# define BOOST_PP_BOOL_55 1
|
||||
# define BOOST_PP_BOOL_56 1
|
||||
# define BOOST_PP_BOOL_57 1
|
||||
# define BOOST_PP_BOOL_58 1
|
||||
# define BOOST_PP_BOOL_59 1
|
||||
# define BOOST_PP_BOOL_60 1
|
||||
# define BOOST_PP_BOOL_61 1
|
||||
# define BOOST_PP_BOOL_62 1
|
||||
# define BOOST_PP_BOOL_63 1
|
||||
# define BOOST_PP_BOOL_64 1
|
||||
# define BOOST_PP_BOOL_65 1
|
||||
# define BOOST_PP_BOOL_66 1
|
||||
# define BOOST_PP_BOOL_67 1
|
||||
# define BOOST_PP_BOOL_68 1
|
||||
# define BOOST_PP_BOOL_69 1
|
||||
# define BOOST_PP_BOOL_70 1
|
||||
# define BOOST_PP_BOOL_71 1
|
||||
# define BOOST_PP_BOOL_72 1
|
||||
# define BOOST_PP_BOOL_73 1
|
||||
# define BOOST_PP_BOOL_74 1
|
||||
# define BOOST_PP_BOOL_75 1
|
||||
# define BOOST_PP_BOOL_76 1
|
||||
# define BOOST_PP_BOOL_77 1
|
||||
# define BOOST_PP_BOOL_78 1
|
||||
# define BOOST_PP_BOOL_79 1
|
||||
# define BOOST_PP_BOOL_80 1
|
||||
# define BOOST_PP_BOOL_81 1
|
||||
# define BOOST_PP_BOOL_82 1
|
||||
# define BOOST_PP_BOOL_83 1
|
||||
# define BOOST_PP_BOOL_84 1
|
||||
# define BOOST_PP_BOOL_85 1
|
||||
# define BOOST_PP_BOOL_86 1
|
||||
# define BOOST_PP_BOOL_87 1
|
||||
# define BOOST_PP_BOOL_88 1
|
||||
# define BOOST_PP_BOOL_89 1
|
||||
# define BOOST_PP_BOOL_90 1
|
||||
# define BOOST_PP_BOOL_91 1
|
||||
# define BOOST_PP_BOOL_92 1
|
||||
# define BOOST_PP_BOOL_93 1
|
||||
# define BOOST_PP_BOOL_94 1
|
||||
# define BOOST_PP_BOOL_95 1
|
||||
# define BOOST_PP_BOOL_96 1
|
||||
# define BOOST_PP_BOOL_97 1
|
||||
# define BOOST_PP_BOOL_98 1
|
||||
# define BOOST_PP_BOOL_99 1
|
||||
# define BOOST_PP_BOOL_100 1
|
||||
# define BOOST_PP_BOOL_101 1
|
||||
# define BOOST_PP_BOOL_102 1
|
||||
# define BOOST_PP_BOOL_103 1
|
||||
# define BOOST_PP_BOOL_104 1
|
||||
# define BOOST_PP_BOOL_105 1
|
||||
# define BOOST_PP_BOOL_106 1
|
||||
# define BOOST_PP_BOOL_107 1
|
||||
# define BOOST_PP_BOOL_108 1
|
||||
# define BOOST_PP_BOOL_109 1
|
||||
# define BOOST_PP_BOOL_110 1
|
||||
# define BOOST_PP_BOOL_111 1
|
||||
# define BOOST_PP_BOOL_112 1
|
||||
# define BOOST_PP_BOOL_113 1
|
||||
# define BOOST_PP_BOOL_114 1
|
||||
# define BOOST_PP_BOOL_115 1
|
||||
# define BOOST_PP_BOOL_116 1
|
||||
# define BOOST_PP_BOOL_117 1
|
||||
# define BOOST_PP_BOOL_118 1
|
||||
# define BOOST_PP_BOOL_119 1
|
||||
# define BOOST_PP_BOOL_120 1
|
||||
# define BOOST_PP_BOOL_121 1
|
||||
# define BOOST_PP_BOOL_122 1
|
||||
# define BOOST_PP_BOOL_123 1
|
||||
# define BOOST_PP_BOOL_124 1
|
||||
# define BOOST_PP_BOOL_125 1
|
||||
# define BOOST_PP_BOOL_126 1
|
||||
# define BOOST_PP_BOOL_127 1
|
||||
# define BOOST_PP_BOOL_128 1
|
||||
# define BOOST_PP_BOOL_129 1
|
||||
# define BOOST_PP_BOOL_130 1
|
||||
# define BOOST_PP_BOOL_131 1
|
||||
# define BOOST_PP_BOOL_132 1
|
||||
# define BOOST_PP_BOOL_133 1
|
||||
# define BOOST_PP_BOOL_134 1
|
||||
# define BOOST_PP_BOOL_135 1
|
||||
# define BOOST_PP_BOOL_136 1
|
||||
# define BOOST_PP_BOOL_137 1
|
||||
# define BOOST_PP_BOOL_138 1
|
||||
# define BOOST_PP_BOOL_139 1
|
||||
# define BOOST_PP_BOOL_140 1
|
||||
# define BOOST_PP_BOOL_141 1
|
||||
# define BOOST_PP_BOOL_142 1
|
||||
# define BOOST_PP_BOOL_143 1
|
||||
# define BOOST_PP_BOOL_144 1
|
||||
# define BOOST_PP_BOOL_145 1
|
||||
# define BOOST_PP_BOOL_146 1
|
||||
# define BOOST_PP_BOOL_147 1
|
||||
# define BOOST_PP_BOOL_148 1
|
||||
# define BOOST_PP_BOOL_149 1
|
||||
# define BOOST_PP_BOOL_150 1
|
||||
# define BOOST_PP_BOOL_151 1
|
||||
# define BOOST_PP_BOOL_152 1
|
||||
# define BOOST_PP_BOOL_153 1
|
||||
# define BOOST_PP_BOOL_154 1
|
||||
# define BOOST_PP_BOOL_155 1
|
||||
# define BOOST_PP_BOOL_156 1
|
||||
# define BOOST_PP_BOOL_157 1
|
||||
# define BOOST_PP_BOOL_158 1
|
||||
# define BOOST_PP_BOOL_159 1
|
||||
# define BOOST_PP_BOOL_160 1
|
||||
# define BOOST_PP_BOOL_161 1
|
||||
# define BOOST_PP_BOOL_162 1
|
||||
# define BOOST_PP_BOOL_163 1
|
||||
# define BOOST_PP_BOOL_164 1
|
||||
# define BOOST_PP_BOOL_165 1
|
||||
# define BOOST_PP_BOOL_166 1
|
||||
# define BOOST_PP_BOOL_167 1
|
||||
# define BOOST_PP_BOOL_168 1
|
||||
# define BOOST_PP_BOOL_169 1
|
||||
# define BOOST_PP_BOOL_170 1
|
||||
# define BOOST_PP_BOOL_171 1
|
||||
# define BOOST_PP_BOOL_172 1
|
||||
# define BOOST_PP_BOOL_173 1
|
||||
# define BOOST_PP_BOOL_174 1
|
||||
# define BOOST_PP_BOOL_175 1
|
||||
# define BOOST_PP_BOOL_176 1
|
||||
# define BOOST_PP_BOOL_177 1
|
||||
# define BOOST_PP_BOOL_178 1
|
||||
# define BOOST_PP_BOOL_179 1
|
||||
# define BOOST_PP_BOOL_180 1
|
||||
# define BOOST_PP_BOOL_181 1
|
||||
# define BOOST_PP_BOOL_182 1
|
||||
# define BOOST_PP_BOOL_183 1
|
||||
# define BOOST_PP_BOOL_184 1
|
||||
# define BOOST_PP_BOOL_185 1
|
||||
# define BOOST_PP_BOOL_186 1
|
||||
# define BOOST_PP_BOOL_187 1
|
||||
# define BOOST_PP_BOOL_188 1
|
||||
# define BOOST_PP_BOOL_189 1
|
||||
# define BOOST_PP_BOOL_190 1
|
||||
# define BOOST_PP_BOOL_191 1
|
||||
# define BOOST_PP_BOOL_192 1
|
||||
# define BOOST_PP_BOOL_193 1
|
||||
# define BOOST_PP_BOOL_194 1
|
||||
# define BOOST_PP_BOOL_195 1
|
||||
# define BOOST_PP_BOOL_196 1
|
||||
# define BOOST_PP_BOOL_197 1
|
||||
# define BOOST_PP_BOOL_198 1
|
||||
# define BOOST_PP_BOOL_199 1
|
||||
# define BOOST_PP_BOOL_200 1
|
||||
# define BOOST_PP_BOOL_201 1
|
||||
# define BOOST_PP_BOOL_202 1
|
||||
# define BOOST_PP_BOOL_203 1
|
||||
# define BOOST_PP_BOOL_204 1
|
||||
# define BOOST_PP_BOOL_205 1
|
||||
# define BOOST_PP_BOOL_206 1
|
||||
# define BOOST_PP_BOOL_207 1
|
||||
# define BOOST_PP_BOOL_208 1
|
||||
# define BOOST_PP_BOOL_209 1
|
||||
# define BOOST_PP_BOOL_210 1
|
||||
# define BOOST_PP_BOOL_211 1
|
||||
# define BOOST_PP_BOOL_212 1
|
||||
# define BOOST_PP_BOOL_213 1
|
||||
# define BOOST_PP_BOOL_214 1
|
||||
# define BOOST_PP_BOOL_215 1
|
||||
# define BOOST_PP_BOOL_216 1
|
||||
# define BOOST_PP_BOOL_217 1
|
||||
# define BOOST_PP_BOOL_218 1
|
||||
# define BOOST_PP_BOOL_219 1
|
||||
# define BOOST_PP_BOOL_220 1
|
||||
# define BOOST_PP_BOOL_221 1
|
||||
# define BOOST_PP_BOOL_222 1
|
||||
# define BOOST_PP_BOOL_223 1
|
||||
# define BOOST_PP_BOOL_224 1
|
||||
# define BOOST_PP_BOOL_225 1
|
||||
# define BOOST_PP_BOOL_226 1
|
||||
# define BOOST_PP_BOOL_227 1
|
||||
# define BOOST_PP_BOOL_228 1
|
||||
# define BOOST_PP_BOOL_229 1
|
||||
# define BOOST_PP_BOOL_230 1
|
||||
# define BOOST_PP_BOOL_231 1
|
||||
# define BOOST_PP_BOOL_232 1
|
||||
# define BOOST_PP_BOOL_233 1
|
||||
# define BOOST_PP_BOOL_234 1
|
||||
# define BOOST_PP_BOOL_235 1
|
||||
# define BOOST_PP_BOOL_236 1
|
||||
# define BOOST_PP_BOOL_237 1
|
||||
# define BOOST_PP_BOOL_238 1
|
||||
# define BOOST_PP_BOOL_239 1
|
||||
# define BOOST_PP_BOOL_240 1
|
||||
# define BOOST_PP_BOOL_241 1
|
||||
# define BOOST_PP_BOOL_242 1
|
||||
# define BOOST_PP_BOOL_243 1
|
||||
# define BOOST_PP_BOOL_244 1
|
||||
# define BOOST_PP_BOOL_245 1
|
||||
# define BOOST_PP_BOOL_246 1
|
||||
# define BOOST_PP_BOOL_247 1
|
||||
# define BOOST_PP_BOOL_248 1
|
||||
# define BOOST_PP_BOOL_249 1
|
||||
# define BOOST_PP_BOOL_250 1
|
||||
# define BOOST_PP_BOOL_251 1
|
||||
# define BOOST_PP_BOOL_252 1
|
||||
# define BOOST_PP_BOOL_253 1
|
||||
# define BOOST_PP_BOOL_254 1
|
||||
# define BOOST_PP_BOOL_255 1
|
||||
# define BOOST_PP_BOOL_256 1
|
||||
#
|
||||
# endif
|
||||
Reference in New Issue
Block a user