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,537 @@
/* boost random/lagged_fibonacci.hpp header file
*
* Copyright Jens Maurer 2000-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 for most recent version including documentation.
*
* $Id$
*
* Revision history
* 2013-10-14 fixed some warnings with Wshadow (mgaunard)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_LAGGED_FIBONACCI_HPP
#define BOOST_RANDOM_LAGGED_FIBONACCI_HPP
#include <istream>
#include <iosfwd>
#include <algorithm> // std::max
#include <iterator>
#include <boost/config/no_tr1/cmath.hpp> // std::pow
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/cstdint.hpp>
#include <boost/integer/integer_mask.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/seed.hpp>
#include <boost/random/detail/operators.hpp>
#include <boost/random/detail/generator_seed_seq.hpp>
namespace boost {
namespace random {
/**
* Instantiations of class template \lagged_fibonacci_engine model a
* \pseudo_random_number_generator. It uses a lagged Fibonacci
* algorithm with two lags @c p and @c q:
* x(i) = x(i-p) + x(i-q) (mod 2<sup>w</sup>) with p > q.
*/
template<class UIntType, int w, unsigned int p, unsigned int q>
class lagged_fibonacci_engine
{
public:
typedef UIntType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(unsigned int, long_lag = p);
BOOST_STATIC_CONSTANT(unsigned int, short_lag = q);
BOOST_STATIC_CONSTANT(UIntType, default_seed = 331u);
/** Returns the smallest value that the generator can produce. */
static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
/** Returns the largest value that the generator can produce. */
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{ return low_bits_mask_t<w>::sig_bits; }
/** Creates a new @c lagged_fibonacci_engine and calls @c seed(). */
lagged_fibonacci_engine() { seed(); }
/** Creates a new @c lagged_fibonacci_engine and calls @c seed(value). */
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(lagged_fibonacci_engine,
UIntType, value)
{ seed(value); }
/** Creates a new @c lagged_fibonacci_engine and calls @c seed(seq). */
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(lagged_fibonacci_engine,
SeedSeq, seq)
{ seed(seq); }
/**
* Creates a new @c lagged_fibonacci_engine and calls @c seed(first, last).
*/
template<class It> lagged_fibonacci_engine(It& first, It last)
{ seed(first, last); }
// compiler-generated copy ctor and assignment operator are fine
/** Calls @c seed(default_seed). */
void seed() { seed(default_seed); }
/**
* Sets the state of the generator to values produced by
* a \minstd_rand0 generator.
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(lagged_fibonacci_engine,
UIntType, value)
{
minstd_rand0 intgen(static_cast<boost::uint32_t>(value));
detail::generator_seed_seq<minstd_rand0> gen(intgen);
seed(gen);
}
/**
* Sets the state of the generator using values produced by seq.
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(lagged_fibonacci_engine, SeedSeq, seq)
{
detail::seed_array_int<w>(seq, x);
i = long_lag;
}
/**
* Sets the state of the generator to values from the iterator
* range [first, last). If there are not enough elements in the
* range [first, last) throws @c std::invalid_argument.
*/
template<class It>
void seed(It& first, It last)
{
detail::fill_array_int<w>(first, last, x);
i = long_lag;
}
/** Returns the next value of the generator. */
result_type operator()()
{
if(i >= long_lag)
fill();
return x[i++];
}
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
{ detail::generate_from_int(*this, first, last); }
/** Advances the state of the generator by @c z. */
void discard(boost::uintmax_t z)
{
for(boost::uintmax_t j = 0; j < z; ++j) {
(*this)();
}
}
/**
* Writes the textual representation of the generator to a @c std::ostream.
*/
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, lagged_fibonacci_engine, f)
{
os << f.i;
for(unsigned int j = 0; j < f.long_lag; ++j)
os << ' ' << f.x[j];
return os;
}
/**
* Reads the textual representation of the generator from a @c std::istream.
*/
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, lagged_fibonacci_engine, f)
{
is >> f.i >> std::ws;
for(unsigned int j = 0; j < f.long_lag; ++j)
is >> f.x[j] >> std::ws;
return is;
}
/**
* Returns true if the two generators will produce identical
* sequences of outputs.
*/
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_engine, x_, y_)
{ return x_.i == y_.i && std::equal(x_.x, x_.x+long_lag, y_.x); }
/**
* Returns true if the two generators will produce different
* sequences of outputs.
*/
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(lagged_fibonacci_engine)
private:
/// \cond show_private
void fill();
/// \endcond
unsigned int i;
UIntType x[long_lag];
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UIntType, int w, unsigned int p, unsigned int q>
const bool lagged_fibonacci_engine<UIntType, w, p, q>::has_fixed_range;
template<class UIntType, int w, unsigned int p, unsigned int q>
const unsigned int lagged_fibonacci_engine<UIntType, w, p, q>::long_lag;
template<class UIntType, int w, unsigned int p, unsigned int q>
const unsigned int lagged_fibonacci_engine<UIntType, w, p, q>::short_lag;
template<class UIntType, int w, unsigned int p, unsigned int q>
const UIntType lagged_fibonacci_engine<UIntType, w, p, q>::default_seed;
#endif
/// \cond show_private
template<class UIntType, int w, unsigned int p, unsigned int q>
void lagged_fibonacci_engine<UIntType, w, p, q>::fill()
{
// two loops to avoid costly modulo operations
{ // extra scope for MSVC brokenness w.r.t. for scope
for(unsigned int j = 0; j < short_lag; ++j)
x[j] = (x[j] + x[j+(long_lag-short_lag)]) & low_bits_mask_t<w>::sig_bits;
}
for(unsigned int j = short_lag; j < long_lag; ++j)
x[j] = (x[j] + x[j-short_lag]) & low_bits_mask_t<w>::sig_bits;
i = 0;
}
/// \endcond
/// \cond show_deprecated
// provided for backwards compatibility
template<class UIntType, int w, unsigned int p, unsigned int q, UIntType v = 0>
class lagged_fibonacci : public lagged_fibonacci_engine<UIntType, w, p, q>
{
typedef lagged_fibonacci_engine<UIntType, w, p, q> base_type;
public:
lagged_fibonacci() {}
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(lagged_fibonacci, UIntType, val)
{ this->seed(val); }
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(lagged_fibonacci, SeedSeq, seq)
{ this->seed(seq); }
template<class It>
lagged_fibonacci(It& first, It last) : base_type(first, last) {}
};
/// \endcond
// lagged Fibonacci generator for the range [0..1)
// contributed by Matthias Troyer
// for p=55, q=24 originally by G. J. Mitchell and D. P. Moore 1958
/**
* Instantiations of class template @c lagged_fibonacci_01 model a
* \pseudo_random_number_generator. It uses a lagged Fibonacci
* algorithm with two lags @c p and @c q, evaluated in floating-point
* arithmetic: x(i) = x(i-p) + x(i-q) (mod 1) with p > q. See
*
* @blockquote
* "Uniform random number generators for supercomputers", Richard Brent,
* Proc. of Fifth Australian Supercomputer Conference, Melbourne,
* Dec. 1992, pp. 704-706.
* @endblockquote
*
* @xmlnote
* The quality of the generator crucially depends on the choice
* of the parameters. User code should employ one of the sensibly
* parameterized generators such as \lagged_fibonacci607 instead.
* @endxmlnote
*
* The generator requires considerable amounts of memory for the storage
* of its state array. For example, \lagged_fibonacci607 requires about
* 4856 bytes and \lagged_fibonacci44497 requires about 350 KBytes.
*/
template<class RealType, int w, unsigned int p, unsigned int q>
class lagged_fibonacci_01_engine
{
public:
typedef RealType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(unsigned int, long_lag = p);
BOOST_STATIC_CONSTANT(unsigned int, short_lag = q);
BOOST_STATIC_CONSTANT(boost::uint32_t, default_seed = 331u);
/** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(). */
lagged_fibonacci_01_engine() { seed(); }
/** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(value). */
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(lagged_fibonacci_01_engine, uint32_t, value)
{ seed(value); }
/** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(gen). */
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(lagged_fibonacci_01_engine, SeedSeq, seq)
{ seed(seq); }
template<class It> lagged_fibonacci_01_engine(It& first, It last)
{ seed(first, last); }
// compiler-generated copy ctor and assignment operator are fine
/** Calls seed(default_seed). */
void seed() { seed(default_seed); }
/**
* Constructs a \minstd_rand0 generator with the constructor parameter
* value and calls seed with it. Distinct seeds in the range
* [1, 2147483647) will produce generators with different states. Other
* seeds will be equivalent to some seed within this range. See
* \linear_congruential_engine for details.
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(lagged_fibonacci_01_engine, boost::uint32_t, value)
{
minstd_rand0 intgen(value);
detail::generator_seed_seq<minstd_rand0> gen(intgen);
seed(gen);
}
/**
* Seeds this @c lagged_fibonacci_01_engine using values produced by
* @c seq.generate.
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(lagged_fibonacci_01_engine, SeedSeq, seq)
{
detail::seed_array_real<w>(seq, x);
i = long_lag;
}
/**
* Seeds this @c lagged_fibonacci_01_engine using values from the
* iterator range [first, last). If there are not enough elements
* in the range, throws @c std::invalid_argument.
*/
template<class It>
void seed(It& first, It last)
{
detail::fill_array_real<w>(first, last, x);
i = long_lag;
}
/** Returns the smallest value that the generator can produce. */
static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return result_type(0); }
/** Returns the upper bound of the generators outputs. */
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return result_type(1); }
/** Returns the next value of the generator. */
result_type operator()()
{
if(i >= long_lag)
fill();
return x[i++];
}
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
{ return detail::generate_from_real(*this, first, last); }
/** Advances the state of the generator by @c z. */
void discard(boost::uintmax_t z)
{
for(boost::uintmax_t j = 0; j < z; ++j) {
(*this)();
}
}
/**
* Writes the textual representation of the generator to a @c std::ostream.
*/
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, lagged_fibonacci_01_engine, f)
{
// allow for Koenig lookup
using std::pow;
os << f.i;
std::ios_base::fmtflags oldflags = os.flags(os.dec | os.fixed | os.left);
for(unsigned int j = 0; j < f.long_lag; ++j)
os << ' ' << f.x[j] * f.modulus();
os.flags(oldflags);
return os;
}
/**
* Reads the textual representation of the generator from a @c std::istream.
*/
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, lagged_fibonacci_01_engine, f)
{
is >> f.i;
for(unsigned int j = 0; j < f.long_lag; ++j) {
typename lagged_fibonacci_01_engine::result_type value;
is >> std::ws >> value;
f.x[j] = value / f.modulus();
}
return is;
}
/**
* Returns true if the two generators will produce identical
* sequences of outputs.
*/
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_01_engine, x_, y_)
{ return x_.i == y_.i && std::equal(x_.x, x_.x+long_lag, y_.x); }
/**
* Returns true if the two generators will produce different
* sequences of outputs.
*/
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(lagged_fibonacci_01_engine)
private:
/// \cond show_private
void fill();
static RealType modulus()
{
using std::pow;
return pow(RealType(2), word_size);
}
/// \endcond
unsigned int i;
RealType x[long_lag];
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class RealType, int w, unsigned int p, unsigned int q>
const bool lagged_fibonacci_01_engine<RealType, w, p, q>::has_fixed_range;
template<class RealType, int w, unsigned int p, unsigned int q>
const unsigned int lagged_fibonacci_01_engine<RealType, w, p, q>::long_lag;
template<class RealType, int w, unsigned int p, unsigned int q>
const unsigned int lagged_fibonacci_01_engine<RealType, w, p, q>::short_lag;
template<class RealType, int w, unsigned int p, unsigned int q>
const int lagged_fibonacci_01_engine<RealType,w,p,q>::word_size;
template<class RealType, int w, unsigned int p, unsigned int q>
const boost::uint32_t lagged_fibonacci_01_engine<RealType,w,p,q>::default_seed;
#endif
/// \cond show_private
template<class RealType, int w, unsigned int p, unsigned int q>
void lagged_fibonacci_01_engine<RealType, w, p, q>::fill()
{
// two loops to avoid costly modulo operations
{ // extra scope for MSVC brokenness w.r.t. for scope
for(unsigned int j = 0; j < short_lag; ++j) {
RealType t = x[j] + x[j+(long_lag-short_lag)];
if(t >= RealType(1))
t -= RealType(1);
x[j] = t;
}
}
for(unsigned int j = short_lag; j < long_lag; ++j) {
RealType t = x[j] + x[j-short_lag];
if(t >= RealType(1))
t -= RealType(1);
x[j] = t;
}
i = 0;
}
/// \endcond
/// \cond show_deprecated
// provided for backwards compatibility
template<class RealType, int w, unsigned int p, unsigned int q>
class lagged_fibonacci_01 : public lagged_fibonacci_01_engine<RealType, w, p, q>
{
typedef lagged_fibonacci_01_engine<RealType, w, p, q> base_type;
public:
lagged_fibonacci_01() {}
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(lagged_fibonacci_01, boost::uint32_t, val)
{ this->seed(val); }
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(lagged_fibonacci_01, SeedSeq, seq)
{ this->seed(seq); }
template<class It>
lagged_fibonacci_01(It& first, It last) : base_type(first, last) {}
};
/// \endcond
namespace detail {
template<class Engine>
struct generator_bits;
template<class RealType, int w, unsigned int p, unsigned int q>
struct generator_bits<lagged_fibonacci_01_engine<RealType, w, p, q> >
{
static std::size_t value() { return w; }
};
template<class RealType, int w, unsigned int p, unsigned int q>
struct generator_bits<lagged_fibonacci_01<RealType, w, p, q> >
{
static std::size_t value() { return w; }
};
}
#ifdef BOOST_RANDOM_DOXYGEN
namespace detail {
/**
* The specializations lagged_fibonacci607 ... lagged_fibonacci44497
* use well tested lags.
*
* See
*
* @blockquote
* "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent
* Computer Sciences Laboratory Australian National University, December 1992
* @endblockquote
*
* The lags used here can be found in
*
* @blockquote
* "Uniform random number generators for supercomputers", Richard Brent,
* Proc. of Fifth Australian Supercomputer Conference, Melbourne,
* Dec. 1992, pp. 704-706.
* @endblockquote
*/
struct lagged_fibonacci_doc {};
}
#endif
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 607, 273> lagged_fibonacci607;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 1279, 418> lagged_fibonacci1279;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 2281, 1252> lagged_fibonacci2281;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 3217, 576> lagged_fibonacci3217;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 4423, 2098> lagged_fibonacci4423;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 9689, 5502> lagged_fibonacci9689;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 19937, 9842> lagged_fibonacci19937;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 23209, 13470> lagged_fibonacci23209;
/** @copydoc boost::random::detail::lagged_fibonacci_doc */
typedef lagged_fibonacci_01_engine<double, 48, 44497, 21034> lagged_fibonacci44497;
} // namespace random
using random::lagged_fibonacci607;
using random::lagged_fibonacci1279;
using random::lagged_fibonacci2281;
using random::lagged_fibonacci3217;
using random::lagged_fibonacci4423;
using random::lagged_fibonacci9689;
using random::lagged_fibonacci19937;
using random::lagged_fibonacci23209;
using random::lagged_fibonacci44497;
} // namespace boost
#endif // BOOST_RANDOM_LAGGED_FIBONACCI_HPP
@@ -0,0 +1,61 @@
/*
[auto_generated]
boost/numeric/odeint/external/vexcl/vexcl_abs.hpp
[begin_description]
abs() specialization for vexcl
[end_description]
Copyright 2009-2013 Karsten Ahnert
Copyright 2009-2013 Mario Mulansky
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED
#include <vexcl/vector.hpp>
#include <vexcl/multivector.hpp>
#include <vexcl/operations.hpp>
namespace vex {
template <typename T, size_t N>
typename std::enable_if<
std::is_integral<T>::value,
typename boost::proto::result_of::make_expr<
boost::proto::tag::function,
abs_func,
const vex::multivector<T, N>&
>::type const
>::type
abs(const multivector<T, N> &arg) {
return boost::proto::make_expr<boost::proto::tag::function>(
abs_func(),
boost::ref(arg)
);
}
template <typename T, size_t N>
typename std::enable_if<
!std::is_integral<T>::value,
typename boost::proto::result_of::make_expr<
boost::proto::tag::function,
fabs_func,
const vex::multivector<T, N>&
>::type const
>::type
abs(const multivector<T, N> &arg) {
return boost::proto::make_expr<boost::proto::tag::function>(
fabs_func(),
boost::ref(arg)
);
}
} // namespace vex
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED
@@ -0,0 +1,313 @@
// ----------------------------------------------------------------------------
// alt_sstream_impl.hpp : alternative stringstream, templates implementation
// ----------------------------------------------------------------------------
// Copyright Samuel Krempp 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/libs/format for library home page
// ----------------------------------------------------------------------------
#ifndef BOOST_SK_ALT_SSTREAM_IMPL_HPP
#define BOOST_SK_ALT_SSTREAM_IMPL_HPP
namespace boost {
namespace io {
// --- Implementation ------------------------------------------------------//
template<class Ch, class Tr, class Alloc>
void basic_altstringbuf<Ch, Tr, Alloc>::
clear_buffer () {
const Ch * p = pptr();
const Ch * b = pbase();
if(p != NULL && p != b) {
seekpos(0, ::std::ios_base::out);
}
p = gptr();
b = eback();
if(p != NULL && p != b) {
seekpos(0, ::std::ios_base::in);
}
}
template<class Ch, class Tr, class Alloc>
void basic_altstringbuf<Ch, Tr, Alloc>::
str (const string_type& s) {
size_type sz=s.size();
if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) {
#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
void *vd_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
Ch *new_ptr = static_cast<Ch *>(vd_ptr);
#else
Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
#endif
// if this didnt throw, we're safe, update the buffer
dealloc();
sz = s.copy(new_ptr, sz);
putend_ = new_ptr + sz;
if(mode_ & ::std::ios_base::in)
streambuf_t::setg(new_ptr, new_ptr, new_ptr + sz);
if(mode_ & ::std::ios_base::out) {
streambuf_t::setp(new_ptr, new_ptr + sz);
if(mode_ & (::std::ios_base::app | ::std::ios_base::ate))
streambuf_t::pbump(static_cast<int>(sz));
if(gptr() == NULL)
streambuf_t::setg(new_ptr, NULL, new_ptr);
}
is_allocated_ = true;
}
else
dealloc();
}
template<class Ch, class Tr, class Alloc>
Ch* basic_altstringbuf<Ch, Tr, Alloc>::
begin () const {
if(mode_ & ::std::ios_base::out && pptr() != NULL)
return pbase();
else if(mode_ & ::std::ios_base::in && gptr() != NULL)
return eback();
return NULL;
}
template<class Ch, class Tr, class Alloc>
typename std::basic_string<Ch,Tr,Alloc>::size_type
basic_altstringbuf<Ch, Tr, Alloc>::
size () const {
if(mode_ & ::std::ios_base::out && pptr())
return static_cast<size_type>(pend() - pbase());
else if(mode_ & ::std::ios_base::in && gptr())
return static_cast<size_type>(egptr() - eback());
else
return 0;
}
template<class Ch, class Tr, class Alloc>
typename std::basic_string<Ch,Tr,Alloc>::size_type
basic_altstringbuf<Ch, Tr, Alloc>::
cur_size () const {
if(mode_ & ::std::ios_base::out && pptr())
return static_cast<streamsize>( pptr() - pbase());
else if(mode_ & ::std::ios_base::in && gptr())
return static_cast<streamsize>( gptr() - eback());
else
return 0;
}
template<class Ch, class Tr, class Alloc>
typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
basic_altstringbuf<Ch, Tr, Alloc>::
seekoff (off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) {
if(pptr() != NULL && putend_ < pptr())
putend_ = pptr();
if(which & ::std::ios_base::in && gptr() != NULL) {
// get area
if(way == ::std::ios_base::end)
off += static_cast<off_type>(putend_ - gptr());
else if(way == ::std::ios_base::beg)
off += static_cast<off_type>(eback() - gptr());
else if(way != ::std::ios_base::cur || (which & ::std::ios_base::out) )
// (altering in&out is only supported if way is beg or end, not cur)
return pos_type(off_type(-1));
if(eback() <= off+gptr() && off+gptr() <= putend_ ) {
// set gptr
streambuf_t::gbump(static_cast<int>(off));
if(which & ::std::ios_base::out && pptr() != NULL)
// update pptr to match gptr
streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
}
else
off = off_type(-1);
}
else if(which & ::std::ios_base::out && pptr() != NULL) {
// put area
if(way == ::std::ios_base::end)
off += static_cast<off_type>(putend_ - pptr());
else if(way == ::std::ios_base::beg)
off += static_cast<off_type>(pbase() - pptr());
else if(way != ::std::ios_base::beg)
return pos_type(off_type(-1));
if(pbase() <= off+pptr() && off+pptr() <= putend_)
// set pptr
streambuf_t::pbump(static_cast<int>(off));
else
off = off_type(-1);
}
else // neither in nor out
off = off_type(-1);
return (pos_type(off));
}
//- end seekoff(..)
template<class Ch, class Tr, class Alloc>
typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
basic_altstringbuf<Ch, Tr, Alloc>::
seekpos (pos_type pos, ::std::ios_base::openmode which) {
off_type off = off_type(pos); // operation guaranteed by fpos.operations table 127
if(pptr() != NULL && putend_ < pptr())
putend_ = pptr();
if(off != off_type(-1)) {
if(which & ::std::ios_base::in && gptr() != NULL) {
// get area
if(0 <= off && off <= putend_ - eback()) {
streambuf_t::gbump(static_cast<int>(eback() - gptr() + off));
if(which & ::std::ios_base::out && pptr() != NULL) {
// update pptr to match gptr
streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
}
}
else
off = off_type(-1);
}
else if(which & ::std::ios_base::out && pptr() != NULL) {
// put area
if(0 <= off && off <= putend_ - eback())
streambuf_t::pbump(static_cast<int>(eback() - pptr() + off));
else
off = off_type(-1);
}
else // neither in nor out
off = off_type(-1);
return (pos_type(off));
}
else {
BOOST_ASSERT(0); // fpos.operations allows undefined-behaviour here
return pos_type(off_type(-1));
}
}
// -end seekpos(..)
template<class Ch, class Tr, class Alloc>
typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
basic_altstringbuf<Ch, Tr, Alloc>::
underflow () {
if(gptr() == NULL) // no get area -> nothing to get.
return (compat_traits_type::eof());
else if(gptr() < egptr()) // ok, in buffer
return (compat_traits_type::to_int_type(*gptr()));
else if(mode_ & ::std::ios_base::in && pptr() != NULL
&& (gptr() < pptr() || gptr() < putend_) )
{ // expand get area
if(putend_ < pptr())
putend_ = pptr(); // remember pptr reached this far
streambuf_t::setg(eback(), gptr(), putend_);
return (compat_traits_type::to_int_type(*gptr()));
}
else // couldnt get anything. EOF.
return (compat_traits_type::eof());
}
// -end underflow(..)
template<class Ch, class Tr, class Alloc>
typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
basic_altstringbuf<Ch, Tr, Alloc>::
pbackfail (int_type meta) {
if(gptr() != NULL && (eback() < gptr())
&& (mode_ & (::std::ios_base::out)
|| compat_traits_type::eq_int_type(compat_traits_type::eof(), meta)
|| compat_traits_type::eq(compat_traits_type::to_char_type(meta), gptr()[-1]) ) ) {
streambuf_t::gbump(-1); // back one character
if(!compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
// put-back meta into get area
*gptr() = compat_traits_type::to_char_type(meta);
return (compat_traits_type::not_eof(meta));
}
else
return (compat_traits_type::eof()); // failed putback
}
// -end pbackfail(..)
template<class Ch, class Tr, class Alloc>
typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
basic_altstringbuf<Ch, Tr, Alloc>::
overflow (int_type meta) {
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4996)
#endif
if(compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
return compat_traits_type::not_eof(meta); // nothing to do
else if(pptr() != NULL && pptr() < epptr()) {
streambuf_t::sputc(compat_traits_type::to_char_type(meta));
return meta;
}
else if(! (mode_ & ::std::ios_base::out))
// no write position, and cant make one
return compat_traits_type::eof();
else { // make a write position available
std::size_t prev_size = pptr() == NULL ? 0 : epptr() - eback();
std::size_t new_size = prev_size;
// exponential growth : size *= 1.5
std::size_t add_size = new_size / 2;
if(add_size < alloc_min)
add_size = alloc_min;
Ch * newptr = NULL, *oldptr = eback();
// make sure adding add_size wont overflow size_t
while (0 < add_size && ((std::numeric_limits<std::size_t>::max)()
- add_size < new_size) )
add_size /= 2;
if(0 < add_size) {
new_size += add_size;
#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
void *vdptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
newptr = static_cast<Ch *>(vdptr);
#else
newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
#endif
}
if(0 < prev_size)
compat_traits_type::copy(newptr, oldptr, prev_size);
if(is_allocated_)
alloc_.deallocate(oldptr, prev_size);
is_allocated_=true;
if(prev_size == 0) { // first allocation
putend_ = newptr;
streambuf_t::setp(newptr, newptr + new_size);
if(mode_ & ::std::ios_base::in)
streambuf_t::setg(newptr, newptr, newptr + 1);
else
streambuf_t::setg(newptr, 0, newptr);
}
else { // update pointers
putend_ = putend_ - oldptr + newptr;
int pptr_count = static_cast<int>(pptr()-pbase());
int gptr_count = static_cast<int>(gptr()-eback());
streambuf_t::setp(pbase() - oldptr + newptr, newptr + new_size);
streambuf_t::pbump(pptr_count);
if(mode_ & ::std::ios_base::in)
streambuf_t::setg(newptr, newptr + gptr_count, pptr() + 1);
else
streambuf_t::setg(newptr, 0, newptr);
}
streambuf_t::sputc(compat_traits_type::to_char_type(meta));
return meta;
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}
// -end overflow(..)
template<class Ch, class Tr, class Alloc>
void basic_altstringbuf<Ch, Tr, Alloc>:: dealloc() {
if(is_allocated_)
alloc_.deallocate(eback(), (pptr() != NULL ? epptr() : egptr()) - eback());
is_allocated_ = false;
streambuf_t::setg(0, 0, 0);
streambuf_t::setp(0, 0);
putend_ = NULL;
}
}// N.S. io
} // N.S. boost
#endif // include guard
@@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct at_impl;
template <>
struct at_impl<struct_tag>
{
template <typename Seq, typename N>
struct apply
: access::struct_member<
typename remove_const<Seq>::type
, N::value
>::template apply<Seq>
{};
};
template <>
struct at_impl<assoc_struct_tag>
: at_impl<struct_tag>
{};
}}}
#endif
@@ -0,0 +1,319 @@
/*=============================================================================
Copyright (c) 2001-2003 Joel de Guzman
Copyright (c) 2002-2003 Hartmut Kaiser
Copyright (c) 2003 Gustavo Guerra
http://spirit.sourceforge.net/
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_SPIRIT_DEBUG_NODE_HPP)
#define BOOST_SPIRIT_DEBUG_NODE_HPP
#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP)
#error "You must include boost/spirit/debug.hpp, not boost/spirit/debug/debug_node.hpp"
#endif
#if defined(BOOST_SPIRIT_DEBUG)
#include <string>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/primitives/primitives.hpp> // for iscntrl_
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
//
// Debug helper classes for rules, which ensure maximum non-intrusiveness of
// the Spirit debug support
//
///////////////////////////////////////////////////////////////////////////////
namespace impl {
struct token_printer_aux_for_chars
{
template<typename CharT>
static void print(std::ostream& o, CharT c)
{
if (c == static_cast<CharT>('\a'))
o << "\\a";
else if (c == static_cast<CharT>('\b'))
o << "\\b";
else if (c == static_cast<CharT>('\f'))
o << "\\f";
else if (c == static_cast<CharT>('\n'))
o << "\\n";
else if (c == static_cast<CharT>('\r'))
o << "\\r";
else if (c == static_cast<CharT>('\t'))
o << "\\t";
else if (c == static_cast<CharT>('\v'))
o << "\\v";
else if (iscntrl_(c))
o << "\\" << static_cast<int>(c);
else
o << static_cast<char>(c);
}
};
// for token types where the comparison with char constants wouldn't work
struct token_printer_aux_for_other_types
{
template<typename CharT>
static void print(std::ostream& o, CharT c)
{
o << c;
}
};
template <typename CharT>
struct token_printer_aux
: mpl::if_<
mpl::and_<
is_convertible<CharT, char>,
is_convertible<char, CharT> >,
token_printer_aux_for_chars,
token_printer_aux_for_other_types
>::type
{
};
template<typename CharT>
inline void token_printer(std::ostream& o, CharT c)
{
#if !defined(BOOST_SPIRIT_DEBUG_TOKEN_PRINTER)
token_printer_aux<CharT>::print(o, c);
#else
BOOST_SPIRIT_DEBUG_TOKEN_PRINTER(o, c);
#endif
}
///////////////////////////////////////////////////////////////////////////////
//
// Dump infos about the parsing state of a rule
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
template <typename IteratorT>
inline void
print_node_info(bool hit, int level, bool close, std::string const& name,
IteratorT first, IteratorT last)
{
if (!name.empty())
{
for (int i = 0; i < level; ++i)
BOOST_SPIRIT_DEBUG_OUT << " ";
if (close)
{
if (hit)
BOOST_SPIRIT_DEBUG_OUT << "/";
else
BOOST_SPIRIT_DEBUG_OUT << "#";
}
BOOST_SPIRIT_DEBUG_OUT << name << ":\t\"";
IteratorT iter = first;
IteratorT ilast = last;
for (int j = 0; j < BOOST_SPIRIT_DEBUG_PRINT_SOME; ++j)
{
if (iter == ilast)
break;
token_printer(BOOST_SPIRIT_DEBUG_OUT, *iter);
++iter;
}
BOOST_SPIRIT_DEBUG_OUT << "\"\n";
}
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
template <typename ResultT>
inline ResultT &
print_closure_info(ResultT &hit, int level, std::string const& name)
{
if (!name.empty())
{
for (int i = 0; i < level-1; ++i)
BOOST_SPIRIT_DEBUG_OUT << " ";
// for now, print out the return value only
BOOST_SPIRIT_DEBUG_OUT << "^" << name << ":\t";
if (hit.has_valid_attribute())
BOOST_SPIRIT_DEBUG_OUT << hit.value();
else
BOOST_SPIRIT_DEBUG_OUT << "undefined attribute";
BOOST_SPIRIT_DEBUG_OUT << "\n";
}
return hit;
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
}
///////////////////////////////////////////////////////////////////////////////
//
// Implementation note: The parser_context_linker, parser_scanner_linker and
// closure_context_linker classes are wrapped by a PP constant to allow
// redefinition of this classes outside of Spirit
//
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED)
#define BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED
///////////////////////////////////////////////////////////////////////////
//
// parser_context_linker is a debug wrapper for the ContextT template
// parameter of the rule<>, subrule<> and the grammar<> classes
//
///////////////////////////////////////////////////////////////////////////
template<typename ContextT>
struct parser_context_linker : public ContextT
{
typedef ContextT base_t;
template <typename ParserT>
parser_context_linker(ParserT const& p)
: ContextT(p) {}
template <typename ParserT, typename ScannerT>
void pre_parse(ParserT const& p, ScannerT &scan)
{
this->base_t::pre_parse(p, scan);
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
if (trace_parser(p.derived())) {
impl::print_node_info(
false,
scan.get_level(),
false,
parser_name(p.derived()),
scan.first,
scan.last);
}
scan.get_level()++;
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
}
template <typename ResultT, typename ParserT, typename ScannerT>
ResultT& post_parse(ResultT& hit, ParserT const& p, ScannerT &scan)
{
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
--scan.get_level();
if (trace_parser(p.derived())) {
impl::print_node_info(
hit,
scan.get_level(),
true,
parser_name(p.derived()),
scan.first,
scan.last);
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
return this->base_t::post_parse(hit, p, scan);
}
};
#endif // !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED)
#if !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED)
#define BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED
///////////////////////////////////////////////////////////////////////////////
// This class is to avoid linker problems and to ensure a real singleton
// 'level' variable
struct debug_support
{
int& get_level()
{
static int level = 0;
return level;
}
};
template<typename ScannerT>
struct parser_scanner_linker : public ScannerT
{
parser_scanner_linker(ScannerT const &scan_) : ScannerT(scan_)
{}
int &get_level()
{ return debug.get_level(); }
private: debug_support debug;
};
#endif // !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED)
#if !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED)
#define BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED
///////////////////////////////////////////////////////////////////////////
//
// closure_context_linker is a debug wrapper for the closure template
// parameter of the rule<>, subrule<> and grammar classes
//
///////////////////////////////////////////////////////////////////////////
template<typename ContextT>
struct closure_context_linker : public parser_context_linker<ContextT>
{
typedef parser_context_linker<ContextT> base_t;
template <typename ParserT>
closure_context_linker(ParserT const& p)
: parser_context_linker<ContextT>(p) {}
template <typename ParserT, typename ScannerT>
void pre_parse(ParserT const& p, ScannerT &scan)
{ this->base_t::pre_parse(p, scan); }
template <typename ResultT, typename ParserT, typename ScannerT>
ResultT&
post_parse(ResultT& hit, ParserT const& p, ScannerT &scan)
{
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
if (hit && trace_parser(p.derived())) {
// for now, print out the return value only
return impl::print_closure_info(
this->base_t::post_parse(hit, p, scan),
scan.get_level(),
parser_name(p.derived())
);
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
return this->base_t::post_parse(hit, p, scan);
}
};
#endif // !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED)
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
#endif // defined(BOOST_SPIRIT_DEBUG)
#endif // !defined(BOOST_SPIRIT_DEBUG_NODE_HPP)
@@ -0,0 +1,347 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
template <typename T, typename A0>
inline
typename expression::new_<detail::target<T>, A0>::type const
new_(A0 const& a0)
{
return
expression::
new_<detail::target<T>, A0>::
make(detail::target<T>(), a0);
}
template <typename T, typename A0 , typename A1>
inline
typename expression::new_<detail::target<T>, A0 , A1>::type const
new_(A0 const& a0 , A1 const& a1)
{
return
expression::
new_<detail::target<T>, A0 , A1>::
make(detail::target<T>(), a0 , a1);
}
template <typename T, typename A0 , typename A1 , typename A2>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2>::
make(detail::target<T>(), a0 , a1 , a2);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3>::
make(detail::target<T>(), a0 , a1 , a2 , a3);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14 , a15);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14 , a15 , a16);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14 , a15 , a16 , a17);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17 , A18 const& a18)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14 , a15 , a16 , a17 , a18);
}
template <typename T, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19>
inline
typename expression::new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19>::type const
new_(A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 , A15 const& a15 , A16 const& a16 , A17 const& a17 , A18 const& a18 , A19 const& a19)
{
return
expression::
new_<detail::target<T>, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19>::
make(detail::target<T>(), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14 , a15 , a16 , a17 , a18 , a19);
}
@@ -0,0 +1,120 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* 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/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_DUPLICATES_ITERATOR_HPP
#define BOOST_MULTI_INDEX_DETAIL_DUPLICATES_ITERATOR_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <cstddef>
#include <iterator>
namespace boost{
namespace multi_index{
namespace detail{
/* duplicates_operator is given a range of ordered elements and
* passes only over those which are duplicated.
*/
template<typename Node,typename Predicate>
class duplicates_iterator
{
public:
typedef typename Node::value_type value_type;
typedef std::ptrdiff_t difference_type;
typedef const typename Node::value_type* pointer;
typedef const typename Node::value_type& reference;
typedef std::forward_iterator_tag iterator_category;
duplicates_iterator(Node* node_,Node* end_,Predicate pred_):
node(node_),begin_chunk(0),end(end_),pred(pred_)
{
advance();
}
duplicates_iterator(Node* end_,Predicate pred_):
node(end_),begin_chunk(end_),end(end_),pred(pred_)
{
}
reference operator*()const
{
return node->value();
}
pointer operator->()const
{
return &node->value();
}
duplicates_iterator& operator++()
{
Node::increment(node);
sync();
return *this;
}
duplicates_iterator operator++(int)
{
duplicates_iterator tmp(*this);
++(*this);
return tmp;
}
Node* get_node()const{return node;}
private:
void sync()
{
if(node!=end&&pred(begin_chunk->value(),node->value()))advance();
}
void advance()
{
for(Node* node2=node;node!=end;node=node2){
Node::increment(node2);
if(node2!=end&&!pred(node->value(),node2->value()))break;
}
begin_chunk=node;
}
Node* node;
Node* begin_chunk;
Node* end;
Predicate pred;
};
template<typename Node,typename Predicate>
bool operator==(
const duplicates_iterator<Node,Predicate>& x,
const duplicates_iterator<Node,Predicate>& y)
{
return x.get_node()==y.get_node();
}
template<typename Node,typename Predicate>
bool operator!=(
const duplicates_iterator<Node,Predicate>& x,
const duplicates_iterator<Node,Predicate>& y)
{
return !(x==y);
}
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
@@ -0,0 +1,49 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_OPERATOR_BITWISE_HPP
#define BOOST_PHOENIX_OPERATOR_BITWISE_HPP
#include <boost/phoenix/operator/detail/define_operator.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/proto/operators.hpp>
namespace boost { namespace phoenix
{
BOOST_PHOENIX_UNARY_OPERATORS(
(complement)
)
BOOST_PHOENIX_BINARY_OPERATORS(
(bitwise_and_assign)
(bitwise_or_assign)
(bitwise_xor_assign)
(shift_left_assign)
(shift_right_assign)
(bitwise_and)
(bitwise_or)
(bitwise_xor)
(shift_left)
(shift_right)
)
using proto::exprns_::operator~;
using proto::exprns_::operator&=;
using proto::exprns_::operator|=;
using proto::exprns_::operator^=;
using proto::exprns_::operator<<=;
using proto::exprns_::operator>>=;
using proto::exprns_::operator&;
using proto::exprns_::operator|;
using proto::exprns_::operator^;
using proto::exprns_::operator<<;
using proto::exprns_::operator>>;
}}
#include <boost/phoenix/operator/detail/undef_operator.hpp>
#endif
@@ -0,0 +1,88 @@
#ifndef BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// common_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/archive/detail/basic_iarchive.hpp>
#include <boost/archive/detail/basic_pointer_iserializer.hpp>
#include <boost/archive/detail/interface_iarchive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
namespace detail {
class extended_type_info;
// note: referred to as Curiously Recurring Template Patter (CRTP)
template<class Archive>
class BOOST_SYMBOL_VISIBLE common_iarchive :
public basic_iarchive,
public interface_iarchive<Archive>
{
friend class interface_iarchive<Archive>;
private:
virtual void vload(version_type & t){
* this->This() >> t;
}
virtual void vload(object_id_type & t){
* this->This() >> t;
}
virtual void vload(class_id_type & t){
* this->This() >> t;
}
virtual void vload(class_id_optional_type & t){
* this->This() >> t;
}
virtual void vload(tracking_type & t){
* this->This() >> t;
}
virtual void vload(class_name_type &s){
* this->This() >> s;
}
protected:
// default processing - invoke serialization library
template<class T>
void load_override(T & t){
archive::load(* this->This(), t);
}
// default implementations of functions which emit start/end tags for
// archive types that require them.
void load_start(const char * /*name*/){}
void load_end(const char * /*name*/){}
// default archive initialization
common_iarchive(unsigned int flags = 0) :
basic_iarchive(flags),
interface_iarchive<Archive>()
{}
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
@@ -0,0 +1,37 @@
#include "about.h"
#include <QCoreApplication>
#include <QString>
#include "revision_utils.hpp"
#include "ui_about.h"
CAboutDlg::CAboutDlg(QWidget *parent) :
QDialog(parent),
ui(new Ui::CAboutDlg)
{
ui->setupUi(this);
ui->labelTxt->setText ("<h2>" + QString {"WSJT-X v"
+ QCoreApplication::applicationVersion ()
+ " " + revision ()}.simplified () + "</h2><br />"
"WSJT-X implements a number of digital modes designed for <br />"
"weak-signal Amateur Radio communication. <br /><br />"
"&copy; 2001-2017 by Joe Taylor, K1JT, with grateful <br />"
"acknowledgment for contributions from AC6SL, AE4JY, <br />"
"DJ0OT, G3WDG, G4KLA, G4WJS, IV3NWV, IW3RAB, K3WYC, K9AN, <br />"
"KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR, <br />"
"VE1SKY, VK3ACF, VK4BDJ, VK7MO, W4TI, W4TV, and W9MDB.<br /><br />"
"WSJT-X is licensed under the terms of Version 3 <br />"
"of the GNU General Public License (GPL) <br />"
"<a href=" WSJTX_STRINGIZE (PROJECT_HOMEPAGE) ">"
"<img src=\":/icon_128x128.png\" /></a>"
"<a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">"
"<img src=\":/gpl-v3-logo.svg\" height=\"80\" /><br />"
"https://www.gnu.org/licenses/gpl-3.0.txt</a>");
}
CAboutDlg::~CAboutDlg()
{
}
@@ -0,0 +1,45 @@
// 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)
// (C) Copyright 2012 Vicente J. Botet Escriba
#ifndef BOOST_THREAD_DETAIL_LOCKABLE_WRAPPER_HPP
#define BOOST_THREAD_DETAIL_LOCKABLE_WRAPPER_HPP
#include <boost/thread/detail/config.hpp>
#if ! defined BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
#include <boost/config/abi_prefix.hpp>
namespace boost
{
#if ! defined BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
namespace thread_detail
{
template <typename Mutex>
struct lockable_wrapper
{
Mutex* m;
explicit lockable_wrapper(Mutex& m_) :
m(&m_)
{}
};
template <typename Mutex>
struct lockable_adopt_wrapper
{
Mutex* m;
explicit lockable_adopt_wrapper(Mutex& m_) :
m(&m_)
{}
};
}
#endif
}
#include <boost/config/abi_suffix.hpp>
#endif // header
@@ -0,0 +1,198 @@
/*
[auto_generated]
boost/numeric/odeint/external/compute/compute_operations.hpp
[begin_description]
Operations of Boost.Compute zipped iterators. Is the counterpart of the compute_algebra.
[end_description]
Copyright 2009-2011 Karsten Ahnert
Copyright 2009-2011 Mario Mulansky
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_HPP_DEFINED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_HPP_DEFINED
#include <boost/preprocessor/repetition.hpp>
#include <boost/compute.hpp>
namespace boost {
namespace numeric {
namespace odeint {
struct compute_operations {
#define BOOST_ODEINT_COMPUTE_TEMPL_FAC(z, n, unused) \
, class Fac ## n = BOOST_PP_CAT(Fac, BOOST_PP_DEC(n))
#define BOOST_ODEINT_COMPUTE_MEMB_FAC(z, n, unused) \
const Fac ## n m_alpha ## n;
#define BOOST_ODEINT_COMPUTE_PRM_FAC(z, n, unused) \
BOOST_PP_COMMA_IF(n) const Fac ## n alpha ## n
#define BOOST_ODEINT_COMPUTE_INIT_FAC(z, n, unused) \
BOOST_PP_COMMA_IF(n) m_alpha ## n (alpha ## n)
#define BOOST_ODEINT_COMPUTE_PRM_STATE(z, n, unused) \
BOOST_PP_COMMA_IF(n) StateType ## n &s ## n
#define BOOST_ODEINT_COMPUTE_BEGIN_STATE(z, n, unused) \
BOOST_PP_COMMA_IF( BOOST_PP_DEC(n) ) s ## n.begin()
#define BOOST_ODEINT_COMPUTE_END_STATE(z, n, unused) \
BOOST_PP_COMMA_IF( BOOST_PP_DEC(n) ) s ## n.end()
#define BOOST_ODEINT_COMPUTE_LAMBDA(z, n, unused) \
BOOST_PP_EXPR_IF(n, +) m_alpha ## n * bc::lambda::get< n >(bc::_1)
#define BOOST_ODEINT_COMPUTE_OPERATIONS(z, n, unused) \
template< \
class Fac0 = double \
BOOST_PP_REPEAT_FROM_TO(1, n, BOOST_ODEINT_COMPUTE_TEMPL_FAC, ~) \
> \
struct scale_sum ## n { \
BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_MEMB_FAC, ~) \
scale_sum ## n( \
BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_PRM_FAC, ~) \
) \
: BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_INIT_FAC, ~) \
{ } \
template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), class StateType) > \
void operator()( \
BOOST_PP_REPEAT( \
BOOST_PP_INC(n), \
BOOST_ODEINT_COMPUTE_PRM_STATE, ~) \
) const \
{ \
namespace bc = boost::compute; \
bc::transform( \
bc::make_zip_iterator( \
boost::make_tuple( \
BOOST_PP_REPEAT_FROM_TO( \
1, BOOST_PP_INC(n), \
BOOST_ODEINT_COMPUTE_BEGIN_STATE, ~) \
) \
), \
bc::make_zip_iterator( \
boost::make_tuple( \
BOOST_PP_REPEAT_FROM_TO( \
1, BOOST_PP_INC(n), \
BOOST_ODEINT_COMPUTE_END_STATE, ~) \
) \
), \
s0.begin(), \
BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_LAMBDA, ~) \
); \
} \
};
BOOST_PP_REPEAT_FROM_TO(2, 8, BOOST_ODEINT_COMPUTE_OPERATIONS, ~)
#undef BOOST_ODEINT_COMPUTE_TEMPL_FAC
#undef BOOST_ODEINT_COMPUTE_MEMB_FAC
#undef BOOST_ODEINT_COMPUTE_PRM_FAC
#undef BOOST_ODEINT_COMPUTE_INIT_FAC
#undef BOOST_ODEINT_COMPUTE_PRM_STATE
#undef BOOST_ODEINT_COMPUTE_BEGIN_STATE
#undef BOOST_ODEINT_COMPUTE_END_STATE
#undef BOOST_ODEINT_COMPUTE_LAMBDA
#undef BOOST_ODEINT_COMPUTE_OPERATIONS
template<class Fac1 = double, class Fac2 = Fac1>
struct scale_sum_swap2 {
const Fac1 m_alpha1;
const Fac2 m_alpha2;
scale_sum_swap2(const Fac1 alpha1, const Fac2 alpha2)
: m_alpha1(alpha1), m_alpha2(alpha2) { }
template<class State0, class State1, class State2>
void operator()(State0 &s0, State1 &s1, State2 &s2) const {
namespace bc = boost::compute;
bc::command_queue &queue = bc::system::default_queue();
const bc::context &context = queue.get_context();
const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE(
kernel void scale_sum_swap2(
F1 a1, F2 a2,
global T0 *x0, global T1 *x1, global T2 *x2,
)
{
uint i = get_global_id(0);
T0 tmp = x0[i];
x0[i] = a1 * x1[i] + a2 * x2[i];
x1[i] = tmp;
}
);
std::stringstream options;
options
<< " -DT0=" << bc::type_name<typename State0::value_type>()
<< " -DT1=" << bc::type_name<typename State1::value_type>()
<< " -DT2=" << bc::type_name<typename State2::value_type>()
<< " -DF1=" << bc::type_name<Fac1>()
<< " -DF2=" << bc::type_name<Fac2>();
bc::program program =
bc::program::build_with_source(source, context, options.str());
bc::kernel kernel(program, "scale_sum_swap2");
kernel.set_arg(0, m_alpha1);
kernel.set_arg(1, m_alpha2);
kernel.set_arg(2, s0.get_buffer());
kernel.set_arg(3, s1.get_buffer());
kernel.set_arg(4, s2.get_buffer());
queue.enqueue_1d_range_kernel(kernel, 0, s0.size());
}
};
template<class Fac1 = double>
struct rel_error {
const Fac1 m_eps_abs, m_eps_rel, m_a_x, m_a_dxdt;
rel_error(const Fac1 eps_abs, const Fac1 eps_rel, const Fac1 a_x, const Fac1 a_dxdt)
: m_eps_abs(eps_abs), m_eps_rel(eps_rel), m_a_x(a_x), m_a_dxdt(a_dxdt) { }
template <class State0, class State1, class State2>
void operator()(State0 &s0, State1 &s1, State2 &s2) const {
namespace bc = boost::compute;
using bc::_1;
using bc::lambda::get;
bc::for_each(
bc::make_zip_iterator(
boost::make_tuple(
s0.begin(),
s1.begin(),
s2.begin()
)
),
bc::make_zip_iterator(
boost::make_tuple(
s0.end(),
s1.end(),
s2.end()
)
),
get<0>(_1) = abs( get<0>(_1) ) /
(m_eps_abs + m_eps_rel * (m_a_x * abs(get<1>(_1) + m_a_dxdt * abs(get<2>(_1)))))
);
}
};
};
} // odeint
} // numeric
} // boost
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_HPP_DEFINED
@@ -0,0 +1,52 @@
#ifndef BOOST_MPL_REMOVE_HPP_INCLUDED
#define BOOST_MPL_REMOVE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/remove_if.hpp>
#include <boost/mpl/same_as.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Sequence
, typename T
, typename Inserter
>
struct remove_impl
: remove_if_impl< Sequence, same_as<T>, Inserter >
{
};
template<
typename Sequence
, typename T
, typename Inserter
>
struct reverse_remove_impl
: reverse_remove_if_impl< Sequence, same_as<T>, Inserter >
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove)
}}
#endif // BOOST_MPL_REMOVE_HPP_INCLUDED
@@ -0,0 +1,91 @@
#include "MetaDataRegistry.hpp"
#include <QMetaType>
#include <QItemEditorFactory>
#include <QStandardItemEditorCreator>
#include "Radio.hpp"
#include "FrequencyList.hpp"
#include "AudioDevice.hpp"
#include "Configuration.hpp"
#include "StationList.hpp"
#include "Transceiver.hpp"
#include "TransceiverFactory.hpp"
#include "WFPalette.hpp"
#include "IARURegions.hpp"
#include "FrequencyLineEdit.hpp"
QItemEditorFactory * item_editor_factory ()
{
static QItemEditorFactory * our_item_editor_factory = new QItemEditorFactory;
return our_item_editor_factory;
}
void register_types ()
{
// types in Radio.hpp are registered in their own translation unit
// as they are needed in the wsjtx_udp shared library too
// we still have to register the fully qualified names of enum types
// used as signal/slot connection arguments since the new Qt 5.5
// Q_ENUM macro only seems to register the unqualified name
item_editor_factory ()->registerEditor (qMetaTypeId<Radio::Frequency> (), new QStandardItemEditorCreator<FrequencyLineEdit> ());
//auto frequency_delta_type_id = qRegisterMetaType<Radio::FrequencyDelta> ("FrequencyDelta");
item_editor_factory ()->registerEditor (qMetaTypeId<Radio::FrequencyDelta> (), new QStandardItemEditorCreator<FrequencyDeltaLineEdit> ());
// Frequency list model
qRegisterMetaTypeStreamOperators<FrequencyList_v2::Item> ("Item_v2");
qRegisterMetaTypeStreamOperators<FrequencyList_v2::FrequencyItems> ("FrequencyItems_v2");
// defunct old versions
qRegisterMetaTypeStreamOperators<FrequencyList::Item> ("Item");
qRegisterMetaTypeStreamOperators<FrequencyList::FrequencyItems> ("FrequencyItems");
// Audio device
qRegisterMetaType<AudioDevice::Channel> ("AudioDevice::Channel");
// Configuration
#if QT_VERSION < 0x050500
qRegisterMetaType<Configuration::DataMode> ("Configuration::DataMode");
qRegisterMetaType<Configuration::Type2MsgGen> ("Configuration::Type2MsgGen");
#endif
qRegisterMetaTypeStreamOperators<Configuration::DataMode> ("Configuration::DataMode");
qRegisterMetaTypeStreamOperators<Configuration::Type2MsgGen> ("Configuration::Type2MsgGen");
// Station details
qRegisterMetaType<StationList::Station> ("Station");
qRegisterMetaType<StationList::Stations> ("Stations");
qRegisterMetaTypeStreamOperators<StationList::Station> ("Station");
qRegisterMetaTypeStreamOperators<StationList::Stations> ("Stations");
// Transceiver
qRegisterMetaType<Transceiver::TransceiverState> ("Transceiver::TransceiverState");
qRegisterMetaType<Transceiver::MODE> ("Transceiver::MODE");
// Transceiver factory
#if QT_VERSION < 0x050500
qRegisterMetaType<TransceiverFactory::DataBits> ("TransceiverFactory::DataBits");
qRegisterMetaType<TransceiverFactory::StopBits> ("TransceiverFactory::StopBits");
qRegisterMetaType<TransceiverFactory::Handshake> ("TransceiverFactory::Handshake");
qRegisterMetaType<TransceiverFactory::PTTMethod> ("TransceiverFactory::PTTMethod");
qRegisterMetaType<TransceiverFactory::TXAudioSource> ("TransceiverFactory::TXAudioSource");
qRegisterMetaType<TransceiverFactory::SplitMode> ("TransceiverFactory::SplitMode");
#endif
qRegisterMetaTypeStreamOperators<TransceiverFactory::DataBits> ("TransceiverFactory::DataBits");
qRegisterMetaTypeStreamOperators<TransceiverFactory::StopBits> ("TransceiverFactory::StopBits");
qRegisterMetaTypeStreamOperators<TransceiverFactory::Handshake> ("TransceiverFactory::Handshake");
qRegisterMetaTypeStreamOperators<TransceiverFactory::PTTMethod> ("TransceiverFactory::PTTMethod");
qRegisterMetaTypeStreamOperators<TransceiverFactory::TXAudioSource> ("TransceiverFactory::TXAudioSource");
qRegisterMetaTypeStreamOperators<TransceiverFactory::SplitMode> ("TransceiverFactory::SplitMode");
// Waterfall palette
qRegisterMetaTypeStreamOperators<WFPalette::Colours> ("Colours");
// IARURegions
#if QT_VERSION < 0x050500
qRegisterMetaType<IARURegions::Region> ("IARURegions::Region");
#endif
qRegisterMetaTypeStreamOperators<IARURegions::Region> ("IARURegions::Region");
}
@@ -0,0 +1,43 @@
/*=============================================================================
Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_END_IMPL_09122006_2034)
#define BOOST_FUSION_DEQUE_END_IMPL_09122006_2034
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/deque/deque_iterator.hpp>
namespace boost { namespace fusion
{
struct deque_tag;
namespace extension
{
template<typename T>
struct end_impl;
template<>
struct end_impl<deque_tag>
{
template<typename Sequence>
struct apply
{
typedef
deque_iterator<Sequence, Sequence::next_up::value>
type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq)
{
return type(seq);
}
};
};
}
}}
#endif
@@ -0,0 +1,453 @@
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file is machine generated, do not edit by hand
// Unrolled polynomial evaluation using second order Horners rule
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
#define BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(0);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[1] * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[4] * x2 + a[2]);
t[1] = static_cast<V>(a[3] * x2 + a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[5] * x2 + a[3];
t[1] = a[4] * x2 + a[2];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[6] * x2 + a[4]);
t[1] = static_cast<V>(a[5] * x2 + a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[7] * x2 + a[5];
t[1] = a[6] * x2 + a[4];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[8] * x2 + a[6]);
t[1] = static_cast<V>(a[7] * x2 + a[5]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[9] * x2 + a[7];
t[1] = a[8] * x2 + a[6];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[5]);
t[1] += static_cast<V>(a[4]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[10] * x2 + a[8]);
t[1] = static_cast<V>(a[9] * x2 + a[7]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[5]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[11] * x2 + a[9];
t[1] = a[10] * x2 + a[8];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[7]);
t[1] += static_cast<V>(a[6]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[5]);
t[1] += static_cast<V>(a[4]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[12] * x2 + a[10]);
t[1] = static_cast<V>(a[11] * x2 + a[9]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[8]);
t[1] += static_cast<V>(a[7]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[5]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[13] * x2 + a[11];
t[1] = a[12] * x2 + a[10];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[9]);
t[1] += static_cast<V>(a[8]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[7]);
t[1] += static_cast<V>(a[6]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[5]);
t[1] += static_cast<V>(a[4]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[14] * x2 + a[12]);
t[1] = static_cast<V>(a[13] * x2 + a[11]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[10]);
t[1] += static_cast<V>(a[9]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[8]);
t[1] += static_cast<V>(a[7]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[5]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[15] * x2 + a[13];
t[1] = a[14] * x2 + a[12];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[11]);
t[1] += static_cast<V>(a[10]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[9]);
t[1] += static_cast<V>(a[8]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[7]);
t[1] += static_cast<V>(a[6]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[5]);
t[1] += static_cast<V>(a[4]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[16] * x2 + a[14]);
t[1] = static_cast<V>(a[15] * x2 + a[13]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[12]);
t[1] += static_cast<V>(a[11]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[10]);
t[1] += static_cast<V>(a[9]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[8]);
t[1] += static_cast<V>(a[7]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[5]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = a[17] * x2 + a[15];
t[1] = a[16] * x2 + a[14];
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[13]);
t[1] += static_cast<V>(a[12]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[11]);
t[1] += static_cast<V>(a[10]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[9]);
t[1] += static_cast<V>(a[8]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[7]);
t[1] += static_cast<V>(a[6]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[5]);
t[1] += static_cast<V>(a[4]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[0] *= x;
return t[0] + t[1];
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*) BOOST_MATH_NOEXCEPT(V)
{
V x2 = x * x;
V t[2];
t[0] = static_cast<V>(a[18] * x2 + a[16]);
t[1] = static_cast<V>(a[17] * x2 + a[15]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[14]);
t[1] += static_cast<V>(a[13]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[12]);
t[1] += static_cast<V>(a[11]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[10]);
t[1] += static_cast<V>(a[9]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[8]);
t[1] += static_cast<V>(a[7]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[5]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[0] *= x2;
t[1] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[0] *= x2;
t[0] += static_cast<V>(a[0]);
t[1] *= x;
return t[0] + t[1];
}
}}}} // namespaces
#endif // include guard
@@ -0,0 +1,28 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_SEQ_TO_ARRAY_HPP
# define BOOST_PREPROCESSOR_SEQ_TO_ARRAY_HPP
#
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/seq/enum.hpp>
# include <boost/preprocessor/seq/size.hpp>
#
# /* BOOST_PP_SEQ_TO_ARRAY */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_SEQ_TO_ARRAY(seq) (BOOST_PP_SEQ_SIZE(seq), (BOOST_PP_SEQ_ENUM(seq)))
# else
# define BOOST_PP_SEQ_TO_ARRAY(seq) BOOST_PP_SEQ_TO_ARRAY_I(seq)
# define BOOST_PP_SEQ_TO_ARRAY_I(seq) (BOOST_PP_SEQ_SIZE(seq), (BOOST_PP_SEQ_ENUM(seq)))
# endif
#
# endif
@@ -0,0 +1,21 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2012-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/move for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONFIG_HPP
#include <boost/config.hpp>
#endif
#ifdef BOOST_MSVC
# pragma warning (push)
# pragma warning (disable : 4324) // structure was padded due to __declspec(align())
# pragma warning (disable : 4675) // "function": resolved overload was found by argument-dependent lookup
# pragma warning (disable : 4996) // "function": was declared deprecated (_CRT_SECURE_NO_DEPRECATE/_SCL_SECURE_NO_WARNINGS)
# pragma warning (disable : 4714) // "function": marked as __forceinline not inlined
# pragma warning (disable : 4127) // conditional expression is constant
#endif
Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

@@ -0,0 +1,69 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/smart_ptr/detail/sp_has_sync.hpp
//
// Copyright (c) 2008, 2009 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Defines the BOOST_SP_HAS_SYNC macro if the __sync_* intrinsics
// are available.
//
#ifndef BOOST_SP_NO_SYNC
#if defined( __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 )
# define BOOST_SP_HAS_SYNC
#elif defined( __IBMCPP__ ) && ( __IBMCPP__ >= 1210 )
# define BOOST_SP_HAS_SYNC
#elif defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
#define BOOST_SP_HAS_SYNC
#if defined( __arm__ ) || defined( __armel__ )
#undef BOOST_SP_HAS_SYNC
#endif
#if defined( __hppa ) || defined( __hppa__ )
#undef BOOST_SP_HAS_SYNC
#endif
#if defined( __m68k__ )
#undef BOOST_SP_HAS_SYNC
#endif
#if defined( __sh__ )
#undef BOOST_SP_HAS_SYNC
#endif
#if defined( __sparc__ )
#undef BOOST_SP_HAS_SYNC
#endif
#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1110 )
#undef BOOST_SP_HAS_SYNC
#endif
#if defined(__PATHSCALE__) && ((__PATHCC__ == 4) && (__PATHCC_MINOR__ < 9))
#undef BOOST_SP_HAS_SYNC
#endif
#endif
#endif // #ifndef BOOST_SP_NO_SYNC
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
@@ -0,0 +1,34 @@
///////////////////////////////////////////////////////////////////////////////
/// \file ignore_unused.hpp
/// Definintion of ignore_unused, a dummy function for suppressing compiler
/// warnings
//
// Copyright 2008 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PROTO_DETAIL_IGNORE_UNUSED_HPP_EAN_03_03_2008
#define BOOST_PROTO_DETAIL_IGNORE_UNUSED_HPP_EAN_03_03_2008
#include <boost/config.hpp>
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
#endif
namespace boost { namespace proto
{
namespace detail
{
template<typename T>
BOOST_FORCEINLINE void ignore_unused(T const &)
{}
}
}}
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif
@@ -0,0 +1,532 @@
/*==============================================================================
Copyright (c) 2005-2007 Dan Marsden
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_STATEMENT_TRY_CATCH_HPP
#define BOOST_PHOENIX_STATEMENT_TRY_CATCH_HPP
#include <boost/phoenix/config.hpp>
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/is_nullary.hpp>
#include <boost/phoenix/scope/local_variable.hpp>
#include <boost/phoenix/scope/scoped_environment.hpp>
#include <boost/proto/functional/fusion/pop_front.hpp>
#include <boost/core/enable_if.hpp>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4355) // 'this' : used in base member initializer list
#endif
namespace boost { namespace phoenix
{
template <typename Expr>
struct try_catch_actor;
template <typename Exception>
struct catch_exception
{
typedef Exception type;
};
namespace tag
{
struct try_catch {};
struct catch_ {};
struct catch_all {};
}
namespace expression
{
template <
typename Try
, BOOST_PHOENIX_typename_A_void(BOOST_PHOENIX_CATCH_LIMIT)
, typename Dummy = void
>
struct try_catch;
// bring in the expression definitions
#include <boost/phoenix/statement/detail/try_catch_expression.hpp>
template <typename A0, typename A1, typename A2 = void>
struct catch_
: proto::nary_expr<tag::catch_, A0, A1, A2>
{};
template <typename A0, typename A1>
struct catch_<A0, A1, void>
: proto::binary_expr<tag::catch_, A0, A1>
{};
template <typename A0>
struct catch_all
: proto::unary_expr<tag::catch_all, A0>
{};
}
namespace rule
{
typedef
expression::catch_<
proto::terminal<catch_exception<proto::_> >
, local_variable
, meta_grammar
>
captured_catch;
typedef
expression::catch_<
proto::terminal<catch_exception<proto::_> >
, meta_grammar
>
non_captured_catch;
struct catch_
: proto::or_<
captured_catch
, non_captured_catch
>
{};
struct catch_all
: expression::catch_all<
meta_grammar
>
{};
struct try_catch
: proto::or_<
expression::try_catch<
meta_grammar
, proto::vararg<rule::catch_>
>
, expression::try_catch<
meta_grammar
, rule::catch_all
>
, expression::try_catch<
meta_grammar
, proto::vararg<rule::catch_>
, rule::catch_all
>
>
{};
}
template <typename Dummy>
struct meta_grammar::case_<tag::try_catch, Dummy>
: enable_rule<rule::try_catch, Dummy>
{};
struct try_catch_eval
{
typedef void result_type;
template <typename Try, typename Context>
void operator()(Try const &, Context const &) const
{}
template <typename Catch, typename Exception, typename Context>
typename enable_if<proto::matches<Catch, rule::non_captured_catch> >::type
eval_catch_body(Catch const &c, Exception & /*unused*/, Context const &ctx
BOOST_PHOENIX_SFINAE_AND_OVERLOADS) const
{
phoenix::eval(proto::child_c<1>(c), ctx);
}
template <typename Catch, typename Exception, typename Context>
typename enable_if<proto::matches<Catch, rule::captured_catch> >::type
eval_catch_body(Catch const &c, Exception &e, Context const &ctx) const
{
typedef
typename proto::detail::uncvref<
typename proto::result_of::value<
typename proto::result_of::child_c<Catch, 1>::type
>::type
>::type
capture_type;
typedef
typename proto::detail::uncvref<
typename result_of::env<Context>::type
>::type
env_type;
typedef vector1<Exception &> local_type;
typedef detail::map_local_index_to_tuple<capture_type> map_type;
typedef
phoenix::scoped_environment<
env_type
, env_type
, local_type
, map_type
>
scoped_env_tpe;
local_type local = {e};
scoped_env_tpe env(phoenix::env(ctx), phoenix::env(ctx), local);
phoenix::eval(proto::child_c<2>(c), phoenix::context(env, phoenix::actions(ctx)));
}
// bring in the operator overloads
#include <boost/phoenix/statement/detail/try_catch_eval.hpp>
};
template <typename Dummy>
struct default_actions::when<rule::try_catch, Dummy>
: call<try_catch_eval, Dummy>
{};
namespace detail
{
struct try_catch_is_nullary
: proto::or_<
proto::when<
phoenix::rule::catch_all
, proto::call<
evaluator(
proto::_child_c<0>
, proto::_data
, proto::make<proto::empty_env()>
)
>
>
, proto::when<
phoenix::rule::catch_
, proto::or_<
proto::when<
phoenix::rule::captured_catch
, proto::call<
evaluator(
proto::_child_c<2>
, proto::call<
phoenix::functional::context(
proto::make<mpl::true_()>
, proto::make<detail::scope_is_nullary_actions()>
)
>
, proto::make<proto::empty_env()>
)
>
>
, proto::otherwise<
proto::call<
evaluator(
proto::_child_c<1>
, proto::_data
, proto::make<proto::empty_env()>
)
>
>
>
>
, proto::when<
phoenix::rule::try_catch
, proto::make<
mpl::and_<
proto::call<
evaluator(
proto::_child_c<0>
, proto::_data
, proto::make<proto::empty_env()>
)
>
, proto::fold<
proto::call<
proto::functional::pop_front(proto::_)
>
, proto::make<mpl::true_()>
, proto::make<
mpl::and_<
proto::_state
, proto::call<
try_catch_is_nullary(
proto::_
, proto::make<proto::empty_env()>
, proto::_data
)
>
>()
>
>
>()
>
>
>
{};
template <
typename TryCatch
, typename Exception
, typename Capture
, typename Expr
, long Arity = proto::arity_of<TryCatch>::value
>
struct catch_push_back;
template <typename TryCatch, typename Exception, typename Capture, typename Expr>
struct catch_push_back<TryCatch, Exception, Capture, Expr, 1>
{
typedef
typename proto::result_of::make_expr<
phoenix::tag::catch_
, proto::basic_default_domain
, catch_exception<Exception>
, Capture
, Expr
>::type
catch_expr;
typedef
phoenix::expression::try_catch<
TryCatch
, catch_expr
>
gen_type;
typedef typename gen_type::type type;
static type make(TryCatch const & try_catch, Capture const & capture, Expr const & catch_)
{
return
gen_type::make(
try_catch
, proto::make_expr<
phoenix::tag::catch_
, proto::basic_default_domain
>(catch_exception<Exception>(), capture, catch_)
);
}
};
template <typename TryCatch, typename Exception, typename Expr>
struct catch_push_back<TryCatch, Exception, void, Expr, 1>
{
typedef
typename proto::result_of::make_expr<
phoenix::tag::catch_
, proto::basic_default_domain
, catch_exception<Exception>
, Expr
>::type
catch_expr;
typedef
phoenix::expression::try_catch<
TryCatch
, catch_expr
>
gen_type;
typedef typename gen_type::type type;
static type make(TryCatch const & try_catch, Expr const & catch_)
{
return
gen_type::make(
try_catch
, proto::make_expr<
phoenix::tag::catch_
, proto::basic_default_domain
>(catch_exception<Exception>(), catch_)
);
}
};
template <
typename TryCatch
, typename Expr
, long Arity = proto::arity_of<TryCatch>::value
>
struct catch_all_push_back;
template <typename TryCatch, typename Expr>
struct catch_all_push_back<TryCatch, Expr, 1>
{
typedef
typename proto::result_of::make_expr<
phoenix::tag::catch_all
, proto::basic_default_domain
, Expr
>::type
catch_expr;
typedef
phoenix::expression::try_catch<
TryCatch
, catch_expr
>
gen_type;
typedef typename gen_type::type type;
static type make(TryCatch const& try_catch, Expr const& catch_)
{
return
gen_type::make(
try_catch
, proto::make_expr<
phoenix::tag::catch_all
, proto::basic_default_domain
>(catch_)
);
}
};
#include <boost/phoenix/statement/detail/catch_push_back.hpp>
}
template <typename Dummy>
struct is_nullary::when<rule::try_catch, Dummy>
: proto::call<
detail::try_catch_is_nullary(
proto::_
, proto::make<proto::empty_env()>
, _context
)
>
{};
template <typename TryCatch, typename Exception, typename Capture = void>
struct catch_gen
{
catch_gen(TryCatch const& try_catch_, Capture const& capture)
: try_catch(try_catch_)
, capture(capture) {}
template <typename Expr>
typename boost::disable_if<
proto::matches<
typename proto::result_of::child_c<
TryCatch
, proto::arity_of<TryCatch>::value - 1
>::type
, rule::catch_all
>
, typename detail::catch_push_back<TryCatch, Exception, Capture, Expr>::type
>::type
operator[](Expr const& expr) const
{
return
detail::catch_push_back<TryCatch, Exception, Capture, Expr>::make(
try_catch, capture, expr
);
}
TryCatch const & try_catch;
Capture const & capture;
};
template <typename TryCatch, typename Exception>
struct catch_gen<TryCatch, Exception, void>
{
catch_gen(TryCatch const& try_catch_) : try_catch(try_catch_) {}
template <typename Expr>
typename boost::disable_if<
proto::matches<
typename proto::result_of::child_c<
TryCatch
, proto::arity_of<TryCatch>::value - 1
>::type
, rule::catch_all
>
, typename detail::catch_push_back<TryCatch, Exception, void, Expr>::type
>::type
operator[](Expr const& expr) const
{
return
detail::catch_push_back<TryCatch, Exception, void, Expr>::make(
try_catch, expr
);
}
TryCatch const & try_catch;
};
template <typename TryCatch>
struct catch_all_gen
{
catch_all_gen(TryCatch const& try_catch_) : try_catch(try_catch_) {}
template <typename Expr>
typename boost::disable_if<
proto::matches<
typename proto::result_of::child_c<
TryCatch
, proto::arity_of<TryCatch>::value - 1
>::type
, rule::catch_all
>
, typename detail::catch_all_push_back<TryCatch, Expr>::type
>::type
operator[](Expr const& expr) const
{
return detail::catch_all_push_back<TryCatch, Expr>::make(
try_catch, expr
);
}
TryCatch const & try_catch;
};
template <
typename Expr
>
struct try_catch_actor;
template <typename Expr>
struct try_catch_actor
: actor<Expr>
{
typedef try_catch_actor<Expr> that_type;
typedef actor<Expr> base_type;
try_catch_actor(base_type const& expr)
: base_type(expr)
, catch_all(*this)
{
}
template <typename Exception>
catch_gen<that_type, Exception> const
catch_() const
{
return catch_gen<that_type, Exception>(*this);
}
template <typename Exception, typename Capture>
catch_gen<that_type, Exception, Capture> const
catch_(Capture const &expr) const
{
return catch_gen<that_type, Exception, Capture>(*this, expr);
}
catch_all_gen<that_type> const catch_all;
};
struct try_gen
{
template <typename Try>
typename expression::try_catch<Try>::type const
operator[](Try const & try_) const
{
return expression::try_catch<Try>::make(try_);
}
};
#ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS
try_gen const try_ = {};
#endif
}}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
@@ -0,0 +1,389 @@
#ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED
#define BOOST_BIND_MEM_FN_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// mem_fn.hpp - a generalization of std::mem_fun[_ref]
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 David Abrahams
// Copyright (c) 2003-2005 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
//
#include <boost/config.hpp>
#include <boost/get_pointer.hpp>
#include <boost/detail/workaround.hpp>
namespace boost
{
#if defined(BOOST_NO_VOID_RETURNS)
#define BOOST_MEM_FN_CLASS_F , class F
#define BOOST_MEM_FN_TYPEDEF(X)
namespace _mfi // mem_fun_impl
{
template<class V> struct mf
{
#define BOOST_MEM_FN_RETURN return
#define BOOST_MEM_FN_NAME(X) inner_##X
#define BOOST_MEM_FN_CC
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#undef BOOST_MEM_FN_RETURN
}; // struct mf<V>
template<> struct mf<void>
{
#define BOOST_MEM_FN_RETURN
#define BOOST_MEM_FN_NAME(X) inner_##X
#define BOOST_MEM_FN_CC
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#undef BOOST_MEM_FN_RETURN
}; // struct mf<void>
#undef BOOST_MEM_FN_CLASS_F
#undef BOOST_MEM_FN_TYPEDEF_F
#define BOOST_MEM_FN_NAME(X) X
#define BOOST_MEM_FN_NAME2(X) inner_##X
#define BOOST_MEM_FN_CC
#include <boost/bind/mem_fn_vw.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_NAME2
#undef BOOST_MEM_FN_CC
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
#include <boost/bind/mem_fn_vw.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_NAME2
#undef BOOST_MEM_FN_CC
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#define BOOST_MEM_FN_NAME(X) X##_stdcall
#define BOOST_MEM_FN_NAME2(X) inner_##X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
#include <boost/bind/mem_fn_vw.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_NAME2
#undef BOOST_MEM_FN_CC
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#define BOOST_MEM_FN_NAME(X) X##_fastcall
#define BOOST_MEM_FN_NAME2(X) inner_##X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
#include <boost/bind/mem_fn_vw.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_NAME2
#undef BOOST_MEM_FN_CC
#endif
} // namespace _mfi
#else // #ifdef BOOST_NO_VOID_RETURNS
#define BOOST_MEM_FN_CLASS_F
#define BOOST_MEM_FN_TYPEDEF(X) typedef X;
namespace _mfi
{
#define BOOST_MEM_FN_RETURN return
#define BOOST_MEM_FN_NAME(X) X
#define BOOST_MEM_FN_CC
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#define BOOST_MEM_FN_NAME(X) X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#define BOOST_MEM_FN_NAME(X) X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
#include <boost/bind/mem_fn_template.hpp>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#endif
#undef BOOST_MEM_FN_RETURN
} // namespace _mfi
#undef BOOST_MEM_FN_CLASS_F
#undef BOOST_MEM_FN_TYPEDEF
#endif // #ifdef BOOST_NO_VOID_RETURNS
#define BOOST_MEM_FN_NAME(X) X
#define BOOST_MEM_FN_CC
#include <boost/bind/mem_fn_cc.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
#include <boost/bind/mem_fn_cc.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#define BOOST_MEM_FN_NAME(X) X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
#include <boost/bind/mem_fn_cc.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#define BOOST_MEM_FN_NAME(X) X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
#include <boost/bind/mem_fn_cc.hpp>
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#endif
// data member support
namespace _mfi
{
template<class R, class T> class dm
{
public:
typedef R const & result_type;
typedef T const * argument_type;
private:
typedef R (T::*F);
F f_;
template<class U> R const & call(U & u, T const *) const
{
return (u.*f_);
}
template<class U> R const & call(U & u, void const *) const
{
return (get_pointer(u)->*f_);
}
public:
explicit dm(F f): f_(f) {}
R & operator()(T * p) const
{
return (p->*f_);
}
R const & operator()(T const * p) const
{
return (p->*f_);
}
template<class U> R const & operator()(U const & u) const
{
return call(u, &u);
}
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200)
R & operator()(T & t) const
{
return (t.*f_);
}
R const & operator()(T const & t) const
{
return (t.*f_);
}
#endif
bool operator==(dm const & rhs) const
{
return f_ == rhs.f_;
}
bool operator!=(dm const & rhs) const
{
return f_ != rhs.f_;
}
};
} // namespace _mfi
template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
{
return _mfi::dm<R, T>(f);
}
} // namespace boost
#endif // #ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED
@@ -0,0 +1,374 @@
// 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)
// (C) Copyright 2007-8 Anthony Williams
// (C) Copyright 2011-2012 Vicente J. Botet Escriba
#ifndef BOOST_THREAD_MOVE_HPP
#define BOOST_THREAD_MOVE_HPP
#include <boost/thread/detail/config.hpp>
#ifndef BOOST_NO_SFINAE
#include <boost/core/enable_if.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/remove_extent.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/add_pointer.hpp>
#include <boost/type_traits/decay.hpp>
#endif
#include <boost/thread/detail/delete.hpp>
#include <boost/move/utility.hpp>
#include <boost/move/traits.hpp>
#include <boost/config/abi_prefix.hpp>
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
#include <type_traits>
#endif
namespace boost
{
namespace detail
{
template <typename T>
struct enable_move_utility_emulation_dummy_specialization;
template<typename T>
struct thread_move_t
{
T& t;
explicit thread_move_t(T& t_):
t(t_)
{}
T& operator*() const
{
return t;
}
T* operator->() const
{
return &t;
}
private:
void operator=(thread_move_t&);
};
}
#if !defined BOOST_THREAD_USES_MOVE
#ifndef BOOST_NO_SFINAE
template<typename T>
typename enable_if<boost::is_convertible<T&,boost::detail::thread_move_t<T> >, boost::detail::thread_move_t<T> >::type move(T& t)
{
return boost::detail::thread_move_t<T>(t);
}
#endif
template<typename T>
boost::detail::thread_move_t<T> move(boost::detail::thread_move_t<T> t)
{
return t;
}
#endif //#if !defined BOOST_THREAD_USES_MOVE
}
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_THREAD_COPY_ASSIGN_REF(TYPE) BOOST_COPY_ASSIGN_REF(TYPE)
#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
#define BOOST_THREAD_RV_REF_2_TEMPL_ARGS(TYPE) BOOST_RV_REF_2_TEMPL_ARGS(TYPE)
#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
#define BOOST_THREAD_RV(V) V
#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
#define BOOST_THREAD_DCL_MOVABLE(TYPE)
#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
namespace detail { \
template <typename T> \
struct enable_move_utility_emulation_dummy_specialization<
#define BOOST_THREAD_DCL_MOVABLE_BEG2(T1, T2) \
namespace detail { \
template <typename T1, typename T2> \
struct enable_move_utility_emulation_dummy_specialization<
#define BOOST_THREAD_DCL_MOVABLE_END > \
: integral_constant<bool, false> \
{}; \
}
#elif ! defined BOOST_NO_CXX11_RVALUE_REFERENCES && defined BOOST_MSVC
#define BOOST_THREAD_COPY_ASSIGN_REF(TYPE) BOOST_COPY_ASSIGN_REF(TYPE)
#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
#define BOOST_THREAD_RV_REF_2_TEMPL_ARGS(TYPE) BOOST_RV_REF_2_TEMPL_ARGS(TYPE)
#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
#define BOOST_THREAD_RV(V) V
#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
#define BOOST_THREAD_DCL_MOVABLE(TYPE)
#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
namespace detail { \
template <typename T> \
struct enable_move_utility_emulation_dummy_specialization<
#define BOOST_THREAD_DCL_MOVABLE_BEG2(T1, T2) \
namespace detail { \
template <typename T1, typename T2> \
struct enable_move_utility_emulation_dummy_specialization<
#define BOOST_THREAD_DCL_MOVABLE_END > \
: integral_constant<bool, false> \
{}; \
}
#else
#if defined BOOST_THREAD_USES_MOVE
#define BOOST_THREAD_COPY_ASSIGN_REF(TYPE) BOOST_COPY_ASSIGN_REF(TYPE)
#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
#define BOOST_THREAD_RV_REF_2_TEMPL_ARGS(TYPE) BOOST_RV_REF_2_TEMPL_ARGS(TYPE)
#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
#define BOOST_THREAD_RV(V) V
#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
#define BOOST_THREAD_DCL_MOVABLE(TYPE)
#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
namespace detail { \
template <typename T> \
struct enable_move_utility_emulation_dummy_specialization<
#define BOOST_THREAD_DCL_MOVABLE_BEG2(T1, T2) \
namespace detail { \
template <typename T1, typename T2> \
struct enable_move_utility_emulation_dummy_specialization<
#define BOOST_THREAD_DCL_MOVABLE_END > \
: integral_constant<bool, false> \
{}; \
}
#else
#define BOOST_THREAD_COPY_ASSIGN_REF(TYPE) const TYPE&
#define BOOST_THREAD_RV_REF(TYPE) boost::detail::thread_move_t< TYPE >
#define BOOST_THREAD_RV_REF_BEG boost::detail::thread_move_t<
#define BOOST_THREAD_RV_REF_END >
#define BOOST_THREAD_RV(V) (*V)
#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
#define BOOST_THREAD_DCL_MOVABLE(TYPE) \
template <> \
struct enable_move_utility_emulation< TYPE > \
{ \
static const bool value = false; \
};
#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
template <typename T> \
struct enable_move_utility_emulation<
#define BOOST_THREAD_DCL_MOVABLE_BEG2(T1, T2) \
template <typename T1, typename T2> \
struct enable_move_utility_emulation<
#define BOOST_THREAD_DCL_MOVABLE_END > \
{ \
static const bool value = false; \
};
#endif
namespace boost
{
namespace detail
{
template <typename T>
BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
make_rv_ref(T v) BOOST_NOEXCEPT
{
return (BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
}
// template <typename T>
// BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
// make_rv_ref(T &v) BOOST_NOEXCEPT
// {
// return (BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
// }
// template <typename T>
// const BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
// make_rv_ref(T const&v) BOOST_NOEXCEPT
// {
// return (const BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
// }
}
}
#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE.move()
//#define BOOST_THREAD_MAKE_RV_REF(RVALUE) boost::detail::make_rv_ref(RVALUE)
#endif
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_THREAD_MOVABLE(TYPE)
#define BOOST_THREAD_COPYABLE(TYPE)
#else
#if defined BOOST_THREAD_USES_MOVE
#define BOOST_THREAD_MOVABLE(TYPE) \
::boost::rv<TYPE>& move() BOOST_NOEXCEPT \
{ \
return *static_cast< ::boost::rv<TYPE>* >(this); \
} \
const ::boost::rv<TYPE>& move() const BOOST_NOEXCEPT \
{ \
return *static_cast<const ::boost::rv<TYPE>* >(this); \
} \
operator ::boost::rv<TYPE>&() \
{ \
return *static_cast< ::boost::rv<TYPE>* >(this); \
} \
operator const ::boost::rv<TYPE>&() const \
{ \
return *static_cast<const ::boost::rv<TYPE>* >(this); \
}\
#define BOOST_THREAD_COPYABLE(TYPE) \
TYPE& operator=(TYPE &t)\
{ this->operator=(static_cast<const ::boost::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}
#else
#define BOOST_THREAD_MOVABLE(TYPE) \
operator ::boost::detail::thread_move_t<TYPE>() BOOST_NOEXCEPT \
{ \
return move(); \
} \
::boost::detail::thread_move_t<TYPE> move() BOOST_NOEXCEPT \
{ \
::boost::detail::thread_move_t<TYPE> x(*this); \
return x; \
} \
#define BOOST_THREAD_COPYABLE(TYPE)
#endif
#endif
#define BOOST_THREAD_MOVABLE_ONLY(TYPE) \
BOOST_THREAD_NO_COPYABLE(TYPE) \
BOOST_THREAD_MOVABLE(TYPE) \
typedef int boost_move_no_copy_constructor_or_assign; \
#define BOOST_THREAD_COPYABLE_AND_MOVABLE(TYPE) \
BOOST_THREAD_COPYABLE(TYPE) \
BOOST_THREAD_MOVABLE(TYPE) \
namespace boost
{
namespace thread_detail
{
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#elif defined BOOST_THREAD_USES_MOVE
template <class T>
struct is_rv
: ::boost::move_detail::is_rv<T>
{};
#else
template <class T>
struct is_rv
: ::boost::integral_constant<bool, false>
{};
template <class T>
struct is_rv< ::boost::detail::thread_move_t<T> >
: ::boost::integral_constant<bool, true>
{};
template <class T>
struct is_rv< const ::boost::detail::thread_move_t<T> >
: ::boost::integral_constant<bool, true>
{};
#endif
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class Tp>
struct remove_reference : boost::remove_reference<Tp> {};
template <class Tp>
struct decay : boost::decay<Tp> {};
#else
template <class Tp>
struct remove_reference
{
typedef Tp type;
};
template <class Tp>
struct remove_reference<Tp&>
{
typedef Tp type;
};
template <class Tp>
struct remove_reference< rv<Tp> > {
typedef Tp type;
};
template <class Tp>
struct decay
{
private:
typedef typename boost::move_detail::remove_rvalue_reference<Tp>::type Up0;
typedef typename boost::remove_reference<Up0>::type Up;
public:
typedef typename conditional
<
is_array<Up>::value,
typename remove_extent<Up>::type*,
typename conditional
<
is_function<Up>::value,
typename add_pointer<Up>::type,
typename remove_cv<Up>::type
>::type
>::type type;
};
#endif
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class T>
typename decay<T>::type
decay_copy(T&& t)
{
return boost::forward<T>(t);
}
#else
template <class T>
typename decay<T>::type
decay_copy(BOOST_THREAD_FWD_REF(T) t)
{
return boost::forward<T>(t);
}
#endif
}
}
#include <boost/config/abi_suffix.hpp>
#endif
@@ -0,0 +1,30 @@
// Copyright 2005 Daniel Wallin.
// Copyright 2005 Joel de Guzman.
//
// 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)
//
// Modeled after range_ex, Copyright 2004 Eric Niebler
///////////////////////////////////////////////////////////////////////////////
//
// has_sort.hpp
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_PHOENIX_HAS_SORT_EN_14_12_2004
#define BOOST_PHOENIX_HAS_SORT_EN_14_12_2004
#include "./is_std_list.hpp"
namespace boost
{
// Specialize this for user-defined types
template<typename T>
struct has_sort
: is_std_list<T>
{
};
}
#endif
@@ -0,0 +1,65 @@
//---------------------------------------------------------------------------//
// 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_DETAIL_MPL_VECTOR_TO_TUPLE_HPP
#define BOOST_COMPUTE_DETAIL_MPL_VECTOR_TO_TUPLE_HPP
#include <boost/mpl/copy.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/fusion/include/mpl.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp>
#include <boost/preprocessor/repetition.hpp>
#include <boost/compute/config.hpp>
namespace boost {
namespace compute {
namespace detail {
namespace mpl = boost::mpl;
template<class Vector, size_t N>
struct mpl_vector_to_tuple_impl;
#define BOOST_COMPUTE_PRINT_ELEM(z, n, unused) \
typename mpl::at_c<Vector, n>::type
#define BOOST_COMPUTE_VEC2TUP(z, n, unused) \
template<class Vector> \
struct mpl_vector_to_tuple_impl<Vector, n> \
{ \
typedef typename \
boost::tuple< \
BOOST_PP_ENUM(n, BOOST_COMPUTE_PRINT_ELEM, ~) \
> type; \
};
BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_VEC2TUP, ~)
#undef BOOST_COMPUTE_VEC2TUP
#undef BOOST_COMPUTE_PRINT_ELEM
// meta-function which converts a mpl::vector to a boost::tuple
template<class Vector>
struct mpl_vector_to_tuple
{
typedef typename
mpl_vector_to_tuple_impl<
Vector,
mpl::size<Vector>::value
>::type type;
};
} // end detail namespace
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_DETAIL_MPL_VECTOR_TO_TUPLE_HPP
@@ -0,0 +1,68 @@
// 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_RANDOM_SHUFFLE_HPP_INCLUDED
#define BOOST_RANGE_ALGORITHM_RANDOM_SHUFFLE_HPP_INCLUDED
#include <boost/concept_check.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/concepts.hpp>
#include <algorithm>
namespace boost
{
namespace range
{
/// \brief template function random_shuffle
///
/// range-based version of the random_shuffle std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Generator is a model of the UnaryFunctionConcept
template<class RandomAccessRange>
inline RandomAccessRange& random_shuffle(RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::random_shuffle(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& random_shuffle(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::random_shuffle(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Generator>
inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::random_shuffle(boost::begin(rng), boost::end(rng), gen);
return rng;
}
/// \overload
template<class RandomAccessRange, class Generator>
inline const RandomAccessRange& random_shuffle(const RandomAccessRange& rng, Generator& gen)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::random_shuffle(boost::begin(rng), boost::end(rng), gen);
return rng;
}
} // namespace range
using range::random_shuffle;
} // namespace boost
#endif // include guard
@@ -0,0 +1,17 @@
/*
Copyright Rene Rivera 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)
*/
#ifndef BOOST_PREDEF_DETAIL_TEST_H
#define BOOST_PREDEF_DETAIL_TEST_H
#if !defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS)
#define BOOST_PREDEF_DECLARE_TEST(x,s)
#endif
#endif
@@ -0,0 +1,120 @@
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
// Hinnant & John Maddock 2000.
// 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/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#include <boost/type_traits/detail/config.hpp>
#include <boost/detail/workaround.hpp>
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
//
// Note: we use the "workaround" version for MSVC because it works for
// __stdcall etc function types, where as the partial specialisation
// version does not do so.
//
# include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/type_traits/integral_constant.hpp>
#else
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_array.hpp>
# include <boost/type_traits/detail/yes_no_type.hpp>
# include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
#endif
namespace boost {
#if defined( __CODEGEARC__ )
template <class T> struct is_member_function_pointer : public integral_constant<bool, __is_member_function_pointer( T )> {};
#elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
template <class T> struct is_member_function_pointer
: public ::boost::integral_constant<bool, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value>{};
#else
namespace detail {
#ifndef __BORLANDC__
template <bool>
struct is_mem_fun_pointer_select
{
template <class T> struct result_ : public false_type{};
};
template <>
struct is_mem_fun_pointer_select<false>
{
template <typename T> struct result_
{
#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
static T* make_t;
typedef result_<T> self_type;
BOOST_STATIC_CONSTANT(
bool, value = (
1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
));
#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(pop)
#endif
};
};
template <typename T>
struct is_member_function_pointer_impl
: public is_mem_fun_pointer_select<
::boost::is_reference<T>::value || ::boost::is_array<T>::value>::template result_<T>{};
template <typename T>
struct is_member_function_pointer_impl<T&> : public false_type{};
#else // Borland C++
template <typename T>
struct is_member_function_pointer_impl
{
static T* m_t;
BOOST_STATIC_CONSTANT(
bool, value =
(1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
};
template <typename T>
struct is_member_function_pointer_impl<T&>
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
#endif
template<> struct is_member_function_pointer_impl<void> : public false_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template<> struct is_member_function_pointer_impl<void const> : public false_type{};
template<> struct is_member_function_pointer_impl<void const volatile> : public false_type{};
template<> struct is_member_function_pointer_impl<void volatile> : public false_type{};
#endif
} // namespace detail
template <class T>
struct is_member_function_pointer
: public integral_constant<bool, ::boost::detail::is_member_function_pointer_impl<T>::value>{};
#endif
} // namespace boost
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
@@ -0,0 +1,29 @@
:doctype: manpage
:man source: AsciiDoc
:man version: {revnumber}
:man manual: WSJT-X Manual
= rigctld-wsjtx(1)
== NAME
rigctld-wsjtx - Hamlib 3 rigctld server.
== SYNOPSIS
*rigctld-wsjtx* [OPTIONS]
== DESCRIPTION
*wsjtx* uses a version of the *hamlib* CAT control library. This
library is heavily modified over the current release version of
*hamlib*. If a *wsjtx* user wishes to use the *hamlib* network rig
server *rigctld* to remotely control their transceiver; then this
special version of *rigctld* should be used since that too has the
modified *hamlib* code embedded with it.
WSJT-X home page:: http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html
WSJT-X User's Guide:: http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main-toc2.html
== OPTIONS
Refer to the *hamlib* documentation.
@@ -0,0 +1,378 @@
///////////////////////////////////////////////////////////////////////////////
/// \file operators.hpp
/// Contains all the overloaded operators that make it possible to build
/// Proto expression trees.
//
// Copyright 2008 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PROTO_OPERATORS_HPP_EAN_04_01_2005
#define BOOST_PROTO_OPERATORS_HPP_EAN_04_01_2005
#include <boost/config.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/tags.hpp>
#include <boost/proto/domain.hpp>
#include <boost/proto/matches.hpp>
#include <boost/proto/generate.hpp>
#include <boost/proto/make_expr.hpp>
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
#endif
namespace boost { namespace proto
{
namespace detail
{
template<typename MakeExpr, typename Grammar>
struct lazy_matches
: proto::matches<typename MakeExpr::type, Grammar>
{};
template<typename Domain, typename Grammar, typename Trait, typename Tag, typename Arg>
struct enable_unary
: boost::lazy_enable_if_c<
boost::mpl::and_<
Trait
, lazy_matches<result_of::make_expr<Tag, basic_default_domain, Arg>, Grammar>
>::value
, result_of::make_expr<Tag, Domain, Arg>
>
{};
template<typename Domain, typename Trait, typename Tag, typename Arg>
struct enable_unary<Domain, proto::_, Trait, Tag, Arg &>
: boost::lazy_enable_if_c<
Trait::value
, result_of::make_expr<Tag, Domain, Arg &>
>
{};
template<typename Trait, typename Tag, typename Arg>
struct enable_unary<deduce_domain, not_a_grammar, Trait, Tag, Arg &>
: enable_unary<
typename domain_of<Arg>::type
, typename domain_of<Arg>::type::proto_grammar
, Trait
, Tag
, Arg &
>
{};
template<typename Domain, typename Grammar, typename Trait, typename Tag, typename Left, typename Right>
struct enable_binary
: boost::lazy_enable_if_c<
boost::mpl::and_<
Trait
, lazy_matches<result_of::make_expr<Tag, basic_default_domain, Left, Right>, Grammar>
>::value
, result_of::make_expr<Tag, Domain, Left, Right>
>
{};
template<typename Domain, typename Trait, typename Tag, typename Left, typename Right>
struct enable_binary<Domain, proto::_, Trait, Tag, Left &, Right &>
: boost::lazy_enable_if_c<
Trait::value
, result_of::make_expr<Tag, Domain, Left &, Right &>
>
{};
template<typename Trait, typename Tag, typename Left, typename Right>
struct enable_binary<deduce_domain, not_a_grammar, Trait, Tag, Left &, Right &>
: enable_binary<
typename deduce_domain2<Left, Right>::type
, typename deduce_domain2<Left, Right>::type::proto_grammar
, Trait
, Tag
, Left &
, Right &
>
{};
} // detail
#define BOOST_PROTO_UNARY_OP_IS_POSTFIX_0
#define BOOST_PROTO_UNARY_OP_IS_POSTFIX_1 , int
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \
template<typename Arg> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_unary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \
, TAG \
, Arg & \
>::type const \
operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg &>()(arg); \
} \
\
template<typename Arg> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_unary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \
, TAG \
, Arg const & \
>::type const \
operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg const &>()(arg); \
} \
/**/
#define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \
template<typename Left, typename Right> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
, TAG \
, Left & \
, Right & \
>::type const \
operator OP(Left &left, Right &right) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Left &, Right &>()(left, right); \
} \
\
template<typename Left, typename Right> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
, TAG \
, Left & \
, Right const & \
>::type const \
operator OP(Left &left, Right const &right) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Left &, Right const &>()(left, right); \
} \
\
template<typename Left, typename Right> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
, TAG \
, Left const & \
, Right & \
>::type const \
operator OP(Left const &left, Right &right) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right &>()(left, right); \
} \
\
template<typename Left, typename Right> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
, TAG \
, Left const & \
, Right const & \
>::type const \
operator OP(Left const &left, Right const &right) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right const &>()(left, right);\
} \
/**/
#else
#define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \
template<typename Arg> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_unary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \
, TAG \
, Arg const & \
>::type const \
operator OP(Arg &&arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg const &>()(arg); \
} \
/**/
#define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \
template<typename Left, typename Right> \
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
, BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
, TAG \
, Left const & \
, Right const & \
>::type const \
operator OP(Left &&left, Right &&right) \
{ \
return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right const &>()(left, right);\
} \
/**/
#endif
#define BOOST_PROTO_DEFINE_OPERATORS(TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(+, boost::proto::tag::unary_plus, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(-, boost::proto::tag::negate, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(*, boost::proto::tag::dereference, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(~, boost::proto::tag::complement, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(&, boost::proto::tag::address_of, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(!, boost::proto::tag::logical_not, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(++, boost::proto::tag::pre_inc, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(--, boost::proto::tag::pre_dec, TRAIT, DOMAIN, 0) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(++, boost::proto::tag::post_inc, TRAIT, DOMAIN, 1) \
BOOST_PROTO_DEFINE_UNARY_OPERATOR(--, boost::proto::tag::post_dec, TRAIT, DOMAIN, 1) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(<<, boost::proto::tag::shift_left, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(>>, boost::proto::tag::shift_right, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(*, boost::proto::tag::multiplies, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(/, boost::proto::tag::divides, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(%, boost::proto::tag::modulus, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(+, boost::proto::tag::plus, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(-, boost::proto::tag::minus, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(<, boost::proto::tag::less, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(>, boost::proto::tag::greater, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(<=, boost::proto::tag::less_equal, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(>=, boost::proto::tag::greater_equal, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(==, boost::proto::tag::equal_to, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(!=, boost::proto::tag::not_equal_to, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(||, boost::proto::tag::logical_or, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(&&, boost::proto::tag::logical_and, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(&, boost::proto::tag::bitwise_and, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(|, boost::proto::tag::bitwise_or, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(^, boost::proto::tag::bitwise_xor, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(BOOST_PP_COMMA(), boost::proto::tag::comma, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(->*, boost::proto::tag::mem_ptr, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(<<=, boost::proto::tag::shift_left_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(>>=, boost::proto::tag::shift_right_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(*=, boost::proto::tag::multiplies_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(/=, boost::proto::tag::divides_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(%=, boost::proto::tag::modulus_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(+=, boost::proto::tag::plus_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(-=, boost::proto::tag::minus_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(&=, boost::proto::tag::bitwise_and_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(|=, boost::proto::tag::bitwise_or_assign, TRAIT, DOMAIN) \
BOOST_PROTO_DEFINE_BINARY_OPERATOR(^=, boost::proto::tag::bitwise_xor_assign, TRAIT, DOMAIN) \
/**/
// Extensions are a superset of Proto expressions
template<typename T>
struct is_extension
: is_expr<T>
{};
template<typename T>
struct is_extension<T &>
: is_expr<T>
{};
#define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) TRAIT<ARG>
#define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) boost::mpl::or_<TRAIT<LEFT>, TRAIT<RIGHT> >
namespace exprns_
{
// This defines all of Proto's built-in free operator overloads
BOOST_PROTO_DEFINE_OPERATORS(is_extension, deduce_domain)
// if_else, for the non-overloadable ternary conditional operator ?:
template<typename A0, typename A1, typename A2>
BOOST_FORCEINLINE
typename result_of::make_expr<
tag::if_else_
, deduce_domain
, A0 const &
, A1 const &
, A2 const &
>::type const
if_else(A0 const &a0, A1 const &a1, A2 const &a2)
{
return proto::detail::make_expr_<
tag::if_else_
, deduce_domain
, A0 const &
, A1 const &
, A2 const &
>()(a0, a1, a2);
}
}
using exprns_::if_else;
#undef BOOST_PROTO_APPLY_UNARY_
#undef BOOST_PROTO_APPLY_BINARY_
// Redefine BOOST_PROTO_APPLY_UNARY_ and BOOST_PROTO_APPLY_BINARY_ so that end users
// can use BOOST_PROTO_DEFINE_OPERATORS to define Proto operator overloads that work
// with their own terminal types.
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) \
boost::mpl::and_< \
TRAIT<ARG> \
, boost::mpl::not_<boost::proto::is_extension<ARG> > \
> \
/**/
#define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) \
boost::mpl::and_< \
boost::mpl::or_<TRAIT<LEFT>, TRAIT<RIGHT> > \
, boost::mpl::not_< \
boost::mpl::or_< \
boost::proto::is_extension<LEFT> \
, boost::proto::is_extension<RIGHT> \
> \
> \
> \
/**/
#else
#define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) \
boost::mpl::and_< \
TRAIT<BOOST_PROTO_UNCVREF(ARG) > \
, boost::mpl::not_<boost::proto::is_extension<ARG> > \
> \
/**/
#define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) \
boost::mpl::and_< \
boost::mpl::or_<TRAIT<BOOST_PROTO_UNCVREF(LEFT) >, TRAIT<BOOST_PROTO_UNCVREF(RIGHT) > > \
, boost::mpl::not_< \
boost::mpl::or_< \
boost::proto::is_extension<LEFT> \
, boost::proto::is_extension<RIGHT> \
> \
> \
> \
/**/
#endif
}}
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif
@@ -0,0 +1,203 @@
//---------------------------------------------------------------------------//
// 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_ALGORITHM_DETAIL_MERGE_WIH_MERGE_PATH_HPP
#define BOOST_COMPUTE_ALGORITHM_DETAIL_MERGE_WIH_MERGE_PATH_HPP
#include <iterator>
#include <boost/compute/algorithm/detail/merge_path.hpp>
#include <boost/compute/algorithm/fill_n.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/detail/iterator_range_size.hpp>
#include <boost/compute/detail/meta_kernel.hpp>
#include <boost/compute/system.hpp>
namespace boost {
namespace compute {
namespace detail {
///
/// \brief Serial merge kernel class
///
/// Subclass of meta_kernel to perform serial merge after tiling
///
class serial_merge_kernel : meta_kernel
{
public:
unsigned int tile_size;
serial_merge_kernel() : meta_kernel("merge")
{
tile_size = 4;
}
template<class InputIterator1, class InputIterator2,
class InputIterator3, class InputIterator4,
class OutputIterator, class Compare>
void set_range(InputIterator1 first1,
InputIterator2 first2,
InputIterator3 tile_first1,
InputIterator3 tile_last1,
InputIterator4 tile_first2,
OutputIterator result,
Compare comp)
{
m_count = iterator_range_size(tile_first1, tile_last1) - 1;
*this <<
"uint i = get_global_id(0);\n" <<
"uint start1 = " << tile_first1[expr<uint_>("i")] << ";\n" <<
"uint end1 = " << tile_first1[expr<uint_>("i+1")] << ";\n" <<
"uint start2 = " << tile_first2[expr<uint_>("i")] << ";\n" <<
"uint end2 = " << tile_first2[expr<uint_>("i+1")] << ";\n" <<
"uint index = i*" << tile_size << ";\n" <<
"while(start1<end1 && start2<end2)\n" <<
"{\n" <<
" if(!(" << comp(first2[expr<uint_>("start2")],
first1[expr<uint_>("start1")]) << "))\n" <<
" {\n" <<
result[expr<uint_>("index")] <<
" = " << first1[expr<uint_>("start1")] << ";\n" <<
" index++;\n" <<
" start1++;\n" <<
" }\n" <<
" else\n" <<
" {\n" <<
result[expr<uint_>("index")] <<
" = " << first2[expr<uint_>("start2")] << ";\n" <<
" index++;\n" <<
" start2++;\n" <<
" }\n" <<
"}\n" <<
"while(start1<end1)\n" <<
"{\n" <<
result[expr<uint_>("index")] <<
" = " << first1[expr<uint_>("start1")] << ";\n" <<
" index++;\n" <<
" start1++;\n" <<
"}\n" <<
"while(start2<end2)\n" <<
"{\n" <<
result[expr<uint_>("index")] <<
" = " << first2[expr<uint_>("start2")] << ";\n" <<
" index++;\n" <<
" start2++;\n" <<
"}\n";
}
template<class InputIterator1, class InputIterator2,
class InputIterator3, class InputIterator4,
class OutputIterator>
void set_range(InputIterator1 first1,
InputIterator2 first2,
InputIterator3 tile_first1,
InputIterator3 tile_last1,
InputIterator4 tile_first2,
OutputIterator result)
{
typedef typename std::iterator_traits<InputIterator1>::value_type value_type;
::boost::compute::less<value_type> less_than;
set_range(first1, first2, tile_first1, tile_last1, tile_first2, result, less_than);
}
event exec(command_queue &queue)
{
if(m_count == 0) {
return event();
}
return exec_1d(queue, 0, m_count);
}
private:
size_t m_count;
};
///
/// \brief Merge algorithm with merge path
///
/// Merges the sorted values in the range [\p first1, \p last1) with
/// the sorted values in the range [\p first2, last2) and stores the
/// result in the range beginning at \p result
///
/// \param first1 Iterator pointing to start of first set
/// \param last1 Iterator pointing to end of first set
/// \param first2 Iterator pointing to start of second set
/// \param last2 Iterator pointing to end of second set
/// \param result Iterator pointing to start of range in which the result
/// will be stored
/// \param comp Comparator which performs less than function
/// \param queue Queue on which to execute
///
template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
inline OutputIterator
merge_with_merge_path(InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
InputIterator2 last2,
OutputIterator result,
Compare comp,
command_queue &queue = system::default_queue())
{
typedef typename
std::iterator_traits<OutputIterator>::difference_type result_difference_type;
size_t tile_size = 1024;
size_t count1 = iterator_range_size(first1, last1);
size_t count2 = iterator_range_size(first2, last2);
vector<uint_> tile_a((count1+count2+tile_size-1)/tile_size+1, queue.get_context());
vector<uint_> tile_b((count1+count2+tile_size-1)/tile_size+1, queue.get_context());
// Tile the sets
merge_path_kernel tiling_kernel;
tiling_kernel.tile_size = static_cast<unsigned int>(tile_size);
tiling_kernel.set_range(first1, last1, first2, last2,
tile_a.begin()+1, tile_b.begin()+1, comp);
fill_n(tile_a.begin(), 1, uint_(0), queue);
fill_n(tile_b.begin(), 1, uint_(0), queue);
tiling_kernel.exec(queue);
fill_n(tile_a.end()-1, 1, static_cast<uint_>(count1), queue);
fill_n(tile_b.end()-1, 1, static_cast<uint_>(count2), queue);
// Merge
serial_merge_kernel merge_kernel;
merge_kernel.tile_size = static_cast<unsigned int>(tile_size);
merge_kernel.set_range(first1, first2, tile_a.begin(), tile_a.end(),
tile_b.begin(), result, comp);
merge_kernel.exec(queue);
return result + static_cast<result_difference_type>(count1 + count2);
}
/// \overload
template<class InputIterator1, class InputIterator2, class OutputIterator>
inline OutputIterator
merge_with_merge_path(InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
InputIterator2 last2,
OutputIterator result,
command_queue &queue = system::default_queue())
{
typedef typename std::iterator_traits<InputIterator1>::value_type value_type;
::boost::compute::less<value_type> less_than;
return merge_with_merge_path(first1, last1, first2, last2, result, less_than, queue);
}
} //end detail namespace
} //end compute namespace
} //end boost namespace
#endif // BOOST_COMPUTE_ALGORITHM_DETAIL_MERGE_WIH_MERGE_PATH_HPP