Initial Commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
program allsim
|
||||
|
||||
! Generate simulated data for WSJT-X slow modes: JT4, JT9, JT65, QRA64,
|
||||
! and WSPR. Also unmodulated carrier and 20 WPM CW.
|
||||
|
||||
|
||||
use wavhdr
|
||||
use packjt
|
||||
parameter (NMAX=60*12000)
|
||||
type(hdr) h
|
||||
integer*2 iwave(NMAX) !Generated waveform (no noise)
|
||||
integer itone(206) !Channel symbols (values 0-8)
|
||||
integer icw(250)
|
||||
real*4 dat(NMAX)
|
||||
character message*22,msgsent*22,arg*8
|
||||
|
||||
nargs=iargc()
|
||||
if(nargs.ne.1) then
|
||||
print*,'Usage: allsim <snr>'
|
||||
go to 999
|
||||
endif
|
||||
|
||||
call getarg(1,arg)
|
||||
read(arg,*) snrdb !S/N in dB (2500 hz reference BW)
|
||||
|
||||
message='CQ KA2ABC FN20'
|
||||
rmsdb=25.
|
||||
rms=10.0**(0.05*rmsdb)
|
||||
sig=10.0**(0.05*snrdb)
|
||||
npts=NMAX
|
||||
|
||||
call init_random_seed() !Seed Fortran RANDOM_NUMBER generator
|
||||
call sgran() !Seed C rand generator (used in gran)
|
||||
|
||||
h=default_header(12000,npts)
|
||||
open(10,file='000000_0000.wav',access='stream',status='unknown')
|
||||
do i=1,npts !Generate gaussian noise
|
||||
dat(i)=gran()
|
||||
enddo
|
||||
|
||||
itone=0
|
||||
call addit(itone,12000,85,6912,400,sig,dat) !Unmodulated carrier
|
||||
|
||||
call morse('CQ CQ DE KA2ABC KA2ABC',icw,ncw)
|
||||
! print*,ncw
|
||||
! write(*,3001) icw(1:ncw)
|
||||
!3001 format(50i1)
|
||||
call addcw(icw,ncw,600,sig,dat) !CW
|
||||
|
||||
call genwspr(message,msgsent,itone)
|
||||
call addit(itone,12000,86,8192,800,sig,dat) !WSPR (only 59 s of data)
|
||||
|
||||
call gen9(message,0,msgsent,itone,itype)
|
||||
call addit(itone,12000,85,6912,1000,sig,dat) !JT9
|
||||
|
||||
call gen4(message,0,msgsent,itone,itype)
|
||||
call addit(itone,11025,206,2520,1200,sig,dat) !JT4
|
||||
|
||||
call genqra64(message,0,msgsent,itone,itype)
|
||||
call addit(itone,12000,84,6912,1400,sig,dat) !QRA64
|
||||
|
||||
call gen65(message,0,msgsent,itone,itype)
|
||||
call addit(itone,11025,126,4096,1600,sig,dat) !JT65
|
||||
|
||||
iwave(1:npts)=nint(rms*dat(1:npts))
|
||||
|
||||
write(10) h,iwave(1:npts)
|
||||
close(10)
|
||||
|
||||
999 end program allsim
|
||||
@@ -0,0 +1,104 @@
|
||||
/*=============================================================================
|
||||
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_07172005_1153)
|
||||
#define FUSION_LIST_07172005_1153
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/void.hpp>
|
||||
#include <boost/fusion/support/detail/enabler.hpp>
|
||||
#include <boost/fusion/container/list/detail/cpp03/list_fwd.hpp>
|
||||
#include <boost/fusion/container/list/detail/cpp03/list_to_cons.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/list" 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
|
||||
{
|
||||
struct nil_;
|
||||
struct void_;
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename T)>
|
||||
struct list
|
||||
: detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>::type
|
||||
{
|
||||
private:
|
||||
typedef
|
||||
detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>
|
||||
list_to_cons;
|
||||
typedef typename list_to_cons::type inherited_type;
|
||||
|
||||
public:
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
list()
|
||||
: inherited_type() {}
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
list(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
|
||||
: inherited_type(rhs) {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
list(Sequence const& rhs
|
||||
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
|
||||
: inherited_type(rhs) {}
|
||||
|
||||
// Expand a couple of forwarding constructors for arguments
|
||||
// of type (T0), (T0, T1), (T0, T1, T2) etc. Exanple:
|
||||
//
|
||||
// list(
|
||||
// typename detail::call_param<T0>::type arg0
|
||||
// , typename detail::call_param<T1>::type arg1)
|
||||
// : inherited_type(list_to_cons::call(arg0, arg1)) {}
|
||||
#include <boost/fusion/container/list/detail/cpp03/list_forward_ctor.hpp>
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
list&
|
||||
operator=(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
|
||||
{
|
||||
inherited_type::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename boost::enable_if<traits::is_sequence<Sequence>, list&>::type
|
||||
operator=(Sequence const& rhs)
|
||||
{
|
||||
inherited_type::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
}}
|
||||
|
||||
#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,131 @@
|
||||
#ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
#define BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
|
||||
// core::demangle
|
||||
//
|
||||
// Copyright 2014 Peter Dimov
|
||||
// Copyright 2014 Andrey Semashev
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <string>
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// __has_include is currently supported by GCC and Clang. However GCC 4.9 may have issues and
|
||||
// returns 1 for 'defined( __has_include )', while '__has_include' is actually not supported:
|
||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63662
|
||||
#if defined( __has_include ) && (!defined( BOOST_GCC ) || (__GNUC__ + 0) >= 5)
|
||||
# if __has_include(<cxxabi.h>)
|
||||
# define BOOST_CORE_HAS_CXXABI_H
|
||||
# endif
|
||||
#elif defined( __GLIBCXX__ ) || defined( __GLIBCPP__ )
|
||||
# define BOOST_CORE_HAS_CXXABI_H
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_CORE_HAS_CXXABI_H )
|
||||
# include <cxxabi.h>
|
||||
// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
|
||||
// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement
|
||||
// abi::__cxa_demangle(). We detect this implementation by checking the include guard here.
|
||||
# if defined( __GABIXX_CXXABI_H__ )
|
||||
# undef BOOST_CORE_HAS_CXXABI_H
|
||||
# else
|
||||
# include <cstdlib>
|
||||
# include <cstddef>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace core
|
||||
{
|
||||
|
||||
inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT;
|
||||
inline void demangle_free( char const * name ) BOOST_NOEXCEPT;
|
||||
|
||||
class scoped_demangled_name
|
||||
{
|
||||
private:
|
||||
char const * m_p;
|
||||
|
||||
public:
|
||||
explicit scoped_demangled_name( char const * name ) BOOST_NOEXCEPT :
|
||||
m_p( demangle_alloc( name ) )
|
||||
{
|
||||
}
|
||||
|
||||
~scoped_demangled_name() BOOST_NOEXCEPT
|
||||
{
|
||||
demangle_free( m_p );
|
||||
}
|
||||
|
||||
char const * get() const BOOST_NOEXCEPT
|
||||
{
|
||||
return m_p;
|
||||
}
|
||||
|
||||
BOOST_DELETED_FUNCTION(scoped_demangled_name( scoped_demangled_name const& ))
|
||||
BOOST_DELETED_FUNCTION(scoped_demangled_name& operator= ( scoped_demangled_name const& ))
|
||||
};
|
||||
|
||||
|
||||
#if defined( BOOST_CORE_HAS_CXXABI_H )
|
||||
|
||||
inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT
|
||||
{
|
||||
int status = 0;
|
||||
std::size_t size = 0;
|
||||
return abi::__cxa_demangle( name, NULL, &size, &status );
|
||||
}
|
||||
|
||||
inline void demangle_free( char const * name ) BOOST_NOEXCEPT
|
||||
{
|
||||
std::free( const_cast< char* >( name ) );
|
||||
}
|
||||
|
||||
inline std::string demangle( char const * name )
|
||||
{
|
||||
scoped_demangled_name demangled_name( name );
|
||||
char const * const p = demangled_name.get();
|
||||
if( p )
|
||||
{
|
||||
return p;
|
||||
}
|
||||
else
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
inline void demangle_free( char const * ) BOOST_NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
inline std::string demangle( char const * name )
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_CORE_HAS_CXXABI_H
|
||||
|
||||
#endif // #ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
#ifndef BOOST_MPL_MULTIPLIES_HPP_INCLUDED
|
||||
#define BOOST_MPL_MULTIPLIES_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$
|
||||
|
||||
#include <boost/mpl/times.hpp>
|
||||
#include <boost/mpl/aux_/na_spec.hpp>
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/mpl/aux_/preprocessor/default_params.hpp>
|
||||
#include <boost/mpl/aux_/preprocessor/params.hpp>
|
||||
#include <boost/mpl/aux_/config/ctps.hpp>
|
||||
|
||||
// backward compatibility header, deprecated
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
# define AUX778076_OP_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
|
||||
#else
|
||||
# define AUX778076_OP_ARITY 2
|
||||
#endif
|
||||
|
||||
template<
|
||||
BOOST_MPL_PP_DEFAULT_PARAMS(AUX778076_OP_ARITY, typename N, na)
|
||||
>
|
||||
struct multiplies
|
||||
: times< BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) >
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(
|
||||
AUX778076_OP_ARITY
|
||||
, multiplies
|
||||
, ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
|
||||
)
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_NA_SPEC(AUX778076_OP_ARITY, multiplies)
|
||||
|
||||
#undef AUX778076_OP_ARITY
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_MULTIPLIES_HPP_INCLUDED
|
||||
@@ -0,0 +1,84 @@
|
||||
# Set paths
|
||||
EXE_DIR = ../../wsjtx_exp_install_latest
|
||||
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 = -I/opt/local/include -O3 -funroll-loops -Wall -Wno-conversion -fno-second-underscore -DUNIX
|
||||
CFLAGS = -I. -fbounds-check -fPIE
|
||||
|
||||
# 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 t3
|
||||
|
||||
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 \
|
||||
fil3.o decoder.o fqso_first.o \
|
||||
twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\
|
||||
chkss2.o zplot9.o flat1.o flat2.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/opt/local/lib -L./sfrsd2 -ljt9 -lsfrsd -lfftw3f_threads -lfftw3f
|
||||
$(CP) jt65 $(EXE_DIR)
|
||||
|
||||
OBJS2 = jt65sim.o wavhdr.o
|
||||
jt65sim: $(OBJS2) libjt9.a
|
||||
$(FC) -o jt65sim $(OBJS2) -L. -L/opt/local/lib -ljt9 -lfftw3f
|
||||
$(CP) jt65sim $(EXE_DIR)
|
||||
|
||||
OBJS3 = t3.o
|
||||
t3: $(OBJS3) libjt9.a
|
||||
$(FC) -o t3 $(OBJS3) -L. -L/opt/local/lib -ljt9
|
||||
|
||||
OBJS6 = jt65code.o
|
||||
jt65code: $(OBJS6) libjt9.a
|
||||
$(FC) -o jt65code $(OBJS6) libjt9.a
|
||||
|
||||
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,491 @@
|
||||
// Copyright John Maddock 2006.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// distributions.hpp provides definitions of the concept of a distribution
|
||||
// and non-member accessor functions that must be implemented by all distributions.
|
||||
// This is used to verify that
|
||||
// all the features of a distributions have been fully implemented.
|
||||
|
||||
#ifndef BOOST_MATH_DISTRIBUTION_CONCEPT_HPP
|
||||
#define BOOST_MATH_DISTRIBUTION_CONCEPT_HPP
|
||||
|
||||
#include <boost/math/distributions/complement.hpp>
|
||||
#include <boost/math/distributions/fwd.hpp>
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4100)
|
||||
#pragma warning(disable: 4510)
|
||||
#pragma warning(disable: 4610)
|
||||
#pragma warning(disable: 4189) // local variable is initialized but not referenced.
|
||||
#endif
|
||||
#include <boost/concept_check.hpp>
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#include <utility>
|
||||
|
||||
namespace boost{
|
||||
namespace math{
|
||||
|
||||
namespace concepts
|
||||
{
|
||||
// Begin by defining a concept archetype
|
||||
// for a distribution class:
|
||||
//
|
||||
template <class RealType>
|
||||
class distribution_archetype
|
||||
{
|
||||
public:
|
||||
typedef RealType value_type;
|
||||
|
||||
distribution_archetype(const distribution_archetype&); // Copy constructible.
|
||||
distribution_archetype& operator=(const distribution_archetype&); // Assignable.
|
||||
|
||||
// There is no default constructor,
|
||||
// but we need a way to instantiate the archetype:
|
||||
static distribution_archetype& get_object()
|
||||
{
|
||||
// will never get caled:
|
||||
return *reinterpret_cast<distribution_archetype*>(0);
|
||||
}
|
||||
}; // template <class RealType>class distribution_archetype
|
||||
|
||||
// Non-member accessor functions:
|
||||
// (This list defines the functions that must be implemented by all distributions).
|
||||
|
||||
template <class RealType>
|
||||
RealType pdf(const distribution_archetype<RealType>& dist, const RealType& x);
|
||||
|
||||
template <class RealType>
|
||||
RealType cdf(const distribution_archetype<RealType>& dist, const RealType& x);
|
||||
|
||||
template <class RealType>
|
||||
RealType quantile(const distribution_archetype<RealType>& dist, const RealType& p);
|
||||
|
||||
template <class RealType>
|
||||
RealType cdf(const complemented2_type<distribution_archetype<RealType>, RealType>& c);
|
||||
|
||||
template <class RealType>
|
||||
RealType quantile(const complemented2_type<distribution_archetype<RealType>, RealType>& c);
|
||||
|
||||
template <class RealType>
|
||||
RealType mean(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType standard_deviation(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType variance(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType hazard(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType chf(const distribution_archetype<RealType>& dist);
|
||||
// http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29
|
||||
|
||||
template <class RealType>
|
||||
RealType coefficient_of_variation(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType mode(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType skewness(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType kurtosis_excess(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType kurtosis(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
RealType median(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
std::pair<RealType, RealType> range(const distribution_archetype<RealType>& dist);
|
||||
|
||||
template <class RealType>
|
||||
std::pair<RealType, RealType> support(const distribution_archetype<RealType>& dist);
|
||||
|
||||
//
|
||||
// Next comes the concept checks for verifying that a class
|
||||
// fullfils the requirements of a Distribution:
|
||||
//
|
||||
template <class Distribution>
|
||||
struct DistributionConcept
|
||||
{
|
||||
typedef typename Distribution::value_type value_type;
|
||||
|
||||
void constraints()
|
||||
{
|
||||
function_requires<CopyConstructibleConcept<Distribution> >();
|
||||
function_requires<AssignableConcept<Distribution> >();
|
||||
|
||||
const Distribution& dist = DistributionConcept<Distribution>::get_object();
|
||||
|
||||
value_type x = 0;
|
||||
// The result values are ignored in all these checks.
|
||||
value_type v = cdf(dist, x);
|
||||
v = cdf(complement(dist, x));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = pdf(dist, x);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(dist, x);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(complement(dist, x));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = mean(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = mode(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = standard_deviation(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = variance(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = hazard(dist, x);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = chf(dist, x);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = coefficient_of_variation(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = skewness(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = kurtosis(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = kurtosis_excess(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = median(dist);
|
||||
suppress_unused_variable_warning(v);
|
||||
std::pair<value_type, value_type> pv;
|
||||
pv = range(dist);
|
||||
suppress_unused_variable_warning(pv);
|
||||
pv = support(dist);
|
||||
suppress_unused_variable_warning(pv);
|
||||
|
||||
float f = 1;
|
||||
v = cdf(dist, f);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = cdf(complement(dist, f));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = pdf(dist, f);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(dist, f);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(complement(dist, f));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = hazard(dist, f);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = chf(dist, f);
|
||||
suppress_unused_variable_warning(v);
|
||||
double d = 1;
|
||||
v = cdf(dist, d);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = cdf(complement(dist, d));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = pdf(dist, d);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(dist, d);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(complement(dist, d));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = hazard(dist, d);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = chf(dist, d);
|
||||
suppress_unused_variable_warning(v);
|
||||
#ifndef TEST_MPFR
|
||||
long double ld = 1;
|
||||
v = cdf(dist, ld);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = cdf(complement(dist, ld));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = pdf(dist, ld);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(dist, ld);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(complement(dist, ld));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = hazard(dist, ld);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = chf(dist, ld);
|
||||
suppress_unused_variable_warning(v);
|
||||
#endif
|
||||
int i = 1;
|
||||
v = cdf(dist, i);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = cdf(complement(dist, i));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = pdf(dist, i);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(dist, i);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(complement(dist, i));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = hazard(dist, i);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = chf(dist, i);
|
||||
suppress_unused_variable_warning(v);
|
||||
unsigned long li = 1;
|
||||
v = cdf(dist, li);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = cdf(complement(dist, li));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = pdf(dist, li);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(dist, li);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = quantile(complement(dist, li));
|
||||
suppress_unused_variable_warning(v);
|
||||
v = hazard(dist, li);
|
||||
suppress_unused_variable_warning(v);
|
||||
v = chf(dist, li);
|
||||
suppress_unused_variable_warning(v);
|
||||
test_extra_members(dist);
|
||||
}
|
||||
template <class D>
|
||||
static void test_extra_members(const D&)
|
||||
{}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::bernoulli_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.success_fraction();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::beta_distribution<R, P>& d)
|
||||
{
|
||||
value_type r1 = d.alpha();
|
||||
value_type r2 = d.beta();
|
||||
r1 = boost::math::beta_distribution<R, P>::find_alpha(r1, r2);
|
||||
suppress_unused_variable_warning(r1);
|
||||
r1 = boost::math::beta_distribution<R, P>::find_beta(r1, r2);
|
||||
suppress_unused_variable_warning(r1);
|
||||
r1 = boost::math::beta_distribution<R, P>::find_alpha(r1, r2, r1);
|
||||
suppress_unused_variable_warning(r1);
|
||||
r1 = boost::math::beta_distribution<R, P>::find_beta(r1, r2, r1);
|
||||
suppress_unused_variable_warning(r1);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::binomial_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.success_fraction();
|
||||
r = d.trials();
|
||||
r = Distribution::find_lower_bound_on_p(r, r, r);
|
||||
r = Distribution::find_lower_bound_on_p(r, r, r, Distribution::clopper_pearson_exact_interval);
|
||||
r = Distribution::find_lower_bound_on_p(r, r, r, Distribution::jeffreys_prior_interval);
|
||||
r = Distribution::find_upper_bound_on_p(r, r, r);
|
||||
r = Distribution::find_upper_bound_on_p(r, r, r, Distribution::clopper_pearson_exact_interval);
|
||||
r = Distribution::find_upper_bound_on_p(r, r, r, Distribution::jeffreys_prior_interval);
|
||||
r = Distribution::find_minimum_number_of_trials(r, r, r);
|
||||
r = Distribution::find_maximum_number_of_trials(r, r, r);
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::cauchy_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.location();
|
||||
r = d.scale();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::chi_squared_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.degrees_of_freedom();
|
||||
r = Distribution::find_degrees_of_freedom(r, r, r, r);
|
||||
r = Distribution::find_degrees_of_freedom(r, r, r, r, r);
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::exponential_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.lambda();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::extreme_value_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.location();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::fisher_f_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.degrees_of_freedom1();
|
||||
r = d.degrees_of_freedom2();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::gamma_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.shape();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::inverse_chi_squared_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.degrees_of_freedom();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::inverse_gamma_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.shape();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::hypergeometric_distribution<R, P>& d)
|
||||
{
|
||||
unsigned u = d.defective();
|
||||
u = d.sample_count();
|
||||
u = d.total();
|
||||
suppress_unused_variable_warning(u);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::laplace_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.location();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::logistic_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.location();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::lognormal_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.location();
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::negative_binomial_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.success_fraction();
|
||||
r = d.successes();
|
||||
r = Distribution::find_lower_bound_on_p(r, r, r);
|
||||
r = Distribution::find_upper_bound_on_p(r, r, r);
|
||||
r = Distribution::find_minimum_number_of_trials(r, r, r);
|
||||
r = Distribution::find_maximum_number_of_trials(r, r, r);
|
||||
suppress_unused_variable_warning(r);
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::non_central_beta_distribution<R, P>& d)
|
||||
{
|
||||
value_type r1 = d.alpha();
|
||||
value_type r2 = d.beta();
|
||||
r1 = d.non_centrality();
|
||||
(void)r1; // warning suppression
|
||||
(void)r2; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::non_central_chi_squared_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.degrees_of_freedom();
|
||||
r = d.non_centrality();
|
||||
r = Distribution::find_degrees_of_freedom(r, r, r);
|
||||
r = Distribution::find_degrees_of_freedom(boost::math::complement(r, r, r));
|
||||
r = Distribution::find_non_centrality(r, r, r);
|
||||
r = Distribution::find_non_centrality(boost::math::complement(r, r, r));
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::non_central_f_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.degrees_of_freedom1();
|
||||
r = d.degrees_of_freedom2();
|
||||
r = d.non_centrality();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::non_central_t_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.degrees_of_freedom();
|
||||
r = d.non_centrality();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::normal_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.location();
|
||||
r = d.mean();
|
||||
r = d.standard_deviation();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::pareto_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.shape();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::poisson_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.mean();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::rayleigh_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.sigma();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::students_t_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.degrees_of_freedom();
|
||||
r = d.find_degrees_of_freedom(r, r, r, r);
|
||||
r = d.find_degrees_of_freedom(r, r, r, r, r);
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::triangular_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.lower();
|
||||
r = d.mode();
|
||||
r = d.upper();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::weibull_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.scale();
|
||||
r = d.shape();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
template <class R, class P>
|
||||
static void test_extra_members(const boost::math::uniform_distribution<R, P>& d)
|
||||
{
|
||||
value_type r = d.lower();
|
||||
r = d.upper();
|
||||
(void)r; // warning suppression
|
||||
}
|
||||
private:
|
||||
static Distribution* pd;
|
||||
static Distribution& get_object()
|
||||
{
|
||||
// In reality this will never get called:
|
||||
return *pd;
|
||||
}
|
||||
}; // struct DistributionConcept
|
||||
|
||||
template <class Distribution>
|
||||
Distribution* DistributionConcept<Distribution>::pd = 0;
|
||||
|
||||
} // namespace concepts
|
||||
} // namespace math
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_MATH_DISTRIBUTION_CONCEPT_HPP
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_CONTROL_EXPR_IIF_HPP
|
||||
# define BOOST_PREPROCESSOR_CONTROL_EXPR_IIF_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# /* BOOST_PP_EXPR_IIF */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# define BOOST_PP_EXPR_IIF(bit, expr) BOOST_PP_EXPR_IIF_I(bit, expr)
|
||||
# else
|
||||
# define BOOST_PP_EXPR_IIF(bit, expr) BOOST_PP_EXPR_IIF_OO((bit, expr))
|
||||
# define BOOST_PP_EXPR_IIF_OO(par) BOOST_PP_EXPR_IIF_I ## par
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_EXPR_IIF_I(bit, expr) BOOST_PP_EXPR_IIF_ ## bit(expr)
|
||||
#
|
||||
# define BOOST_PP_EXPR_IIF_0(expr)
|
||||
# define BOOST_PP_EXPR_IIF_1(expr) expr
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,121 @@
|
||||
/*=============================================================================
|
||||
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_STD_TUPLE_ITERATOR_09112011_1905)
|
||||
#define FUSION_STD_TUPLE_ITERATOR_09112011_1905
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/iterator_facade.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
template <typename Tuple, int Index>
|
||||
struct std_tuple_iterator_identity;
|
||||
|
||||
template <typename Tuple, int Index>
|
||||
struct std_tuple_iterator
|
||||
: iterator_facade<
|
||||
std_tuple_iterator<Tuple, Index>
|
||||
, random_access_traversal_tag>
|
||||
{
|
||||
typedef Tuple tuple_type;
|
||||
static int const index = Index;
|
||||
typedef std_tuple_iterator_identity<
|
||||
typename add_const<Tuple>::type, Index>
|
||||
identity;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit std_tuple_iterator(Tuple& tuple)
|
||||
: tuple(tuple) {}
|
||||
|
||||
Tuple& tuple;
|
||||
|
||||
template <typename Iterator>
|
||||
struct value_of
|
||||
: std::tuple_element<Iterator::index,
|
||||
typename remove_const<typename Iterator::tuple_type>::type> {};
|
||||
|
||||
template <typename Iterator>
|
||||
struct deref
|
||||
{
|
||||
typedef typename value_of<Iterator>::type element;
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_const<typename Iterator::tuple_type>
|
||||
, typename fusion::detail::cref_result<element>::type
|
||||
, typename fusion::detail::ref_result<element>::type
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& iter)
|
||||
{
|
||||
return std::get<Index>(iter.tuple);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator, typename N>
|
||||
struct advance
|
||||
{
|
||||
static int const index = Iterator::index;
|
||||
typedef typename Iterator::tuple_type tuple_type;
|
||||
typedef std_tuple_iterator<tuple_type, index+N::value> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.tuple);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct next : advance<Iterator, mpl::int_<1>> {};
|
||||
|
||||
template <typename Iterator>
|
||||
struct prior : advance<Iterator, mpl::int_<-1>> {};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct equal_to
|
||||
: is_same<typename I1::identity, typename I2::identity> {};
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct distance
|
||||
{
|
||||
typedef mpl::int_<Last::index-First::index> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(First const&, Last const&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Tuple, int Index>
|
||||
struct iterator_traits< ::boost::fusion::std_tuple_iterator<Tuple, Index> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// Boost noncopyable.hpp header file --------------------------------------//
|
||||
|
||||
// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/utility for documentation.
|
||||
|
||||
#ifndef BOOST_CORE_NONCOPYABLE_HPP
|
||||
#define BOOST_CORE_NONCOPYABLE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
// Private copy constructor and copy assignment ensure classes derived from
|
||||
// class noncopyable cannot be copied.
|
||||
|
||||
// Contributed by Dave Abrahams
|
||||
|
||||
namespace noncopyable_ // protection from unintended ADL
|
||||
{
|
||||
class noncopyable
|
||||
{
|
||||
protected:
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
|
||||
BOOST_CONSTEXPR noncopyable() = default;
|
||||
~noncopyable() = default;
|
||||
#else
|
||||
noncopyable() {}
|
||||
~noncopyable() {}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
noncopyable( const noncopyable& ) = delete;
|
||||
noncopyable& operator=( const noncopyable& ) = delete;
|
||||
#else
|
||||
private: // emphasize the following members are private
|
||||
noncopyable( const noncopyable& );
|
||||
noncopyable& operator=( const noncopyable& );
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
typedef noncopyable_::noncopyable noncopyable;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_CORE_NONCOPYABLE_HPP
|
||||
@@ -0,0 +1,139 @@
|
||||
module ft8_decode
|
||||
|
||||
type :: ft8_decoder
|
||||
procedure(ft8_decode_callback), pointer :: callback
|
||||
contains
|
||||
procedure :: decode
|
||||
end type ft8_decoder
|
||||
|
||||
abstract interface
|
||||
subroutine ft8_decode_callback (this,sync,snr,dt,freq,decoded,nap,qual)
|
||||
import ft8_decoder
|
||||
implicit none
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
real, intent(in) :: freq
|
||||
character(len=22), intent(in) :: decoded
|
||||
integer, intent(in) :: nap
|
||||
real, intent(in) :: qual
|
||||
end subroutine ft8_decode_callback
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine decode(this,callback,iwave,nQSOProgress,nfqso,nftx,newdat, &
|
||||
nutc,nfa,nfb,nexp_decode,ndepth,nagain,lapon,napwid,mycall12, &
|
||||
mygrid6,hiscall12,hisgrid6)
|
||||
! use wavhdr
|
||||
use timer_module, only: timer
|
||||
include 'fsk4hf/ft8_params.f90'
|
||||
! type(hdr) h
|
||||
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
procedure(ft8_decode_callback) :: callback
|
||||
real s(NH1,NHSYM)
|
||||
real sbase(NH1)
|
||||
real candidate(3,200)
|
||||
real dd(15*12000)
|
||||
logical, intent(in) :: lapon,nagain
|
||||
logical newdat,lsubtract,ldupe,bcontest
|
||||
character*12 mycall12, hiscall12
|
||||
character*6 mygrid6,hisgrid6
|
||||
integer*2 iwave(15*12000)
|
||||
integer apsym(KK)
|
||||
character datetime*13,message*22
|
||||
character*22 allmessages(100)
|
||||
integer allsnrs(100)
|
||||
save s,dd
|
||||
|
||||
bcontest=iand(nexp_decode,128).ne.0
|
||||
this%callback => callback
|
||||
write(datetime,1001) nutc !### TEMPORARY ###
|
||||
1001 format("000000_",i6.6)
|
||||
|
||||
call ft8apset(mycall12,mygrid6,hiscall12,hisgrid6,bcontest,apsym,iaptype)
|
||||
dd=iwave
|
||||
ndecodes=0
|
||||
allmessages=' '
|
||||
allsnrs=0
|
||||
ifa=nfa
|
||||
ifb=nfb
|
||||
if(nagain) then
|
||||
ifa=nfqso-10
|
||||
ifb=nfqso+10
|
||||
endif
|
||||
|
||||
! For now:
|
||||
! ndepth=1: no subtraction, 1 pass, belief propagation only
|
||||
! ndepth=2: subtraction, 2 passes, belief propagation only
|
||||
! ndepth=3: subtraction, 2 passes, bp+osd
|
||||
if(ndepth.eq.1) npass=1
|
||||
if(ndepth.ge.2) npass=3
|
||||
do ipass=1,npass
|
||||
newdat=.true. ! Is this a problem? I hijacked newdat.
|
||||
syncmin=1.5
|
||||
if(ipass.eq.1) then
|
||||
lsubtract=.true.
|
||||
if(ndepth.eq.1) lsubtract=.false.
|
||||
elseif(ipass.eq.2) then
|
||||
n2=ndecodes
|
||||
if(ndecodes.eq.0) cycle
|
||||
lsubtract=.true.
|
||||
elseif(ipass.eq.3) then
|
||||
if((ndecodes-n2).eq.0) cycle
|
||||
lsubtract=.false.
|
||||
endif
|
||||
|
||||
call timer('sync8 ',0)
|
||||
call sync8(dd,ifa,ifb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||
call timer('sync8 ',1)
|
||||
do icand=1,ncand
|
||||
sync=candidate(3,icand)
|
||||
f1=candidate(1,icand)
|
||||
xdt=candidate(2,icand)
|
||||
xbase=10.0**(0.1*(sbase(nint(f1/3.125))-40.0))
|
||||
nsnr0=min(99,nint(10.0*log10(sync) - 25.5)) !### empirical ###
|
||||
call timer('ft8b ',0)
|
||||
call ft8b(dd,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,napwid, &
|
||||
lsubtract,nagain,iaptype,mygrid6,bcontest,sync,f1,xdt,xbase, &
|
||||
apsym,nharderrors,dmin,nbadcrc,iappass,iera,message,xsnr)
|
||||
nsnr=nint(xsnr)
|
||||
xdt=xdt-0.5
|
||||
hd=nharderrors+dmin
|
||||
call timer('ft8b ',1)
|
||||
if(nbadcrc.eq.0) then
|
||||
! call jtmsg(message,iflag)
|
||||
if(bcontest) call fix_contest_msg(mygrid6,message)
|
||||
! if(iand(iflag,31).ne.0) message(22:22)='?'
|
||||
ldupe=.false.
|
||||
do id=1,ndecodes
|
||||
if(message.eq.allmessages(id).and.nsnr.le.allsnrs(id)) ldupe=.true.
|
||||
enddo
|
||||
if(.not.ldupe) then
|
||||
ndecodes=ndecodes+1
|
||||
allmessages(ndecodes)=message
|
||||
allsnrs(ndecodes)=nsnr
|
||||
endif
|
||||
! write(81,1004) nutc,ncand,icand,ipass,iaptype,iappass, &
|
||||
! nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||
! xdt,nint(f1),message
|
||||
!1004 format(i6.6,2i4,3i2,i3,3f6.1,i4,f6.2,i5,2x,a22)
|
||||
! flush(81)
|
||||
if(.not.ldupe .and. associated(this%callback)) then
|
||||
qual=1.0-(nharderrors+dmin)/60.0 ! scale qual to [0.0,1.0]
|
||||
call this%callback(sync,nsnr,xdt,f1,message,iaptype,qual)
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
! h=default_header(12000,NMAX)
|
||||
! open(10,file='subtract.wav',status='unknown',access='stream')
|
||||
! iwave=nint(dd)
|
||||
! write(10) h,iwave
|
||||
! close(10)
|
||||
enddo
|
||||
return
|
||||
end subroutine decode
|
||||
|
||||
end module ft8_decode
|
||||
@@ -0,0 +1,9 @@
|
||||
0; 0; 0
|
||||
0; 32; 0
|
||||
0;154; 0
|
||||
0;161; 0
|
||||
0;177; 0
|
||||
156;209;144
|
||||
192;185;183
|
||||
214;222;224
|
||||
255;255;255
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
#ifndef EQUALIZATION_TOOLS_DIALOG_HPP__
|
||||
#define EQUALIZATION_TOOLS_DIALOG_HPP__
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "pimpl_h.hpp"
|
||||
|
||||
class QWidget;
|
||||
class QSettings;
|
||||
class QDir;
|
||||
|
||||
class EqualizationToolsDialog
|
||||
: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EqualizationToolsDialog (QSettings *
|
||||
, QDir const& data_directory
|
||||
, QVector<double> const& coefficients
|
||||
, QWidget * = nullptr);
|
||||
Q_SLOT void show ();
|
||||
|
||||
Q_SIGNAL void phase_equalization_changed (QVector<double> const&);
|
||||
|
||||
private:
|
||||
class impl;
|
||||
pimpl<impl> m_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,86 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Neil Groves 2009. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
#ifndef BOOST_RANGE_ALGORITHM_EXT_FOR_EACH_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_EXT_FOR_EACH_HPP_INCLUDED
|
||||
|
||||
#include <boost/range/config.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
template<class InputIterator1, class InputIterator2, class Fn2>
|
||||
inline Fn2 for_each_impl(InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Fn2 fn)
|
||||
{
|
||||
for (; first1 != last1 && first2 != last2; ++first1, ++first2)
|
||||
{
|
||||
fn(*first1, *first2);
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
}
|
||||
|
||||
namespace range
|
||||
{
|
||||
template<class SinglePassRange1, class SinglePassRange2, class Fn2>
|
||||
inline Fn2 for_each(const SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
|
||||
|
||||
return ::boost::range_detail::for_each_impl(
|
||||
::boost::begin(rng1), ::boost::end(rng1),
|
||||
::boost::begin(rng2), ::boost::end(rng2), fn);
|
||||
}
|
||||
|
||||
template<class SinglePassRange1, class SinglePassRange2, class Fn2>
|
||||
inline Fn2 for_each(const SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
|
||||
|
||||
return ::boost::range_detail::for_each_impl(
|
||||
::boost::begin(rng1), ::boost::end(rng1),
|
||||
::boost::begin(rng2), ::boost::end(rng2), fn);
|
||||
}
|
||||
|
||||
template<class SinglePassRange1, class SinglePassRange2, class Fn2>
|
||||
inline Fn2 for_each(SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
|
||||
|
||||
return ::boost::range_detail::for_each_impl(
|
||||
::boost::begin(rng1), ::boost::end(rng1),
|
||||
::boost::begin(rng2), ::boost::end(rng2), fn);
|
||||
}
|
||||
|
||||
template<class SinglePassRange1, class SinglePassRange2, class Fn2>
|
||||
inline Fn2 for_each(SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
|
||||
|
||||
return ::boost::range_detail::for_each_impl(
|
||||
::boost::begin(rng1), ::boost::end(rng1),
|
||||
::boost::begin(rng2), ::boost::end(rng2), fn);
|
||||
}
|
||||
} // namespace range
|
||||
using range::for_each;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,76 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
// Copyright David Abrahams 2003-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/order_fwd.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/long.hpp>
|
||||
#include <boost/mpl/has_key.hpp>
|
||||
#include <boost/mpl/aux_/overload_names.hpp>
|
||||
#include <boost/mpl/aux_/static_cast.hpp>
|
||||
#include <boost/mpl/aux_/type_wrapper.hpp>
|
||||
#include <boost/mpl/aux_/traits_lambda_spec.hpp>
|
||||
#include <boost/mpl/aux_/config/msvc.hpp>
|
||||
#include <boost/mpl/aux_/config/static_constant.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
// default implementation; requires 'Seq' to provide corresponding overloads
|
||||
// of BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY
|
||||
|
||||
template< typename Seq, typename Key > struct x_order_impl
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
|
||||
|| BOOST_WORKAROUND(__EDG_VERSION__, <= 245)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(long, value =
|
||||
sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(
|
||||
Seq
|
||||
, BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)
|
||||
) )
|
||||
);
|
||||
|
||||
typedef long_<value> type;
|
||||
|
||||
#else // ISO98 C++
|
||||
: long_<
|
||||
sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(
|
||||
Seq
|
||||
, BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)
|
||||
) )
|
||||
>
|
||||
{
|
||||
#endif
|
||||
};
|
||||
|
||||
template< typename Tag >
|
||||
struct order_impl
|
||||
{
|
||||
template< typename Seq, typename Key > struct apply
|
||||
: if_<
|
||||
typename has_key_impl<Tag>::template apply<Seq,Key>
|
||||
, x_order_impl<Seq,Key>
|
||||
, void_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,order_impl)
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
|
||||
@@ -0,0 +1,44 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2014 Kohei Takahashi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef FUSION_VECTOR_TIE_11112014_2302
|
||||
#define FUSION_VECTOR_TIE_11112014_2302
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/vector/detail/config.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# include <boost/fusion/container/generation/detail/pp_vector_tie.hpp>
|
||||
#else
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 variadic interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename ...T>
|
||||
struct vector_tie
|
||||
{
|
||||
typedef vector<T&...> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename ...T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline vector<T&...>
|
||||
vector_tie(T&... arg)
|
||||
{
|
||||
return vector<T&...>(arg...);
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,779 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013 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_CONTAINER_VECTOR_HPP
|
||||
#define BOOST_COMPUTE_CONTAINER_VECTOR_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <boost/compute/config.hpp>
|
||||
|
||||
#ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#include <boost/compute/buffer.hpp>
|
||||
#include <boost/compute/device.hpp>
|
||||
#include <boost/compute/system.hpp>
|
||||
#include <boost/compute/context.hpp>
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/algorithm/copy.hpp>
|
||||
#include <boost/compute/algorithm/copy_n.hpp>
|
||||
#include <boost/compute/algorithm/fill_n.hpp>
|
||||
#include <boost/compute/allocator/buffer_allocator.hpp>
|
||||
#include <boost/compute/iterator/buffer_iterator.hpp>
|
||||
#include <boost/compute/type_traits/detail/capture_traits.hpp>
|
||||
#include <boost/compute/detail/buffer_value.hpp>
|
||||
#include <boost/compute/detail/iterator_range_size.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// \class vector
|
||||
/// \brief A resizable array of values.
|
||||
///
|
||||
/// The vector<T> class stores a dynamic array of values. Internally, the data
|
||||
/// is stored in an OpenCL buffer object.
|
||||
///
|
||||
/// The vector class is the prefered container for storing and accessing data
|
||||
/// on a compute device. In most cases it should be used instead of directly
|
||||
/// dealing with buffer objects. If the undelying buffer is needed, it can be
|
||||
/// accessed with the get_buffer() method.
|
||||
///
|
||||
/// The internal storage is allocated in a specific OpenCL context which is
|
||||
/// passed as an argument to the constructor when the vector is created.
|
||||
///
|
||||
/// For example, to create a vector on the device containing space for ten
|
||||
/// \c int values:
|
||||
/// \code
|
||||
/// boost::compute::vector<int> vec(10, context);
|
||||
/// \endcode
|
||||
///
|
||||
/// Allocation and data transfer can also be performed in a single step:
|
||||
/// \code
|
||||
/// // values on the host
|
||||
/// int data[] = { 1, 2, 3, 4 };
|
||||
///
|
||||
/// // create a vector of size four and copy the values from data
|
||||
/// boost::compute::vector<int> vec(data, data + 4, queue);
|
||||
/// \endcode
|
||||
///
|
||||
/// The Boost.Compute \c vector class provides a STL-like API and is modeled
|
||||
/// after the \c std::vector class from the C++ standard library. It can be
|
||||
/// used with any of the STL-like algorithms provided by Boost.Compute
|
||||
/// including \c copy(), \c transform(), and \c sort() (among many others).
|
||||
///
|
||||
/// For example:
|
||||
/// \code
|
||||
/// // a vector on a compute device
|
||||
/// boost::compute::vector<float> vec = ...
|
||||
///
|
||||
/// // copy data to the vector from a host std:vector
|
||||
/// boost::compute::copy(host_vec.begin(), host_vec.end(), vec.begin(), queue);
|
||||
///
|
||||
/// // copy data from the vector to a host std::vector
|
||||
/// boost::compute::copy(vec.begin(), vec.end(), host_vec.begin(), queue);
|
||||
///
|
||||
/// // sort the values in the vector
|
||||
/// boost::compute::sort(vec.begin(), vec.end(), queue);
|
||||
///
|
||||
/// // calculate the sum of the values in the vector (also see reduce())
|
||||
/// float sum = boost::compute::accumulate(vec.begin(), vec.end(), 0, queue);
|
||||
///
|
||||
/// // reverse the values in the vector
|
||||
/// boost::compute::reverse(vec.begin(), vec.end(), queue);
|
||||
///
|
||||
/// // fill the vector with ones
|
||||
/// boost::compute::fill(vec.begin(), vec.end(), 1, queue);
|
||||
/// \endcode
|
||||
///
|
||||
/// \see \ref array "array<T, N>", buffer
|
||||
template<class T, class Alloc = buffer_allocator<T> >
|
||||
class vector
|
||||
{
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef Alloc allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
typedef typename allocator_type::difference_type difference_type;
|
||||
typedef detail::buffer_value<T> reference;
|
||||
typedef const detail::buffer_value<T> const_reference;
|
||||
typedef typename allocator_type::pointer pointer;
|
||||
typedef typename allocator_type::const_pointer const_pointer;
|
||||
typedef buffer_iterator<T> iterator;
|
||||
typedef buffer_iterator<T> const_iterator;
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
/// Creates an empty vector in \p context.
|
||||
explicit vector(const context &context = system::default_context())
|
||||
: m_size(0),
|
||||
m_allocator(context)
|
||||
{
|
||||
m_data = m_allocator.allocate(_minimum_capacity());
|
||||
}
|
||||
|
||||
/// Creates a vector with space for \p count elements in \p context.
|
||||
///
|
||||
/// Note that unlike \c std::vector's constructor, this will not initialize
|
||||
/// the values in the container. Either call the vector constructor which
|
||||
/// takes a value to initialize with or use the fill() algorithm to set
|
||||
/// the initial values.
|
||||
///
|
||||
/// For example:
|
||||
/// \code
|
||||
/// // create a vector on the device with space for ten ints
|
||||
/// boost::compute::vector<int> vec(10, context);
|
||||
/// \endcode
|
||||
explicit vector(size_type count,
|
||||
const context &context = system::default_context())
|
||||
: m_size(count),
|
||||
m_allocator(context)
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(count, _minimum_capacity()));
|
||||
}
|
||||
|
||||
/// Creates a vector with space for \p count elements and sets each equal
|
||||
/// to \p value.
|
||||
///
|
||||
/// For example:
|
||||
/// \code
|
||||
/// // creates a vector with four values set to nine (e.g. [9, 9, 9, 9]).
|
||||
/// boost::compute::vector<int> vec(4, 9, queue);
|
||||
/// \endcode
|
||||
vector(size_type count,
|
||||
const T &value,
|
||||
command_queue &queue = system::default_queue())
|
||||
: m_size(count),
|
||||
m_allocator(queue.get_context())
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(count, _minimum_capacity()));
|
||||
|
||||
::boost::compute::fill_n(begin(), count, value, queue);
|
||||
}
|
||||
|
||||
/// Creates a vector with space for the values in the range [\p first,
|
||||
/// \p last) and copies them into the vector with \p queue.
|
||||
///
|
||||
/// For example:
|
||||
/// \code
|
||||
/// // values on the host
|
||||
/// int data[] = { 1, 2, 3, 4 };
|
||||
///
|
||||
/// // create a vector of size four and copy the values from data
|
||||
/// boost::compute::vector<int> vec(data, data + 4, queue);
|
||||
/// \endcode
|
||||
template<class InputIterator>
|
||||
vector(InputIterator first,
|
||||
InputIterator last,
|
||||
command_queue &queue = system::default_queue())
|
||||
: m_size(detail::iterator_range_size(first, last)),
|
||||
m_allocator(queue.get_context())
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(m_size, _minimum_capacity()));
|
||||
|
||||
::boost::compute::copy(first, last, begin(), queue);
|
||||
}
|
||||
|
||||
/// Creates a new vector and copies the values from \p other.
|
||||
vector(const vector &other,
|
||||
command_queue &queue = system::default_queue())
|
||||
: m_size(other.m_size),
|
||||
m_allocator(other.m_allocator)
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(m_size, _minimum_capacity()));
|
||||
|
||||
if(!other.empty()){
|
||||
if(other.get_buffer().get_context() != queue.get_context()){
|
||||
command_queue other_queue = other.default_queue();
|
||||
::boost::compute::copy(other.begin(), other.end(), begin(), other_queue);
|
||||
other_queue.finish();
|
||||
}
|
||||
else {
|
||||
::boost::compute::copy(other.begin(), other.end(), begin(), queue);
|
||||
queue.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new vector and copies the values from \p other.
|
||||
template<class OtherAlloc>
|
||||
vector(const vector<T, OtherAlloc> &other,
|
||||
command_queue &queue = system::default_queue())
|
||||
: m_size(other.size()),
|
||||
m_allocator(queue.get_context())
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(m_size, _minimum_capacity()));
|
||||
|
||||
if(!other.empty()){
|
||||
::boost::compute::copy(other.begin(), other.end(), begin(), queue);
|
||||
queue.finish();
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new vector and copies the values from \p vector.
|
||||
template<class OtherAlloc>
|
||||
vector(const std::vector<T, OtherAlloc> &vector,
|
||||
command_queue &queue = system::default_queue())
|
||||
: m_size(vector.size()),
|
||||
m_allocator(queue.get_context())
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(m_size, _minimum_capacity()));
|
||||
|
||||
::boost::compute::copy(vector.begin(), vector.end(), begin(), queue);
|
||||
}
|
||||
|
||||
#ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
|
||||
vector(std::initializer_list<T> list,
|
||||
command_queue &queue = system::default_queue())
|
||||
: m_size(list.size()),
|
||||
m_allocator(queue.get_context())
|
||||
{
|
||||
m_data = m_allocator.allocate((std::max)(m_size, _minimum_capacity()));
|
||||
|
||||
::boost::compute::copy(list.begin(), list.end(), begin(), queue);
|
||||
}
|
||||
#endif // BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
|
||||
|
||||
vector& operator=(const vector &other)
|
||||
{
|
||||
if(this != &other){
|
||||
command_queue queue = default_queue();
|
||||
resize(other.size(), queue);
|
||||
::boost::compute::copy(other.begin(), other.end(), begin(), queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class OtherAlloc>
|
||||
vector& operator=(const vector<T, OtherAlloc> &other)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
resize(other.size(), queue);
|
||||
::boost::compute::copy(other.begin(), other.end(), begin(), queue);
|
||||
queue.finish();
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class OtherAlloc>
|
||||
vector& operator=(const std::vector<T, OtherAlloc> &vector)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
resize(vector.size(), queue);
|
||||
::boost::compute::copy(vector.begin(), vector.end(), begin(), queue);
|
||||
queue.finish();
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
|
||||
/// Move-constructs a new vector from \p other.
|
||||
vector(vector&& other)
|
||||
: m_data(std::move(other.m_data)),
|
||||
m_size(other.m_size),
|
||||
m_allocator(std::move(other.m_allocator))
|
||||
{
|
||||
other.m_size = 0;
|
||||
}
|
||||
|
||||
/// Move-assigns the data from \p other to \c *this.
|
||||
vector& operator=(vector&& other)
|
||||
{
|
||||
if(m_size){
|
||||
m_allocator.deallocate(m_data, m_size);
|
||||
}
|
||||
|
||||
m_data = std::move(other.m_data);
|
||||
m_size = other.m_size;
|
||||
m_allocator = std::move(other.m_allocator);
|
||||
|
||||
other.m_size = 0;
|
||||
|
||||
return *this;
|
||||
}
|
||||
#endif // BOOST_COMPUTE_NO_RVALUE_REFERENCES
|
||||
|
||||
/// Destroys the vector object.
|
||||
~vector()
|
||||
{
|
||||
if(m_size){
|
||||
m_allocator.deallocate(m_data, m_size);
|
||||
}
|
||||
}
|
||||
|
||||
iterator begin()
|
||||
{
|
||||
return ::boost::compute::make_buffer_iterator<T>(m_data.get_buffer(), 0);
|
||||
}
|
||||
|
||||
const_iterator begin() const
|
||||
{
|
||||
return ::boost::compute::make_buffer_iterator<T>(m_data.get_buffer(), 0);
|
||||
}
|
||||
|
||||
const_iterator cbegin() const
|
||||
{
|
||||
return begin();
|
||||
}
|
||||
|
||||
iterator end()
|
||||
{
|
||||
return ::boost::compute::make_buffer_iterator<T>(m_data.get_buffer(), m_size);
|
||||
}
|
||||
|
||||
const_iterator end() const
|
||||
{
|
||||
return ::boost::compute::make_buffer_iterator<T>(m_data.get_buffer(), m_size);
|
||||
}
|
||||
|
||||
const_iterator cend() const
|
||||
{
|
||||
return end();
|
||||
}
|
||||
|
||||
reverse_iterator rbegin()
|
||||
{
|
||||
return reverse_iterator(end() - 1);
|
||||
}
|
||||
|
||||
const_reverse_iterator rbegin() const
|
||||
{
|
||||
return reverse_iterator(end() - 1);
|
||||
}
|
||||
|
||||
const_reverse_iterator crbegin() const
|
||||
{
|
||||
return rbegin();
|
||||
}
|
||||
|
||||
reverse_iterator rend()
|
||||
{
|
||||
return reverse_iterator(begin() - 1);
|
||||
}
|
||||
|
||||
const_reverse_iterator rend() const
|
||||
{
|
||||
return reverse_iterator(begin() - 1);
|
||||
}
|
||||
|
||||
const_reverse_iterator crend() const
|
||||
{
|
||||
return rend();
|
||||
}
|
||||
|
||||
/// Returns the number of elements in the vector.
|
||||
size_type size() const
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
size_type max_size() const
|
||||
{
|
||||
return m_allocator.max_size();
|
||||
}
|
||||
|
||||
/// Resizes the vector to \p size.
|
||||
void resize(size_type size, command_queue &queue)
|
||||
{
|
||||
if(size <= capacity()){
|
||||
m_size = size;
|
||||
}
|
||||
else {
|
||||
// allocate new buffer
|
||||
pointer new_data =
|
||||
m_allocator.allocate(
|
||||
static_cast<size_type>(
|
||||
static_cast<float>(size) * _growth_factor()
|
||||
)
|
||||
);
|
||||
|
||||
// copy old values to the new buffer
|
||||
::boost::compute::copy(m_data, m_data + m_size, new_data, queue);
|
||||
|
||||
// free old memory
|
||||
m_allocator.deallocate(m_data, m_size);
|
||||
|
||||
// set new data and size
|
||||
m_data = new_data;
|
||||
m_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
/// \overload
|
||||
void resize(size_type size)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
resize(size, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
/// Returns \c true if the vector is empty.
|
||||
bool empty() const
|
||||
{
|
||||
return m_size == 0;
|
||||
}
|
||||
|
||||
/// Returns the capacity of the vector.
|
||||
size_type capacity() const
|
||||
{
|
||||
return m_data.get_buffer().size() / sizeof(T);
|
||||
}
|
||||
|
||||
void reserve(size_type size, command_queue &queue)
|
||||
{
|
||||
(void) size;
|
||||
(void) queue;
|
||||
}
|
||||
|
||||
void reserve(size_type size)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
reserve(size, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
void shrink_to_fit(command_queue &queue)
|
||||
{
|
||||
(void) queue;
|
||||
}
|
||||
|
||||
void shrink_to_fit()
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
shrink_to_fit(queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
reference operator[](size_type index)
|
||||
{
|
||||
return *(begin() + static_cast<difference_type>(index));
|
||||
}
|
||||
|
||||
const_reference operator[](size_type index) const
|
||||
{
|
||||
return *(begin() + static_cast<difference_type>(index));
|
||||
}
|
||||
|
||||
reference at(size_type index)
|
||||
{
|
||||
if(index >= size()){
|
||||
BOOST_THROW_EXCEPTION(std::out_of_range("index out of range"));
|
||||
}
|
||||
|
||||
return operator[](index);
|
||||
}
|
||||
|
||||
const_reference at(size_type index) const
|
||||
{
|
||||
if(index >= size()){
|
||||
BOOST_THROW_EXCEPTION(std::out_of_range("index out of range"));
|
||||
}
|
||||
|
||||
return operator[](index);
|
||||
}
|
||||
|
||||
reference front()
|
||||
{
|
||||
return *begin();
|
||||
}
|
||||
|
||||
const_reference front() const
|
||||
{
|
||||
return *begin();
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return *(end() - static_cast<difference_type>(1));
|
||||
}
|
||||
|
||||
const_reference back() const
|
||||
{
|
||||
return *(end() - static_cast<difference_type>(1));
|
||||
}
|
||||
|
||||
template<class InputIterator>
|
||||
void assign(InputIterator first,
|
||||
InputIterator last,
|
||||
command_queue &queue)
|
||||
{
|
||||
// resize vector for new contents
|
||||
resize(detail::iterator_range_size(first, last), queue);
|
||||
|
||||
// copy values into the vector
|
||||
::boost::compute::copy(first, last, begin(), queue);
|
||||
}
|
||||
|
||||
template<class InputIterator>
|
||||
void assign(InputIterator first, InputIterator last)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
assign(first, last, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
void assign(size_type n, const T &value, command_queue &queue)
|
||||
{
|
||||
// resize vector for new contents
|
||||
resize(n, queue);
|
||||
|
||||
// fill vector with value
|
||||
::boost::compute::fill_n(begin(), n, value, queue);
|
||||
}
|
||||
|
||||
void assign(size_type n, const T &value)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
assign(n, value, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
/// Inserts \p value at the end of the vector (resizing if neccessary).
|
||||
///
|
||||
/// Note that calling \c push_back() to insert data values one at a time
|
||||
/// is inefficient as there is a non-trivial overhead in performing a data
|
||||
/// transfer to the device. It is usually better to store a set of values
|
||||
/// on the host (for example, in a \c std::vector) and then transfer them
|
||||
/// in bulk using the \c insert() method or the copy() algorithm.
|
||||
void push_back(const T &value, command_queue &queue)
|
||||
{
|
||||
insert(end(), value, queue);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
void push_back(const T &value)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
push_back(value, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
void pop_back(command_queue &queue)
|
||||
{
|
||||
resize(size() - 1, queue);
|
||||
}
|
||||
|
||||
void pop_back()
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
pop_back(queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
iterator insert(iterator position, const T &value, command_queue &queue)
|
||||
{
|
||||
if(position == end()){
|
||||
resize(m_size + 1, queue);
|
||||
position = begin() + position.get_index();
|
||||
::boost::compute::copy_n(&value, 1, position, queue);
|
||||
}
|
||||
else {
|
||||
::boost::compute::vector<T, Alloc> tmp(position, end(), queue);
|
||||
resize(m_size + 1, queue);
|
||||
position = begin() + position.get_index();
|
||||
::boost::compute::copy_n(&value, 1, position, queue);
|
||||
::boost::compute::copy(tmp.begin(), tmp.end(), position + 1, queue);
|
||||
}
|
||||
|
||||
return position + 1;
|
||||
}
|
||||
|
||||
iterator insert(iterator position, const T &value)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
iterator iter = insert(position, value, queue);
|
||||
queue.finish();
|
||||
return iter;
|
||||
}
|
||||
|
||||
void insert(iterator position,
|
||||
size_type count,
|
||||
const T &value,
|
||||
command_queue &queue)
|
||||
{
|
||||
::boost::compute::vector<T, Alloc> tmp(position, end(), queue);
|
||||
resize(size() + count, queue);
|
||||
|
||||
position = begin() + position.get_index();
|
||||
|
||||
::boost::compute::fill_n(position, count, value, queue);
|
||||
::boost::compute::copy(
|
||||
tmp.begin(),
|
||||
tmp.end(),
|
||||
position + static_cast<difference_type>(count),
|
||||
queue
|
||||
);
|
||||
}
|
||||
|
||||
void insert(iterator position, size_type count, const T &value)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
insert(position, count, value, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
/// Inserts the values in the range [\p first, \p last) into the vector at
|
||||
/// \p position using \p queue.
|
||||
template<class InputIterator>
|
||||
void insert(iterator position,
|
||||
InputIterator first,
|
||||
InputIterator last,
|
||||
command_queue &queue)
|
||||
{
|
||||
::boost::compute::vector<T, Alloc> tmp(position, end(), queue);
|
||||
|
||||
size_type count = detail::iterator_range_size(first, last);
|
||||
resize(size() + count, queue);
|
||||
|
||||
position = begin() + position.get_index();
|
||||
|
||||
::boost::compute::copy(first, last, position, queue);
|
||||
::boost::compute::copy(
|
||||
tmp.begin(),
|
||||
tmp.end(),
|
||||
position + static_cast<difference_type>(count),
|
||||
queue
|
||||
);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class InputIterator>
|
||||
void insert(iterator position, InputIterator first, InputIterator last)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
insert(position, first, last, queue);
|
||||
queue.finish();
|
||||
}
|
||||
|
||||
iterator erase(iterator position, command_queue &queue)
|
||||
{
|
||||
return erase(position, position + 1, queue);
|
||||
}
|
||||
|
||||
iterator erase(iterator position)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
iterator iter = erase(position, queue);
|
||||
queue.finish();
|
||||
return iter;
|
||||
}
|
||||
|
||||
iterator erase(iterator first, iterator last, command_queue &queue)
|
||||
{
|
||||
if(last != end()){
|
||||
::boost::compute::vector<T, Alloc> tmp(last, end(), queue);
|
||||
::boost::compute::copy(tmp.begin(), tmp.end(), first, queue);
|
||||
}
|
||||
|
||||
difference_type count = std::distance(first, last);
|
||||
resize(size() - static_cast<size_type>(count), queue);
|
||||
|
||||
return begin() + first.get_index() + count;
|
||||
}
|
||||
|
||||
iterator erase(iterator first, iterator last)
|
||||
{
|
||||
command_queue queue = default_queue();
|
||||
iterator iter = erase(first, last, queue);
|
||||
queue.finish();
|
||||
return iter;
|
||||
}
|
||||
|
||||
/// Swaps the contents of \c *this with \p other.
|
||||
void swap(vector &other)
|
||||
{
|
||||
std::swap(m_data, other.m_data);
|
||||
std::swap(m_size, other.m_size);
|
||||
std::swap(m_allocator, other.m_allocator);
|
||||
}
|
||||
|
||||
/// Removes all elements from the vector.
|
||||
void clear()
|
||||
{
|
||||
m_size = 0;
|
||||
}
|
||||
|
||||
allocator_type get_allocator() const
|
||||
{
|
||||
return m_allocator;
|
||||
}
|
||||
|
||||
/// Returns the underlying buffer.
|
||||
const buffer& get_buffer() const
|
||||
{
|
||||
return m_data.get_buffer();
|
||||
}
|
||||
|
||||
/// \internal_
|
||||
///
|
||||
/// Returns a command queue usable to issue commands for the vector's
|
||||
/// memory buffer. This is used when a member function is called without
|
||||
/// specifying an existing command queue to use.
|
||||
command_queue default_queue() const
|
||||
{
|
||||
const context &context = m_allocator.get_context();
|
||||
command_queue queue(context, context.get_device());
|
||||
return queue;
|
||||
}
|
||||
|
||||
private:
|
||||
/// \internal_
|
||||
BOOST_CONSTEXPR size_type _minimum_capacity() const { return 4; }
|
||||
|
||||
/// \internal_
|
||||
BOOST_CONSTEXPR float _growth_factor() const { return 1.5; }
|
||||
|
||||
private:
|
||||
pointer m_data;
|
||||
size_type m_size;
|
||||
allocator_type m_allocator;
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
||||
// set_kernel_arg specialization for vector<T>
|
||||
template<class T, class Alloc>
|
||||
struct set_kernel_arg<vector<T, Alloc> >
|
||||
{
|
||||
void operator()(kernel &kernel_, size_t index, const vector<T, Alloc> &vector)
|
||||
{
|
||||
kernel_.set_arg(index, vector.get_buffer());
|
||||
}
|
||||
};
|
||||
|
||||
// for capturing vector<T> with BOOST_COMPUTE_CLOSURE()
|
||||
template<class T, class Alloc>
|
||||
struct capture_traits<vector<T, Alloc> >
|
||||
{
|
||||
static std::string type_name()
|
||||
{
|
||||
return std::string("__global ") + ::boost::compute::type_name<T>() + "*";
|
||||
}
|
||||
};
|
||||
|
||||
// meta_kernel streaming operator for vector<T>
|
||||
template<class T, class Alloc>
|
||||
meta_kernel& operator<<(meta_kernel &k, const vector<T, Alloc> &vector)
|
||||
{
|
||||
return k << k.get_buffer_identifier<T>(vector.get_buffer());
|
||||
}
|
||||
|
||||
} // end detail namespace
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_CONTAINER_VECTOR_HPP
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2001-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
|
||||
|
||||
#include <boost/mpl/aux_/config/typeof.hpp>
|
||||
#include <boost/mpl/aux_/config/ctps.hpp>
|
||||
#include <boost/mpl/aux_/config/preprocessor.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
|
||||
# define AUX778076_INCLUDE_DIR typeof_based
|
||||
#elif defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
# define AUX778076_INCLUDE_DIR no_ctps
|
||||
#else
|
||||
# define AUX778076_INCLUDE_DIR plain
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
|
||||
# define AUX778076_HEADER \
|
||||
AUX778076_INCLUDE_DIR/BOOST_MPL_PREPROCESSED_HEADER \
|
||||
/**/
|
||||
#else
|
||||
# define AUX778076_HEADER \
|
||||
BOOST_PP_CAT(AUX778076_INCLUDE_DIR,/)##BOOST_MPL_PREPROCESSED_HEADER \
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(700))
|
||||
# define AUX778076_INCLUDE_STRING BOOST_PP_STRINGIZE(boost/mpl/map/aux_/preprocessed/AUX778076_HEADER)
|
||||
# include AUX778076_INCLUDE_STRING
|
||||
# undef AUX778076_INCLUDE_STRING
|
||||
#else
|
||||
# include BOOST_PP_STRINGIZE(boost/mpl/map/aux_/preprocessed/AUX778076_HEADER)
|
||||
#endif
|
||||
|
||||
# undef AUX778076_HEADER
|
||||
# undef AUX778076_INCLUDE_DIR
|
||||
|
||||
#undef BOOST_MPL_PREPROCESSED_HEADER
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,194 @@
|
||||
// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/numeric/conversion
|
||||
//
|
||||
// Contact the author at: fernando_cacciola@hotmail.com
|
||||
//
|
||||
#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP
|
||||
#define BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP
|
||||
|
||||
#include <typeinfo> // for std::bad_cast
|
||||
|
||||
#include <boost/config/no_tr1/cmath.hpp> // for std::floor and std::ceil
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "boost/type_traits/is_arithmetic.hpp"
|
||||
|
||||
#include "boost/mpl/if.hpp"
|
||||
#include "boost/mpl/integral_c.hpp"
|
||||
|
||||
namespace boost { namespace numeric
|
||||
{
|
||||
|
||||
template<class S>
|
||||
struct Trunc
|
||||
{
|
||||
typedef S source_type ;
|
||||
|
||||
typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
|
||||
|
||||
static source_type nearbyint ( argument_type s )
|
||||
{
|
||||
#if !defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using std::floor ;
|
||||
using std::ceil ;
|
||||
#endif
|
||||
|
||||
return s < static_cast<S>(0) ? ceil(s) : floor(s) ;
|
||||
}
|
||||
|
||||
typedef mpl::integral_c< std::float_round_style, std::round_toward_zero> round_style ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
template<class S>
|
||||
struct Floor
|
||||
{
|
||||
typedef S source_type ;
|
||||
|
||||
typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
|
||||
|
||||
static source_type nearbyint ( argument_type s )
|
||||
{
|
||||
#if !defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using std::floor ;
|
||||
#endif
|
||||
|
||||
return floor(s) ;
|
||||
}
|
||||
|
||||
typedef mpl::integral_c< std::float_round_style, std::round_toward_neg_infinity> round_style ;
|
||||
} ;
|
||||
|
||||
template<class S>
|
||||
struct Ceil
|
||||
{
|
||||
typedef S source_type ;
|
||||
|
||||
typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
|
||||
|
||||
static source_type nearbyint ( argument_type s )
|
||||
{
|
||||
#if !defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using std::ceil ;
|
||||
#endif
|
||||
|
||||
return ceil(s) ;
|
||||
}
|
||||
|
||||
typedef mpl::integral_c< std::float_round_style, std::round_toward_infinity> round_style ;
|
||||
} ;
|
||||
|
||||
template<class S>
|
||||
struct RoundEven
|
||||
{
|
||||
typedef S source_type ;
|
||||
|
||||
typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
|
||||
|
||||
static source_type nearbyint ( argument_type s )
|
||||
{
|
||||
// Algorithm contributed by Guillaume Melquiond
|
||||
|
||||
#if !defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using std::floor ;
|
||||
using std::ceil ;
|
||||
#endif
|
||||
|
||||
// only works inside the range not at the boundaries
|
||||
S prev = floor(s);
|
||||
S next = ceil(s);
|
||||
|
||||
S rt = (s - prev) - (next - s); // remainder type
|
||||
|
||||
S const zero(0.0);
|
||||
S const two(2.0);
|
||||
|
||||
if ( rt < zero )
|
||||
return prev;
|
||||
else if ( rt > zero )
|
||||
return next;
|
||||
else
|
||||
{
|
||||
bool is_prev_even = two * floor(prev / two) == prev ;
|
||||
return ( is_prev_even ? prev : next ) ;
|
||||
}
|
||||
}
|
||||
|
||||
typedef mpl::integral_c< std::float_round_style, std::round_to_nearest> round_style ;
|
||||
} ;
|
||||
|
||||
|
||||
enum range_check_result
|
||||
{
|
||||
cInRange = 0 ,
|
||||
cNegOverflow = 1 ,
|
||||
cPosOverflow = 2
|
||||
} ;
|
||||
|
||||
class bad_numeric_cast : public std::bad_cast
|
||||
{
|
||||
public:
|
||||
|
||||
virtual const char * what() const throw()
|
||||
{ return "bad numeric conversion: overflow"; }
|
||||
};
|
||||
|
||||
class negative_overflow : public bad_numeric_cast
|
||||
{
|
||||
public:
|
||||
|
||||
virtual const char * what() const throw()
|
||||
{ return "bad numeric conversion: negative overflow"; }
|
||||
};
|
||||
class positive_overflow : public bad_numeric_cast
|
||||
{
|
||||
public:
|
||||
|
||||
virtual const char * what() const throw()
|
||||
{ return "bad numeric conversion: positive overflow"; }
|
||||
};
|
||||
|
||||
struct def_overflow_handler
|
||||
{
|
||||
void operator() ( range_check_result r ) // throw(negative_overflow,positive_overflow)
|
||||
{
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
if ( r == cNegOverflow )
|
||||
throw negative_overflow() ;
|
||||
else if ( r == cPosOverflow )
|
||||
throw positive_overflow() ;
|
||||
#else
|
||||
if ( r == cNegOverflow )
|
||||
::boost::throw_exception(negative_overflow()) ;
|
||||
else if ( r == cPosOverflow )
|
||||
::boost::throw_exception(positive_overflow()) ;
|
||||
#endif
|
||||
}
|
||||
} ;
|
||||
|
||||
struct silent_overflow_handler
|
||||
{
|
||||
void operator() ( range_check_result ) {} // throw()
|
||||
} ;
|
||||
|
||||
template<class Traits>
|
||||
struct raw_converter
|
||||
{
|
||||
typedef typename Traits::result_type result_type ;
|
||||
typedef typename Traits::argument_type argument_type ;
|
||||
|
||||
static result_type low_level_convert ( argument_type s ) { return static_cast<result_type>(s) ; }
|
||||
} ;
|
||||
|
||||
struct UseInternalRangeChecker {} ;
|
||||
|
||||
} } // namespace boost::numeric
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
// Status=review
|
||||
|
||||
The _WSJT_ project was started in 2001. Since 2005 it has been an
|
||||
Open Source project, and it now includes programs _WSJT_, _MAP65_,
|
||||
_WSPR_, _WSJT-X_, and _WSPR-X_. All code is licensed under the
|
||||
GNU Public License (GPL). Many users of these programs, too numerous
|
||||
to mention here individually, have contributed suggestions and advice
|
||||
that have greatly aided the development of _WSJT_ and its sister
|
||||
programs.
|
||||
|
||||
For _WSJT-X_ in particular, we acknowledge contributions from *AC6SL,
|
||||
AE4JY, DJ0OT, G3WDG, G4KLA, G4WJS, IV3NWV, IW3RAB, K3WYC, K9AN,
|
||||
KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR, VE1SKY, VK3ACF,
|
||||
VK4BDJ, VK7MO, W4TI, W4TV, and W9MDB*. Each of these amateurs has helped to
|
||||
bring the program’s design, code, testing, and/or documentation to
|
||||
its present state.
|
||||
|
||||
Most of the color palettes for the _WSJT-X_ waterfall were copied from
|
||||
the excellent, well documented, open-source program _fldigi_, by *W1HKJ*
|
||||
and friends.
|
||||
|
||||
We use development tools and libraries from many sources. We
|
||||
particularly wish to acknowledge importance of the GNU Compiler
|
||||
Collection from the Free Software Foundation, the "clang" compiler
|
||||
from LLVM at the University of Illinois, and the Qt Project from Digia
|
||||
PLC. Other important resources include the FFTW library by Matteo
|
||||
Frigo and Steven G. Johnson; SLALIB, the Positional Astronomy Library
|
||||
by P. T. Wallace; and a high-precision planetary ephemeris and
|
||||
associated software from NASA's Jet Propulsion Laboratory.
|
||||
@@ -0,0 +1,316 @@
|
||||
// (C) Copyright Eric Niebler 2004-2005
|
||||
// (C) Copyright Gennadiy Rozental 2001.
|
||||
// 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/test for the library home page.
|
||||
//
|
||||
// File : $RCSfile$
|
||||
//
|
||||
// Version : $Revision$
|
||||
//
|
||||
// Description : this is an abridged version of an excelent BOOST_FOREACH facility
|
||||
// presented by Eric Niebler. I am so fond of it so I can't wait till it
|
||||
// going to be accepted into Boost. Also I need version with less number of dependencies
|
||||
// and more portable. This version doesn't support rvalues and will reeveluate it's
|
||||
// parameters, but should be good enough for my purposes.
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_UTILS_FOREACH_HPP
|
||||
#define BOOST_TEST_UTILS_FOREACH_HPP
|
||||
|
||||
// Boost.Test
|
||||
#include <boost/test/detail/config.hpp>
|
||||
|
||||
// Boost
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/test/detail/workaround.hpp>
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace unit_test {
|
||||
namespace for_each {
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** static_any ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
struct static_any_base
|
||||
{
|
||||
operator bool() const { return false; }
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename Iter>
|
||||
struct static_any : static_any_base
|
||||
{
|
||||
static_any( Iter const& t ) : m_it( t ) {}
|
||||
|
||||
mutable Iter m_it;
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
typedef static_any_base const& static_any_t;
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename Iter>
|
||||
inline Iter&
|
||||
static_any_cast( static_any_t a, Iter* = 0 )
|
||||
{
|
||||
return static_cast<Iter&>( static_cast<static_any<Iter> const&>( a ).m_it );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** is_const ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename C>
|
||||
inline is_const<C>
|
||||
is_const_coll( C& )
|
||||
{
|
||||
return is_const<C>();
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** begin ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename C>
|
||||
inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
|
||||
begin( C& t, mpl::false_ )
|
||||
{
|
||||
return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.begin() );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename C>
|
||||
inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
|
||||
begin( C const& t, mpl::true_ )
|
||||
{
|
||||
return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.begin() );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** end ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename C>
|
||||
inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
|
||||
end( C& t, mpl::false_ )
|
||||
{
|
||||
return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.end() );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename C>
|
||||
inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
|
||||
end( C const& t, mpl::true_ )
|
||||
{
|
||||
return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.end() );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** done ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename C>
|
||||
inline bool
|
||||
done( static_any_t cur, static_any_t end, C&, mpl::false_ )
|
||||
{
|
||||
return static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur ) ==
|
||||
static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( end );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename C>
|
||||
inline bool
|
||||
done( static_any_t cur, static_any_t end, C const&, mpl::true_ )
|
||||
{
|
||||
return static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur ) ==
|
||||
static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( end );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** next ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename C>
|
||||
inline void
|
||||
next( static_any_t cur, C&, mpl::false_ )
|
||||
{
|
||||
++static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename C>
|
||||
inline void
|
||||
next( static_any_t cur, C const&, mpl::true_ )
|
||||
{
|
||||
++static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** prev ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename C>
|
||||
inline void
|
||||
prev( static_any_t cur, C&, mpl::false_ )
|
||||
{
|
||||
--static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename C>
|
||||
inline void
|
||||
prev( static_any_t cur, C const&, mpl::true_ )
|
||||
{
|
||||
--static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** deref ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<class RefType,typename C>
|
||||
inline RefType
|
||||
deref( static_any_t cur, C&, ::boost::type<RefType>, mpl::false_ )
|
||||
{
|
||||
return *static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<class RefType,typename C>
|
||||
inline RefType
|
||||
deref( static_any_t cur, C const&, ::boost::type<RefType>, mpl::true_ )
|
||||
{
|
||||
return *static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** BOOST_TEST_FOREACH ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
#define BOOST_TEST_FE_ANY ::boost::unit_test::for_each::static_any_t
|
||||
#define BOOST_TEST_FE_IS_CONST( COL ) ::boost::unit_test::for_each::is_const_coll( COL )
|
||||
|
||||
#define BOOST_TEST_FE_BEG( COL ) \
|
||||
::boost::unit_test::for_each::begin( \
|
||||
COL, \
|
||||
BOOST_TEST_FE_IS_CONST( COL ) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_FE_END( COL ) \
|
||||
::boost::unit_test::for_each::end( \
|
||||
COL, \
|
||||
BOOST_TEST_FE_IS_CONST( COL ) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_FE_DONE( COL ) \
|
||||
::boost::unit_test::for_each::done( \
|
||||
BOOST_TEST_FE_CUR_VAR, \
|
||||
BOOST_TEST_FE_END_VAR, \
|
||||
COL, \
|
||||
BOOST_TEST_FE_IS_CONST( COL ) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_FE_NEXT( COL ) \
|
||||
::boost::unit_test::for_each::next( \
|
||||
BOOST_TEST_FE_CUR_VAR, \
|
||||
COL, \
|
||||
BOOST_TEST_FE_IS_CONST( COL ) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_FE_PREV( COL ) \
|
||||
::boost::unit_test::for_each::prev( \
|
||||
BOOST_TEST_FE_CUR_VAR, \
|
||||
COL, \
|
||||
BOOST_TEST_FE_IS_CONST( COL ) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_FOREACH_NOOP(COL) \
|
||||
((void)&(COL))
|
||||
|
||||
#define BOOST_TEST_FE_DEREF( COL, RefType ) \
|
||||
::boost::unit_test::for_each::deref( \
|
||||
BOOST_TEST_FE_CUR_VAR, \
|
||||
COL, \
|
||||
::boost::type<RefType >(), \
|
||||
BOOST_TEST_FE_IS_CONST( COL ) ) \
|
||||
/**/
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
|
||||
#define BOOST_TEST_LINE_NUM
|
||||
#else
|
||||
#define BOOST_TEST_LINE_NUM __LINE__
|
||||
#endif
|
||||
|
||||
#define BOOST_TEST_FE_CUR_VAR BOOST_JOIN( _fe_cur_, BOOST_TEST_LINE_NUM )
|
||||
#define BOOST_TEST_FE_END_VAR BOOST_JOIN( _fe_end_, BOOST_TEST_LINE_NUM )
|
||||
#define BOOST_TEST_FE_CON_VAR BOOST_JOIN( _fe_con_, BOOST_TEST_LINE_NUM )
|
||||
|
||||
#define BOOST_TEST_FOREACH( RefType, var, COL ) \
|
||||
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else \
|
||||
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_END( COL ) ) {} else \
|
||||
for( bool BOOST_TEST_FE_CON_VAR = true; \
|
||||
BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL ); \
|
||||
BOOST_TEST_FE_CON_VAR ? BOOST_TEST_FE_NEXT( COL ) : BOOST_FOREACH_NOOP( COL )) \
|
||||
\
|
||||
if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \
|
||||
for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \
|
||||
!BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_REVERSE_FOREACH( RefType, var, COL ) \
|
||||
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_END( COL ) ) {} else \
|
||||
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else \
|
||||
for( bool BOOST_TEST_FE_CON_VAR = true; \
|
||||
BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL ); ) \
|
||||
\
|
||||
if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \
|
||||
if( (BOOST_TEST_FE_PREV( COL ), false) ) {} else \
|
||||
for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \
|
||||
!BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \
|
||||
/**/
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
} // namespace for_each
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_UTILS_FOREACH_HPP
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
Copyright (c) Microsoft Corporation 2014
|
||||
Copyright Rene Rivera 2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_PREDEF_PLAT_WINDOWS_DESKTOP_H
|
||||
#define BOOST_PREDEF_PLAT_WINDOWS_DESKTOP_H
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
#include <boost/predef/os/windows.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_PLAT_WINDOWS_DESKTOP`]
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`!WINAPI_FAMILY`] [__predef_detection__]]
|
||||
[[`WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_PLAT_WINDOWS_DESKTOP BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if BOOST_OS_WINDOWS && \
|
||||
( !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) )
|
||||
# undef BOOST_PLAT_WINDOWS_DESKTOP
|
||||
# define BOOST_PLAT_WINDOWS_DESKTOP BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
# define BOOST_PLAT_WINDOWS_DESKTOP_AVAILABLE
|
||||
# include <boost/predef/detail/platform_detected.h>
|
||||
#endif
|
||||
|
||||
#define BOOST_PLAT_WINDOWS_DESKTOP_NAME "Windows Desktop"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_DESKTOP,BOOST_PLAT_WINDOWS_DESKTOP_NAME)
|
||||
@@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2015
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/intrusive for documentation.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_MINIMAL_LESS_EQUAL_HEADER_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_MINIMAL_LESS_EQUAL_HEADER_HPP
|
||||
#
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
#
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
#
|
||||
#//Try to avoid including <functional>, as it's quite big in C++11
|
||||
#if defined(BOOST_GNU_STDLIB)
|
||||
# include <bits/stl_function.h>
|
||||
#else
|
||||
# include <functional> //Fallback
|
||||
#endif
|
||||
#
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_MINIMAL_LESS_EQUAL_HEADER_HPP
|
||||
Reference in New Issue
Block a user