Initial Commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.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
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_SVM_HPP
|
||||
#define BOOST_COMPUTE_SVM_HPP
|
||||
|
||||
#include <boost/compute/config.hpp>
|
||||
#include <boost/compute/context.hpp>
|
||||
#include <boost/compute/memory/svm_ptr.hpp>
|
||||
|
||||
// svm functions require OpenCL 2.0
|
||||
#if defined(CL_VERSION_2_0) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// Allocates a shared virtual memory (SVM) buffer.
|
||||
//
|
||||
/// \opencl_version_warning{2,0}
|
||||
///
|
||||
/// \see_opencl2_ref{clSVMAlloc}
|
||||
///
|
||||
/// \see svm_free()
|
||||
template<class T>
|
||||
inline svm_ptr<T> svm_alloc(const context &context,
|
||||
size_t size,
|
||||
cl_svm_mem_flags flags = CL_MEM_READ_WRITE,
|
||||
unsigned int alignment = 0)
|
||||
{
|
||||
svm_ptr<T> ptr(
|
||||
clSVMAlloc(context.get(), flags, size * sizeof(T), alignment),
|
||||
context
|
||||
);
|
||||
if(!ptr.get()){
|
||||
BOOST_THROW_EXCEPTION(opencl_error(CL_MEM_OBJECT_ALLOCATION_FAILURE));
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/// Deallocates a shared virtual memory (SVM) buffer.
|
||||
///
|
||||
/// \opencl_version_warning{2,0}
|
||||
///
|
||||
/// \see_opencl2_ref{clSVMFree}
|
||||
///
|
||||
/// \see svm_alloc(), command_queue::enqueue_svm_free()
|
||||
template<class T>
|
||||
inline void svm_free(svm_ptr<T> ptr)
|
||||
{
|
||||
clSVMFree(ptr.get_context(), ptr.get());
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class T>
|
||||
inline void svm_free(const context &context, svm_ptr<T> ptr)
|
||||
{
|
||||
clSVMFree(context.get(), ptr.get());
|
||||
}
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // CL_VERSION_2_0
|
||||
|
||||
#endif // BOOST_COMPUTE_PIPE_HPP
|
||||
@@ -0,0 +1,40 @@
|
||||
# /* Copyright (C) 2001
|
||||
# * Housemarque Oy
|
||||
# * http://www.housemarque.com
|
||||
# *
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_LIST_REVERSE_HPP
|
||||
# define BOOST_PREPROCESSOR_LIST_REVERSE_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/list/fold_left.hpp>
|
||||
#
|
||||
# /* BOOST_PP_LIST_REVERSE */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_LIST_REVERSE(list) BOOST_PP_LIST_FOLD_LEFT(BOOST_PP_LIST_REVERSE_O, BOOST_PP_NIL, list)
|
||||
# else
|
||||
# define BOOST_PP_LIST_REVERSE(list) BOOST_PP_LIST_REVERSE_I(list)
|
||||
# define BOOST_PP_LIST_REVERSE_I(list) BOOST_PP_LIST_FOLD_LEFT(BOOST_PP_LIST_REVERSE_O, BOOST_PP_NIL, list)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_LIST_REVERSE_O(d, s, x) (x, s)
|
||||
#
|
||||
# /* BOOST_PP_LIST_REVERSE_D */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_LIST_REVERSE_D(d, list) BOOST_PP_LIST_FOLD_LEFT_ ## d(BOOST_PP_LIST_REVERSE_O, BOOST_PP_NIL, list)
|
||||
# else
|
||||
# define BOOST_PP_LIST_REVERSE_D(d, list) BOOST_PP_LIST_REVERSE_D_I(d, list)
|
||||
# define BOOST_PP_LIST_REVERSE_D_I(d, list) BOOST_PP_LIST_FOLD_LEFT_ ## d(BOOST_PP_LIST_REVERSE_O, BOOST_PP_NIL, list)
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,198 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_15_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
subroutine softsym(id2,npts8,nsps8,newdat,fpk,syncpk,snrdb,xdt, &
|
||||
freq,drift,a3,schk,i1SoftSymbols)
|
||||
|
||||
! Compute the soft symbols
|
||||
|
||||
use timer_module, only: timer
|
||||
|
||||
parameter (NZ2=1512,NZ3=1360)
|
||||
logical, intent(inout) :: newdat
|
||||
complex c2(0:NZ2-1)
|
||||
complex c3(0:NZ3-1)
|
||||
complex c5(0:NZ3-1)
|
||||
real a(3)
|
||||
integer*1 i1SoftSymbolsScrambled(207)
|
||||
integer*1 i1SoftSymbols(207)
|
||||
include 'jt9sync.f90'
|
||||
|
||||
nspsd=16
|
||||
ndown=nsps8/nspsd
|
||||
|
||||
! Mix, low-pass filter, and downsample to 16 samples per symbol
|
||||
call timer('downsam9',0)
|
||||
call downsam9(id2,npts8,nsps8,newdat,nspsd,fpk,c2)
|
||||
call timer('downsam9',1)
|
||||
|
||||
call peakdt9(c2,nsps8,nspsd,c3,xdt) !Find DT
|
||||
|
||||
fsample=1500.0/ndown
|
||||
a=0.
|
||||
call timer('afc9 ',0)
|
||||
call afc9(c3,nz3,fsample,a,syncpk) !Find deltaF, fDot, extra DT
|
||||
call timer('afc9 ',1)
|
||||
freq=fpk - a(1)
|
||||
drift=-2.0*a(2)
|
||||
! write(*,3301) fpk,freq,a
|
||||
!3301 format(2f9.3,3f10.4)
|
||||
a3=a(3)
|
||||
a(3)=0.
|
||||
|
||||
call timer('twkfreq ',0)
|
||||
call twkfreq(c3,c5,nz3,fsample,a) !Correct for delta f, f1, f2 ==> a(1:3)
|
||||
call timer('twkfreq ',1)
|
||||
|
||||
! Compute soft symbols (in scrambled order)
|
||||
call timer('symspec2',0)
|
||||
call symspec2(c5,nz3,nsps8,nspsd,fsample,freq,drift,snrdb,schk, &
|
||||
i1SoftSymbolsScrambled)
|
||||
call timer('symspec2',1)
|
||||
|
||||
! Remove interleaving
|
||||
call interleave9(i1SoftSymbolsScrambled,-1,i1SoftSymbols)
|
||||
|
||||
return
|
||||
end subroutine softsym
|
||||
@@ -0,0 +1,23 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_CONS_FWD_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_CONS_FWD_HPP_INCLUDED
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nil_;
|
||||
#ifndef nil
|
||||
typedef nil_ nil;
|
||||
#endif
|
||||
|
||||
template <typename Car, typename Cdr = nil_>
|
||||
struct cons;
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/container for documentation.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_CONTAINER_DETAIL_COMPARE_FUNCTORS_HPP
|
||||
#define BOOST_CONTAINER_DETAIL_COMPARE_FUNCTORS_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace container {
|
||||
|
||||
template<class Allocator>
|
||||
class equal_to_value
|
||||
{
|
||||
typedef typename Allocator::value_type value_type;
|
||||
const value_type &t_;
|
||||
|
||||
public:
|
||||
explicit equal_to_value(const value_type &t)
|
||||
: t_(t)
|
||||
{}
|
||||
|
||||
bool operator()(const value_type &t)const
|
||||
{ return t_ == t; }
|
||||
};
|
||||
|
||||
template<class Node, class Pred>
|
||||
struct value_to_node_compare
|
||||
: Pred
|
||||
{
|
||||
typedef Pred predicate_type;
|
||||
typedef Node node_type;
|
||||
|
||||
value_to_node_compare()
|
||||
: Pred()
|
||||
{}
|
||||
|
||||
explicit value_to_node_compare(Pred pred)
|
||||
: Pred(pred)
|
||||
{}
|
||||
|
||||
bool operator()(const Node &a, const Node &b) const
|
||||
{ return static_cast<const Pred&>(*this)(a.get_data(), b.get_data()); }
|
||||
|
||||
bool operator()(const Node &a) const
|
||||
{ return static_cast<const Pred&>(*this)(a.get_data()); }
|
||||
|
||||
bool operator()(const Node &a, const Node &b)
|
||||
{ return static_cast<Pred&>(*this)(a.get_data(), b.get_data()); }
|
||||
|
||||
bool operator()(const Node &a)
|
||||
{ return static_cast<Pred&>(*this)(a.get_data()); }
|
||||
|
||||
predicate_type & predicate() { return static_cast<predicate_type&>(*this); }
|
||||
const predicate_type & predicate() const { return static_cast<predicate_type&>(*this); }
|
||||
};
|
||||
|
||||
} //namespace container {
|
||||
} //namespace boost {
|
||||
|
||||
#endif //BOOST_CONTAINER_DETAIL_COMPARE_FUNCTORS_HPP
|
||||
@@ -0,0 +1,51 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file rbegin.hpp
|
||||
/// Proto callables for boost::rbegin()
|
||||
//
|
||||
// Copyright 2012 Eric Niebler. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PROTO_FUNCTIONAL_RANGE_RBEGIN_HPP_EAN_27_08_2012
|
||||
#define BOOST_PROTO_FUNCTIONAL_RANGE_RBEGIN_HPP_EAN_27_08_2012
|
||||
|
||||
#include <boost/range/rbegin.hpp>
|
||||
#include <boost/proto/proto_fwd.hpp>
|
||||
|
||||
namespace boost { namespace proto { namespace functional
|
||||
{
|
||||
|
||||
// A PolymorphicFunctionObject that wraps boost::rbegin()
|
||||
struct rbegin
|
||||
{
|
||||
BOOST_PROTO_CALLABLE()
|
||||
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename This, typename Rng>
|
||||
struct result<This(Rng)>
|
||||
: boost::range_reverse_iterator<Rng const>
|
||||
{};
|
||||
|
||||
template<typename This, typename Rng>
|
||||
struct result<This(Rng &)>
|
||||
: boost::range_reverse_iterator<Rng>
|
||||
{};
|
||||
|
||||
template<typename Rng>
|
||||
typename boost::range_reverse_iterator<Rng>::type operator()(Rng &rng) const
|
||||
{
|
||||
return boost::rbegin(rng);
|
||||
}
|
||||
|
||||
template<typename Rng>
|
||||
typename boost::range_reverse_iterator<Rng const>::type operator()(Rng const &rng) const
|
||||
{
|
||||
return boost::rbegin(rng);
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost blank.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_BLANK_HPP
|
||||
#define BOOST_BLANK_HPP
|
||||
|
||||
#include "boost/blank_fwd.hpp"
|
||||
|
||||
#if !defined(BOOST_NO_IOSTREAM)
|
||||
#include <iosfwd> // for std::basic_ostream forward declare
|
||||
#include "boost/detail/templated_streams.hpp"
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
#include "boost/mpl/bool.hpp"
|
||||
#include "boost/type_traits/is_empty.hpp"
|
||||
#include "boost/type_traits/is_pod.hpp"
|
||||
#include "boost/type_traits/is_stateless.hpp"
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct blank
|
||||
{
|
||||
};
|
||||
|
||||
// type traits specializations
|
||||
//
|
||||
|
||||
template <>
|
||||
struct is_pod< blank >
|
||||
: mpl::true_
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_empty< blank >
|
||||
: mpl::true_
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_stateless< blank >
|
||||
: mpl::true_
|
||||
{
|
||||
};
|
||||
|
||||
// relational operators
|
||||
//
|
||||
|
||||
inline bool operator==(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator<=(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator>=(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator!=(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator<(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator>(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// streaming support
|
||||
//
|
||||
#if !defined(BOOST_NO_IOSTREAM)
|
||||
|
||||
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
||||
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
||||
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
|
||||
, const blank&
|
||||
)
|
||||
{
|
||||
// (output nothing)
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_BLANK_HPP
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,56 @@
|
||||
/*==============================================================================
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !BOOST_PHOENIX_IS_ITERATING
|
||||
|
||||
#ifndef BOOST_PHOENIX_OPERATOR_DETAIL_MEM_FUN_PTR_EVAL_RESULT_OF_HPP
|
||||
#define BOOST_PHOENIX_OPERATOR_DETAIL_MEM_FUN_PTR_EVAL_RESULT_OF_HPP
|
||||
|
||||
#define BOOST_PHOENIX_MEM_FUN_PTR_EVAL_RESULT_OF_CHILD(Z, N, D) \
|
||||
typedef \
|
||||
typename \
|
||||
evaluator::impl< \
|
||||
BOOST_PP_CAT(A, N) \
|
||||
, Context \
|
||||
, proto::empty_env \
|
||||
>::result_type \
|
||||
BOOST_PP_CAT(child, N); \
|
||||
/**/
|
||||
|
||||
#define BOOST_PHOENIX_ITERATION_PARAMS \
|
||||
(3, (2, BOOST_PHOENIX_LIMIT, \
|
||||
<boost/phoenix/operator/detail/cpp03/mem_fun_ptr_eval_result_of.hpp>))
|
||||
#include BOOST_PHOENIX_ITERATE()
|
||||
|
||||
#undef BOOST_PHOENIX_MEM_FUN_PTR_EVAL_RESULT_OF_CHILD
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
template <typename Context, BOOST_PHOENIX_typename_A>
|
||||
struct mem_fun_ptr_eval<Context, BOOST_PHOENIX_A>
|
||||
{
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, BOOST_PHOENIX_MEM_FUN_PTR_EVAL_RESULT_OF_CHILD
|
||||
, _
|
||||
)
|
||||
|
||||
typedef
|
||||
typename boost::result_of<
|
||||
child1(
|
||||
BOOST_PP_ENUM_SHIFTED_PARAMS(
|
||||
BOOST_PHOENIX_ITERATION
|
||||
, child
|
||||
)
|
||||
)
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/derived_dimension.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
#include <boost/units/physical_dimensions/current.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// derived dimension for conductivity : L^-3 M^-1 T^3 I^2
|
||||
typedef derived_dimension<length_base_dimension,-3,
|
||||
mass_base_dimension,-1,
|
||||
time_base_dimension,3,
|
||||
current_base_dimension,2>::type conductivity_dimension;
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP
|
||||
@@ -0,0 +1,180 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// *Preprocessed* version of the main "iter_fold_impl.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
/// forward declaration
|
||||
|
||||
template<
|
||||
int N
|
||||
, typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl;
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< 0,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef state0 state;
|
||||
typedef iter0 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< 1,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
|
||||
|
||||
typedef state1 state;
|
||||
typedef iter1 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< 2,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp,state1,iter1 >::type state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
|
||||
|
||||
typedef state2 state;
|
||||
typedef iter2 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< 3,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp,state1,iter1 >::type state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp,state2,iter2 >::type state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
|
||||
|
||||
typedef state3 state;
|
||||
typedef iter3 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< 4,First,Last,State,ForwardOp >
|
||||
{
|
||||
typedef First iter0;
|
||||
typedef State state0;
|
||||
typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
|
||||
typedef typename mpl::next<iter0>::type iter1;
|
||||
typedef typename apply2< ForwardOp,state1,iter1 >::type state2;
|
||||
typedef typename mpl::next<iter1>::type iter2;
|
||||
typedef typename apply2< ForwardOp,state2,iter2 >::type state3;
|
||||
typedef typename mpl::next<iter2>::type iter3;
|
||||
typedef typename apply2< ForwardOp,state3,iter3 >::type state4;
|
||||
typedef typename mpl::next<iter3>::type iter4;
|
||||
|
||||
|
||||
typedef state4 state;
|
||||
typedef iter4 iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
int N
|
||||
, typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl
|
||||
{
|
||||
typedef iter_fold_impl<
|
||||
4
|
||||
, First
|
||||
, Last
|
||||
, State
|
||||
, ForwardOp
|
||||
> chunk_;
|
||||
|
||||
typedef iter_fold_impl<
|
||||
( (N - 4) < 0 ? 0 : N - 4 )
|
||||
, typename chunk_::iterator
|
||||
, Last
|
||||
, typename chunk_::state
|
||||
, ForwardOp
|
||||
> res_;
|
||||
|
||||
typedef typename res_::state state;
|
||||
typedef typename res_::iterator iterator;
|
||||
};
|
||||
|
||||
template<
|
||||
typename First
|
||||
, typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< -1,First,Last,State,ForwardOp >
|
||||
: iter_fold_impl<
|
||||
-1
|
||||
, typename mpl::next<First>::type
|
||||
, Last
|
||||
, typename apply2< ForwardOp,State,First >::type
|
||||
, ForwardOp
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
template<
|
||||
typename Last
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
struct iter_fold_impl< -1,Last,Last,State,ForwardOp >
|
||||
{
|
||||
typedef State state;
|
||||
typedef Last iterator;
|
||||
};
|
||||
|
||||
}}}
|
||||
@@ -0,0 +1,111 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2009-2011 Christopher Schmidt
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/preprocessor/config/config.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/variadic/to_seq.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/end_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
NAME_SEQ, \
|
||||
IS_VIEW, \
|
||||
I, \
|
||||
BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_LESS( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2))
|
||||
|
||||
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
|
||||
BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT(...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(BOOST_PP_SEQ_HEAD(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
|
||||
BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(BOOST_PP_SEQ_HEAD(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
|
||||
BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_TPL_STRUCT( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \
|
||||
_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \
|
||||
_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#endif
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
/*=============================================================================
|
||||
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_LIST_TO_CONS_07172005_1041)
|
||||
#define FUSION_LIST_TO_CONS_07172005_1041
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/list/cons.hpp>
|
||||
#include <boost/fusion/container/list/detail/cpp03/limits.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
|
||||
#define FUSION_VOID(z, n, _) void_
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct nil_;
|
||||
struct void_;
|
||||
}}
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list_to_cons.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/list_to_cons" FUSION_MAX_LIST_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 { namespace detail
|
||||
{
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename T)>
|
||||
struct list_to_cons
|
||||
{
|
||||
typedef T0 head_type;
|
||||
typedef list_to_cons<
|
||||
BOOST_PP_ENUM_SHIFTED_PARAMS(FUSION_MAX_LIST_SIZE, T), void_>
|
||||
tail_list_to_cons;
|
||||
typedef typename tail_list_to_cons::type tail_type;
|
||||
|
||||
typedef cons<head_type, tail_type> type;
|
||||
|
||||
#include <boost/fusion/container/list/detail/cpp03/list_to_cons_call.hpp>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct list_to_cons<BOOST_PP_ENUM(FUSION_MAX_LIST_SIZE, FUSION_VOID, _)>
|
||||
{
|
||||
typedef nil_ type;
|
||||
};
|
||||
}}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#undef FUSION_VOID
|
||||
#endif
|
||||
@@ -0,0 +1,131 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Neil Groves 2014. 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_COMBINE_CXX03_HPP
|
||||
#define BOOST_RANGE_DETAIL_COMBINE_CXX03_HPP
|
||||
|
||||
#ifndef BOOST_RANGE_MIN_COMBINE_ARGS
|
||||
#define BOOST_RANGE_MIN_COMBINE_ARGS 2
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_RANGE_MAX_COMBINE_ARGS
|
||||
#define BOOST_RANGE_MAX_COMBINE_ARGS 5
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/iterator/zip_iterator.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/div.hpp>
|
||||
#include <boost/preprocessor/arithmetic/mul.hpp>
|
||||
#include <boost/preprocessor/control.hpp>
|
||||
#include <boost/preprocessor/control/while.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
#include <boost/preprocessor/facilities/identity.hpp>
|
||||
#include <boost/preprocessor/iteration/local.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma.hpp>
|
||||
#include <boost/preprocessor/repetition.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/range/iterator_range_core.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/mpl/transform.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
|
||||
template<typename F, typename T, int SIZE>
|
||||
struct combined_result_impl;
|
||||
|
||||
template<typename F, typename T>
|
||||
struct combined_result
|
||||
: combined_result_impl<F, T, tuples::length<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
#define BOOST_RANGE_combined_element(z, n, data) \
|
||||
typename tuples::element<n, T>::type
|
||||
|
||||
#define BOOST_RANGE_combined_result(z, n, data) \
|
||||
template<typename F, typename T> \
|
||||
struct combined_result_impl <F,T,n> \
|
||||
: result_of<F(BOOST_PP_ENUM(n, BOOST_RANGE_combined_element, ~))> \
|
||||
{ \
|
||||
};
|
||||
|
||||
#define BOOST_PP_LOCAL_MACRO(n) BOOST_RANGE_combined_result(~,n,~)
|
||||
|
||||
#define BOOST_PP_LOCAL_LIMITS (BOOST_RANGE_MIN_COMBINE_ARGS, \
|
||||
BOOST_RANGE_MAX_COMBINE_ARGS)
|
||||
#include BOOST_PP_LOCAL_ITERATE()
|
||||
|
||||
#define BOOST_RANGE_combined_get(z, n, data) get<n>(tuple)
|
||||
|
||||
#define BOOST_RANGE_combined_unpack(z, n, data) \
|
||||
template<typename F, typename T> inline \
|
||||
typename combined_result<F,T>::type \
|
||||
unpack_(mpl::int_<n>, F f, const T& tuple) \
|
||||
{ \
|
||||
return f(BOOST_PP_ENUM(n, BOOST_RANGE_combined_get, ~)); \
|
||||
}
|
||||
|
||||
#define BOOST_PP_LOCAL_MACRO(n) BOOST_RANGE_combined_unpack(~,n,~)
|
||||
#define BOOST_PP_LOCAL_LIMITS (BOOST_RANGE_MIN_COMBINE_ARGS, \
|
||||
BOOST_RANGE_MAX_COMBINE_ARGS)
|
||||
#include BOOST_PP_LOCAL_ITERATE()
|
||||
|
||||
} // namespace range_detail
|
||||
|
||||
namespace range
|
||||
{
|
||||
|
||||
#define BOOST_RANGE_combined_seq(z, n, data) boost::data(BOOST_PP_CAT(r,n))
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/range/detail/combine_no_rvalue.hpp>
|
||||
|
||||
#else // by using rvalue references we avoid requiring 2^n overloads.
|
||||
|
||||
#include <boost/range/detail/combine_rvalue.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_LOCAL_MACRO(n) BOOST_RANGE_combine(~,n,~)
|
||||
#define BOOST_PP_LOCAL_LIMITS (BOOST_RANGE_MIN_COMBINE_ARGS, \
|
||||
BOOST_RANGE_MAX_COMBINE_ARGS)
|
||||
#include BOOST_PP_LOCAL_ITERATE()
|
||||
|
||||
} // namespace range
|
||||
|
||||
using boost::range::combine;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
|
||||
#undef BOOST_RANGE_combined_element
|
||||
#undef BOOST_RANGE_combined_result
|
||||
#undef BOOST_RANGE_combined_get
|
||||
#undef BOOST_RANGE_combined_unpack
|
||||
#undef BOOST_RANGE_combined_seq
|
||||
#undef BOOST_RANGE_combined_exp_pred
|
||||
#undef BOOST_RANGE_combined_exp_op
|
||||
#undef BOOST_RANGE_combined_exp
|
||||
#undef BOOST_RANGE_combined_bitset_pred
|
||||
#undef BOOST_RANGE_combined_bitset_op
|
||||
#undef BOOST_RANGE_combined_bitset
|
||||
#undef BOOST_RANGE_combined_range_iterator
|
||||
#undef BOOST_RANGE_combined_args
|
||||
#undef BOOST_RANGE_combine_impl
|
||||
#undef BOOST_RANGE_combine
|
||||
@@ -0,0 +1,98 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/greater.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<
|
||||
typename Tag1
|
||||
, typename Tag2
|
||||
>
|
||||
struct greater_impl
|
||||
: if_c<
|
||||
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
|
||||
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
|
||||
)
|
||||
|
||||
, aux::cast2nd_impl< greater_impl< Tag1,Tag1 >,Tag1, Tag2 >
|
||||
, aux::cast1st_impl< greater_impl< Tag2,Tag2 >,Tag1, Tag2 >
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
/// for Digital Mars C++/compilers with no CTPS/TTP support
|
||||
template<> struct greater_impl< na,na >
|
||||
{
|
||||
template< typename U1, typename U2 > struct apply
|
||||
{
|
||||
typedef apply type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename Tag > struct greater_impl< na,Tag >
|
||||
{
|
||||
template< typename U1, typename U2 > struct apply
|
||||
{
|
||||
typedef apply type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename Tag > struct greater_impl< Tag,na >
|
||||
{
|
||||
template< typename U1, typename U2 > struct apply
|
||||
{
|
||||
typedef apply type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename T > struct greater_tag
|
||||
{
|
||||
typedef typename T::tag type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename BOOST_MPL_AUX_NA_PARAM(N1)
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct greater
|
||||
|
||||
: greater_impl<
|
||||
typename greater_tag<N1>::type
|
||||
, typename greater_tag<N2>::type
|
||||
>::template apply< N1,N2 >::type
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, greater, (N1, N2))
|
||||
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_NA_SPEC2(2, 2, greater)
|
||||
|
||||
}}
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct greater_impl< integral_c_tag,integral_c_tag >
|
||||
{
|
||||
template< typename N1, typename N2 > struct apply
|
||||
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
( BOOST_MPL_AUX_VALUE_WKND(N1)::value >
|
||||
BOOST_MPL_AUX_VALUE_WKND(N2)::value )
|
||||
);
|
||||
typedef bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
|
||||
|
||||
#ifndef BOOST_MPL_LIMITS_MAP_HPP_INCLUDED
|
||||
#define BOOST_MPL_LIMITS_MAP_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#if !defined(BOOST_MPL_LIMIT_MAP_SIZE)
|
||||
# define BOOST_MPL_LIMIT_MAP_SIZE 20
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_LIMITS_MAP_HPP_INCLUDED
|
||||
@@ -0,0 +1,5 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource>@wsjtx_RESOURCES@
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,113 @@
|
||||
/* Boost interval/compare/possible.hpp template implementation file
|
||||
*
|
||||
* Copyright 2003 Guillaume Melquiond
|
||||
*
|
||||
* 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_INTERVAL_COMPARE_POSSIBLE_HPP
|
||||
#define BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
|
||||
|
||||
#include <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
#include <boost/numeric/interval/detail/test_input.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
namespace compare {
|
||||
namespace possible {
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() < y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() < y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() > y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() > y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() >= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y.upper() && x.upper() >= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator==(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y && x.upper() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() != y.upper() || x.upper() != y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator!=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() != y || x.upper() != y;
|
||||
}
|
||||
|
||||
} // namespace possible
|
||||
} // namespace compare
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
|
||||
@@ -0,0 +1,28 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2011. *
|
||||
# * (C) Copyright Paul Mensonides 2011. *
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See *
|
||||
# * accompanying file LICENSE_1_0.txt or copy at *
|
||||
# * http://www.boost.org/LICENSE_1_0.txt) *
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_TUPLE_SIZE_HPP
|
||||
# define BOOST_PREPROCESSOR_TUPLE_SIZE_HPP
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/variadic/size.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_TUPLE_SIZE(tuple) BOOST_PP_CAT(BOOST_PP_VARIADIC_SIZE tuple,)
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_SIZE(tuple) BOOST_PP_VARIADIC_SIZE tuple
|
||||
# endif
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef BOOST_THREAD_THREAD_HEAP_ALLOC_HPP
|
||||
#define BOOST_THREAD_THREAD_HEAP_ALLOC_HPP
|
||||
|
||||
// thread_heap_alloc.hpp
|
||||
//
|
||||
// (C) Copyright 2008 Anthony Williams
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/thread/detail/platform.hpp>
|
||||
|
||||
#if defined(BOOST_THREAD_PLATFORM_WIN32)
|
||||
#include <boost/thread/win32/thread_heap_alloc.hpp>
|
||||
#elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
|
||||
#include <boost/thread/pthread/thread_heap_alloc.hpp>
|
||||
#else
|
||||
#error "Boost threads unavailable on this platform"
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,266 @@
|
||||
/* RAND-TEST.C - Program to test random number generators. */
|
||||
|
||||
/* Copyright (c) 1995-2012 by Radford M. Neal.
|
||||
*
|
||||
* Permission is granted for anyone to copy, use, modify, and distribute
|
||||
* these programs and accompanying documents for any purpose, provided
|
||||
* this copyright notice is retained and prominently displayed, and note
|
||||
* is made of any changes made to these programs. These programs and
|
||||
* documents are distributed without any warranty, express or implied.
|
||||
* As the programs were written for research purposes only, they have not
|
||||
* been tested to the degree that would be advisable in any important
|
||||
* application. All use of these programs is entirely at the user's own
|
||||
* risk.
|
||||
*/
|
||||
|
||||
|
||||
/* Usage:
|
||||
|
||||
rand-test seed generator { parameters } / sample-size [ low high bins ]
|
||||
|
||||
Using the seed given, tests the random number generator identified by
|
||||
the second argument, for the parameter values specified. The possible
|
||||
generators and required parameters are as follows:
|
||||
|
||||
uniform Uniform from [0,1)
|
||||
uniopen Uniform from (0,1)
|
||||
int n Uniform from the set { 0, 1, ..., (n-1) }
|
||||
gaussian From Gaussian with mean zero and unit variance
|
||||
exp From exponential with mean one
|
||||
cauchy From Cauchy centred at zero with unit width
|
||||
gamma alpha From Gamma with shape parameter (and mean) alpha
|
||||
beta a b From Beta with parameters a and b
|
||||
|
||||
The size of the sample to use is also specified. The program reports
|
||||
the mean and variance of the sample. A histogram is also printed if a
|
||||
low and high range and number of bins are for it are specified.
|
||||
|
||||
These tests are not really adequate to detect subtle forms of bias due
|
||||
to use of pseudo-random numbers, but are hopefully good enough to find
|
||||
most programming errors.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "rand.h"
|
||||
|
||||
|
||||
#define Max_bins 1000 /* Maximum number of histogram bins */
|
||||
|
||||
static void usage (void);
|
||||
|
||||
|
||||
/* MAIN PROGRAM. */
|
||||
|
||||
main
|
||||
( int argc,
|
||||
char **argv
|
||||
)
|
||||
{
|
||||
int seed, sample_size, bins, np;
|
||||
double low, high;
|
||||
char *generator;
|
||||
double p1, p2;
|
||||
|
||||
double mean, variance;
|
||||
double tmean, tvariance;
|
||||
int undef_mean, undef_variance;
|
||||
|
||||
int count[Max_bins];
|
||||
int under, over;
|
||||
|
||||
char **ap;
|
||||
double x;
|
||||
int i, n;
|
||||
|
||||
bins = 0;
|
||||
|
||||
if (argc<5) usage();
|
||||
|
||||
if ((seed = atoi(argv[1]))==0 && strcmp(argv[1],"0")!=0) usage();
|
||||
|
||||
generator = argv[2];
|
||||
|
||||
if (strcmp(generator,"uniform")==0) np = 0;
|
||||
else if (strcmp(generator,"uniopen")==0) np = 0;
|
||||
else if (strcmp(generator,"int")==0) np = 1;
|
||||
else if (strcmp(generator,"poisson")==0) np = 1;
|
||||
else if (strcmp(generator,"gaussian")==0) np = 0;
|
||||
else if (strcmp(generator,"exp")==0) np = 0;
|
||||
else if (strcmp(generator,"cauchy")==0) np = 0;
|
||||
else if (strcmp(generator,"gamma")==0) np = 1;
|
||||
else if (strcmp(generator,"beta")==0) np = 2;
|
||||
else
|
||||
{ fprintf(stderr,"Unknown generator: %s\n",generator);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ap = argv+3;
|
||||
|
||||
if (np>0)
|
||||
{ if (*ap==0 || (p1 = atof(*ap++))<=0) usage();
|
||||
}
|
||||
if (np>1)
|
||||
{ if (*ap==0 || (p2 = atof(*ap++))<=0) usage();
|
||||
}
|
||||
|
||||
if (*ap==0 || strcmp(*ap++,"/")!=0) usage();
|
||||
|
||||
if (*ap==0 || (sample_size = atoi(*ap++))<=0) usage();
|
||||
|
||||
if (*ap!=0)
|
||||
{ low = atof(*ap++);
|
||||
if (*ap==0) usage();
|
||||
high = atof(*ap++);
|
||||
if (high<=low) usage();
|
||||
if (*ap==0 || (bins = atoi(*ap++))<=0) usage();
|
||||
if (bins>Max_bins)
|
||||
{ fprintf(stderr,"Too many histogram bins\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (*ap!=0) usage();
|
||||
|
||||
printf("\nTest of %s(",generator);
|
||||
if (np>0) printf("%.4f",p1);
|
||||
if (np>1) printf(",%.4f",p2);
|
||||
printf(") generator using sample of size %d with seed %d\n\n",
|
||||
sample_size, seed);
|
||||
|
||||
undef_mean = undef_variance = 0;
|
||||
|
||||
if (strcmp(generator,"uniform")==0)
|
||||
{ tmean = 0.5;
|
||||
tvariance = 1.0/12.0;
|
||||
}
|
||||
else if (strcmp(generator,"uniopen")==0)
|
||||
{ tmean = 0.5;
|
||||
tvariance = 1.0/12.0;
|
||||
}
|
||||
else if (strcmp(generator,"int")==0)
|
||||
{ tmean = (p1-1)/2;
|
||||
tvariance = p1*p1/3.0 - p1/2.0 + 1/6.0 - tmean*tmean;
|
||||
}
|
||||
else if (strcmp(generator,"poisson")==0)
|
||||
{ tmean = p1;
|
||||
tvariance = p1;
|
||||
}
|
||||
else if (strcmp(generator,"gaussian")==0)
|
||||
{ tmean = 0;
|
||||
tvariance = 1;
|
||||
}
|
||||
else if (strcmp(generator,"exp")==0)
|
||||
{ tmean = 1;
|
||||
tvariance = 1;
|
||||
}
|
||||
else if (strcmp(generator,"cauchy")==0)
|
||||
{ undef_mean = 1;
|
||||
undef_variance = 1;
|
||||
}
|
||||
else if (strcmp(generator,"gamma")==0)
|
||||
{ tmean = p1;
|
||||
tvariance = p1;
|
||||
}
|
||||
else if (strcmp(generator,"beta")==0)
|
||||
{ tmean = p1 / (p1+p2);
|
||||
tvariance = (p1*p2) / ((p1+p2)*(p1+p2)*(p1+p2+1));
|
||||
}
|
||||
else
|
||||
{ abort();
|
||||
}
|
||||
|
||||
mean = 0;
|
||||
variance = 0;
|
||||
|
||||
if (bins>0)
|
||||
{ for (i = 0; i<bins; i++) count[i] = 0;
|
||||
under = over = 0;
|
||||
}
|
||||
|
||||
rand_seed(seed);
|
||||
|
||||
for (n = 0; n<sample_size; n++)
|
||||
{
|
||||
if (strcmp(generator,"uniform")==0) x = rand_uniform();
|
||||
else if (strcmp(generator,"uniopen")==0) x = rand_uniopen();
|
||||
else if (strcmp(generator,"int")==0) x = rand_int((int)p1);
|
||||
else if (strcmp(generator,"poisson")==0) x = rand_poisson(p1);
|
||||
else if (strcmp(generator,"gaussian")==0) x = rand_gaussian();
|
||||
else if (strcmp(generator,"exp")==0) x = rand_exp();
|
||||
else if (strcmp(generator,"cauchy")==0) x = rand_cauchy();
|
||||
else if (strcmp(generator,"gamma")==0) x = rand_gamma(p1);
|
||||
else if (strcmp(generator,"beta")==0) x = rand_beta(p1,p2);
|
||||
else abort();
|
||||
|
||||
mean += x;
|
||||
variance += x*x;
|
||||
|
||||
if (bins>0)
|
||||
{ if (x<low)
|
||||
{ under += 1;
|
||||
}
|
||||
else
|
||||
{ i = (int) ((x-low)/((high-low)/bins));
|
||||
if (i>=bins)
|
||||
{ over += 1;
|
||||
}
|
||||
else
|
||||
{ count[i] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mean /= sample_size;
|
||||
variance /= sample_size;
|
||||
variance -= mean*mean;
|
||||
|
||||
printf("Sample mean: %.4f",mean);
|
||||
if (undef_mean)
|
||||
{ printf(" (true value: undefined)\n");
|
||||
}
|
||||
else
|
||||
{ printf(" (true value: %.4f)\n",tmean);
|
||||
}
|
||||
|
||||
printf("Sample variance: %.4f",variance);
|
||||
if (undef_variance)
|
||||
{ printf(" (true value: undefined)\n");
|
||||
}
|
||||
else
|
||||
{ printf(" (true value: %.4f)\n",tvariance);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
if (bins!=0)
|
||||
{ printf("Histogram:\n");
|
||||
printf(" under : %8d %.5f\n\n",
|
||||
under, (double)under / sample_size);
|
||||
for (i = 0; i<bins; i++)
|
||||
{ printf(" %10.4f - %10.4f : %8d %.5f\n",
|
||||
i*(high-low)/bins + low, (i+1)*(high-low)/bins + low,
|
||||
count[i], (double)count[i] / sample_size);
|
||||
}
|
||||
printf("\n over : %8d %.5f\n",
|
||||
over, (double)over / sample_size);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
/* PRINT USAGE MESSAGE AND EXIT. */
|
||||
|
||||
static void usage (void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: rand-test seed generator { parameters } / sample-size [ low high bins ]\n");
|
||||
|
||||
exit(1);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2002-2006 Marcin Kalicinski
|
||||
// Copyright (C) 2009 Sebastian Redl
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// For more information, see www.boost.org
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_PROPERTY_TREE_EXCEPTIONS_HPP_INCLUDED
|
||||
#define BOOST_PROPERTY_TREE_EXCEPTIONS_HPP_INCLUDED
|
||||
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
#include <boost/any.hpp>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace boost { namespace property_tree
|
||||
{
|
||||
|
||||
/// Base class for all property tree errors. Derives from
|
||||
/// @c std::runtime_error. Call member function @c what to get human
|
||||
/// readable message associated with the error.
|
||||
class ptree_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
/// Instantiate a ptree_error instance with the given message.
|
||||
/// @param what The message to associate with this error.
|
||||
ptree_error(const std::string &what);
|
||||
|
||||
~ptree_error() throw();
|
||||
};
|
||||
|
||||
|
||||
/// Error indicating that translation from given value to the property tree
|
||||
/// data_type (or vice versa) failed. Derives from ptree_error.
|
||||
class ptree_bad_data : public ptree_error
|
||||
{
|
||||
public:
|
||||
/// Instantiate a ptree_bad_data instance with the given message and
|
||||
/// data.
|
||||
/// @param what The message to associate with this error.
|
||||
/// @param data The value associated with this error that was the source
|
||||
/// of the translation failure.
|
||||
template<class T> ptree_bad_data(const std::string &what,
|
||||
const T &data);
|
||||
|
||||
~ptree_bad_data() throw();
|
||||
|
||||
/// Retrieve the data associated with this error. This is the source
|
||||
/// value that failed to be translated. You need to explicitly
|
||||
/// specify its type.
|
||||
template<class T> T data() const;
|
||||
private:
|
||||
boost::any m_data;
|
||||
};
|
||||
|
||||
|
||||
/// Error indicating that specified path does not exist. Derives from
|
||||
/// ptree_error.
|
||||
class ptree_bad_path : public ptree_error
|
||||
{
|
||||
public:
|
||||
/// Instantiate a ptree_bad_path with the given message and path data.
|
||||
/// @param what The message to associate with this error.
|
||||
/// @param path The path that could not be found in the property_tree.
|
||||
template<class T> ptree_bad_path(const std::string &what,
|
||||
const T &path);
|
||||
|
||||
~ptree_bad_path() throw();
|
||||
|
||||
/// Retrieve the invalid path. You need to explicitly specify the
|
||||
/// type of path.
|
||||
template<class T> T path() const;
|
||||
private:
|
||||
boost::any m_path;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#include <boost/property_tree/detail/exception_implementation.hpp>
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user