Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,25 @@
#ifndef BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED
#define BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED
// Copyright Eric Friedman 2002
// Copyright Aleksey Gurtovoy 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$
namespace boost { namespace mpl {
template< typename Tag > struct contains_impl;
template< typename Sequence, typename T > struct contains;
}}
#endif // BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED
@@ -0,0 +1,51 @@
///////////////////////////////////////////////////////////////////////////////
/// \file begin.hpp
/// Proto callables for boost::begin()
//
// Copyright 2012 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PROTO_FUNCTIONAL_RANGE_BEGIN_HPP_EAN_27_08_2012
#define BOOST_PROTO_FUNCTIONAL_RANGE_BEGIN_HPP_EAN_27_08_2012
#include <boost/range/begin.hpp>
#include <boost/proto/proto_fwd.hpp>
namespace boost { namespace proto { namespace functional
{
// A PolymorphicFunctionObject that wraps boost::begin()
struct begin
{
BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
template<typename This, typename Rng>
struct result<This(Rng)>
: boost::range_iterator<Rng const>
{};
template<typename This, typename Rng>
struct result<This(Rng &)>
: boost::range_iterator<Rng>
{};
template<typename Rng>
typename boost::range_iterator<Rng>::type operator()(Rng &rng) const
{
return boost::begin(rng);
}
template<typename Rng>
typename boost::range_iterator<Rng const>::type operator()(Rng const &rng) const
{
return boost::begin(rng);
}
};
}}}
#endif
@@ -0,0 +1,39 @@
#ifndef BOOST_MPL_FRONT_HPP_INCLUDED
#define BOOST_MPL_FRONT_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/front_fwd.hpp>
#include <boost/mpl/aux_/front_impl.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct front
: front_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,front,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, front)
}}
#endif // BOOST_MPL_FRONT_HPP_INCLUDED
@@ -0,0 +1,36 @@
/* boost random/detail/generator_bits.hpp header file
*
* Copyright Steven Watanabe 2011
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id$
*
*/
#ifndef BOOST_RANDOM_DETAIL_GENERATOR_BITS_HPP
#define BOOST_RANDOM_DETAIL_GENERATOR_BITS_HPP
#include <boost/limits.hpp>
namespace boost {
namespace random {
namespace detail {
// This is a temporary measure that retains backwards
// compatibility.
template<class URNG>
struct generator_bits {
static std::size_t value() {
return std::numeric_limits<typename URNG::result_type>::digits;
}
};
} // namespace detail
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_DETAIL_GENERATOR_BITS_HPP
@@ -0,0 +1,60 @@
// Copyright David Abrahams 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)
#ifndef ITERATOR_TRAITS_DWA200347_HPP
# define ITERATOR_TRAITS_DWA200347_HPP
# include <boost/detail/iterator.hpp>
# include <boost/detail/workaround.hpp>
namespace boost {
namespace iterators {
// Macro for supporting old compilers, no longer needed but kept
// for backwards compatibility (it was documented).
#define BOOST_ITERATOR_CATEGORY iterator_category
template <class Iterator>
struct iterator_value
{
typedef typename boost::detail::iterator_traits<Iterator>::value_type type;
};
template <class Iterator>
struct iterator_reference
{
typedef typename boost::detail::iterator_traits<Iterator>::reference type;
};
template <class Iterator>
struct iterator_pointer
{
typedef typename boost::detail::iterator_traits<Iterator>::pointer type;
};
template <class Iterator>
struct iterator_difference
{
typedef typename boost::detail::iterator_traits<Iterator>::difference_type type;
};
template <class Iterator>
struct iterator_category
{
typedef typename boost::detail::iterator_traits<Iterator>::iterator_category type;
};
} // namespace iterators
using iterators::iterator_value;
using iterators::iterator_reference;
using iterators::iterator_pointer;
using iterators::iterator_difference;
using iterators::iterator_category;
} // namespace boost
#endif // ITERATOR_TRAITS_DWA200347_HPP
@@ -0,0 +1,74 @@
# Set paths
EXE_DIR = ../../wsjtx_install
CC = clang
CXX = g++
FC = gfortran
AR = ar cr
MKDIR = mkdir -p
CP = cp
RANLIB = ranlib
RM = rm -f
FFLAGS = -I/opt/local/include -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
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 sgran.o gran.o sync9.o decjt9.o \
fil3.o decoder.o timer.o exp_decode65.o fqso_first.o\
twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\
fillcom.o chkss2.o zplot9.o flat1.o flat2.o \
jt65a.o symspec65.o flat65.o ccf65.o decode65a.o \
filbig.o fil6521.o afc65b.o decode65b.o setup65.o \
extract.o fchisq65.o demod64a.o chkhist.o interleave63.o ccf2.o \
move.o indexx.o graycode65.o twkfreq65.o smo.o smo121.o \
wrapkarn.o init_rs.o encode_rs.o decode_rs.o gen65.o fil4.o \
flat4.o determ.o baddata.o subtract65.o
libjt9.a: $(OBJS1)
$(AR) libjt9.a $(OBJS1)
$(RANLIB) libjt9.a
OBJS7 = jt65.o
jt65: $(OBJS7) libjt9.a libftrsd.a
$(FC) -o jt65 $(OBJS7) -L. -L/opt/local/lib -L./ftrsd -ljt9 -lftrsd -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)
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,49 @@
#ifndef BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
#define BOOST_MPL_NEXT_PRIOR_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/aux_/common_name_wknd.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
BOOST_MPL_AUX_COMMON_NAME_WKND(next)
BOOST_MPL_AUX_COMMON_NAME_WKND(prior)
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct next
{
typedef typename T::next type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,next,(T))
};
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct prior
{
typedef typename T::prior type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,prior,(T))
};
BOOST_MPL_AUX_NA_SPEC(1, next)
BOOST_MPL_AUX_NA_SPEC(1, prior)
}}
#endif // BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
@@ -0,0 +1,179 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTERPROCESS_WINDOWS_NAMED_MUTEX_HPP
#define BOOST_INTERPROCESS_WINDOWS_NAMED_MUTEX_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/creation_tags.hpp>
#include <boost/interprocess/permissions.hpp>
#include <boost/interprocess/detail/interprocess_tester.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <boost/interprocess/sync/windows/sync_utils.hpp>
#include <boost/interprocess/sync/windows/named_sync.hpp>
#include <boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp>
#include <boost/interprocess/errors.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <limits>
namespace boost {
namespace interprocess {
namespace ipcdetail {
class windows_named_mutex
{
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
//Non-copyable
windows_named_mutex();
windows_named_mutex(const windows_named_mutex &);
windows_named_mutex &operator=(const windows_named_mutex &);
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
windows_named_mutex(create_only_t, const char *name, const permissions &perm = permissions());
windows_named_mutex(open_or_create_t, const char *name, const permissions &perm = permissions());
windows_named_mutex(open_only_t, const char *name);
~windows_named_mutex();
void unlock();
void lock();
bool try_lock();
bool timed_lock(const boost::posix_time::ptime &abs_time);
static bool remove(const char *name);
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
private:
friend class interprocess_tester;
void dont_close_on_destruction();
winapi_mutex_wrapper m_mtx_wrapper;
windows_named_sync m_named_sync;
class named_mut_callbacks : public windows_named_sync_interface
{
public:
named_mut_callbacks(winapi_mutex_wrapper &mtx_wrapper)
: m_mtx_wrapper(mtx_wrapper)
{}
virtual std::size_t get_data_size() const
{ return 0u; }
virtual const void *buffer_with_init_data_to_file()
{ return 0; }
virtual const void *buffer_with_final_data_to_file()
{ return 0; }
virtual void *buffer_to_store_init_data_from_file()
{ return 0; }
virtual bool open(create_enum_t, const char *id_name)
{
std::string aux_str = "Global\\bipc.mut.";
aux_str += id_name;
//
permissions mut_perm;
mut_perm.set_unrestricted();
return m_mtx_wrapper.open_or_create(aux_str.c_str(), mut_perm);
}
virtual void close()
{
m_mtx_wrapper.close();
}
virtual ~named_mut_callbacks()
{}
private:
winapi_mutex_wrapper& m_mtx_wrapper;
};
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};
inline windows_named_mutex::~windows_named_mutex()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.close(callbacks);
}
inline void windows_named_mutex::dont_close_on_destruction()
{}
inline windows_named_mutex::windows_named_mutex
(create_only_t, const char *name, const permissions &perm)
: m_mtx_wrapper()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
inline windows_named_mutex::windows_named_mutex
(open_or_create_t, const char *name, const permissions &perm)
: m_mtx_wrapper()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
inline windows_named_mutex::windows_named_mutex(open_only_t, const char *name)
: m_mtx_wrapper()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
}
inline void windows_named_mutex::unlock()
{
m_mtx_wrapper.unlock();
}
inline void windows_named_mutex::lock()
{
m_mtx_wrapper.lock();
}
inline bool windows_named_mutex::try_lock()
{
return m_mtx_wrapper.try_lock();
}
inline bool windows_named_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
{
return m_mtx_wrapper.timed_lock(abs_time);
}
inline bool windows_named_mutex::remove(const char *name)
{
return windows_named_sync::remove(name);
}
} //namespace ipcdetail {
} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
#endif //BOOST_INTERPROCESS_WINDOWS_NAMED_MUTEX_HPP
@@ -0,0 +1,93 @@
/* MAKE-PCHK.C - Make a parity check matrix explicitly. */
/* Copyright (c) 1995-2012 by Radford M. Neal.
*
* Permission is granted for anyone to copy, use, modify, and distribute
* these programs and accompanying documents for any purpose, provided
* this copyright notice is retained and prominently displayed, and note
* is made of any changes made to these programs. These programs and
* documents are distributed without any warranty, express or implied.
* As the programs were written for research purposes only, they have not
* been tested to the degree that would be advisable in any important
* application. All use of these programs is entirely at the user's own
* risk.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "alloc.h"
#include "intio.h"
#include "open.h"
#include "mod2sparse.h"
#include "mod2dense.h"
#include "mod2convert.h"
#include "rcode.h"
void usage(void);
/* MAIN PROGRAM. */
int main
( int argc,
char **argv
)
{
char **bit_specs;
char *file;
FILE *f;
int i, j, k;
char junk;
if (!(file = argv[1])
|| !argv[2] || sscanf(argv[2],"%d%c",&M,&junk)!=1 || M<=0
|| !argv[3] || sscanf(argv[3],"%d%c",&N,&junk)!=1 || N<=0)
{ usage();
}
bit_specs = argv+4;
if (bit_specs[0]==0)
{ usage();
}
H = mod2sparse_allocate(M,N);
for (k = 0; bit_specs[k]!=0; k++)
{ if (sscanf(bit_specs[k],"%d:%d%c",&i,&j,&junk)!=2 || i<0 || j<0)
{ usage();
}
if (i>=M || j>=N)
{ fprintf(stderr,"Bit %d:%d is out of range\n",i,j);
exit(1);
}
mod2sparse_insert(H,i,j);
}
f = open_file_std(file,"wb");
if (f==NULL)
{ fprintf(stderr,"Can't create parity check file: %s\n",file);
exit(1);
}
intio_write(f,('P'<<8)+0x80);
if (ferror(f) || !mod2sparse_write(f,H) || fclose(f)!=0)
{ fprintf(stderr,"Error writing to parity check file %s\n",file);
exit(1);
}
return 0;
}
/* PRINT USAGE MESSAGE AND EXIT. */
void usage(void)
{ fprintf(stderr,"Usage: make-pchk pchk-file n-checks n-bits row:col ...\n");
exit(1);
}
@@ -0,0 +1,44 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002-2011. *
# * (C) Copyright Edward Diener 2011. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_SEQ_HPP
# define BOOST_PREPROCESSOR_SEQ_HPP
#
# include <boost/preprocessor/seq/cat.hpp>
# include <boost/preprocessor/seq/elem.hpp>
# include <boost/preprocessor/seq/enum.hpp>
# include <boost/preprocessor/seq/filter.hpp>
# include <boost/preprocessor/seq/first_n.hpp>
# include <boost/preprocessor/seq/fold_left.hpp>
# include <boost/preprocessor/seq/fold_right.hpp>
# include <boost/preprocessor/seq/for_each.hpp>
# include <boost/preprocessor/seq/for_each_i.hpp>
# include <boost/preprocessor/seq/for_each_product.hpp>
# include <boost/preprocessor/seq/insert.hpp>
# include <boost/preprocessor/seq/pop_back.hpp>
# include <boost/preprocessor/seq/pop_front.hpp>
# include <boost/preprocessor/seq/push_back.hpp>
# include <boost/preprocessor/seq/push_front.hpp>
# include <boost/preprocessor/seq/remove.hpp>
# include <boost/preprocessor/seq/replace.hpp>
# include <boost/preprocessor/seq/rest_n.hpp>
# include <boost/preprocessor/seq/reverse.hpp>
# include <boost/preprocessor/seq/seq.hpp>
# include <boost/preprocessor/seq/size.hpp>
# include <boost/preprocessor/seq/subseq.hpp>
# include <boost/preprocessor/seq/to_array.hpp>
# include <boost/preprocessor/seq/to_list.hpp>
# include <boost/preprocessor/seq/to_tuple.hpp>
# include <boost/preprocessor/seq/transform.hpp>
# include <boost/preprocessor/seq/variadic_seq_to_seq.hpp>
#
# endif
@@ -0,0 +1,59 @@
// (C) Copyright John Maddock 2001.
// (C) Copyright Douglas Gregor 2001.
// (C) Copyright Peter Dimov 2001.
// (C) Copyright Aleksey Gurtovoy 2003.
// (C) Copyright Beman Dawes 2003.
// (C) Copyright Jens Maurer 2003.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// Comeau C++ compiler setup:
#include <boost/config/compiler/common_edg.hpp>
#if (__COMO_VERSION__ <= 4245)
# if defined(_MSC_VER) && _MSC_VER <= 1300
# if _MSC_VER > 100
// only set this in non-strict mode:
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# endif
# endif
// Void returns don't work when emulating VC 6 (Peter Dimov)
// TODO: look up if this doesn't apply to the whole 12xx range
# if defined(_MSC_VER) && (_MSC_VER < 1300)
# define BOOST_NO_VOID_RETURNS
# endif
#endif // version 4245
//
// enable __int64 support in VC emulation mode
//
# if defined(_MSC_VER) && (_MSC_VER >= 1200)
# define BOOST_HAS_MS_INT64
# endif
#define BOOST_COMPILER "Comeau compiler version " BOOST_STRINGIZE(__COMO_VERSION__)
//
// versions check:
// we don't know Comeau prior to version 4245:
#if __COMO_VERSION__ < 4245
# error "Compiler not configured - please reconfigure"
#endif
//
// last known and checked version is 4245:
#if (__COMO_VERSION__ > 4245)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif
@@ -0,0 +1,45 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2006. 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_AS_ARRAY_HPP
#define BOOST_RANGE_AS_ARRAY_HPP
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/range/iterator_range.hpp>
#include <boost/range/detail/str_types.hpp>
namespace boost
{
template< class R >
inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<R>::type >
as_array( R& r )
{
return boost::make_iterator_range( r );
}
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template< class Range >
inline boost::iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type >
as_array( const Range& r )
{
return boost::make_iterator_range( r );
}
#endif
}
#endif
@@ -0,0 +1,44 @@
/*=============================================================================
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)
==============================================================================*/
#ifndef BOOST_PP_IS_ITERATING
#if !defined(FUSION_LIST_TO_CONS_CALL_07192005_0138)
#define FUSION_LIST_TO_CONS_CALL_07192005_0138
#include <boost/preprocessor/iterate.hpp>
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#define BOOST_PP_FILENAME_1 \
<boost/fusion/container/list/detail/cpp03/list_to_cons_call.hpp>
#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE)
#include BOOST_PP_ITERATE()
#endif
#else // defined(BOOST_PP_IS_ITERATING)
///////////////////////////////////////////////////////////////////////////////
//
// Preprocessor vertical repetition code
//
///////////////////////////////////////////////////////////////////////////////
#define N BOOST_PP_ITERATION()
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(BOOST_PP_ENUM_BINARY_PARAMS(
N, typename detail::call_param<T, >::type arg))
{
return type(arg0
#if N > 1
, tail_list_to_cons::call(BOOST_PP_ENUM_SHIFTED_PARAMS(N, arg)));
#else
);
#endif
}
#undef N
#endif // defined(BOOST_PP_IS_ITERATING)
@@ -0,0 +1,24 @@
#ifndef BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED
#define BOOST_MPL_POP_BACK_FWD_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$
namespace boost { namespace mpl {
template< typename Tag > struct pop_back_impl;
template< typename Sequence > struct pop_back;
}}
#endif // BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED
@@ -0,0 +1,238 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2014 Roshan <thisisroshansmail@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_RANDOM_LINEAR_CONGRUENTIAL_ENGINE_HPP
#define BOOST_COMPUTE_RANDOM_LINEAR_CONGRUENTIAL_ENGINE_HPP
#include <algorithm>
#include <boost/compute/types.hpp>
#include <boost/compute/buffer.hpp>
#include <boost/compute/kernel.hpp>
#include <boost/compute/context.hpp>
#include <boost/compute/program.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/algorithm/transform.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/detail/iterator_range_size.hpp>
#include <boost/compute/iterator/discard_iterator.hpp>
#include <boost/compute/utility/program_cache.hpp>
namespace boost {
namespace compute {
///
/// \class linear_congruential_engine
/// \brief 'Quick and Dirty' linear congruential engine
///
/// Quick and dirty linear congruential engine to generate low quality
/// random numbers very quickly. For uses in which good quality of random
/// numbers is required(Monte-Carlo Simulations), use other engines like
/// Mersenne Twister instead.
///
template<class T = uint_>
class linear_congruential_engine
{
public:
typedef T result_type;
static const T default_seed = 1;
static const T a = 1099087573;
static const size_t threads = 1024;
/// Creates a new linear_congruential_engine and seeds it with \p value.
explicit linear_congruential_engine(command_queue &queue,
result_type value = default_seed)
: m_context(queue.get_context()),
m_multiplicands(m_context, threads * sizeof(result_type))
{
// setup program
load_program();
// seed state
seed(value, queue);
// generate multiplicands
generate_multiplicands(queue);
}
/// Creates a new linear_congruential_engine object as a copy of \p other.
linear_congruential_engine(const linear_congruential_engine<T> &other)
: m_context(other.m_context),
m_program(other.m_program),
m_seed(other.m_seed),
m_multiplicands(other.m_multiplicands)
{
}
/// Copies \p other to \c *this.
linear_congruential_engine<T>&
operator=(const linear_congruential_engine<T> &other)
{
if(this != &other){
m_context = other.m_context;
m_program = other.m_program;
m_seed = other.m_seed;
m_multiplicands = other.m_multiplicands;
}
return *this;
}
/// Destroys the linear_congruential_engine object.
~linear_congruential_engine()
{
}
/// Seeds the random number generator with \p value.
///
/// \param value seed value for the random-number generator
/// \param queue command queue to perform the operation
///
/// If no seed value is provided, \c default_seed is used.
void seed(result_type value, command_queue &queue)
{
(void) queue;
m_seed = value;
}
/// \overload
void seed(command_queue &queue)
{
seed(default_seed, queue);
}
/// Generates random numbers and stores them to the range [\p first, \p last).
template<class OutputIterator>
void generate(OutputIterator first, OutputIterator last, command_queue &queue)
{
size_t size = detail::iterator_range_size(first, last);
kernel fill_kernel(m_program, "fill");
fill_kernel.set_arg(1, m_multiplicands);
fill_kernel.set_arg(2, first.get_buffer());
size_t offset = 0;
for(;;){
size_t count = 0;
if(size > threads){
count = (std::min)(static_cast<size_t>(threads), size - offset);
}
else {
count = size;
}
fill_kernel.set_arg(0, static_cast<const uint_>(m_seed));
fill_kernel.set_arg(3, static_cast<const uint_>(offset));
queue.enqueue_1d_range_kernel(fill_kernel, 0, count, 0);
offset += count;
if(offset >= size){
break;
}
update_seed(queue);
}
}
/// \internal_
void generate(discard_iterator first, discard_iterator last, command_queue &queue)
{
(void) queue;
size_t size = detail::iterator_range_size(first, last);
uint_ max_mult =
detail::read_single_value<T>(m_multiplicands, threads-1, queue);
while(size >= threads) {
m_seed *= max_mult;
size -= threads;
}
m_seed *=
detail::read_single_value<T>(m_multiplicands, size-1, queue);
}
/// Generates random numbers, transforms them with \p op, and then stores
/// them to the range [\p first, \p last).
template<class OutputIterator, class Function>
void generate(OutputIterator first, OutputIterator last, Function op, command_queue &queue)
{
vector<T> tmp(std::distance(first, last), queue.get_context());
generate(tmp.begin(), tmp.end(), queue);
transform(tmp.begin(), tmp.end(), first, op, queue);
}
/// Generates \p z random numbers and discards them.
void discard(size_t z, command_queue &queue)
{
generate(discard_iterator(0), discard_iterator(z), queue);
}
private:
/// \internal_
/// Generates the multiplicands for each thread
void generate_multiplicands(command_queue &queue)
{
kernel multiplicand_kernel =
m_program.create_kernel("multiplicand");
multiplicand_kernel.set_arg(0, m_multiplicands);
queue.enqueue_task(multiplicand_kernel);
}
/// \internal_
void update_seed(command_queue &queue)
{
m_seed *=
detail::read_single_value<T>(m_multiplicands, threads-1, queue);
}
/// \internal_
void load_program()
{
boost::shared_ptr<program_cache> cache =
program_cache::get_global_cache(m_context);
std::string cache_key =
std::string("__boost_linear_congruential_engine_") + type_name<T>();
const char source[] =
"__kernel void multiplicand(__global uint *multiplicands)\n"
"{\n"
" uint a = 1099087573;\n"
" multiplicands[0] = a;\n"
" for(uint i = 1; i < 1024; i++){\n"
" multiplicands[i] = a * multiplicands[i-1];\n"
" }\n"
"}\n"
"__kernel void fill(const uint seed,\n"
" __global uint *multiplicands,\n"
" __global uint *result,"
" const uint offset)\n"
"{\n"
" const uint i = get_global_id(0);\n"
" result[offset+i] = seed * multiplicands[i];\n"
"}\n";
m_program = cache->get_or_build(cache_key, std::string(), source, m_context);
}
private:
context m_context;
program m_program;
T m_seed;
buffer m_multiplicands;
};
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_RANDOM_LINEAR_CONGRUENTIAL_ENGINE_HPP
@@ -0,0 +1,25 @@
/*==============================================================================
Copyright (c) 2011 Hartmut Kaiser
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_PHOENIX_PREPROCESSED_EXPRESSION)
#define BOOST_PHOENIX_PREPROCESSED_EXPRESSION
#if BOOST_PHOENIX_LIMIT <= 10
#include <boost/phoenix/core/detail/cpp03/preprocessed/expression_10.hpp>
#elif BOOST_PHOENIX_LIMIT <= 20
#include <boost/phoenix/core/detail/cpp03/preprocessed/expression_20.hpp>
#elif BOOST_PHOENIX_LIMIT <= 30
#include <boost/phoenix/core/detail/cpp03/preprocessed/expression_30.hpp>
#elif BOOST_PHOENIX_LIMIT <= 40
#include <boost/phoenix/core/detail/cpp03/preprocessed/expression_40.hpp>
#elif BOOST_PHOENIX_LIMIT <= 50
#include <boost/phoenix/core/detail/cpp03/preprocessed/expression_50.hpp>
#else
#error "BOOST_PHOENIX_LIMIT out of bounds for preprocessed headers"
#endif
#endif
@@ -0,0 +1,9 @@
0; 0; 0
39; 39; 0
75; 75; 0
111;111; 0
147;147; 0
183;183; 0
219;219; 0
255;255; 0
255;255;255
@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2014-2014
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/intrusive for documentation.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP
#define BOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
namespace boost {
namespace intrusive {
enum algo_types
{
CircularListAlgorithms,
CircularSListAlgorithms,
LinearSListAlgorithms,
CommonSListAlgorithms,
BsTreeAlgorithms,
RbTreeAlgorithms,
AvlTreeAlgorithms,
SgTreeAlgorithms,
SplayTreeAlgorithms,
TreapAlgorithms,
UnorderedAlgorithms,
UnorderedCircularSlistAlgorithms,
AnyAlgorithm
};
template<algo_types AlgoType, class NodeTraits>
struct get_algo;
template<algo_types AlgoType, class ValueTraits, class NodePtrCompare, class ExtraChecker>
struct get_node_checker;
} //namespace intrusive
} //namespace boost
#endif //BOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP
@@ -0,0 +1,87 @@
/*
Copyright Charly Chevalier 2015
Copyright Joel Falcou 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_HARDWARE_SIMD_X86_AMD_H
#define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H
#include <boost/predef/version_number.h>
#include <boost/predef/hardware/simd/x86_amd/versions.h>
/*`
[heading `BOOST_HW_SIMD_X86_AMD`]
The SIMD extension for x86 (AMD) (*if detected*).
Version number depends on the most recent detected extension.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__SSE4A__`] [__predef_detection__]]
[[`__FMA4__`] [__predef_detection__]]
[[`__XOP__`] [__predef_detection__]]
[[`BOOST_HW_SIMD_X86`] [__predef_detection__]]
]
[table
[[__predef_symbol__] [__predef_version__]]
[[`__SSE4A__`] [BOOST_HW_SIMD_X86_SSE4A_VERSION]]
[[`__FMA4__`] [BOOST_HW_SIMD_X86_FMA4_VERSION]]
[[`__XOP__`] [BOOST_HW_SIMD_X86_XOP_VERSION]]
[[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_X86]]
]
[note This predef includes every other x86 SIMD extensions and also has other
more specific extensions (FMA4, XOP, SSE4a). You should use this predef
instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have
been detected.]
*/
#define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
// AMD CPUs also use x86 architecture. We first try to detect if any AMD
// specific extension are detected, if yes, then try to detect more recent x86
// common extensions.
#undef BOOST_HW_SIMD_X86_AMD
#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__)
# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION
#endif
#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__FMA4__)
# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_FMA4_VERSION
#endif
#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__)
# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION
#endif
#if !defined(BOOST_HW_SIMD_X86_AMD)
# define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
#else
// At this point, we know that we have an AMD CPU, we do need to check for
// other x86 extensions to determine the final version number.
# include <boost/predef/hardware/simd/x86.h>
# if BOOST_HW_SIMD_X86 > BOOST_HW_SIMD_X86_AMD
# undef BOOST_HW_SIMD_X86_AMD
# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86
# endif
# define BOOST_HW_SIMD_X86_AMD_AVAILABLE
#endif
#define BOOST_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AMD, BOOST_HW_SIMD_X86_AMD_NAME)
@@ -0,0 +1,56 @@
// (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 : runtime parameters initialization final step
// ***************************************************************************
#ifndef BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
#define BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
// Boost.Test Runtime parameters
#include <boost/test/utils/runtime/parameter.hpp>
#include <boost/test/utils/runtime/argument.hpp>
// Boost.Test
#include <boost/test/utils/foreach.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
namespace boost {
namespace runtime {
inline void
finalize_arguments( parameters_store const& params, runtime::arguments_store& args )
{
BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) {
basic_param_ptr param = v.second;
if( !args.has( param->p_name ) ) {
if( param->p_has_default_value )
param->produce_default( args );
if( !args.has( param->p_name ) ) {
BOOST_TEST_I_ASSRT( param->p_optional,
missing_req_arg( param->p_name ) << "Missing argument for required parameter " << param->p_name << "." );
}
}
if( args.has( param->p_name ) && !!param->p_callback )
param->p_callback( param->p_name );
}
}
} // namespace runtime
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP