Initial Commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,198 @@
|
||||
// (C) Copyright John Maddock 2001.
|
||||
// (C) Copyright Jens Maurer 2001 - 2003.
|
||||
// (C) Copyright Peter Dimov 2002.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
|
||||
// (C) Copyright David Abrahams 2002.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Sun C++ compiler setup:
|
||||
|
||||
# if __SUNPRO_CC <= 0x500
|
||||
# define BOOST_NO_MEMBER_TEMPLATES
|
||||
# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
# endif
|
||||
|
||||
# if (__SUNPRO_CC <= 0x520)
|
||||
//
|
||||
// Sunpro 5.2 and earler:
|
||||
//
|
||||
// although sunpro 5.2 supports the syntax for
|
||||
// inline initialization it often gets the value
|
||||
// wrong, especially where the value is computed
|
||||
// from other constants (J Maddock 6th May 2001)
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
|
||||
// Although sunpro 5.2 supports the syntax for
|
||||
// partial specialization, it often seems to
|
||||
// bind to the wrong specialization. Better
|
||||
// to disable it until suppport becomes more stable
|
||||
// (J Maddock 6th May 2001).
|
||||
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# endif
|
||||
|
||||
# if (__SUNPRO_CC <= 0x530)
|
||||
// Requesting debug info (-g) with Boost.Python results
|
||||
// in an internal compiler error for "static const"
|
||||
// initialized in-class.
|
||||
// >> Assertion: (../links/dbg_cstabs.cc, line 611)
|
||||
// while processing ../test.cpp at line 0.
|
||||
// (Jens Maurer according to Gottfried Ganssauge 04 Mar 2002)
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
|
||||
// SunPro 5.3 has better support for partial specialization,
|
||||
// but breaks when compiling std::less<shared_ptr<T> >
|
||||
// (Jens Maurer 4 Nov 2001).
|
||||
|
||||
// std::less specialization fixed as reported by George
|
||||
// Heintzelman; partial specialization re-enabled
|
||||
// (Peter Dimov 17 Jan 2002)
|
||||
|
||||
//# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
// integral constant expressions with 64 bit numbers fail
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
# endif
|
||||
|
||||
# if (__SUNPRO_CC < 0x570)
|
||||
# define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
// see http://lists.boost.org/MailArchives/boost/msg47184.php
|
||||
// and http://lists.boost.org/MailArchives/boost/msg47220.php
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
# define BOOST_NO_SFINAE
|
||||
# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
|
||||
# endif
|
||||
# if (__SUNPRO_CC <= 0x580)
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# endif
|
||||
|
||||
# if (__SUNPRO_CC <= 0x5100)
|
||||
// Sun 5.10 may not correctly value-initialize objects of
|
||||
// some user defined types, as was reported in April 2010
|
||||
// (CR 6947016), and confirmed by Steve Clamage.
|
||||
// (Niels Dekker, LKEB, May 2010).
|
||||
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
|
||||
# endif
|
||||
|
||||
//
|
||||
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
|
||||
//
|
||||
#if __SUNPRO_CC > 0x500
|
||||
# define BOOST_SYMBOL_EXPORT __global
|
||||
# define BOOST_SYMBOL_IMPORT __global
|
||||
# define BOOST_SYMBOL_VISIBLE __global
|
||||
#endif
|
||||
|
||||
#if (__SUNPRO_CC < 0x5130)
|
||||
// C++03 features in 12.4:
|
||||
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
||||
#define BOOST_NO_SFINAE_EXPR
|
||||
#define BOOST_NO_ADL_BARRIER
|
||||
#define BOOST_NO_CXX11_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
#if (__SUNPRO_CC < 0x5130) || (__cplusplus < 201100)
|
||||
// C++11 only featuires in 12.4:
|
||||
#define BOOST_NO_CXX11_AUTO_DECLARATIONS
|
||||
#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
|
||||
#define BOOST_NO_CXX11_CHAR16_T
|
||||
#define BOOST_NO_CXX11_CHAR32_T
|
||||
#define BOOST_NO_CXX11_CONSTEXPR
|
||||
#define BOOST_NO_CXX11_DECLTYPE
|
||||
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||
#define BOOST_NO_CXX11_EXTERN_TEMPLATE
|
||||
#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
|
||||
#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#define BOOST_NO_CXX11_LAMBDAS
|
||||
#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
|
||||
#define BOOST_NO_CXX11_NOEXCEPT
|
||||
#define BOOST_NO_CXX11_NULLPTR
|
||||
#define BOOST_NO_CXX11_RANGE_BASED_FOR
|
||||
#define BOOST_NO_CXX11_RAW_LITERALS
|
||||
#define BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#define BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
#define BOOST_NO_CXX11_STATIC_ASSERT
|
||||
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_CXX11_UNICODE_LITERALS
|
||||
#define BOOST_NO_CXX11_ALIGNAS
|
||||
#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
|
||||
#define BOOST_NO_CXX11_INLINE_NAMESPACES
|
||||
#define BOOST_NO_CXX11_FINAL
|
||||
#endif
|
||||
|
||||
#if (__SUNPRO_CC < 0x5140) || (__cplusplus < 201103)
|
||||
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
|
||||
#define BOOST_NO_CXX11_DECLTYPE_N3276
|
||||
#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
|
||||
#define BOOST_NO_CXX11_REF_QUALIFIERS
|
||||
#define BOOST_NO_CXX11_THREAD_LOCAL
|
||||
#endif
|
||||
|
||||
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
|
||||
//
|
||||
// C++0x features
|
||||
//
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
|
||||
|
||||
// C++ 14:
|
||||
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
|
||||
# define BOOST_NO_CXX14_AGGREGATE_NSDMI
|
||||
#endif
|
||||
#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
|
||||
# define BOOST_NO_CXX14_BINARY_LITERALS
|
||||
#endif
|
||||
#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
|
||||
# define BOOST_NO_CXX14_CONSTEXPR
|
||||
#endif
|
||||
#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304) || (__cplusplus < 201402L)
|
||||
# define BOOST_NO_CXX14_DECLTYPE_AUTO
|
||||
#endif
|
||||
#if (__cplusplus < 201304) // There's no SD6 check for this....
|
||||
# define BOOST_NO_CXX14_DIGIT_SEPARATORS
|
||||
#endif
|
||||
#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
|
||||
# define BOOST_NO_CXX14_GENERIC_LAMBDAS
|
||||
#endif
|
||||
#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
|
||||
# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
|
||||
#endif
|
||||
#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
|
||||
# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
|
||||
#endif
|
||||
#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
|
||||
# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
|
||||
#endif
|
||||
|
||||
// Turn on threading support for Solaris 12.
|
||||
// Ticket #11972
|
||||
#if (__SUNPRO_CC >= 0x5140) && defined(__SunOS_5_12) && !defined(BOOST_HAS_THREADS)
|
||||
# define BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
|
||||
|
||||
//
|
||||
// versions check:
|
||||
// we don't support sunpro prior to version 4:
|
||||
#if __SUNPRO_CC < 0x400
|
||||
#error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 0x590:
|
||||
#if (__SUNPRO_CC > 0x590)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,265 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2015 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_IMAGE_IMAGE3D_HPP
|
||||
#define BOOST_COMPUTE_IMAGE_IMAGE3D_HPP
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <boost/compute/detail/get_object_info.hpp>
|
||||
#include <boost/compute/exception/opencl_error.hpp>
|
||||
#include <boost/compute/image/image_format.hpp>
|
||||
#include <boost/compute/image/image_object.hpp>
|
||||
#include <boost/compute/type_traits/type_name.hpp>
|
||||
#include <boost/compute/utility/extents.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
// forward declarations
|
||||
class command_queue;
|
||||
|
||||
/// \class image3d
|
||||
/// \brief An OpenCL 3D image object
|
||||
///
|
||||
/// \see image_format, image2d
|
||||
class image3d : public image_object
|
||||
{
|
||||
public:
|
||||
/// Creates a null image3d object.
|
||||
image3d()
|
||||
: image_object()
|
||||
{
|
||||
}
|
||||
|
||||
/// Creates a new image3d object.
|
||||
///
|
||||
/// \see_opencl_ref{clCreateImage}
|
||||
image3d(const context &context,
|
||||
size_t image_width,
|
||||
size_t image_height,
|
||||
size_t image_depth,
|
||||
const image_format &format,
|
||||
cl_mem_flags flags = read_write,
|
||||
void *host_ptr = 0,
|
||||
size_t image_row_pitch = 0,
|
||||
size_t image_slice_pitch = 0)
|
||||
{
|
||||
cl_int error = 0;
|
||||
|
||||
#ifdef CL_VERSION_1_2
|
||||
cl_image_desc desc;
|
||||
desc.image_type = CL_MEM_OBJECT_IMAGE3D;
|
||||
desc.image_width = image_width;
|
||||
desc.image_height = image_height;
|
||||
desc.image_depth = image_depth;
|
||||
desc.image_array_size = 0;
|
||||
desc.image_row_pitch = image_row_pitch;
|
||||
desc.image_slice_pitch = image_slice_pitch;
|
||||
desc.num_mip_levels = 0;
|
||||
desc.num_samples = 0;
|
||||
#ifdef CL_VERSION_2_0
|
||||
desc.mem_object = 0;
|
||||
#else
|
||||
desc.buffer = 0;
|
||||
#endif
|
||||
|
||||
m_mem = clCreateImage(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
&desc,
|
||||
host_ptr,
|
||||
&error);
|
||||
#else
|
||||
m_mem = clCreateImage3D(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
image_width,
|
||||
image_height,
|
||||
image_depth,
|
||||
image_row_pitch,
|
||||
image_slice_pitch,
|
||||
host_ptr,
|
||||
&error);
|
||||
#endif
|
||||
|
||||
if(!m_mem){
|
||||
BOOST_THROW_EXCEPTION(opencl_error(error));
|
||||
}
|
||||
}
|
||||
|
||||
/// \internal_ (deprecated)
|
||||
image3d(const context &context,
|
||||
cl_mem_flags flags,
|
||||
const image_format &format,
|
||||
size_t image_width,
|
||||
size_t image_height,
|
||||
size_t image_depth,
|
||||
size_t image_row_pitch,
|
||||
size_t image_slice_pitch = 0,
|
||||
void *host_ptr = 0)
|
||||
{
|
||||
cl_int error = 0;
|
||||
|
||||
#ifdef CL_VERSION_1_2
|
||||
cl_image_desc desc;
|
||||
desc.image_type = CL_MEM_OBJECT_IMAGE3D;
|
||||
desc.image_width = image_width;
|
||||
desc.image_height = image_height;
|
||||
desc.image_depth = image_depth;
|
||||
desc.image_array_size = 0;
|
||||
desc.image_row_pitch = image_row_pitch;
|
||||
desc.image_slice_pitch = image_slice_pitch;
|
||||
desc.num_mip_levels = 0;
|
||||
desc.num_samples = 0;
|
||||
#ifdef CL_VERSION_2_0
|
||||
desc.mem_object = 0;
|
||||
#else
|
||||
desc.buffer = 0;
|
||||
#endif
|
||||
|
||||
m_mem = clCreateImage(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
&desc,
|
||||
host_ptr,
|
||||
&error);
|
||||
#else
|
||||
m_mem = clCreateImage3D(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
image_width,
|
||||
image_height,
|
||||
image_depth,
|
||||
image_row_pitch,
|
||||
image_slice_pitch,
|
||||
host_ptr,
|
||||
&error);
|
||||
#endif
|
||||
|
||||
if(!m_mem){
|
||||
BOOST_THROW_EXCEPTION(opencl_error(error));
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new image3d as a copy of \p other.
|
||||
image3d(const image3d &other)
|
||||
: image_object(other)
|
||||
{
|
||||
}
|
||||
|
||||
/// Copies the image3d from \p other.
|
||||
image3d& operator=(const image3d &other)
|
||||
{
|
||||
image_object::operator=(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
|
||||
/// Move-constructs a new image object from \p other.
|
||||
image3d(image3d&& other) BOOST_NOEXCEPT
|
||||
: image_object(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
/// Move-assigns the image from \p other to \c *this.
|
||||
image3d& operator=(image3d&& other) BOOST_NOEXCEPT
|
||||
{
|
||||
image_object::operator=(std::move(other));
|
||||
|
||||
return *this;
|
||||
}
|
||||
#endif // BOOST_COMPUTE_NO_RVALUE_REFERENCES
|
||||
|
||||
/// Destroys the image3d object.
|
||||
~image3d()
|
||||
{
|
||||
}
|
||||
|
||||
/// Returns the size (width, height, depth) of the image.
|
||||
extents<3> size() const
|
||||
{
|
||||
extents<3> size;
|
||||
size[0] = get_info<size_t>(CL_IMAGE_WIDTH);
|
||||
size[1] = get_info<size_t>(CL_IMAGE_HEIGHT);
|
||||
size[2] = get_info<size_t>(CL_IMAGE_DEPTH);
|
||||
return size;
|
||||
}
|
||||
|
||||
/// Returns the origin of the image (\c 0, \c 0, \c 0).
|
||||
extents<3> origin() const
|
||||
{
|
||||
return extents<3>();
|
||||
}
|
||||
|
||||
/// Returns information about the image.
|
||||
///
|
||||
/// \see_opencl_ref{clGetImageInfo}
|
||||
template<class T>
|
||||
T get_info(cl_image_info info) const
|
||||
{
|
||||
return detail::get_object_info<T>(clGetImageInfo, m_mem, info);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<int Enum>
|
||||
typename detail::get_object_info_type<image3d, Enum>::type
|
||||
get_info() const;
|
||||
|
||||
/// Returns the supported 3D image formats for the context.
|
||||
///
|
||||
/// \see_opencl_ref{clGetSupportedImageFormats}
|
||||
static std::vector<image_format>
|
||||
get_supported_formats(const context &context, cl_mem_flags flags = read_write)
|
||||
{
|
||||
return image_object::get_supported_formats(context, CL_MEM_OBJECT_IMAGE3D, flags);
|
||||
}
|
||||
|
||||
/// Returns \c true if \p format is a supported 3D image format for
|
||||
/// \p context.
|
||||
static bool is_supported_format(const image_format &format,
|
||||
const context &context,
|
||||
cl_mem_flags flags = read_write)
|
||||
{
|
||||
return image_object::is_supported_format(
|
||||
format, context, CL_MEM_OBJECT_IMAGE3D, flags
|
||||
);
|
||||
}
|
||||
|
||||
/// Creates a new image with a copy of the data in \c *this. Uses \p queue
|
||||
/// to perform the copy operation.
|
||||
image3d clone(command_queue &queue) const;
|
||||
};
|
||||
|
||||
/// \internal_ define get_info() specializations for image3d
|
||||
BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(image3d,
|
||||
((cl_image_format, CL_IMAGE_FORMAT))
|
||||
((size_t, CL_IMAGE_ELEMENT_SIZE))
|
||||
((size_t, CL_IMAGE_ROW_PITCH))
|
||||
((size_t, CL_IMAGE_SLICE_PITCH))
|
||||
((size_t, CL_IMAGE_WIDTH))
|
||||
((size_t, CL_IMAGE_HEIGHT))
|
||||
((size_t, CL_IMAGE_DEPTH))
|
||||
)
|
||||
|
||||
namespace detail {
|
||||
|
||||
// set_kernel_arg() specialization for image3d
|
||||
template<>
|
||||
struct set_kernel_arg<image3d> : public set_kernel_arg<image_object> { };
|
||||
|
||||
} // end detail namespace
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
BOOST_COMPUTE_TYPE_NAME(boost::compute::image3d, image3d_t)
|
||||
|
||||
#endif // BOOST_COMPUTE_IMAGE_IMAGE3D_HPP
|
||||
@@ -0,0 +1,51 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// 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_FUNCTIONAL_CONVERT_HPP
|
||||
#define BOOST_COMPUTE_FUNCTIONAL_CONVERT_HPP
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
namespace detail {
|
||||
|
||||
template<class T, class Arg>
|
||||
struct invoked_convert
|
||||
{
|
||||
invoked_convert(const Arg &arg)
|
||||
: m_arg(arg)
|
||||
{
|
||||
}
|
||||
|
||||
Arg m_arg;
|
||||
};
|
||||
|
||||
} // end detail namespace
|
||||
|
||||
/// The \ref convert function converts its argument to type \c T (similar to
|
||||
/// static_cast<T>).
|
||||
///
|
||||
/// \see \ref as "as<T>"
|
||||
template<class T>
|
||||
struct convert
|
||||
{
|
||||
typedef T result_type;
|
||||
|
||||
/// \internal_
|
||||
template<class Arg>
|
||||
detail::invoked_convert<T, Arg> operator()(const Arg &arg) const
|
||||
{
|
||||
return detail::invoked_convert<T, Arg>(arg);
|
||||
}
|
||||
};
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_FUNCTIONAL_CONVERT_HPP
|
||||
@@ -0,0 +1,121 @@
|
||||
#ifndef DATE_TIME_DATE_FORMATTING_LIMITED_HPP___
|
||||
#define DATE_TIME_DATE_FORMATTING_LIMITED_HPP___
|
||||
|
||||
/* Copyright (c) 2002-2004 CrystalClear Software, Inc.
|
||||
* Use, modification and distribution is subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
* Author: Jeff Garland, Bart Garst
|
||||
* $Date$
|
||||
*/
|
||||
|
||||
#include "boost/date_time/iso_format.hpp"
|
||||
#include "boost/date_time/compiler_config.hpp"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace date_time {
|
||||
|
||||
//! Formats a month as as string into an ostream
|
||||
template<class month_type, class format_type>
|
||||
class month_formatter
|
||||
{
|
||||
public:
|
||||
//! Formats a month as as string into an ostream
|
||||
/*! This function demands that month_type provide
|
||||
* functions for converting to short and long strings
|
||||
* if that capability is used.
|
||||
*/
|
||||
static std::ostream& format_month(const month_type& month,
|
||||
std::ostream& os)
|
||||
{
|
||||
switch (format_type::month_format())
|
||||
{
|
||||
case month_as_short_string:
|
||||
{
|
||||
os << month.as_short_string();
|
||||
break;
|
||||
}
|
||||
case month_as_long_string:
|
||||
{
|
||||
os << month.as_long_string();
|
||||
break;
|
||||
}
|
||||
case month_as_integer:
|
||||
{
|
||||
os << std::setw(2) << std::setfill('0') << month.as_number();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return os;
|
||||
} // format_month
|
||||
};
|
||||
|
||||
|
||||
//! Convert ymd to a standard string formatting policies
|
||||
template<class ymd_type, class format_type>
|
||||
class ymd_formatter
|
||||
{
|
||||
public:
|
||||
//! Convert ymd to a standard string formatting policies
|
||||
/*! This is standard code for handling date formatting with
|
||||
* year-month-day based date information. This function
|
||||
* uses the format_type to control whether the string will
|
||||
* contain separator characters, and if so what the character
|
||||
* will be. In addtion, it can format the month as either
|
||||
* an integer or a string as controled by the formatting
|
||||
* policy
|
||||
*/
|
||||
static std::string ymd_to_string(ymd_type ymd)
|
||||
{
|
||||
typedef typename ymd_type::month_type month_type;
|
||||
std::ostringstream ss;
|
||||
ss << ymd.year;
|
||||
if (format_type::has_date_sep_chars()) {
|
||||
ss << format_type::month_sep_char();
|
||||
}
|
||||
//this name is a bit ugly, oh well....
|
||||
month_formatter<month_type,format_type>::format_month(ymd.month, ss);
|
||||
if (format_type::has_date_sep_chars()) {
|
||||
ss << format_type::day_sep_char();
|
||||
}
|
||||
ss << std::setw(2) << std::setfill('0')
|
||||
<< ymd.day;
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//! Convert a date to string using format policies
|
||||
template<class date_type, class format_type>
|
||||
class date_formatter
|
||||
{
|
||||
public:
|
||||
//! Convert to a date to standard string using format policies
|
||||
static std::string date_to_string(date_type d)
|
||||
{
|
||||
typedef typename date_type::ymd_type ymd_type;
|
||||
if (d.is_not_a_date()) {
|
||||
return format_type::not_a_date();
|
||||
}
|
||||
if (d.is_neg_infinity()) {
|
||||
return format_type::neg_infinity();
|
||||
}
|
||||
if (d.is_pos_infinity()) {
|
||||
return format_type::pos_infinity();
|
||||
}
|
||||
ymd_type ymd = d.year_month_day();
|
||||
return ymd_formatter<ymd_type, format_type>::ymd_to_string(ymd);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} } //namespace date_time
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/* Copyright 2003-2015 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_ORDERED_INDEX_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_ORDERED_INDEX_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/multi_index/detail/ord_index_args.hpp>
|
||||
#include <boost/multi_index/detail/ord_index_impl_fwd.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
/* ordered_index specifiers */
|
||||
|
||||
template<typename Arg1,typename Arg2=mpl::na,typename Arg3=mpl::na>
|
||||
struct ordered_unique;
|
||||
|
||||
template<typename Arg1,typename Arg2=mpl::na,typename Arg3=mpl::na>
|
||||
struct ordered_non_unique;
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,154 @@
|
||||
// (C) Copyright John Maddock 2006.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_MATH_TOOLS_MINIMA_HPP
|
||||
#define BOOST_MATH_TOOLS_MINIMA_HPP
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <utility>
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <boost/math/tools/precision.hpp>
|
||||
#include <boost/math/policies/policy.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{
|
||||
|
||||
template <class F, class T>
|
||||
std::pair<T, T> brent_find_minima(F f, T min, T max, int bits, boost::uintmax_t& max_iter)
|
||||
BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval<F>()(std::declval<T>())))
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
bits = (std::min)(policies::digits<T, policies::policy<> >() / 2, bits);
|
||||
T tolerance = static_cast<T>(ldexp(1.0, 1-bits));
|
||||
T x; // minima so far
|
||||
T w; // second best point
|
||||
T v; // previous value of w
|
||||
T u; // most recent evaluation point
|
||||
T delta; // The distance moved in the last step
|
||||
T delta2; // The distance moved in the step before last
|
||||
T fu, fv, fw, fx; // function evaluations at u, v, w, x
|
||||
T mid; // midpoint of min and max
|
||||
T fract1, fract2; // minimal relative movement in x
|
||||
|
||||
static const T golden = 0.3819660f; // golden ratio, don't need too much precision here!
|
||||
|
||||
x = w = v = max;
|
||||
fw = fv = fx = f(x);
|
||||
delta2 = delta = 0;
|
||||
|
||||
uintmax_t count = max_iter;
|
||||
|
||||
do{
|
||||
// get midpoint
|
||||
mid = (min + max) / 2;
|
||||
// work out if we're done already:
|
||||
fract1 = tolerance * fabs(x) + tolerance / 4;
|
||||
fract2 = 2 * fract1;
|
||||
if(fabs(x - mid) <= (fract2 - (max - min) / 2))
|
||||
break;
|
||||
|
||||
if(fabs(delta2) > fract1)
|
||||
{
|
||||
// try and construct a parabolic fit:
|
||||
T r = (x - w) * (fx - fv);
|
||||
T q = (x - v) * (fx - fw);
|
||||
T p = (x - v) * q - (x - w) * r;
|
||||
q = 2 * (q - r);
|
||||
if(q > 0)
|
||||
p = -p;
|
||||
q = fabs(q);
|
||||
T td = delta2;
|
||||
delta2 = delta;
|
||||
// determine whether a parabolic step is acceptible or not:
|
||||
if((fabs(p) >= fabs(q * td / 2)) || (p <= q * (min - x)) || (p >= q * (max - x)))
|
||||
{
|
||||
// nope, try golden section instead
|
||||
delta2 = (x >= mid) ? min - x : max - x;
|
||||
delta = golden * delta2;
|
||||
}
|
||||
else
|
||||
{
|
||||
// whew, parabolic fit:
|
||||
delta = p / q;
|
||||
u = x + delta;
|
||||
if(((u - min) < fract2) || ((max- u) < fract2))
|
||||
delta = (mid - x) < 0 ? (T)-fabs(fract1) : (T)fabs(fract1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// golden section:
|
||||
delta2 = (x >= mid) ? min - x : max - x;
|
||||
delta = golden * delta2;
|
||||
}
|
||||
// update current position:
|
||||
u = (fabs(delta) >= fract1) ? T(x + delta) : (delta > 0 ? T(x + fabs(fract1)) : T(x - fabs(fract1)));
|
||||
fu = f(u);
|
||||
if(fu <= fx)
|
||||
{
|
||||
// good new point is an improvement!
|
||||
// update brackets:
|
||||
if(u >= x)
|
||||
min = x;
|
||||
else
|
||||
max = x;
|
||||
// update control points:
|
||||
v = w;
|
||||
w = x;
|
||||
x = u;
|
||||
fv = fw;
|
||||
fw = fx;
|
||||
fx = fu;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Oh dear, point u is worse than what we have already,
|
||||
// even so it *must* be better than one of our endpoints:
|
||||
if(u < x)
|
||||
min = u;
|
||||
else
|
||||
max = u;
|
||||
if((fu <= fw) || (w == x))
|
||||
{
|
||||
// however it is at least second best:
|
||||
v = w;
|
||||
w = u;
|
||||
fv = fw;
|
||||
fw = fu;
|
||||
}
|
||||
else if((fu <= fv) || (v == x) || (v == w))
|
||||
{
|
||||
// third best:
|
||||
v = u;
|
||||
fv = fu;
|
||||
}
|
||||
}
|
||||
|
||||
}while(--count);
|
||||
|
||||
max_iter -= count;
|
||||
|
||||
return std::make_pair(x, fx);
|
||||
}
|
||||
|
||||
template <class F, class T>
|
||||
inline std::pair<T, T> brent_find_minima(F f, T min, T max, int digits)
|
||||
BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval<F>()(std::declval<T>())))
|
||||
{
|
||||
boost::uintmax_t m = (std::numeric_limits<boost::uintmax_t>::max)();
|
||||
return brent_find_minima(f, min, max, digits, m);
|
||||
}
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
// (C) Copyright 2005 Matthias Troyer
|
||||
|
||||
// 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)
|
||||
|
||||
// Authors: Matthias Troyer
|
||||
|
||||
#ifndef BOOST_MPI_PACKED_IPRIMITIVE_HPP
|
||||
#define BOOST_MPI_PACKED_IPRIMITIVE_HPP
|
||||
|
||||
#include <boost/mpi/config.hpp>
|
||||
#include <cstddef> // size_t
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mpi/datatype.hpp>
|
||||
#include <boost/mpi/exception.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/detail/get_data.hpp>
|
||||
#include <vector>
|
||||
#include <boost/mpi/allocator.hpp>
|
||||
|
||||
namespace boost { namespace mpi {
|
||||
|
||||
/// deserialization using MPI_Unpack
|
||||
|
||||
class BOOST_MPI_DECL packed_iprimitive
|
||||
{
|
||||
public:
|
||||
/// the type of the buffer from which the data is unpacked upon deserialization
|
||||
typedef std::vector<char, allocator<char> > buffer_type;
|
||||
|
||||
packed_iprimitive(buffer_type & b, MPI_Comm const & comm, int position = 0)
|
||||
: buffer_(b),
|
||||
comm(comm),
|
||||
position(position)
|
||||
{
|
||||
}
|
||||
|
||||
void* address ()
|
||||
{
|
||||
return &buffer_[0];
|
||||
}
|
||||
|
||||
void const* address () const
|
||||
{
|
||||
return &buffer_[0];
|
||||
}
|
||||
|
||||
const std::size_t& size() const
|
||||
{
|
||||
return size_ = buffer_.size();
|
||||
}
|
||||
|
||||
void resize(std::size_t s)
|
||||
{
|
||||
buffer_.resize(s);
|
||||
}
|
||||
|
||||
void load_binary(void *address, std::size_t count)
|
||||
{
|
||||
load_impl(address,MPI_BYTE,count);
|
||||
}
|
||||
|
||||
// fast saving of arrays of fundamental types
|
||||
template<class T>
|
||||
void load_array(serialization::array_wrapper<T> const& x, unsigned int /* file_version */)
|
||||
{
|
||||
if (x.count())
|
||||
load_impl(x.address(), get_mpi_datatype(*x.address()), x.count());
|
||||
}
|
||||
|
||||
/*
|
||||
template<class T>
|
||||
void load(serialization::array_wrapper<T> const& x)
|
||||
{
|
||||
load_array(x,0u);
|
||||
}
|
||||
*/
|
||||
|
||||
typedef is_mpi_datatype<mpl::_1> use_array_optimization;
|
||||
|
||||
// default saving of primitives.
|
||||
template<class T>
|
||||
void load( T & t)
|
||||
{
|
||||
load_impl(&t, get_mpi_datatype(t), 1);
|
||||
}
|
||||
|
||||
template<class CharType>
|
||||
void load(std::basic_string<CharType> & s)
|
||||
{
|
||||
unsigned int l;
|
||||
load(l);
|
||||
s.resize(l);
|
||||
// note breaking a rule here - could be a problem on some platform
|
||||
if (l)
|
||||
load_impl(const_cast<CharType *>(s.data()),
|
||||
get_mpi_datatype(CharType()),l);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void load_impl(void * p, MPI_Datatype t, int l)
|
||||
{
|
||||
BOOST_MPI_CHECK_RESULT(MPI_Unpack,
|
||||
(const_cast<char*>(boost::serialization::detail::get_data(buffer_)), buffer_.size(), &position, p, l, t, comm));
|
||||
}
|
||||
|
||||
buffer_type & buffer_;
|
||||
mutable std::size_t size_;
|
||||
MPI_Comm comm;
|
||||
int position;
|
||||
};
|
||||
|
||||
} } // end namespace boost::mpi
|
||||
|
||||
#endif // BOOST_MPI_PACKED_IPRIMITIVE_HPP
|
||||
@@ -0,0 +1,43 @@
|
||||
// (C) Copyright John Maddock & Thorsten Ottosen 2005.
|
||||
// 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_DECAY_HPP_INCLUDED
|
||||
#define BOOST_TT_DECAY_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/type_traits/remove_bounds.hpp>
|
||||
#include <boost/type_traits/add_pointer.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <class T, bool Array, bool Function> struct decay_imp { typedef typename remove_cv<T>::type type; };
|
||||
template <class T> struct decay_imp<T, true, false> { typedef typename remove_bounds<T>::type* type; };
|
||||
template <class T> struct decay_imp<T, false, true> { typedef T* type; };
|
||||
|
||||
}
|
||||
|
||||
template< class T >
|
||||
struct decay
|
||||
{
|
||||
private:
|
||||
typedef typename remove_reference<T>::type Ty;
|
||||
public:
|
||||
typedef typename boost::detail::decay_imp<Ty, boost::is_array<Ty>::value, boost::is_function<Ty>::value>::type type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_TT_DECAY_HPP_INCLUDED
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,207 @@
|
||||
// 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 Anthony Williams
|
||||
// (C) Copyright 2011-2012 Vicente J. Botet Escriba
|
||||
|
||||
#ifndef BOOST_THREAD_LOCKABLE_TRAITS_HPP
|
||||
#define BOOST_THREAD_LOCKABLE_TRAITS_HPP
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/type_traits/is_class.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
// todo make use of integral_constant, true_type and false_type
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace sync
|
||||
{
|
||||
|
||||
#if defined(BOOST_NO_SFINAE) || \
|
||||
BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \
|
||||
BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
|
||||
#if ! defined BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
|
||||
#define BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
|
||||
namespace detail
|
||||
{
|
||||
#define BOOST_THREAD_DEFINE_HAS_MEMBER_CALLED(member_name) \
|
||||
template<typename T, bool=boost::is_class<T>::value> \
|
||||
struct has_member_called_##member_name \
|
||||
{ \
|
||||
BOOST_STATIC_CONSTANT(bool, value=false); \
|
||||
}; \
|
||||
\
|
||||
template<typename T> \
|
||||
struct has_member_called_##member_name<T,true> \
|
||||
{ \
|
||||
typedef char true_type; \
|
||||
struct false_type \
|
||||
{ \
|
||||
true_type dummy[2]; \
|
||||
}; \
|
||||
\
|
||||
struct fallback { int member_name; }; \
|
||||
struct derived: \
|
||||
T, fallback \
|
||||
{ \
|
||||
derived(); \
|
||||
}; \
|
||||
\
|
||||
template<int fallback::*> struct tester; \
|
||||
\
|
||||
template<typename U> \
|
||||
static false_type has_member(tester<&U::member_name>*); \
|
||||
template<typename U> \
|
||||
static true_type has_member(...); \
|
||||
\
|
||||
BOOST_STATIC_CONSTANT( \
|
||||
bool, value=sizeof(has_member<derived>(0))==sizeof(true_type)); \
|
||||
}
|
||||
|
||||
BOOST_THREAD_DEFINE_HAS_MEMBER_CALLED(lock)
|
||||
; BOOST_THREAD_DEFINE_HAS_MEMBER_CALLED(unlock);
|
||||
BOOST_THREAD_DEFINE_HAS_MEMBER_CALLED(try_lock);
|
||||
|
||||
template<typename T,bool=has_member_called_lock<T>::value >
|
||||
struct has_member_lock
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value=false);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct has_member_lock<T,true>
|
||||
{
|
||||
typedef char true_type;
|
||||
struct false_type
|
||||
{
|
||||
true_type dummy[2];
|
||||
};
|
||||
|
||||
template<typename U,typename V>
|
||||
static true_type has_member(V (U::*)());
|
||||
template<typename U>
|
||||
static false_type has_member(U);
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool,value=sizeof(has_member_lock<T>::has_member(&T::lock))==sizeof(true_type));
|
||||
};
|
||||
|
||||
template<typename T,bool=has_member_called_unlock<T>::value >
|
||||
struct has_member_unlock
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value=false);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct has_member_unlock<T,true>
|
||||
{
|
||||
typedef char true_type;
|
||||
struct false_type
|
||||
{
|
||||
true_type dummy[2];
|
||||
};
|
||||
|
||||
template<typename U,typename V>
|
||||
static true_type has_member(V (U::*)());
|
||||
template<typename U>
|
||||
static false_type has_member(U);
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool,value=sizeof(has_member_unlock<T>::has_member(&T::unlock))==sizeof(true_type));
|
||||
};
|
||||
|
||||
template<typename T,bool=has_member_called_try_lock<T>::value >
|
||||
struct has_member_try_lock
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value=false);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct has_member_try_lock<T,true>
|
||||
{
|
||||
typedef char true_type;
|
||||
struct false_type
|
||||
{
|
||||
true_type dummy[2];
|
||||
};
|
||||
|
||||
template<typename U>
|
||||
static true_type has_member(bool (U::*)());
|
||||
template<typename U>
|
||||
static false_type has_member(U);
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool,value=sizeof(has_member_try_lock<T>::has_member(&T::try_lock))==sizeof(true_type));
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct is_basic_lockable
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = detail::has_member_lock<T>::value &&
|
||||
detail::has_member_unlock<T>::value);
|
||||
};
|
||||
template<typename T>
|
||||
struct is_lockable
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
is_basic_lockable<T>::value &&
|
||||
detail::has_member_try_lock<T>::value);
|
||||
};
|
||||
|
||||
#else
|
||||
template<typename T>
|
||||
struct is_basic_lockable
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template<typename T>
|
||||
struct is_lockable
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
struct is_recursive_mutex_sur_parole
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template<typename T>
|
||||
struct is_recursive_mutex_sur_parolle : is_recursive_mutex_sur_parole<T>
|
||||
{
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct is_recursive_basic_lockable
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = is_basic_lockable<T>::value &&
|
||||
is_recursive_mutex_sur_parolle<T>::value);
|
||||
};
|
||||
template<typename T>
|
||||
struct is_recursive_lockable
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = is_lockable<T>::value &&
|
||||
is_recursive_mutex_sur_parolle<T>::value);
|
||||
};
|
||||
}
|
||||
template<typename T>
|
||||
struct is_mutex_type
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = sync::is_lockable<T>::value);
|
||||
};
|
||||
|
||||
}
|
||||
#include <boost/config/abi_suffix.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,139 @@
|
||||
module ft8_decode
|
||||
|
||||
type :: ft8_decoder
|
||||
procedure(ft8_decode_callback), pointer :: callback
|
||||
contains
|
||||
procedure :: decode
|
||||
end type ft8_decoder
|
||||
|
||||
abstract interface
|
||||
subroutine ft8_decode_callback (this,sync,snr,dt,freq,decoded,nap,qual)
|
||||
import ft8_decoder
|
||||
implicit none
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
real, intent(in) :: freq
|
||||
character(len=22), intent(in) :: decoded
|
||||
integer, intent(in) :: nap
|
||||
real, intent(in) :: qual
|
||||
end subroutine ft8_decode_callback
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine decode(this,callback,iwave,nQSOProgress,nfqso,nftx,newdat, &
|
||||
nutc,nfa,nfb,nexp_decode,ndepth,nagain,lapon,napwid,mycall12, &
|
||||
mygrid6,hiscall12,hisgrid6)
|
||||
! use wavhdr
|
||||
use timer_module, only: timer
|
||||
include 'fsk4hf/ft8_params.f90'
|
||||
! type(hdr) h
|
||||
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
procedure(ft8_decode_callback) :: callback
|
||||
real s(NH1,NHSYM)
|
||||
real candidate(3,200)
|
||||
real dd(15*12000)
|
||||
logical, intent(in) :: lapon,nagain
|
||||
logical newdat,lsubtract,ldupe,bcontest
|
||||
character*12 mycall12, hiscall12
|
||||
character*6 mygrid6,hisgrid6
|
||||
integer*2 iwave(15*12000)
|
||||
integer apsym(KK)
|
||||
character datetime*13,message*22
|
||||
character*22 allmessages(100)
|
||||
integer allsnrs(100)
|
||||
save s,dd
|
||||
|
||||
bcontest=iand(nexp_decode,128).ne.0
|
||||
this%callback => callback
|
||||
write(datetime,1001) nutc !### TEMPORARY ###
|
||||
1001 format("000000_",i6.6)
|
||||
|
||||
call ft8apset(mycall12,mygrid6,hiscall12,hisgrid6,bcontest,apsym,iaptype)
|
||||
dd=iwave
|
||||
ndecodes=0
|
||||
allmessages=' '
|
||||
allsnrs=0
|
||||
ifa=nfa
|
||||
ifb=nfb
|
||||
if(nagain) then
|
||||
ifa=nfqso-10
|
||||
ifb=nfqso+10
|
||||
endif
|
||||
|
||||
! For now:
|
||||
! ndepth=1: no subtraction, 1 pass, belief propagation only
|
||||
! ndepth=2: subtraction, 2 passes, belief propagation only
|
||||
! ndepth=3: subtraction, 2 passes, bp+osd2 at and near nfqso
|
||||
if(ndepth.eq.1) npass=1
|
||||
if(ndepth.ge.2) npass=2
|
||||
do ipass=1,npass
|
||||
newdat=.true. ! Is this a problem? I hijacked newdat.
|
||||
if(ipass.eq.1) then
|
||||
lsubtract=.true.
|
||||
if(ndepth.eq.1) lsubtract=.false.
|
||||
syncmin=1.5
|
||||
else
|
||||
lsubtract=.false.
|
||||
syncmin=1.5
|
||||
endif
|
||||
call timer('sync8 ',0)
|
||||
call sync8(dd,ifa,ifb,syncmin,nfqso,s,candidate,ncand)
|
||||
call timer('sync8 ',1)
|
||||
do icand=1,ncand
|
||||
sync=candidate(3,icand)
|
||||
f1=candidate(1,icand)
|
||||
xdt=candidate(2,icand)
|
||||
nsnr0=min(99,nint(10.0*log10(sync) - 25.5)) !### empirical ###
|
||||
call timer('ft8b ',0)
|
||||
call ft8b(dd,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,napwid, &
|
||||
lsubtract,nagain,iaptype,mygrid6,bcontest,sync,f1,xdt,apsym, &
|
||||
nharderrors,dmin,nbadcrc,iappass,iera,message,xsnr)
|
||||
nsnr=nint(xsnr)
|
||||
xdt=xdt-0.5
|
||||
hd=nharderrors+dmin
|
||||
call timer('ft8b ',1)
|
||||
if(nbadcrc.eq.0) then
|
||||
call jtmsg(message,iflag)
|
||||
if(bcontest) call fix_contest_msg(mygrid6,message)
|
||||
if(iand(iflag,16).ne.0) message(22:22)='?'
|
||||
if(iand(iflag,15).eq.0) then
|
||||
ldupe=.false.
|
||||
do id=1,ndecodes
|
||||
if(message.eq.allmessages(id).and.nsnr.le.allsnrs(id)) ldupe=.true.
|
||||
enddo
|
||||
if(.not.ldupe) then
|
||||
ndecodes=ndecodes+1
|
||||
allmessages(ndecodes)=message
|
||||
allsnrs(ndecodes)=nsnr
|
||||
endif
|
||||
! write(81,1004) nutc,ncand,icand,ipass,iaptype,iappass, &
|
||||
! iflag,nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||
! xdt,nint(f1),message
|
||||
! flush(81)
|
||||
if(.not.ldupe .and. associated(this%callback)) then
|
||||
qual=1.0-(nharderrors+dmin)/60.0 ! scale qual to [0.0,1.0]
|
||||
call this%callback(sync,nsnr,xdt,f1,message,iaptype,qual)
|
||||
endif
|
||||
else
|
||||
write(19,1004) nutc,ncand,icand,ipass,iaptype,iappass, &
|
||||
iflag,nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||
xdt,nint(f1),message
|
||||
1004 format(i6.6,2i4,3i2,2i3,3f6.1,i4,f6.2,i5,2x,a22)
|
||||
flush(19)
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
! h=default_header(12000,NMAX)
|
||||
! open(10,file='subtract.wav',status='unknown',access='stream')
|
||||
! iwave=nint(dd)
|
||||
! write(10) h,iwave
|
||||
! close(10)
|
||||
enddo
|
||||
return
|
||||
end subroutine decode
|
||||
|
||||
end module ft8_decode
|
||||
@@ -0,0 +1,73 @@
|
||||
#include "MaidenheadLocatorValidator.hpp"
|
||||
|
||||
MaidenheadLocatorValidator::MaidenheadLocatorValidator (QObject * parent, Length length, Length required)
|
||||
: QValidator {parent}
|
||||
{
|
||||
switch (length)
|
||||
{
|
||||
case Length::field:
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})$)"});
|
||||
break;
|
||||
case Length::square:
|
||||
if (Length::field == required)
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})([0-9]{2}){0,1}$)"});
|
||||
}
|
||||
else
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})[0-9]{2}$)"});
|
||||
}
|
||||
break;
|
||||
case Length::subsquare:
|
||||
if (Length::field == required)
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})([0-9]{2}((?<subsquare>[A-Xa-x]{2}){0,1})){0,1}$)"});
|
||||
}
|
||||
else if (Length::square == required)
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})[0-9]{2}(?<subsquare>[A-Xa-x]{2}){0,1}$)"});
|
||||
}
|
||||
else
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})[0-9]{2}(?<subsquare>[A-Xa-x]{2})$)"});
|
||||
}
|
||||
break;
|
||||
case Length::extended:
|
||||
if (Length::field == required)
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})([0-9]{2}((?<subsquare>[A-Xa-x]{2}){0,1}([0-9]{2}){0,1})){0,1}$)"});
|
||||
}
|
||||
else if (Length::square == required)
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})[0-9]{2}((?<subsquare>[A-Xa-x]{2})([0-9]{2}){0,1}){0,1}$)"});
|
||||
}
|
||||
else if (Length::subsquare == required)
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})[0-9]{2}(?<subsquare>[A-Xa-x]{2})([0-9]{2}){0,1}$)"});
|
||||
}
|
||||
else
|
||||
{
|
||||
re_.setPattern ({R"(^(?<field>[A-Ra-r]{2})[0-9]{2}(?<subsquare>[A-Xa-x]{2})[0-9]{2}$)"});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
auto MaidenheadLocatorValidator::validate (QString& input, int& pos) const -> State
|
||||
{
|
||||
auto match = re_.match (input, 0, QRegularExpression::PartialPreferCompleteMatch);
|
||||
auto field = match.captured ("field");
|
||||
if (field.size ())
|
||||
{
|
||||
input.replace (match.capturedStart ("field"), match.capturedLength ("field"), field.toUpper ());
|
||||
}
|
||||
auto subsquare = match.captured ("subsquare");
|
||||
if (subsquare.size ())
|
||||
{
|
||||
input.replace (match.capturedStart ("subsquare"), match.capturedLength ("subsquare"), subsquare.toLower ());
|
||||
}
|
||||
if (match.hasMatch ()) return Acceptable;
|
||||
if (!input.size () || match.hasPartialMatch ()) return Intermediate;
|
||||
pos = input.size ();
|
||||
return Invalid;
|
||||
}
|
||||
@@ -0,0 +1,369 @@
|
||||
// (C) Copyright Dustin Spicuzza 2009.
|
||||
// Adapted to vxWorks 6.9 by Peter Brockamp 2012.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Since WRS does not yet properly support boost under vxWorks
|
||||
// and this file was badly outdated, but I was keen on using it,
|
||||
// I patched boost myself to make things work. This has been tested
|
||||
// and adapted by me for vxWorks 6.9 *only*, as I'm lacking access
|
||||
// to earlier 6.X versions! The only thing I know for sure is that
|
||||
// very old versions of vxWorks (namely everything below 6.x) are
|
||||
// absolutely unable to use boost. This is mainly due to the completely
|
||||
// outdated libraries and ancient compiler (GCC 2.96 or worse). Do
|
||||
// not even think of getting this to work, a miserable failure will
|
||||
// be guaranteed!
|
||||
// Equally, this file has been tested for RTPs (Real Time Processes)
|
||||
// only, not for DKMs (Downloadable Kernel Modules). These two types
|
||||
// of executables differ largely in the available functionality of
|
||||
// the C-library, STL, and so on. A DKM uses a library similar to those
|
||||
// of vxWorks 5.X - with all its limitations and incompatibilities
|
||||
// with respect to ANSI C++ and STL. So probably there might be problems
|
||||
// with the usage of boost from DKMs. WRS or any voluteers are free to
|
||||
// prove the opposite!
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// Some important information regarding the usage of POSIX semaphores:
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// VxWorks as a real time operating system handles threads somewhat
|
||||
// different from what "normal" OSes do, regarding their scheduling!
|
||||
// This could lead to a scenario called "priority inversion" when using
|
||||
// semaphores, see http://en.wikipedia.org/wiki/Priority_inversion.
|
||||
//
|
||||
// Now, VxWorks POSIX-semaphores for DKM's default to the usage of
|
||||
// priority inverting semaphores, which is fine. On the other hand,
|
||||
// for RTP's it defaults to using non priority inverting semaphores,
|
||||
// which could easily pose a serious problem for a real time process,
|
||||
// i.e. deadlocks! To overcome this two possibilities do exist:
|
||||
//
|
||||
// a) Patch every piece of boost that uses semaphores to instanciate
|
||||
// the proper type of semaphores. This is non-intrusive with respect
|
||||
// to the OS and could relatively easy been done by giving all
|
||||
// semaphores attributes deviating from the default (for in-depth
|
||||
// information see the POSIX functions pthread_mutexattr_init()
|
||||
// and pthread_mutexattr_setprotocol()). However this breaks all
|
||||
// too easily, as with every new version some boost library could
|
||||
// all in a sudden start using semaphores, resurrecting the very
|
||||
// same, hard to locate problem over and over again!
|
||||
//
|
||||
// b) We could change the default properties for POSIX-semaphores
|
||||
// that VxWorks uses for RTP's and this is being suggested here,
|
||||
// as it will more or less seamlessly integrate with boost. I got
|
||||
// the following information from WRS how to do this, compare
|
||||
// Wind River TSR# 1209768:
|
||||
//
|
||||
// Instructions for changing the default properties of POSIX-
|
||||
// semaphores for RTP's in VxWorks 6.9:
|
||||
// - Edit the file /vxworks-6.9/target/usr/src/posix/pthreadLib.c
|
||||
// in the root of your Workbench-installation.
|
||||
// - Around line 917 there should be the definition of the default
|
||||
// mutex attributes:
|
||||
//
|
||||
// LOCAL pthread_mutexattr_t defaultMutexAttr =
|
||||
// {
|
||||
// PTHREAD_INITIALIZED_OBJ, PTHREAD_PRIO_NONE, 0,
|
||||
// PTHREAD_MUTEX_DEFAULT
|
||||
// };
|
||||
//
|
||||
// Here, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT.
|
||||
// - Around line 1236 there should be a definition for the function
|
||||
// pthread_mutexattr_init(). A couple of lines below you should
|
||||
// find a block of code like this:
|
||||
//
|
||||
// pAttr->mutexAttrStatus = PTHREAD_INITIALIZED_OBJ;
|
||||
// pAttr->mutexAttrProtocol = PTHREAD_PRIO_NONE;
|
||||
// pAttr->mutexAttrPrioceiling = 0;
|
||||
// pAttr->mutexAttrType = PTHREAD_MUTEX_DEFAULT;
|
||||
//
|
||||
// Here again, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT.
|
||||
// - Finally, rebuild your VSB. This will create a new VxWorks kernel
|
||||
// with the changed properties. That's it! Now, using boost should
|
||||
// no longer cause any problems with task deadlocks!
|
||||
//
|
||||
// And here's another useful piece of information concerning VxWorks'
|
||||
// POSIX-functionality in general:
|
||||
// VxWorks is not a genuine POSIX-OS in itself, rather it is using a
|
||||
// kind of compatibility layer (sort of a wrapper) to emulate the
|
||||
// POSIX-functionality by using its own resources and functions.
|
||||
// At the time a task (thread) calls it's first POSIX-function during
|
||||
// runtime it is being transformed by the OS into a POSIX-thread.
|
||||
// This transformation does include a call to malloc() to allocate the
|
||||
// memory required for the housekeeping of POSIX-threads. In a high
|
||||
// priority RTP this malloc() call may be highly undesirable, as its
|
||||
// timing is more or less unpredictable (depending on what your actual
|
||||
// heap looks like). You can circumvent this problem by calling the
|
||||
// function thread_self() at a well defined point in the code of the
|
||||
// task, e.g. shortly after the task spawns up. Thereby you are able
|
||||
// to define the time when the task-transformation will take place and
|
||||
// you could shift it to an uncritical point where a malloc() call is
|
||||
// tolerable. So, if this could pose a problem for your code, remember
|
||||
// to call thread_self() from the affected task at an early stage.
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
// Block out all versions before vxWorks 6.x, as these don't work:
|
||||
// Include header with the vxWorks version information and query them
|
||||
#include <version.h>
|
||||
#if !defined(_WRS_VXWORKS_MAJOR) || (_WRS_VXWORKS_MAJOR < 6)
|
||||
# error "The vxWorks version you're using is so badly outdated,\
|
||||
it doesn't work at all with boost, sorry, no chance!"
|
||||
#endif
|
||||
|
||||
// Handle versions above 5.X but below 6.9
|
||||
#if (_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR < 9)
|
||||
// TODO: Starting from what version does vxWorks work with boost?
|
||||
// We can't reasonably insert a #warning "" as a user hint here,
|
||||
// as this will show up with every file including some boost header,
|
||||
// badly bugging the user... So for the time being we just leave it.
|
||||
#endif
|
||||
|
||||
// vxWorks specific config options:
|
||||
// --------------------------------
|
||||
#define BOOST_PLATFORM "vxWorks"
|
||||
|
||||
// Special behaviour for DKMs:
|
||||
#ifdef _WRS_KERNEL
|
||||
// DKMs do not have the <cwchar>-header,
|
||||
// but apparently they do have an intrinsic wchar_t meanwhile!
|
||||
# define BOOST_NO_CWCHAR
|
||||
|
||||
// Lots of wide-functions and -headers are unavailable for DKMs as well:
|
||||
# define BOOST_NO_CWCTYPE
|
||||
# define BOOST_NO_SWPRINTF
|
||||
# define BOOST_NO_STD_WSTRING
|
||||
# define BOOST_NO_STD_WSTREAMBUF
|
||||
#endif
|
||||
|
||||
// Generally available headers:
|
||||
#define BOOST_HAS_UNISTD_H
|
||||
#define BOOST_HAS_STDINT_H
|
||||
#define BOOST_HAS_DIRENT_H
|
||||
#define BOOST_HAS_SLIST
|
||||
|
||||
// vxWorks does not have installed an iconv-library by default,
|
||||
// so unfortunately no Unicode support from scratch is available!
|
||||
// Thus, instead it is suggested to switch to ICU, as this seems
|
||||
// to be the most complete and portable option...
|
||||
#define BOOST_LOCALE_WITH_ICU
|
||||
|
||||
// Generally available functionality:
|
||||
#define BOOST_HAS_THREADS
|
||||
#define BOOST_HAS_NANOSLEEP
|
||||
#define BOOST_HAS_GETTIMEOFDAY
|
||||
#define BOOST_HAS_CLOCK_GETTIME
|
||||
#define BOOST_HAS_MACRO_USE_FACET
|
||||
|
||||
// Generally unavailable functionality, delivered by boost's test function:
|
||||
//#define BOOST_NO_DEDUCED_TYPENAME // Commented this out, boost's test gives an errorneous result!
|
||||
#define BOOST_NO_CXX11_EXTERN_TEMPLATE
|
||||
#define BOOST_NO_CXX11_VARIADIC_MACROS
|
||||
|
||||
// Generally available threading API's:
|
||||
#define BOOST_HAS_PTHREADS
|
||||
#define BOOST_HAS_SCHED_YIELD
|
||||
#define BOOST_HAS_SIGACTION
|
||||
|
||||
// Functionality available for RTPs only:
|
||||
#ifdef __RTP__
|
||||
# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
|
||||
# define BOOST_HAS_LOG1P
|
||||
# define BOOST_HAS_EXPM1
|
||||
#endif
|
||||
|
||||
// Functionality available for DKMs only:
|
||||
#ifdef _WRS_KERNEL
|
||||
// Luckily, at the moment there seems to be none!
|
||||
#endif
|
||||
|
||||
// These #defines allow posix_features to work, since vxWorks doesn't
|
||||
// #define them itself for DKMs (for RTPs on the contrary it does):
|
||||
#ifdef _WRS_KERNEL
|
||||
# ifndef _POSIX_TIMERS
|
||||
# define _POSIX_TIMERS 1
|
||||
# endif
|
||||
# ifndef _POSIX_THREADS
|
||||
# define _POSIX_THREADS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// vxWorks doesn't work with asio serial ports:
|
||||
#define BOOST_ASIO_DISABLE_SERIAL_PORT
|
||||
// TODO: The problem here seems to bee that vxWorks uses its own, very specific
|
||||
// ways to handle serial ports, incompatible with POSIX or anything...
|
||||
// Maybe a specific implementation would be possible, but until the
|
||||
// straight need arises... This implementation would presumably consist
|
||||
// of some vxWorks specific ioctl-calls, etc. Any voluteers?
|
||||
|
||||
// vxWorks-around: <time.h> #defines CLOCKS_PER_SEC as sysClkRateGet() but
|
||||
// miserably fails to #include the required <sysLib.h> to make
|
||||
// sysClkRateGet() available! So we manually include it here.
|
||||
#ifdef __RTP__
|
||||
# include <time.h>
|
||||
# include <sysLib.h>
|
||||
#endif
|
||||
|
||||
// vxWorks-around: In <stdint.h> the macros INT32_C(), UINT32_C(), INT64_C() and
|
||||
// UINT64_C() are defined errorneously, yielding not a signed/
|
||||
// unsigned long/long long type, but a signed/unsigned int/long
|
||||
// type. Eventually this leads to compile errors in ratio_fwd.hpp,
|
||||
// when trying to define several constants which do not fit into a
|
||||
// long type! We correct them here by redefining.
|
||||
#include <cstdint>
|
||||
|
||||
// Some macro-magic to do the job
|
||||
#define VX_JOIN(X, Y) VX_DO_JOIN(X, Y)
|
||||
#define VX_DO_JOIN(X, Y) VX_DO_JOIN2(X, Y)
|
||||
#define VX_DO_JOIN2(X, Y) X##Y
|
||||
|
||||
// Correctly setup the macros
|
||||
#undef INT32_C
|
||||
#undef UINT32_C
|
||||
#undef INT64_C
|
||||
#undef UINT64_C
|
||||
#define INT32_C(x) VX_JOIN(x, L)
|
||||
#define UINT32_C(x) VX_JOIN(x, UL)
|
||||
#define INT64_C(x) VX_JOIN(x, LL)
|
||||
#define UINT64_C(x) VX_JOIN(x, ULL)
|
||||
|
||||
// #include Libraries required for the following function adaption
|
||||
#include <ioLib.h>
|
||||
#include <tickLib.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
// Use C-linkage for the following helper functions
|
||||
extern "C" {
|
||||
|
||||
// vxWorks-around: The required functions getrlimit() and getrlimit() are missing.
|
||||
// But we have the similar functions getprlimit() and setprlimit(),
|
||||
// which may serve the purpose.
|
||||
// Problem: The vxWorks-documentation regarding these functions
|
||||
// doesn't deserve its name! It isn't documented what the first two
|
||||
// parameters idtype and id mean, so we must fall back to an educated
|
||||
// guess - null, argh... :-/
|
||||
|
||||
// TODO: getprlimit() and setprlimit() do exist for RTPs only, for whatever reason.
|
||||
// Thus for DKMs there would have to be another implementation.
|
||||
#ifdef __RTP__
|
||||
inline int getrlimit(int resource, struct rlimit *rlp){
|
||||
return getprlimit(0, 0, resource, rlp);
|
||||
}
|
||||
|
||||
inline int setrlimit(int resource, const struct rlimit *rlp){
|
||||
return setprlimit(0, 0, resource, const_cast<struct rlimit*>(rlp));
|
||||
}
|
||||
#endif
|
||||
|
||||
// vxWorks has ftruncate() only, so we do simulate truncate():
|
||||
inline int truncate(const char *p, off_t l){
|
||||
int fd = open(p, O_WRONLY);
|
||||
if (fd == -1){
|
||||
errno = EACCES;
|
||||
return -1;
|
||||
}
|
||||
if (ftruncate(fd, l) == -1){
|
||||
close(fd);
|
||||
errno = EACCES;
|
||||
return -1;
|
||||
}
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
// Fake symlink handling by dummy functions:
|
||||
inline int symlink(const char*, const char*){
|
||||
// vxWorks has no symlinks -> always return an error!
|
||||
errno = EACCES;
|
||||
return -1;
|
||||
}
|
||||
|
||||
inline ssize_t readlink(const char*, char*, size_t){
|
||||
// vxWorks has no symlinks -> always return an error!
|
||||
errno = EACCES;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// vxWorks claims to implement gettimeofday in sys/time.h
|
||||
// but nevertheless does not provide it! See
|
||||
// https://support.windriver.com/olsPortal/faces/maintenance/techtipDetail_noHeader.jspx?docId=16442&contentId=WR_TECHTIP_006256
|
||||
// We implement a surrogate version here via clock_gettime:
|
||||
inline int gettimeofday(struct timeval *tv, void * /*tzv*/) {
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
tv->tv_sec = ts.tv_sec;
|
||||
tv->tv_usec = ts.tv_nsec / 1000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// vxWorks does provide neither struct tms nor function times()!
|
||||
// We implement an empty dummy-function, simply setting the user
|
||||
// and system time to the half of thew actual system ticks-value
|
||||
// and the child user and system time to 0.
|
||||
// Rather ugly but at least it suppresses compiler errors...
|
||||
// Unfortunately, this of course *does* have an severe impact on
|
||||
// dependant libraries, actually this is chrono only! Here it will
|
||||
// not be possible to correctly use user and system times! But
|
||||
// as vxWorks is lacking the ability to calculate user and system
|
||||
// process times there seems to be no other possible solution.
|
||||
struct tms{
|
||||
clock_t tms_utime; // User CPU time
|
||||
clock_t tms_stime; // System CPU time
|
||||
clock_t tms_cutime; // User CPU time of terminated child processes
|
||||
clock_t tms_cstime; // System CPU time of terminated child processes
|
||||
};
|
||||
|
||||
inline clock_t times(struct tms *t){
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
|
||||
clock_t ticks(static_cast<clock_t>(static_cast<double>(ts.tv_sec) * CLOCKS_PER_SEC +
|
||||
static_cast<double>(ts.tv_nsec) * CLOCKS_PER_SEC / 1000000.0));
|
||||
t->tms_utime = ticks/2U;
|
||||
t->tms_stime = ticks/2U;
|
||||
t->tms_cutime = 0; // vxWorks is lacking the concept of a child process!
|
||||
t->tms_cstime = 0; // -> Set the wait times for childs to 0
|
||||
return ticks;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
// Put the selfmade functions into the std-namespace, just in case
|
||||
namespace std {
|
||||
# ifdef __RTP__
|
||||
using ::getrlimit;
|
||||
using ::setrlimit;
|
||||
# endif
|
||||
using ::truncate;
|
||||
using ::symlink;
|
||||
using ::readlink;
|
||||
using ::times;
|
||||
using ::gettimeofday;
|
||||
}
|
||||
|
||||
// Some more macro-magic:
|
||||
// vxWorks-around: Some functions are not present or broken in vxWorks
|
||||
// but may be patched to life via helper macros...
|
||||
|
||||
// Include signal.h which might contain a typo to be corrected here
|
||||
#include <signal.h>
|
||||
|
||||
#define getpagesize() sysconf(_SC_PAGESIZE) // getpagesize is deprecated anyway!
|
||||
#ifndef S_ISSOCK
|
||||
# define S_ISSOCK(mode) ((mode & S_IFMT) == S_IFSOCK) // Is file a socket?
|
||||
#endif
|
||||
#define lstat(p, b) stat(p, b) // lstat() == stat(), as vxWorks has no symlinks!
|
||||
#ifndef FPE_FLTINV
|
||||
# define FPE_FLTINV (FPE_FLTSUB+1) // vxWorks has no FPE_FLTINV, so define one as a dummy
|
||||
#endif
|
||||
#if !defined(BUS_ADRALN) && defined(BUS_ADRALNR)
|
||||
# define BUS_ADRALN BUS_ADRALNR // Correct a supposed typo in vxWorks' <signal.h>
|
||||
#endif
|
||||
//typedef int locale_t; // locale_t is a POSIX-extension, currently unpresent in vxWorks!
|
||||
|
||||
// #include boilerplate code:
|
||||
#include <boost/config/posix_features.hpp>
|
||||
|
||||
// vxWorks lies about XSI conformance, there is no nl_types.h:
|
||||
#undef BOOST_HAS_NL_TYPES_H
|
||||
@@ -0,0 +1,79 @@
|
||||
|
||||
// (C) Copyright Tobias Schwinger
|
||||
//
|
||||
// Use modification and distribution are subject to the boost Software License,
|
||||
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_FT_DETAIL_SYNTHESIZE_HPP_INCLUDED
|
||||
#define BOOST_FT_DETAIL_SYNTHESIZE_HPP_INCLUDED
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/mpl/at.hpp>
|
||||
#include <boost/mpl/size.hpp>
|
||||
|
||||
#include <boost/function_types/config/config.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
#include <boost/function_types/detail/cv_traits.hpp>
|
||||
#include <boost/function_types/detail/retag_default_cc.hpp>
|
||||
|
||||
namespace boost { namespace function_types { namespace detail {
|
||||
|
||||
template<bits_t Flags, bits_t CCID, std::size_t Size>
|
||||
struct synthesize_impl_o
|
||||
{
|
||||
template<typename Seq> struct synthesize_impl_i { };
|
||||
};
|
||||
|
||||
template<typename Seq, bits_t Bits>
|
||||
struct synthesize_impl
|
||||
: detail::synthesize_impl_o
|
||||
< ::boost::function_types::detail::decode_bits<Bits>::flags
|
||||
, ::boost::function_types::detail::decode_bits<Bits>::cc_id
|
||||
, ::boost::mpl::size<Seq>::value
|
||||
>
|
||||
::template synthesize_impl_i<Seq>
|
||||
{ };
|
||||
|
||||
template<typename Seq, typename Tag>
|
||||
struct synthesize_func
|
||||
: detail::synthesize_impl
|
||||
< Seq
|
||||
, ::boost::function_types::detail::bits
|
||||
< detail::retag_default_cc
|
||||
< function_types::tag<nv_dcc_func, Tag> >
|
||||
>::value
|
||||
>
|
||||
{ };
|
||||
|
||||
template<typename Seq, typename Tag>
|
||||
struct synthesize_mfp
|
||||
: detail::synthesize_impl
|
||||
< Seq
|
||||
, ::boost::function_types::detail::bits
|
||||
< detail::retag_default_cc
|
||||
< function_types::tag
|
||||
< typename detail::cv_traits< typename mpl::at_c<Seq,1>::type >::tag
|
||||
, nv_dcc_mfp, Tag
|
||||
> >
|
||||
>::value
|
||||
>
|
||||
{ };
|
||||
|
||||
template<typename S, typename R = typename mpl::at_c<S,0>::type,
|
||||
typename C = typename mpl::at_c<S,1>::type>
|
||||
struct synthesize_mop
|
||||
{
|
||||
typedef R C::* type;
|
||||
};
|
||||
|
||||
#define BOOST_FT_variations BOOST_FT_function|BOOST_FT_member_pointer
|
||||
#define BOOST_FT_al_path boost/function_types/detail/synthesize_impl
|
||||
#include <boost/function_types/detail/pp_loop.hpp>
|
||||
|
||||
} } } // namespace ::boost::function_types::detail
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,645 @@
|
||||
// -*- Mode: C++ -*-
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
#ifdef QT5
|
||||
#include <QtWidgets>
|
||||
#else
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QList>
|
||||
#include <QAudioDeviceInfo>
|
||||
#include <QScopedPointer>
|
||||
#include <QDir>
|
||||
#include <QProgressDialog>
|
||||
#include <QAbstractSocket>
|
||||
#include <QHostAddress>
|
||||
#include <QPointer>
|
||||
#include <QSet>
|
||||
#include <QVector>
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
|
||||
#include "AudioDevice.hpp"
|
||||
#include "commons.h"
|
||||
#include "Radio.hpp"
|
||||
#include "Modes.hpp"
|
||||
#include "FrequencyList.hpp"
|
||||
#include "Configuration.hpp"
|
||||
#include "WSPRBandHopping.hpp"
|
||||
#include "Transceiver.hpp"
|
||||
#include "DisplayManual.hpp"
|
||||
#include "psk_reporter.h"
|
||||
#include "logbook/logbook.h"
|
||||
#include "commons.h"
|
||||
#include "astro.h"
|
||||
#include "MessageBox.hpp"
|
||||
#include "NetworkAccessManager.hpp"
|
||||
|
||||
#define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync
|
||||
#define NUM_JT65_SYMBOLS 126 //63 data + 63 sync
|
||||
#define NUM_JT9_SYMBOLS 85 //69 data + 16 sync
|
||||
#define NUM_WSPR_SYMBOLS 162 //(50+31)*2, embedded sync
|
||||
#define NUM_WSPR_LF_SYMBOLS 412 //300 data + 109 sync + 3 ramp
|
||||
#define NUM_ISCAT_SYMBOLS 1291 //30*11025/256
|
||||
#define NUM_MSK144_SYMBOLS 144 //s8 + d48 + s8 + d80
|
||||
#define NUM_QRA64_SYMBOLS 84 //63 data + 21 sync
|
||||
#define NUM_FT8_SYMBOLS 79
|
||||
#define NUM_CW_SYMBOLS 250
|
||||
#define TX_SAMPLE_RATE 48000
|
||||
#define N_WIDGETS 24
|
||||
|
||||
extern int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
|
||||
extern int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID
|
||||
|
||||
//--------------------------------------------------------------- MainWindow
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class QSettings;
|
||||
class QLineEdit;
|
||||
class QFont;
|
||||
class QHostInfo;
|
||||
class EchoGraph;
|
||||
class FastGraph;
|
||||
class WideGraph;
|
||||
class LogQSO;
|
||||
class Transceiver;
|
||||
class MessageAveraging;
|
||||
class MessageClient;
|
||||
class QTime;
|
||||
class WSPRBandHopping;
|
||||
class HelpTextWindow;
|
||||
class WSPRNet;
|
||||
class SoundOutput;
|
||||
class Modulator;
|
||||
class SoundInput;
|
||||
class Detector;
|
||||
class SampleDownloader;
|
||||
class MultiSettings;
|
||||
class EqualizationToolsDialog;
|
||||
class DecodedText;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
using Frequency = Radio::Frequency;
|
||||
using FrequencyDelta = Radio::FrequencyDelta;
|
||||
using Mode = Modes::Mode;
|
||||
|
||||
explicit MainWindow(QDir const& temp_directory, bool multiple, MultiSettings *,
|
||||
QSharedMemory *shdmem, unsigned downSampleFactor,
|
||||
QSplashScreen *,
|
||||
QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
public slots:
|
||||
void showSoundInError(const QString& errorMsg);
|
||||
void showSoundOutError(const QString& errorMsg);
|
||||
void showStatusMessage(const QString& statusMsg);
|
||||
void dataSink(qint64 frames);
|
||||
void fastSink(qint64 frames);
|
||||
void diskDat();
|
||||
void freezeDecode(int n);
|
||||
void guiUpdate();
|
||||
void doubleClickOnCall(bool shift, bool ctrl);
|
||||
void doubleClickOnCall2(bool shift, bool ctrl);
|
||||
void readFromStdout();
|
||||
void p1ReadFromStdout();
|
||||
void setXIT(int n, Frequency base = 0u);
|
||||
void setFreq4(int rxFreq, int txFreq);
|
||||
void msgAvgDecode2();
|
||||
void fastPick(int x0, int x1, int y);
|
||||
|
||||
protected:
|
||||
void keyPressEvent (QKeyEvent *) override;
|
||||
void closeEvent(QCloseEvent *) override;
|
||||
void childEvent(QChildEvent *) override;
|
||||
bool eventFilter(QObject *, QEvent *) override;
|
||||
|
||||
private slots:
|
||||
void initialize_fonts ();
|
||||
void on_tx1_editingFinished();
|
||||
void on_tx2_editingFinished();
|
||||
void on_tx3_editingFinished();
|
||||
void on_tx4_editingFinished();
|
||||
void on_tx5_currentTextChanged (QString const&);
|
||||
void on_tx6_editingFinished();
|
||||
void on_actionSettings_triggered();
|
||||
void on_monitorButton_clicked (bool);
|
||||
void on_actionAbout_triggered();
|
||||
void on_autoButton_clicked (bool);
|
||||
void on_stopTxButton_clicked();
|
||||
void on_stopButton_clicked();
|
||||
void on_actionRelease_Notes_triggered ();
|
||||
void on_actionOnline_User_Guide_triggered();
|
||||
void on_actionLocal_User_Guide_triggered();
|
||||
void on_actionWide_Waterfall_triggered();
|
||||
void on_actionOpen_triggered();
|
||||
void on_actionOpen_next_in_directory_triggered();
|
||||
void on_actionDecode_remaining_files_in_directory_triggered();
|
||||
void on_actionDelete_all_wav_files_in_SaveDir_triggered();
|
||||
void on_actionOpen_log_directory_triggered ();
|
||||
void on_actionNone_triggered();
|
||||
void on_actionSave_all_triggered();
|
||||
void on_actionKeyboard_shortcuts_triggered();
|
||||
void on_actionSpecial_mouse_commands_triggered();
|
||||
void on_DecodeButton_clicked (bool);
|
||||
void decode();
|
||||
void decodeBusy(bool b);
|
||||
void on_EraseButton_clicked();
|
||||
void on_txFirstCheckBox_stateChanged(int arg1);
|
||||
void set_dateTimeQSO(int m_ntx);
|
||||
void set_ntx(int n);
|
||||
void on_txrb1_toggled(bool status);
|
||||
void on_txrb1_doubleClicked ();
|
||||
void on_txrb2_toggled(bool status);
|
||||
void on_txrb3_toggled(bool status);
|
||||
void on_txrb4_toggled(bool status);
|
||||
void on_txrb4_doubleClicked ();
|
||||
void on_txrb5_toggled(bool status);
|
||||
void on_txrb5_doubleClicked ();
|
||||
void on_txrb6_toggled(bool status);
|
||||
void on_txb1_clicked();
|
||||
void on_txb1_doubleClicked ();
|
||||
void on_txb2_clicked();
|
||||
void on_txb3_clicked();
|
||||
void on_txb4_clicked();
|
||||
void on_txb4_doubleClicked ();
|
||||
void on_txb5_clicked();
|
||||
void on_txb5_doubleClicked ();
|
||||
void on_txb6_clicked();
|
||||
void on_lookupButton_clicked();
|
||||
void on_addButton_clicked();
|
||||
void on_dxCallEntry_textChanged (QString const&);
|
||||
void on_dxGridEntry_textChanged (QString const&);
|
||||
void on_dxCallEntry_returnPressed ();
|
||||
void on_genStdMsgsPushButton_clicked();
|
||||
void on_logQSOButton_clicked();
|
||||
void on_actionJT9_triggered();
|
||||
void on_actionJT65_triggered();
|
||||
void on_actionJT9_JT65_triggered();
|
||||
void on_actionJT4_triggered();
|
||||
void on_actionFT8_triggered();
|
||||
void on_TxFreqSpinBox_valueChanged(int arg1);
|
||||
void on_actionSave_decoded_triggered();
|
||||
void on_actionQuickDecode_toggled (bool);
|
||||
void on_actionMediumDecode_toggled (bool);
|
||||
void on_actionDeepestDecode_toggled (bool);
|
||||
void bumpFqso(int n);
|
||||
void on_actionErase_ALL_TXT_triggered();
|
||||
void on_actionErase_wsjtx_log_adi_triggered();
|
||||
void startTx2();
|
||||
void startP1();
|
||||
void stopTx();
|
||||
void stopTx2();
|
||||
void on_pbCallCQ_clicked();
|
||||
void on_pbAnswerCaller_clicked();
|
||||
void on_pbSendRRR_clicked();
|
||||
void on_pbAnswerCQ_clicked();
|
||||
void on_pbSendReport_clicked();
|
||||
void on_pbSend73_clicked();
|
||||
void on_rbGenMsg_clicked(bool checked);
|
||||
void on_rbFreeText_clicked(bool checked);
|
||||
void on_freeTextMsg_currentTextChanged (QString const&);
|
||||
void on_rptSpinBox_valueChanged(int n);
|
||||
void killFile();
|
||||
void on_tuneButton_clicked (bool);
|
||||
void on_pbR2T_clicked();
|
||||
void on_pbT2R_clicked();
|
||||
void acceptQSO2(QDateTime const&, QString const& call, QString const& grid
|
||||
, Frequency dial_freq, QString const& mode
|
||||
, QString const& rpt_sent, QString const& rpt_received
|
||||
, QString const& tx_power, QString const& comments
|
||||
, QString const& name, QDateTime const&);
|
||||
void on_bandComboBox_currentIndexChanged (int index);
|
||||
void on_bandComboBox_activated (int index);
|
||||
void on_readFreq_clicked();
|
||||
void on_pbTxMode_clicked();
|
||||
void on_RxFreqSpinBox_valueChanged(int n);
|
||||
void on_cbTxLock_clicked(bool checked);
|
||||
void on_outAttenuation_valueChanged (int);
|
||||
void rigOpen ();
|
||||
void handle_transceiver_update (Transceiver::TransceiverState const&);
|
||||
void handle_transceiver_failure (QString const& reason);
|
||||
void on_actionAstronomical_data_toggled (bool);
|
||||
void on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered();
|
||||
void band_changed (Frequency);
|
||||
void monitor (bool);
|
||||
void stop_tuning ();
|
||||
void stopTuneATU();
|
||||
void auto_tx_mode(bool);
|
||||
void on_actionMessage_averaging_triggered();
|
||||
void on_actionInclude_averaging_toggled (bool);
|
||||
void on_actionInclude_correlation_toggled (bool);
|
||||
void on_actionEnable_AP_DXcall_toggled (bool);
|
||||
void VHF_features_enabled(bool b);
|
||||
void on_sbSubmode_valueChanged(int n);
|
||||
void on_cbShMsgs_toggled(bool b);
|
||||
void on_cbSWL_toggled(bool b);
|
||||
void on_cbTx6_toggled(bool b);
|
||||
void on_cbMenus_toggled(bool b);
|
||||
void on_cbFirst_toggled(bool b);
|
||||
void on_cbAutoSeq_toggled(bool b);
|
||||
void networkError (QString const&);
|
||||
void on_ClrAvgButton_clicked();
|
||||
void on_actionWSPR_triggered();
|
||||
void on_actionWSPR_LF_triggered();
|
||||
void on_syncSpinBox_valueChanged(int n);
|
||||
void on_TxPowerComboBox_currentIndexChanged(const QString &arg1);
|
||||
void on_sbTxPercent_valueChanged(int n);
|
||||
void on_cbUploadWSPR_Spots_toggled(bool b);
|
||||
void WSPR_config(bool b);
|
||||
void uploadSpots();
|
||||
void TxAgain();
|
||||
void uploadResponse(QString response);
|
||||
void on_WSPRfreqSpinBox_valueChanged(int n);
|
||||
void on_pbTxNext_clicked(bool b);
|
||||
void on_actionEcho_Graph_triggered();
|
||||
void on_actionEcho_triggered();
|
||||
void on_actionISCAT_triggered();
|
||||
void on_actionFast_Graph_triggered();
|
||||
void fast_decode_done();
|
||||
void on_actionMeasure_reference_spectrum_triggered();
|
||||
void on_actionErase_reference_spectrum_triggered();
|
||||
void on_actionMeasure_phase_response_triggered();
|
||||
void on_sbTR_valueChanged (int);
|
||||
void on_sbFtol_valueChanged (int);
|
||||
void on_cbFast9_clicked(bool b);
|
||||
void on_sbCQTxFreq_valueChanged(int n);
|
||||
void on_cbCQTx_toggled(bool b);
|
||||
void on_actionMSK144_triggered();
|
||||
void on_actionQRA64_triggered();
|
||||
void on_actionFreqCal_triggered();
|
||||
void splash_done ();
|
||||
|
||||
private:
|
||||
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
|
||||
unsigned channels, unsigned msBuffered) const;
|
||||
Q_SIGNAL void stopAudioOutputStream () const;
|
||||
Q_SIGNAL void startAudioInputStream (QAudioDeviceInfo const&,
|
||||
int framesPerBuffer, AudioDevice * sink,
|
||||
unsigned downSampleFactor, AudioDevice::Channel) const;
|
||||
Q_SIGNAL void suspendAudioInputStream () const;
|
||||
Q_SIGNAL void resumeAudioInputStream () const;
|
||||
Q_SIGNAL void startDetector (AudioDevice::Channel) const;
|
||||
Q_SIGNAL void FFTSize (unsigned) const;
|
||||
Q_SIGNAL void detectorClose () const;
|
||||
Q_SIGNAL void finished () const;
|
||||
Q_SIGNAL void transmitFrequency (double) const;
|
||||
Q_SIGNAL void endTransmitMessage (bool quick = false) const;
|
||||
Q_SIGNAL void tune (bool = true) const;
|
||||
Q_SIGNAL void sendMessage (unsigned symbolsLength, double framesPerSymbol,
|
||||
double frequency, double toneSpacing,
|
||||
SoundOutput *, AudioDevice::Channel = AudioDevice::Mono,
|
||||
bool synchronize = true, bool fastMode = false, double dBSNR = 99.,
|
||||
int TRperiod=60) const;
|
||||
Q_SIGNAL void outAttenuationChanged (qreal) const;
|
||||
Q_SIGNAL void toggleShorthand () const;
|
||||
|
||||
private:
|
||||
void astroUpdate ();
|
||||
void writeAllTxt(QString message);
|
||||
void auto_sequence (DecodedText const& message, unsigned start_tolerance, unsigned stop_tolerance);
|
||||
void hideMenus(bool b);
|
||||
|
||||
NetworkAccessManager m_network_manager;
|
||||
bool m_valid;
|
||||
QSplashScreen * m_splash;
|
||||
QString m_revision;
|
||||
bool m_multiple;
|
||||
MultiSettings * m_multi_settings;
|
||||
QPushButton * m_configurations_button;
|
||||
QSettings * m_settings;
|
||||
QScopedPointer<Ui::MainWindow> ui;
|
||||
|
||||
// other windows
|
||||
Configuration m_config;
|
||||
WSPRBandHopping m_WSPR_band_hopping;
|
||||
bool m_WSPR_tx_next;
|
||||
MessageBox m_rigErrorMessageBox;
|
||||
QScopedPointer<SampleDownloader> m_sampleDownloader;
|
||||
QScopedPointer<EqualizationToolsDialog> m_equalizationToolsDialog;
|
||||
|
||||
QScopedPointer<WideGraph> m_wideGraph;
|
||||
QScopedPointer<EchoGraph> m_echoGraph;
|
||||
QScopedPointer<FastGraph> m_fastGraph;
|
||||
QScopedPointer<LogQSO> m_logDlg;
|
||||
QScopedPointer<Astro> m_astroWidget;
|
||||
QScopedPointer<HelpTextWindow> m_shortcuts;
|
||||
QScopedPointer<HelpTextWindow> m_prefixes;
|
||||
QScopedPointer<HelpTextWindow> m_mouseCmnds;
|
||||
QScopedPointer<MessageAveraging> m_msgAvgWidget;
|
||||
|
||||
Transceiver::TransceiverState m_rigState;
|
||||
Frequency m_lastDialFreq;
|
||||
QString m_lastBand;
|
||||
QString m_lastCallsign;
|
||||
Frequency m_dialFreqRxWSPR; // best guess at WSPR QRG
|
||||
|
||||
Detector * m_detector;
|
||||
unsigned m_FFTSize;
|
||||
SoundInput * m_soundInput;
|
||||
Modulator * m_modulator;
|
||||
SoundOutput * m_soundOutput;
|
||||
QThread m_audioThread;
|
||||
|
||||
qint64 m_msErase;
|
||||
qint64 m_secBandChanged;
|
||||
qint64 m_freqMoon;
|
||||
Frequency m_freqNominal;
|
||||
Frequency m_freqTxNominal;
|
||||
Astro::Correction m_astroCorrection;
|
||||
|
||||
double m_s6;
|
||||
double m_tRemaining;
|
||||
|
||||
float m_DTtol;
|
||||
float m_t0;
|
||||
float m_t1;
|
||||
float m_t0Pick;
|
||||
float m_t1Pick;
|
||||
float m_fCPUmskrtd;
|
||||
|
||||
qint32 m_waterfallAvg;
|
||||
qint32 m_ntx;
|
||||
bool m_gen_message_is_cq;
|
||||
bool m_send_RR73;
|
||||
qint32 m_timeout;
|
||||
qint32 m_XIT;
|
||||
qint32 m_setftx;
|
||||
qint32 m_ndepth;
|
||||
qint32 m_sec0;
|
||||
qint32 m_RxLog;
|
||||
qint32 m_nutc0;
|
||||
qint32 m_ntr;
|
||||
qint32 m_tx;
|
||||
qint32 m_hsym;
|
||||
qint32 m_TRperiod;
|
||||
qint32 m_nsps;
|
||||
qint32 m_hsymStop;
|
||||
qint32 m_inGain;
|
||||
qint32 m_ncw;
|
||||
qint32 m_secID;
|
||||
qint32 m_idleMinutes;
|
||||
qint32 m_nSubMode;
|
||||
qint32 m_nclearave;
|
||||
qint32 m_minSync;
|
||||
qint32 m_dBm;
|
||||
qint32 m_pctx;
|
||||
qint32 m_nseq;
|
||||
qint32 m_nWSPRdecodes;
|
||||
qint32 m_k0;
|
||||
qint32 m_kdone;
|
||||
qint32 m_nPick;
|
||||
FrequencyList_v2::const_iterator m_frequency_list_fcal_iter;
|
||||
qint32 m_nTx73;
|
||||
qint32 m_UTCdisk;
|
||||
qint32 m_wait;
|
||||
|
||||
bool m_btxok; //True if OK to transmit
|
||||
bool m_diskData;
|
||||
bool m_loopall;
|
||||
bool m_decoderBusy;
|
||||
bool m_txFirst;
|
||||
bool m_auto;
|
||||
bool m_restart;
|
||||
bool m_startAnother;
|
||||
bool m_saveDecoded;
|
||||
bool m_saveAll;
|
||||
bool m_widebandDecode;
|
||||
bool m_call3Modified;
|
||||
bool m_dataAvailable;
|
||||
bool m_bDecoded;
|
||||
bool m_noSuffix;
|
||||
bool m_blankLine;
|
||||
bool m_decodedText2;
|
||||
bool m_freeText;
|
||||
bool m_sentFirst73;
|
||||
int m_currentMessageType;
|
||||
QString m_currentMessage;
|
||||
int m_lastMessageType;
|
||||
QString m_lastMessageSent;
|
||||
bool m_lockTxFreq;
|
||||
bool m_bShMsgs;
|
||||
bool m_bSWL;
|
||||
bool m_uploadSpots;
|
||||
bool m_uploading;
|
||||
bool m_txNext;
|
||||
bool m_grid6;
|
||||
bool m_tuneup;
|
||||
bool m_bTxTime;
|
||||
bool m_rxDone;
|
||||
bool m_bSimplex; // not using split even if it is available
|
||||
bool m_bEchoTxOK;
|
||||
bool m_bTransmittedEcho;
|
||||
bool m_bEchoTxed;
|
||||
bool m_bFastMode;
|
||||
bool m_bFast9;
|
||||
bool m_bFastDecodeCalled;
|
||||
bool m_bDoubleClickAfterCQnnn;
|
||||
bool m_bRefSpec;
|
||||
bool m_bClearRefSpec;
|
||||
bool m_bTrain;
|
||||
bool m_bUseRef;
|
||||
bool m_bFastDone;
|
||||
bool m_bAltV;
|
||||
bool m_bNoMoreFiles;
|
||||
bool m_bQRAsyncWarned;
|
||||
bool m_bDoubleClicked;
|
||||
bool m_bCallingCQ;
|
||||
bool m_bAutoReply;
|
||||
enum
|
||||
{
|
||||
CALLING,
|
||||
REPLYING,
|
||||
REPORT,
|
||||
ROGER_REPORT,
|
||||
ROGERS,
|
||||
SIGNOFF
|
||||
}
|
||||
m_QSOProgress;
|
||||
|
||||
int m_ihsym;
|
||||
int m_nzap;
|
||||
int m_npts8;
|
||||
float m_px;
|
||||
float m_pxmax;
|
||||
float m_df3;
|
||||
int m_iptt0;
|
||||
bool m_btxok0;
|
||||
int m_nsendingsh;
|
||||
double m_onAirFreq0;
|
||||
bool m_first_error;
|
||||
|
||||
char m_msg[100][80];
|
||||
|
||||
// labels in status bar
|
||||
QLabel tx_status_label;
|
||||
QLabel config_label;
|
||||
QLabel mode_label;
|
||||
QLabel last_tx_label;
|
||||
QLabel auto_tx_label;
|
||||
QLabel band_hopping_label;
|
||||
QProgressBar progressBar;
|
||||
QLabel watchdog_label;
|
||||
|
||||
QFuture<void> m_wav_future;
|
||||
QFutureWatcher<void> m_wav_future_watcher;
|
||||
QFutureWatcher<void> watcher3;
|
||||
QFutureWatcher<QString> m_saveWAVWatcher;
|
||||
|
||||
QProcess proc_jt9;
|
||||
QProcess p1;
|
||||
QProcess p3;
|
||||
|
||||
WSPRNet *wsprNet;
|
||||
|
||||
QTimer m_guiTimer;
|
||||
QTimer ptt1Timer; //StartTx delay
|
||||
QTimer ptt0Timer; //StopTx delay
|
||||
QTimer logQSOTimer;
|
||||
QTimer killFileTimer;
|
||||
QTimer tuneButtonTimer;
|
||||
QTimer uploadTimer;
|
||||
QTimer tuneATU_Timer;
|
||||
QTimer TxAgainTimer;
|
||||
QTimer minuteTimer;
|
||||
QTimer splashTimer;
|
||||
QTimer p1Timer;
|
||||
|
||||
QString m_path;
|
||||
QString m_baseCall;
|
||||
QString m_hisCall;
|
||||
QString m_hisGrid;
|
||||
QString m_appDir;
|
||||
QString m_palette;
|
||||
QString m_dateTime;
|
||||
QString m_mode;
|
||||
QString m_modeTx;
|
||||
QString m_fnameWE; // save path without extension
|
||||
QString m_rpt;
|
||||
QString m_rptSent;
|
||||
QString m_rptRcvd;
|
||||
QString m_qsoStart;
|
||||
QString m_qsoStop;
|
||||
QString m_cmnd;
|
||||
QString m_cmndP1;
|
||||
QString m_msgSent0;
|
||||
QString m_fileToSave;
|
||||
QString m_calls;
|
||||
QString m_CQtype;
|
||||
|
||||
QSet<QString> m_pfx;
|
||||
QSet<QString> m_sfx;
|
||||
|
||||
QDateTime m_dateTimeQSOOn;
|
||||
|
||||
QSharedMemory *mem_jt9;
|
||||
LogBook m_logBook;
|
||||
QString m_QSOText;
|
||||
unsigned m_msAudioOutputBuffered;
|
||||
unsigned m_framesAudioInputBuffered;
|
||||
unsigned m_downSampleFactor;
|
||||
QThread::Priority m_audioThreadPriority;
|
||||
bool m_bandEdited;
|
||||
bool m_splitMode;
|
||||
bool m_monitoring;
|
||||
bool m_tx_when_ready;
|
||||
bool m_transmitting;
|
||||
bool m_tune;
|
||||
bool m_tx_watchdog; // true when watchdog triggered
|
||||
bool m_block_pwr_tooltip;
|
||||
bool m_PwrBandSetOK;
|
||||
bool m_bVHFwarned;
|
||||
Frequency m_lastMonitoredFrequency;
|
||||
double m_toneSpacing;
|
||||
int m_firstDecode;
|
||||
QProgressDialog m_optimizingProgress;
|
||||
QTimer m_heartbeat;
|
||||
MessageClient * m_messageClient;
|
||||
PSK_Reporter *psk_Reporter;
|
||||
DisplayManual m_manual;
|
||||
QHash<QString, QVariant> m_pwrBandTxMemory; // Remembers power level by band
|
||||
QHash<QString, QVariant> m_pwrBandTuneMemory; // Remembers power level by band for tuning
|
||||
QByteArray m_geometryNoControls;
|
||||
QVector<double> m_phaseEqCoefficients;
|
||||
|
||||
//---------------------------------------------------- private functions
|
||||
void readSettings();
|
||||
void set_application_font (QFont const&);
|
||||
void setDecodedTextFont (QFont const&);
|
||||
void writeSettings();
|
||||
void createStatusBar();
|
||||
void updateStatusBar();
|
||||
void genStdMsgs(QString rpt, bool unconditional = false);
|
||||
void genCQMsg();
|
||||
void clearDX ();
|
||||
void lookup();
|
||||
void ba2msg(QByteArray ba, char* message);
|
||||
void msgtype(QString t, QLineEdit* tx);
|
||||
void stub();
|
||||
void statusChanged();
|
||||
void fixStop();
|
||||
bool shortList(QString callsign);
|
||||
void transmit (double snr = 99.);
|
||||
void rigFailure (QString const& reason);
|
||||
void pskSetLocal ();
|
||||
void pskPost(DecodedText const& decodedtext);
|
||||
void displayDialFrequency ();
|
||||
void transmitDisplay (bool);
|
||||
void processMessage(DecodedText const&, bool ctrl = false, bool alt = false);
|
||||
void replyToCQ (QTime, qint32 snr, float delta_time, quint32 delta_frequency, QString const& mode, QString const& message_text);
|
||||
void replayDecodes ();
|
||||
void postDecode (bool is_new, QString const& message);
|
||||
void postWSPRDecode (bool is_new, QStringList message_parts);
|
||||
void enable_DXCC_entity (bool on);
|
||||
void switch_mode (Mode);
|
||||
void WSPR_scheduling ();
|
||||
void freqCalStep();
|
||||
void setRig (Frequency = 0); // zero frequency means no change
|
||||
void WSPR_history(Frequency dialFreq, int ndecodes);
|
||||
QString WSPR_hhmm(int n);
|
||||
void fast_config(bool b);
|
||||
void CQTxFreq();
|
||||
QString save_wave_file (QString const& name
|
||||
, short const * data
|
||||
, int seconds
|
||||
, QString const& my_callsign
|
||||
, QString const& my_grid
|
||||
, QString const& mode
|
||||
, qint32 sub_mode
|
||||
, Frequency frequency
|
||||
, QString const& his_call
|
||||
, QString const& his_grid) const;
|
||||
void read_wav_file (QString const& fname);
|
||||
void decodeDone ();
|
||||
void subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus);
|
||||
void subProcessError (QProcess *, QProcess::ProcessError);
|
||||
void statusUpdate () const;
|
||||
void update_watchdog_label ();
|
||||
void on_the_minute ();
|
||||
void add_child_to_event_filter (QObject *);
|
||||
void remove_child_from_event_filter (QObject *);
|
||||
void setup_status_bar (bool vhf);
|
||||
void tx_watchdog (bool triggered);
|
||||
int nWidgets(QString t);
|
||||
void displayWidgets(int n);
|
||||
void vhfWarning();
|
||||
QChar current_submode () const; // returns QChar {0} if sub mode is
|
||||
// not appropriate
|
||||
void write_transmit_entry (QString const& file_name);
|
||||
};
|
||||
|
||||
extern int killbyname(const char* progName);
|
||||
extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
|
||||
int minChan[], int maxChan[],
|
||||
int minSpeed[], int maxSpeed[]);
|
||||
extern int next_tx_state(int pctx);
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/integrate/integrate_adaptive.hpp
|
||||
|
||||
[begin_description]
|
||||
Adaptive integration of ODEs.
|
||||
[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_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
|
||||
#include <boost/numeric/odeint/iterator/integrate/null_observer.hpp>
|
||||
#include <boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
|
||||
/*
|
||||
* the two overloads are needed in order to solve the forwarding problem
|
||||
*/
|
||||
template< class Stepper , class System , class State , class Time , class Observer >
|
||||
size_t integrate_adaptive(
|
||||
Stepper stepper , System system , State &start_state ,
|
||||
Time start_time , Time end_time , Time dt ,
|
||||
Observer observer )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
|
||||
return detail::integrate_adaptive(
|
||||
stepper , system , start_state ,
|
||||
start_time , end_time , dt ,
|
||||
observer , stepper_category() );
|
||||
|
||||
/*
|
||||
* Suggestion for a new extendable version:
|
||||
*
|
||||
* integrator_adaptive< Stepper , System, State , Time , Observer , typename Stepper::stepper_category > integrator;
|
||||
* return integrator.run( stepper , system , start_state , start_time , end_time , dt , observer );
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Second version to solve the forwarding problem,
|
||||
* can be called with Boost.Range as start_state.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class Time , class Observer >
|
||||
size_t integrate_adaptive(
|
||||
Stepper stepper , System system , const State &start_state ,
|
||||
Time start_time , Time end_time , Time dt ,
|
||||
Observer observer )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
|
||||
return detail::integrate_adaptive(
|
||||
stepper , system , start_state ,
|
||||
start_time , end_time , dt ,
|
||||
observer , stepper_category() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief integrate_adaptive without an observer.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class Time >
|
||||
size_t integrate_adaptive(
|
||||
Stepper stepper , System system , State &start_state ,
|
||||
Time start_time , Time end_time , Time dt )
|
||||
{
|
||||
return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Second version to solve the forwarding problem,
|
||||
* can be called with Boost.Range as start_state.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class Time >
|
||||
size_t integrate_adaptive(
|
||||
Stepper stepper , System system , const State &start_state ,
|
||||
Time start_time , Time end_time , Time dt )
|
||||
{
|
||||
return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() );
|
||||
}
|
||||
|
||||
|
||||
/************* DOXYGEN ************/
|
||||
|
||||
/**
|
||||
* \fn integrate_adaptive( Stepper stepper , System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer )
|
||||
* \brief Integrates the ODE with adaptive step size.
|
||||
*
|
||||
* This function integrates the ODE given by system with the given stepper.
|
||||
* The observer is called after each step. If the stepper has no error
|
||||
* control, the step size remains constant and the observer is called at
|
||||
* equidistant time points t0+n*dt. If the stepper is a ControlledStepper,
|
||||
* the step size is adjusted and the observer is called in non-equidistant
|
||||
* intervals.
|
||||
*
|
||||
* \param stepper The stepper to be used for numerical integration.
|
||||
* \param system Function/Functor defining the rhs of the ODE.
|
||||
* \param start_state The initial condition x0.
|
||||
* \param start_time The initial time t0.
|
||||
* \param end_time The final integration time tend.
|
||||
* \param dt The time step between observer calls, _not_ necessarily the
|
||||
* time step of the integration.
|
||||
* \param observer Function/Functor called at equidistant time intervals.
|
||||
* \return The number of steps performed.
|
||||
*/
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
|
||||
@@ -0,0 +1,481 @@
|
||||
#ifndef BOOST_ATOMIC_DETAIL_INTERLOCKED_HPP
|
||||
#define BOOST_ATOMIC_DETAIL_INTERLOCKED_HPP
|
||||
|
||||
// Copyright (c) 2009 Helge Bahmann
|
||||
// Copyright (c) 2012 - 2014 Andrey Semashev
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/atomic/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
|
||||
#if _WIN32_WCE >= 0x600
|
||||
|
||||
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
|
||||
extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare) _InterlockedCompareExchange((long*)(dest), exchange, compare)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, addend) _InterlockedExchangeAdd((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval) _InterlockedExchange((long*)(dest), (long)(newval))
|
||||
|
||||
#else // _WIN32_WCE >= 0x600
|
||||
|
||||
extern "C" long __cdecl InterlockedCompareExchange( long*, long, long );
|
||||
extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
||||
extern "C" long __cdecl InterlockedExchange( long*, long );
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare) InterlockedCompareExchange((long*)(dest), exchange, compare)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, addend) InterlockedExchangeAdd((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval) InterlockedExchange((long*)(dest), (long)(newval))
|
||||
|
||||
#endif // _WIN32_WCE >= 0x600
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) ((void*)BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest), (long)(exchange), (long)(compare)))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, exchange) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE((long*)(dest), (long)(exchange)))
|
||||
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
|
||||
#if _MSC_VER < 1400
|
||||
|
||||
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
|
||||
extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd)
|
||||
#pragma intrinsic(_InterlockedExchange)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare) _InterlockedCompareExchange((long*)(dest), exchange, compare)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, addend) _InterlockedExchangeAdd((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval) _InterlockedExchange((long*)(dest), (long)(newval))
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) ((void*)BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest), (long)(exchange), (long)(compare)))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, exchange) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE((long*)(dest), (long)(exchange)))
|
||||
|
||||
#else // _MSC_VER < 1400
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd)
|
||||
#pragma intrinsic(_InterlockedExchange)
|
||||
#pragma intrinsic(_InterlockedAnd)
|
||||
#pragma intrinsic(_InterlockedOr)
|
||||
#pragma intrinsic(_InterlockedXor)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare) _InterlockedCompareExchange((long*)(dest), (long)(exchange), (long)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, addend) _InterlockedExchangeAdd((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval) _InterlockedExchange((long*)(dest), (long)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND(dest, arg) _InterlockedAnd((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR(dest, arg) _InterlockedOr((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR(dest, arg) _InterlockedXor((long*)(dest), (long)(arg))
|
||||
|
||||
#if (defined(_M_IX86) && _M_IX86 >= 500) || defined(_M_AMD64) || defined(_M_IA64)
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange64)
|
||||
#endif
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) _InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1500 && defined(_M_AMD64)
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange128)
|
||||
#endif
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE128(dest, exchange, compare) _InterlockedCompareExchange128((__int64*)(dest), ((const __int64*)(&exchange))[1], ((const __int64*)(&exchange))[0], (__int64*)(compare))
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1600
|
||||
|
||||
// MSVC 2010 and later provide intrinsics for 8 and 16 bit integers.
|
||||
// Note that for each bit count these macros must be either all defined or all not defined.
|
||||
// Otherwise atomic<> operations will be implemented inconsistently.
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange8)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd8)
|
||||
#pragma intrinsic(_InterlockedExchange8)
|
||||
#pragma intrinsic(_InterlockedAnd8)
|
||||
#pragma intrinsic(_InterlockedOr8)
|
||||
#pragma intrinsic(_InterlockedXor8)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE8(dest, exchange, compare) _InterlockedCompareExchange8((char*)(dest), (char)(exchange), (char)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD8(dest, addend) _InterlockedExchangeAdd8((char*)(dest), (char)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE8(dest, newval) _InterlockedExchange8((char*)(dest), (char)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND8(dest, arg) _InterlockedAnd8((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR8(dest, arg) _InterlockedOr8((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR8(dest, arg) _InterlockedXor8((char*)(dest), (char)(arg))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange16)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd16)
|
||||
#pragma intrinsic(_InterlockedExchange16)
|
||||
#pragma intrinsic(_InterlockedAnd16)
|
||||
#pragma intrinsic(_InterlockedOr16)
|
||||
#pragma intrinsic(_InterlockedXor16)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE16(dest, exchange, compare) _InterlockedCompareExchange16((short*)(dest), (short)(exchange), (short)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD16(dest, addend) _InterlockedExchangeAdd16((short*)(dest), (short)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE16(dest, newval) _InterlockedExchange16((short*)(dest), (short)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND16(dest, arg) _InterlockedAnd16((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR16(dest, arg) _InterlockedOr16((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR16(dest, arg) _InterlockedXor16((short*)(dest), (short)(arg))
|
||||
|
||||
#endif // _MSC_VER >= 1600
|
||||
|
||||
#if defined(_M_AMD64) || defined(_M_IA64)
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd64)
|
||||
#pragma intrinsic(_InterlockedExchange64)
|
||||
#pragma intrinsic(_InterlockedAnd64)
|
||||
#pragma intrinsic(_InterlockedOr64)
|
||||
#pragma intrinsic(_InterlockedXor64)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) _InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) _InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64(dest, arg) _InterlockedAnd64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64(dest, arg) _InterlockedOr64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64(dest, arg) _InterlockedXor64((__int64*)(dest), (__int64)(arg))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchangePointer)
|
||||
#pragma intrinsic(_InterlockedExchangePointer)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) _InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) _InterlockedExchangePointer((void**)(dest), (void*)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64((long*)(dest), byte_offset))
|
||||
|
||||
#elif defined(_M_IX86)
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) ((void*)_InterlockedCompareExchange((long*)(dest), (long)(exchange), (long)(compare)))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) ((void*)_InterlockedExchange((long*)(dest), (long)(newval)))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD((long*)(dest), byte_offset))
|
||||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1700 && defined(_M_ARM)
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd64)
|
||||
#pragma intrinsic(_InterlockedExchange64)
|
||||
#pragma intrinsic(_InterlockedAnd64)
|
||||
#pragma intrinsic(_InterlockedOr64)
|
||||
#pragma intrinsic(_InterlockedXor64)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) _InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) _InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64(dest, arg) _InterlockedAnd64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64(dest, arg) _InterlockedOr64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64(dest, arg) _InterlockedXor64((__int64*)(dest), (__int64)(arg))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedCompareExchange8_nf)
|
||||
#pragma intrinsic(_InterlockedCompareExchange8_acq)
|
||||
#pragma intrinsic(_InterlockedCompareExchange8_rel)
|
||||
#pragma intrinsic(_InterlockedCompareExchange16_nf)
|
||||
#pragma intrinsic(_InterlockedCompareExchange16_acq)
|
||||
#pragma intrinsic(_InterlockedCompareExchange16_rel)
|
||||
#pragma intrinsic(_InterlockedCompareExchange_nf)
|
||||
#pragma intrinsic(_InterlockedCompareExchange_acq)
|
||||
#pragma intrinsic(_InterlockedCompareExchange_rel)
|
||||
#pragma intrinsic(_InterlockedCompareExchange64)
|
||||
#pragma intrinsic(_InterlockedCompareExchange64_nf)
|
||||
#pragma intrinsic(_InterlockedCompareExchange64_acq)
|
||||
#pragma intrinsic(_InterlockedCompareExchange64_rel)
|
||||
#pragma intrinsic(_InterlockedCompareExchangePointer)
|
||||
#pragma intrinsic(_InterlockedCompareExchangePointer_nf)
|
||||
#pragma intrinsic(_InterlockedCompareExchangePointer_acq)
|
||||
#pragma intrinsic(_InterlockedCompareExchangePointer_rel)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE8_RELAXED(dest, exchange, compare) _InterlockedCompareExchange8_nf((char*)(dest), (char)(exchange), (char)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE8_ACQUIRE(dest, exchange, compare) _InterlockedCompareExchange8_acq((char*)(dest), (char)(exchange), (char)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE8_RELEASE(dest, exchange, compare) _InterlockedCompareExchange8_rel((char*)(dest), (char)(exchange), (char)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE16_RELAXED(dest, exchange, compare) _InterlockedCompareExchange16_nf((short*)(dest), (short)(exchange), (short)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE16_ACQUIRE(dest, exchange, compare) _InterlockedCompareExchange16_acq((short*)(dest), (short)(exchange), (short)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE16_RELEASE(dest, exchange, compare) _InterlockedCompareExchange16_rel((short*)(dest), (short)(exchange), (short)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_RELAXED(dest, exchange, compare) _InterlockedCompareExchange_nf((long*)(dest), (long)(exchange), (long)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_ACQUIRE(dest, exchange, compare) _InterlockedCompareExchange_acq((long*)(dest), (long)(exchange), (long)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_RELEASE(dest, exchange, compare) _InterlockedCompareExchange_rel((long*)(dest), (long)(exchange), (long)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) _InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64_RELAXED(dest, exchange, compare) _InterlockedCompareExchange64_nf((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64_ACQUIRE(dest, exchange, compare) _InterlockedCompareExchange64_acq((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64_RELEASE(dest, exchange, compare) _InterlockedCompareExchange64_rel((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) _InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER_RELAXED(dest, exchange, compare) _InterlockedCompareExchangePointer_nf((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER_ACQUIRE(dest, exchange, compare) _InterlockedCompareExchangePointer_acq((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER_RELEASE(dest, exchange, compare) _InterlockedCompareExchangePointer_rel((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd8_nf)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd8_acq)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd8_rel)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd16_nf)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd16_acq)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd16_rel)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd_nf)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd_acq)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd_rel)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd64_nf)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd64_acq)
|
||||
#pragma intrinsic(_InterlockedExchangeAdd64_rel)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD8_RELAXED(dest, addend) _InterlockedExchangeAdd8_nf((char*)(dest), (char)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD8_ACQUIRE(dest, addend) _InterlockedExchangeAdd8_acq((char*)(dest), (char)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD8_RELEASE(dest, addend) _InterlockedExchangeAdd8_rel((char*)(dest), (char)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD16_RELAXED(dest, addend) _InterlockedExchangeAdd16_nf((short*)(dest), (short)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD16_ACQUIRE(dest, addend) _InterlockedExchangeAdd16_acq((short*)(dest), (short)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD16_RELEASE(dest, addend) _InterlockedExchangeAdd16_rel((short*)(dest), (short)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_RELAXED(dest, addend) _InterlockedExchangeAdd_nf((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_ACQUIRE(dest, addend) _InterlockedExchangeAdd_acq((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_RELEASE(dest, addend) _InterlockedExchangeAdd_rel((long*)(dest), (long)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64_RELAXED(dest, addend) _InterlockedExchangeAdd64_nf((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64_ACQUIRE(dest, addend) _InterlockedExchangeAdd64_acq((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64_RELEASE(dest, addend) _InterlockedExchangeAdd64_rel((__int64*)(dest), (__int64)(addend))
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD((long*)(dest), byte_offset))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER_RELAXED(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_RELAXED((long*)(dest), byte_offset))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER_ACQUIRE(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_ACQUIRE((long*)(dest), byte_offset))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER_RELEASE(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_RELEASE((long*)(dest), byte_offset))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedExchange8_nf)
|
||||
#pragma intrinsic(_InterlockedExchange8_acq)
|
||||
#pragma intrinsic(_InterlockedExchange16_nf)
|
||||
#pragma intrinsic(_InterlockedExchange16_acq)
|
||||
#pragma intrinsic(_InterlockedExchange_nf)
|
||||
#pragma intrinsic(_InterlockedExchange_acq)
|
||||
#pragma intrinsic(_InterlockedExchange64_nf)
|
||||
#pragma intrinsic(_InterlockedExchange64_acq)
|
||||
#pragma intrinsic(_InterlockedExchangePointer)
|
||||
#pragma intrinsic(_InterlockedExchangePointer_nf)
|
||||
#pragma intrinsic(_InterlockedExchangePointer_acq)
|
||||
#if _MSC_VER >= 1800
|
||||
#pragma intrinsic(_InterlockedExchange8_rel)
|
||||
#pragma intrinsic(_InterlockedExchange16_rel)
|
||||
#pragma intrinsic(_InterlockedExchange_rel)
|
||||
#pragma intrinsic(_InterlockedExchange64_rel)
|
||||
#pragma intrinsic(_InterlockedExchangePointer_rel)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE8_RELAXED(dest, newval) _InterlockedExchange8_nf((char*)(dest), (char)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE8_ACQUIRE(dest, newval) _InterlockedExchange8_acq((char*)(dest), (char)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE16_RELAXED(dest, newval) _InterlockedExchange16_nf((short*)(dest), (short)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE16_ACQUIRE(dest, newval) _InterlockedExchange16_acq((short*)(dest), (short)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_RELAXED(dest, newval) _InterlockedExchange_nf((long*)(dest), (long)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ACQUIRE(dest, newval) _InterlockedExchange_acq((long*)(dest), (long)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64_RELAXED(dest, newval) _InterlockedExchange64_nf((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64_ACQUIRE(dest, newval) _InterlockedExchange64_acq((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) _InterlockedExchangePointer((void**)(dest), (void*)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER_RELAXED(dest, newval) _InterlockedExchangePointer_nf((void**)(dest), (void*)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER_ACQUIRE(dest, newval) _InterlockedExchangePointer_acq((void**)(dest), (void*)(newval))
|
||||
|
||||
#if _MSC_VER >= 1800
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE8_RELEASE(dest, newval) _InterlockedExchange8_rel((char*)(dest), (char)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE16_RELEASE(dest, newval) _InterlockedExchange16_rel((short*)(dest), (short)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_RELEASE(dest, newval) _InterlockedExchange_rel((long*)(dest), (long)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64_RELEASE(dest, newval) _InterlockedExchange64_rel((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER_RELEASE(dest, newval) _InterlockedExchangePointer_rel((void**)(dest), (void*)(newval))
|
||||
#else
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE8_RELEASE(dest, newval) BOOST_ATOMIC_INTERLOCKED_EXCHANGE8(dest, newval)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE16_RELEASE(dest, newval) BOOST_ATOMIC_INTERLOCKED_EXCHANGE16(dest, newval)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_RELEASE(dest, newval) BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64_RELEASE(dest, newval) BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER_RELEASE(dest, newval) BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval)
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedAnd8_nf)
|
||||
#pragma intrinsic(_InterlockedAnd8_acq)
|
||||
#pragma intrinsic(_InterlockedAnd8_rel)
|
||||
#pragma intrinsic(_InterlockedAnd16_nf)
|
||||
#pragma intrinsic(_InterlockedAnd16_acq)
|
||||
#pragma intrinsic(_InterlockedAnd16_rel)
|
||||
#pragma intrinsic(_InterlockedAnd_nf)
|
||||
#pragma intrinsic(_InterlockedAnd_acq)
|
||||
#pragma intrinsic(_InterlockedAnd_rel)
|
||||
#pragma intrinsic(_InterlockedAnd64_nf)
|
||||
#pragma intrinsic(_InterlockedAnd64_acq)
|
||||
#pragma intrinsic(_InterlockedAnd64_rel)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND8_RELAXED(dest, arg) _InterlockedAnd8_nf((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND8_ACQUIRE(dest, arg) _InterlockedAnd8_acq((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND8_RELEASE(dest, arg) _InterlockedAnd8_rel((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND16_RELAXED(dest, arg) _InterlockedAnd16_nf((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND16_ACQUIRE(dest, arg) _InterlockedAnd16_acq((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND16_RELEASE(dest, arg) _InterlockedAnd16_rel((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND_RELAXED(dest, arg) _InterlockedAnd_nf((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND_ACQUIRE(dest, arg) _InterlockedAnd_acq((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND_RELEASE(dest, arg) _InterlockedAnd_rel((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64_RELAXED(dest, arg) _InterlockedAnd64_nf((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64_ACQUIRE(dest, arg) _InterlockedAnd64_acq((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64_RELEASE(dest, arg) _InterlockedAnd64_rel((__int64*)(dest), (__int64)(arg))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedOr8_nf)
|
||||
#pragma intrinsic(_InterlockedOr8_acq)
|
||||
#pragma intrinsic(_InterlockedOr8_rel)
|
||||
#pragma intrinsic(_InterlockedOr16_nf)
|
||||
#pragma intrinsic(_InterlockedOr16_acq)
|
||||
#pragma intrinsic(_InterlockedOr16_rel)
|
||||
#pragma intrinsic(_InterlockedOr_nf)
|
||||
#pragma intrinsic(_InterlockedOr_acq)
|
||||
#pragma intrinsic(_InterlockedOr_rel)
|
||||
#pragma intrinsic(_InterlockedOr64_nf)
|
||||
#pragma intrinsic(_InterlockedOr64_acq)
|
||||
#pragma intrinsic(_InterlockedOr64_rel)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR8_RELAXED(dest, arg) _InterlockedOr8_nf((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR8_ACQUIRE(dest, arg) _InterlockedOr8_acq((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR8_RELEASE(dest, arg) _InterlockedOr8_rel((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR16_RELAXED(dest, arg) _InterlockedOr16_nf((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR16_ACQUIRE(dest, arg) _InterlockedOr16_acq((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR16_RELEASE(dest, arg) _InterlockedOr16_rel((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR_RELAXED(dest, arg) _InterlockedOr_nf((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR_ACQUIRE(dest, arg) _InterlockedOr_acq((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR_RELEASE(dest, arg) _InterlockedOr_rel((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64_RELAXED(dest, arg) _InterlockedOr64_nf((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64_ACQUIRE(dest, arg) _InterlockedOr64_acq((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64_RELEASE(dest, arg) _InterlockedOr64_rel((__int64*)(dest), (__int64)(arg))
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma intrinsic(_InterlockedXor8_nf)
|
||||
#pragma intrinsic(_InterlockedXor8_acq)
|
||||
#pragma intrinsic(_InterlockedXor8_rel)
|
||||
#pragma intrinsic(_InterlockedXor16_nf)
|
||||
#pragma intrinsic(_InterlockedXor16_acq)
|
||||
#pragma intrinsic(_InterlockedXor16_rel)
|
||||
#pragma intrinsic(_InterlockedXor_nf)
|
||||
#pragma intrinsic(_InterlockedXor_acq)
|
||||
#pragma intrinsic(_InterlockedXor_rel)
|
||||
#pragma intrinsic(_InterlockedXor64_nf)
|
||||
#pragma intrinsic(_InterlockedXor64_acq)
|
||||
#pragma intrinsic(_InterlockedXor64_rel)
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR8_RELAXED(dest, arg) _InterlockedXor8_nf((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR8_ACQUIRE(dest, arg) _InterlockedXor8_acq((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR8_RELEASE(dest, arg) _InterlockedXor8_rel((char*)(dest), (char)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR16_RELAXED(dest, arg) _InterlockedXor16_nf((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR16_ACQUIRE(dest, arg) _InterlockedXor16_acq((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR16_RELEASE(dest, arg) _InterlockedXor16_rel((short*)(dest), (short)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR_RELAXED(dest, arg) _InterlockedXor_nf((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR_ACQUIRE(dest, arg) _InterlockedXor_acq((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR_RELEASE(dest, arg) _InterlockedXor_rel((long*)(dest), (long)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64_RELAXED(dest, arg) _InterlockedXor64_nf((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64_ACQUIRE(dest, arg) _InterlockedXor64_acq((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64_RELEASE(dest, arg) _InterlockedXor64_rel((__int64*)(dest), (__int64)(arg))
|
||||
|
||||
#endif // _MSC_VER >= 1700 && defined(_M_ARM)
|
||||
|
||||
#endif // _MSC_VER < 1400
|
||||
|
||||
#else // defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
|
||||
#if defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare) InterlockedCompareExchange((long*)(dest), (long)(exchange), (long)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval) InterlockedExchange((long*)(dest), (long)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, addend) InterlockedExchangeAdd((long*)(dest), (long)(addend))
|
||||
|
||||
#if defined(_WIN64)
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) InterlockedExchangePointer((void**)(dest), (void*)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, byte_offset))
|
||||
|
||||
#else // defined(_WIN64)
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) ((void*)BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, byte_offset))
|
||||
|
||||
#endif // defined(_WIN64)
|
||||
|
||||
#else // defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
#if defined(__MINGW64__)
|
||||
#define BOOST_ATOMIC_INTERLOCKED_IMPORT
|
||||
#else
|
||||
#define BOOST_ATOMIC_INTERLOCKED_IMPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace atomics {
|
||||
namespace detail {
|
||||
|
||||
extern "C" {
|
||||
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange(long volatile*, long, long);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT long __stdcall InterlockedExchange(long volatile*, long);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd(long volatile*, long);
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchange((long*)(dest), (long)(exchange), (long)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval) boost::atomics::detail::InterlockedExchange((long*)(dest), (long)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, addend) boost::atomics::detail::InterlockedExchangeAdd((long*)(dest), (long)(addend))
|
||||
|
||||
#if defined(_WIN64)
|
||||
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedCompareExchange64(__int64 volatile*, __int64, __int64);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedExchange64(__int64 volatile*, __int64);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedExchangeAdd64(__int64 volatile*, __int64);
|
||||
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer(void* volatile *, void*, void*);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer(void* volatile *, void*);
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) boost::atomics::detail::InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) boost::atomics::detail::InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) boost::atomics::detail::InterlockedExchangePointer((void**)(dest), (void*)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, byte_offset))
|
||||
|
||||
#else // defined(_WIN64)
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) ((void*)BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE(dest, exchange, compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE(dest, newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD_POINTER(dest, byte_offset) ((void*)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(dest, byte_offset))
|
||||
|
||||
#endif // defined(_WIN64)
|
||||
|
||||
} // extern "C"
|
||||
|
||||
} // namespace detail
|
||||
} // namespace atomics
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_ATOMIC_INTERLOCKED_IMPORT
|
||||
|
||||
#endif // defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
#endif // defined(_MSC_VER)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,782 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (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. */
|
||||
#
|
||||
# if BOOST_PP_LOCAL_R(256)
|
||||
BOOST_PP_LOCAL_MACRO(256)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(255)
|
||||
BOOST_PP_LOCAL_MACRO(255)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(254)
|
||||
BOOST_PP_LOCAL_MACRO(254)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(253)
|
||||
BOOST_PP_LOCAL_MACRO(253)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(252)
|
||||
BOOST_PP_LOCAL_MACRO(252)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(251)
|
||||
BOOST_PP_LOCAL_MACRO(251)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(250)
|
||||
BOOST_PP_LOCAL_MACRO(250)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(249)
|
||||
BOOST_PP_LOCAL_MACRO(249)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(248)
|
||||
BOOST_PP_LOCAL_MACRO(248)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(247)
|
||||
BOOST_PP_LOCAL_MACRO(247)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(246)
|
||||
BOOST_PP_LOCAL_MACRO(246)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(245)
|
||||
BOOST_PP_LOCAL_MACRO(245)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(244)
|
||||
BOOST_PP_LOCAL_MACRO(244)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(243)
|
||||
BOOST_PP_LOCAL_MACRO(243)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(242)
|
||||
BOOST_PP_LOCAL_MACRO(242)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(241)
|
||||
BOOST_PP_LOCAL_MACRO(241)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(240)
|
||||
BOOST_PP_LOCAL_MACRO(240)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(239)
|
||||
BOOST_PP_LOCAL_MACRO(239)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(238)
|
||||
BOOST_PP_LOCAL_MACRO(238)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(237)
|
||||
BOOST_PP_LOCAL_MACRO(237)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(236)
|
||||
BOOST_PP_LOCAL_MACRO(236)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(235)
|
||||
BOOST_PP_LOCAL_MACRO(235)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(234)
|
||||
BOOST_PP_LOCAL_MACRO(234)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(233)
|
||||
BOOST_PP_LOCAL_MACRO(233)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(232)
|
||||
BOOST_PP_LOCAL_MACRO(232)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(231)
|
||||
BOOST_PP_LOCAL_MACRO(231)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(230)
|
||||
BOOST_PP_LOCAL_MACRO(230)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(229)
|
||||
BOOST_PP_LOCAL_MACRO(229)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(228)
|
||||
BOOST_PP_LOCAL_MACRO(228)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(227)
|
||||
BOOST_PP_LOCAL_MACRO(227)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(226)
|
||||
BOOST_PP_LOCAL_MACRO(226)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(225)
|
||||
BOOST_PP_LOCAL_MACRO(225)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(224)
|
||||
BOOST_PP_LOCAL_MACRO(224)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(223)
|
||||
BOOST_PP_LOCAL_MACRO(223)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(222)
|
||||
BOOST_PP_LOCAL_MACRO(222)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(221)
|
||||
BOOST_PP_LOCAL_MACRO(221)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(220)
|
||||
BOOST_PP_LOCAL_MACRO(220)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(219)
|
||||
BOOST_PP_LOCAL_MACRO(219)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(218)
|
||||
BOOST_PP_LOCAL_MACRO(218)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(217)
|
||||
BOOST_PP_LOCAL_MACRO(217)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(216)
|
||||
BOOST_PP_LOCAL_MACRO(216)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(215)
|
||||
BOOST_PP_LOCAL_MACRO(215)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(214)
|
||||
BOOST_PP_LOCAL_MACRO(214)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(213)
|
||||
BOOST_PP_LOCAL_MACRO(213)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(212)
|
||||
BOOST_PP_LOCAL_MACRO(212)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(211)
|
||||
BOOST_PP_LOCAL_MACRO(211)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(210)
|
||||
BOOST_PP_LOCAL_MACRO(210)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(209)
|
||||
BOOST_PP_LOCAL_MACRO(209)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(208)
|
||||
BOOST_PP_LOCAL_MACRO(208)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(207)
|
||||
BOOST_PP_LOCAL_MACRO(207)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(206)
|
||||
BOOST_PP_LOCAL_MACRO(206)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(205)
|
||||
BOOST_PP_LOCAL_MACRO(205)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(204)
|
||||
BOOST_PP_LOCAL_MACRO(204)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(203)
|
||||
BOOST_PP_LOCAL_MACRO(203)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(202)
|
||||
BOOST_PP_LOCAL_MACRO(202)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(201)
|
||||
BOOST_PP_LOCAL_MACRO(201)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(200)
|
||||
BOOST_PP_LOCAL_MACRO(200)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(199)
|
||||
BOOST_PP_LOCAL_MACRO(199)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(198)
|
||||
BOOST_PP_LOCAL_MACRO(198)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(197)
|
||||
BOOST_PP_LOCAL_MACRO(197)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(196)
|
||||
BOOST_PP_LOCAL_MACRO(196)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(195)
|
||||
BOOST_PP_LOCAL_MACRO(195)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(194)
|
||||
BOOST_PP_LOCAL_MACRO(194)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(193)
|
||||
BOOST_PP_LOCAL_MACRO(193)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(192)
|
||||
BOOST_PP_LOCAL_MACRO(192)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(191)
|
||||
BOOST_PP_LOCAL_MACRO(191)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(190)
|
||||
BOOST_PP_LOCAL_MACRO(190)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(189)
|
||||
BOOST_PP_LOCAL_MACRO(189)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(188)
|
||||
BOOST_PP_LOCAL_MACRO(188)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(187)
|
||||
BOOST_PP_LOCAL_MACRO(187)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(186)
|
||||
BOOST_PP_LOCAL_MACRO(186)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(185)
|
||||
BOOST_PP_LOCAL_MACRO(185)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(184)
|
||||
BOOST_PP_LOCAL_MACRO(184)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(183)
|
||||
BOOST_PP_LOCAL_MACRO(183)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(182)
|
||||
BOOST_PP_LOCAL_MACRO(182)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(181)
|
||||
BOOST_PP_LOCAL_MACRO(181)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(180)
|
||||
BOOST_PP_LOCAL_MACRO(180)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(179)
|
||||
BOOST_PP_LOCAL_MACRO(179)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(178)
|
||||
BOOST_PP_LOCAL_MACRO(178)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(177)
|
||||
BOOST_PP_LOCAL_MACRO(177)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(176)
|
||||
BOOST_PP_LOCAL_MACRO(176)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(175)
|
||||
BOOST_PP_LOCAL_MACRO(175)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(174)
|
||||
BOOST_PP_LOCAL_MACRO(174)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(173)
|
||||
BOOST_PP_LOCAL_MACRO(173)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(172)
|
||||
BOOST_PP_LOCAL_MACRO(172)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(171)
|
||||
BOOST_PP_LOCAL_MACRO(171)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(170)
|
||||
BOOST_PP_LOCAL_MACRO(170)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(169)
|
||||
BOOST_PP_LOCAL_MACRO(169)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(168)
|
||||
BOOST_PP_LOCAL_MACRO(168)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(167)
|
||||
BOOST_PP_LOCAL_MACRO(167)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(166)
|
||||
BOOST_PP_LOCAL_MACRO(166)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(165)
|
||||
BOOST_PP_LOCAL_MACRO(165)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(164)
|
||||
BOOST_PP_LOCAL_MACRO(164)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(163)
|
||||
BOOST_PP_LOCAL_MACRO(163)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(162)
|
||||
BOOST_PP_LOCAL_MACRO(162)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(161)
|
||||
BOOST_PP_LOCAL_MACRO(161)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(160)
|
||||
BOOST_PP_LOCAL_MACRO(160)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(159)
|
||||
BOOST_PP_LOCAL_MACRO(159)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(158)
|
||||
BOOST_PP_LOCAL_MACRO(158)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(157)
|
||||
BOOST_PP_LOCAL_MACRO(157)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(156)
|
||||
BOOST_PP_LOCAL_MACRO(156)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(155)
|
||||
BOOST_PP_LOCAL_MACRO(155)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(154)
|
||||
BOOST_PP_LOCAL_MACRO(154)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(153)
|
||||
BOOST_PP_LOCAL_MACRO(153)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(152)
|
||||
BOOST_PP_LOCAL_MACRO(152)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(151)
|
||||
BOOST_PP_LOCAL_MACRO(151)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(150)
|
||||
BOOST_PP_LOCAL_MACRO(150)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(149)
|
||||
BOOST_PP_LOCAL_MACRO(149)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(148)
|
||||
BOOST_PP_LOCAL_MACRO(148)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(147)
|
||||
BOOST_PP_LOCAL_MACRO(147)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(146)
|
||||
BOOST_PP_LOCAL_MACRO(146)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(145)
|
||||
BOOST_PP_LOCAL_MACRO(145)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(144)
|
||||
BOOST_PP_LOCAL_MACRO(144)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(143)
|
||||
BOOST_PP_LOCAL_MACRO(143)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(142)
|
||||
BOOST_PP_LOCAL_MACRO(142)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(141)
|
||||
BOOST_PP_LOCAL_MACRO(141)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(140)
|
||||
BOOST_PP_LOCAL_MACRO(140)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(139)
|
||||
BOOST_PP_LOCAL_MACRO(139)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(138)
|
||||
BOOST_PP_LOCAL_MACRO(138)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(137)
|
||||
BOOST_PP_LOCAL_MACRO(137)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(136)
|
||||
BOOST_PP_LOCAL_MACRO(136)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(135)
|
||||
BOOST_PP_LOCAL_MACRO(135)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(134)
|
||||
BOOST_PP_LOCAL_MACRO(134)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(133)
|
||||
BOOST_PP_LOCAL_MACRO(133)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(132)
|
||||
BOOST_PP_LOCAL_MACRO(132)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(131)
|
||||
BOOST_PP_LOCAL_MACRO(131)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(130)
|
||||
BOOST_PP_LOCAL_MACRO(130)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(129)
|
||||
BOOST_PP_LOCAL_MACRO(129)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(128)
|
||||
BOOST_PP_LOCAL_MACRO(128)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(127)
|
||||
BOOST_PP_LOCAL_MACRO(127)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(126)
|
||||
BOOST_PP_LOCAL_MACRO(126)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(125)
|
||||
BOOST_PP_LOCAL_MACRO(125)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(124)
|
||||
BOOST_PP_LOCAL_MACRO(124)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(123)
|
||||
BOOST_PP_LOCAL_MACRO(123)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(122)
|
||||
BOOST_PP_LOCAL_MACRO(122)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(121)
|
||||
BOOST_PP_LOCAL_MACRO(121)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(120)
|
||||
BOOST_PP_LOCAL_MACRO(120)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(119)
|
||||
BOOST_PP_LOCAL_MACRO(119)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(118)
|
||||
BOOST_PP_LOCAL_MACRO(118)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(117)
|
||||
BOOST_PP_LOCAL_MACRO(117)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(116)
|
||||
BOOST_PP_LOCAL_MACRO(116)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(115)
|
||||
BOOST_PP_LOCAL_MACRO(115)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(114)
|
||||
BOOST_PP_LOCAL_MACRO(114)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(113)
|
||||
BOOST_PP_LOCAL_MACRO(113)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(112)
|
||||
BOOST_PP_LOCAL_MACRO(112)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(111)
|
||||
BOOST_PP_LOCAL_MACRO(111)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(110)
|
||||
BOOST_PP_LOCAL_MACRO(110)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(109)
|
||||
BOOST_PP_LOCAL_MACRO(109)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(108)
|
||||
BOOST_PP_LOCAL_MACRO(108)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(107)
|
||||
BOOST_PP_LOCAL_MACRO(107)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(106)
|
||||
BOOST_PP_LOCAL_MACRO(106)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(105)
|
||||
BOOST_PP_LOCAL_MACRO(105)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(104)
|
||||
BOOST_PP_LOCAL_MACRO(104)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(103)
|
||||
BOOST_PP_LOCAL_MACRO(103)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(102)
|
||||
BOOST_PP_LOCAL_MACRO(102)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(101)
|
||||
BOOST_PP_LOCAL_MACRO(101)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(100)
|
||||
BOOST_PP_LOCAL_MACRO(100)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(99)
|
||||
BOOST_PP_LOCAL_MACRO(99)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(98)
|
||||
BOOST_PP_LOCAL_MACRO(98)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(97)
|
||||
BOOST_PP_LOCAL_MACRO(97)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(96)
|
||||
BOOST_PP_LOCAL_MACRO(96)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(95)
|
||||
BOOST_PP_LOCAL_MACRO(95)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(94)
|
||||
BOOST_PP_LOCAL_MACRO(94)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(93)
|
||||
BOOST_PP_LOCAL_MACRO(93)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(92)
|
||||
BOOST_PP_LOCAL_MACRO(92)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(91)
|
||||
BOOST_PP_LOCAL_MACRO(91)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(90)
|
||||
BOOST_PP_LOCAL_MACRO(90)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(89)
|
||||
BOOST_PP_LOCAL_MACRO(89)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(88)
|
||||
BOOST_PP_LOCAL_MACRO(88)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(87)
|
||||
BOOST_PP_LOCAL_MACRO(87)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(86)
|
||||
BOOST_PP_LOCAL_MACRO(86)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(85)
|
||||
BOOST_PP_LOCAL_MACRO(85)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(84)
|
||||
BOOST_PP_LOCAL_MACRO(84)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(83)
|
||||
BOOST_PP_LOCAL_MACRO(83)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(82)
|
||||
BOOST_PP_LOCAL_MACRO(82)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(81)
|
||||
BOOST_PP_LOCAL_MACRO(81)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(80)
|
||||
BOOST_PP_LOCAL_MACRO(80)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(79)
|
||||
BOOST_PP_LOCAL_MACRO(79)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(78)
|
||||
BOOST_PP_LOCAL_MACRO(78)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(77)
|
||||
BOOST_PP_LOCAL_MACRO(77)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(76)
|
||||
BOOST_PP_LOCAL_MACRO(76)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(75)
|
||||
BOOST_PP_LOCAL_MACRO(75)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(74)
|
||||
BOOST_PP_LOCAL_MACRO(74)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(73)
|
||||
BOOST_PP_LOCAL_MACRO(73)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(72)
|
||||
BOOST_PP_LOCAL_MACRO(72)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(71)
|
||||
BOOST_PP_LOCAL_MACRO(71)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(70)
|
||||
BOOST_PP_LOCAL_MACRO(70)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(69)
|
||||
BOOST_PP_LOCAL_MACRO(69)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(68)
|
||||
BOOST_PP_LOCAL_MACRO(68)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(67)
|
||||
BOOST_PP_LOCAL_MACRO(67)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(66)
|
||||
BOOST_PP_LOCAL_MACRO(66)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(65)
|
||||
BOOST_PP_LOCAL_MACRO(65)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(64)
|
||||
BOOST_PP_LOCAL_MACRO(64)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(63)
|
||||
BOOST_PP_LOCAL_MACRO(63)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(62)
|
||||
BOOST_PP_LOCAL_MACRO(62)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(61)
|
||||
BOOST_PP_LOCAL_MACRO(61)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(60)
|
||||
BOOST_PP_LOCAL_MACRO(60)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(59)
|
||||
BOOST_PP_LOCAL_MACRO(59)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(58)
|
||||
BOOST_PP_LOCAL_MACRO(58)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(57)
|
||||
BOOST_PP_LOCAL_MACRO(57)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(56)
|
||||
BOOST_PP_LOCAL_MACRO(56)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(55)
|
||||
BOOST_PP_LOCAL_MACRO(55)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(54)
|
||||
BOOST_PP_LOCAL_MACRO(54)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(53)
|
||||
BOOST_PP_LOCAL_MACRO(53)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(52)
|
||||
BOOST_PP_LOCAL_MACRO(52)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(51)
|
||||
BOOST_PP_LOCAL_MACRO(51)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(50)
|
||||
BOOST_PP_LOCAL_MACRO(50)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(49)
|
||||
BOOST_PP_LOCAL_MACRO(49)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(48)
|
||||
BOOST_PP_LOCAL_MACRO(48)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(47)
|
||||
BOOST_PP_LOCAL_MACRO(47)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(46)
|
||||
BOOST_PP_LOCAL_MACRO(46)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(45)
|
||||
BOOST_PP_LOCAL_MACRO(45)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(44)
|
||||
BOOST_PP_LOCAL_MACRO(44)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(43)
|
||||
BOOST_PP_LOCAL_MACRO(43)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(42)
|
||||
BOOST_PP_LOCAL_MACRO(42)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(41)
|
||||
BOOST_PP_LOCAL_MACRO(41)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(40)
|
||||
BOOST_PP_LOCAL_MACRO(40)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(39)
|
||||
BOOST_PP_LOCAL_MACRO(39)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(38)
|
||||
BOOST_PP_LOCAL_MACRO(38)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(37)
|
||||
BOOST_PP_LOCAL_MACRO(37)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(36)
|
||||
BOOST_PP_LOCAL_MACRO(36)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(35)
|
||||
BOOST_PP_LOCAL_MACRO(35)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(34)
|
||||
BOOST_PP_LOCAL_MACRO(34)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(33)
|
||||
BOOST_PP_LOCAL_MACRO(33)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(32)
|
||||
BOOST_PP_LOCAL_MACRO(32)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(31)
|
||||
BOOST_PP_LOCAL_MACRO(31)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(30)
|
||||
BOOST_PP_LOCAL_MACRO(30)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(29)
|
||||
BOOST_PP_LOCAL_MACRO(29)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(28)
|
||||
BOOST_PP_LOCAL_MACRO(28)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(27)
|
||||
BOOST_PP_LOCAL_MACRO(27)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(26)
|
||||
BOOST_PP_LOCAL_MACRO(26)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(25)
|
||||
BOOST_PP_LOCAL_MACRO(25)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(24)
|
||||
BOOST_PP_LOCAL_MACRO(24)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(23)
|
||||
BOOST_PP_LOCAL_MACRO(23)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(22)
|
||||
BOOST_PP_LOCAL_MACRO(22)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(21)
|
||||
BOOST_PP_LOCAL_MACRO(21)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(20)
|
||||
BOOST_PP_LOCAL_MACRO(20)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(19)
|
||||
BOOST_PP_LOCAL_MACRO(19)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(18)
|
||||
BOOST_PP_LOCAL_MACRO(18)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(17)
|
||||
BOOST_PP_LOCAL_MACRO(17)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(16)
|
||||
BOOST_PP_LOCAL_MACRO(16)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(15)
|
||||
BOOST_PP_LOCAL_MACRO(15)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(14)
|
||||
BOOST_PP_LOCAL_MACRO(14)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(13)
|
||||
BOOST_PP_LOCAL_MACRO(13)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(12)
|
||||
BOOST_PP_LOCAL_MACRO(12)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(11)
|
||||
BOOST_PP_LOCAL_MACRO(11)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(10)
|
||||
BOOST_PP_LOCAL_MACRO(10)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(9)
|
||||
BOOST_PP_LOCAL_MACRO(9)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(8)
|
||||
BOOST_PP_LOCAL_MACRO(8)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(7)
|
||||
BOOST_PP_LOCAL_MACRO(7)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(6)
|
||||
BOOST_PP_LOCAL_MACRO(6)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(5)
|
||||
BOOST_PP_LOCAL_MACRO(5)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(4)
|
||||
BOOST_PP_LOCAL_MACRO(4)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(3)
|
||||
BOOST_PP_LOCAL_MACRO(3)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(2)
|
||||
BOOST_PP_LOCAL_MACRO(2)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(1)
|
||||
BOOST_PP_LOCAL_MACRO(1)
|
||||
# endif
|
||||
# if BOOST_PP_LOCAL_R(0)
|
||||
BOOST_PP_LOCAL_MACRO(0)
|
||||
# endif
|
||||
@@ -0,0 +1,236 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Neil Groves 2010. 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_IRANGE_HPP_INCLUDED
|
||||
#define BOOST_RANGE_IRANGE_HPP_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
// integer_iterator is an iterator over an integer sequence that
|
||||
// is bounded only by the limits of the underlying integer
|
||||
// representation.
|
||||
//
|
||||
// This is useful for implementing the irange(first, last)
|
||||
// function.
|
||||
//
|
||||
// Note:
|
||||
// This use of this iterator and irange is appreciably less
|
||||
// performant than the corresponding hand-written integer
|
||||
// loop on many compilers.
|
||||
template<typename Integer>
|
||||
class integer_iterator
|
||||
: public boost::iterator_facade<
|
||||
integer_iterator<Integer>,
|
||||
Integer,
|
||||
boost::random_access_traversal_tag,
|
||||
Integer,
|
||||
std::ptrdiff_t
|
||||
>
|
||||
{
|
||||
typedef boost::iterator_facade<
|
||||
integer_iterator<Integer>,
|
||||
Integer,
|
||||
boost::random_access_traversal_tag,
|
||||
Integer,
|
||||
std::ptrdiff_t
|
||||
> base_t;
|
||||
public:
|
||||
typedef typename base_t::value_type value_type;
|
||||
typedef typename base_t::difference_type difference_type;
|
||||
typedef typename base_t::reference reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
|
||||
integer_iterator() : m_value() {}
|
||||
explicit integer_iterator(value_type x) : m_value(x) {}
|
||||
|
||||
private:
|
||||
void increment()
|
||||
{
|
||||
++m_value;
|
||||
}
|
||||
|
||||
void decrement()
|
||||
{
|
||||
--m_value;
|
||||
}
|
||||
|
||||
void advance(difference_type offset)
|
||||
{
|
||||
m_value += offset;
|
||||
}
|
||||
|
||||
difference_type distance_to(const integer_iterator& other) const
|
||||
{
|
||||
return is_signed<value_type>::value
|
||||
? (other.m_value - m_value)
|
||||
: (other.m_value >= m_value)
|
||||
? static_cast<difference_type>(other.m_value - m_value)
|
||||
: -static_cast<difference_type>(m_value - other.m_value);
|
||||
}
|
||||
|
||||
bool equal(const integer_iterator& other) const
|
||||
{
|
||||
return m_value == other.m_value;
|
||||
}
|
||||
|
||||
reference dereference() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
friend class ::boost::iterator_core_access;
|
||||
value_type m_value;
|
||||
};
|
||||
|
||||
// integer_iterator_with_step is similar in nature to the
|
||||
// integer_iterator but provides the ability to 'move' in
|
||||
// a number of steps specified at construction time.
|
||||
//
|
||||
// The three variable implementation provides the best guarantees
|
||||
// of loop termination upon various combinations of input.
|
||||
//
|
||||
// While this design is less performant than some less
|
||||
// safe alternatives, the use of ranges and iterators to
|
||||
// perform counting will never be optimal anyhow, hence
|
||||
// if optimal performance is desired a hand-coded loop
|
||||
// is the solution.
|
||||
template<typename Integer>
|
||||
class integer_iterator_with_step
|
||||
: public boost::iterator_facade<
|
||||
integer_iterator_with_step<Integer>,
|
||||
Integer,
|
||||
boost::random_access_traversal_tag,
|
||||
Integer,
|
||||
std::ptrdiff_t
|
||||
>
|
||||
{
|
||||
typedef boost::iterator_facade<
|
||||
integer_iterator_with_step<Integer>,
|
||||
Integer,
|
||||
boost::random_access_traversal_tag,
|
||||
Integer,
|
||||
std::ptrdiff_t
|
||||
> base_t;
|
||||
public:
|
||||
typedef typename base_t::value_type value_type;
|
||||
typedef typename base_t::difference_type difference_type;
|
||||
typedef typename base_t::reference reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
|
||||
integer_iterator_with_step(value_type first, difference_type step, value_type step_size)
|
||||
: m_first(first)
|
||||
, m_step(step)
|
||||
, m_step_size(step_size)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
void increment()
|
||||
{
|
||||
++m_step;
|
||||
}
|
||||
|
||||
void decrement()
|
||||
{
|
||||
--m_step;
|
||||
}
|
||||
|
||||
void advance(difference_type offset)
|
||||
{
|
||||
m_step += offset;
|
||||
}
|
||||
|
||||
difference_type distance_to(const integer_iterator_with_step& other) const
|
||||
{
|
||||
return other.m_step - m_step;
|
||||
}
|
||||
|
||||
bool equal(const integer_iterator_with_step& other) const
|
||||
{
|
||||
return m_step == other.m_step;
|
||||
}
|
||||
|
||||
reference dereference() const
|
||||
{
|
||||
return m_first + (m_step * m_step_size);
|
||||
}
|
||||
|
||||
friend class ::boost::iterator_core_access;
|
||||
value_type m_first;
|
||||
difference_type m_step;
|
||||
difference_type m_step_size;
|
||||
};
|
||||
|
||||
} // namespace range_detail
|
||||
|
||||
template<typename Integer>
|
||||
class integer_range
|
||||
: public iterator_range< range_detail::integer_iterator<Integer> >
|
||||
{
|
||||
typedef range_detail::integer_iterator<Integer> iterator_t;
|
||||
typedef iterator_range<iterator_t> base_t;
|
||||
public:
|
||||
integer_range(Integer first, Integer last)
|
||||
: base_t(iterator_t(first), iterator_t(last))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Integer>
|
||||
class strided_integer_range
|
||||
: public iterator_range< range_detail::integer_iterator_with_step<Integer> >
|
||||
{
|
||||
typedef range_detail::integer_iterator_with_step<Integer> iterator_t;
|
||||
typedef iterator_range<iterator_t> base_t;
|
||||
public:
|
||||
template<typename Iterator>
|
||||
strided_integer_range(Iterator first, Iterator last)
|
||||
: base_t(first, last)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Integer>
|
||||
integer_range<Integer>
|
||||
irange(Integer first, Integer last)
|
||||
{
|
||||
BOOST_ASSERT( first <= last );
|
||||
return integer_range<Integer>(first, last);
|
||||
}
|
||||
|
||||
template<typename Integer, typename StepSize>
|
||||
strided_integer_range<Integer>
|
||||
irange(Integer first, Integer last, StepSize step_size)
|
||||
{
|
||||
BOOST_ASSERT( step_size != 0 );
|
||||
BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) );
|
||||
|
||||
typedef typename range_detail::integer_iterator_with_step<Integer> iterator_t;
|
||||
|
||||
const std::ptrdiff_t sz = static_cast<std::ptrdiff_t>(step_size >= 0 ? step_size : -step_size);
|
||||
const Integer l = step_size >= 0 ? last : first;
|
||||
const Integer f = step_size >= 0 ? first : last;
|
||||
const std::ptrdiff_t num_steps = (l - f) / sz + ((l - f) % sz ? 1 : 0);
|
||||
BOOST_ASSERT(num_steps >= 0);
|
||||
|
||||
return strided_integer_range<Integer>(
|
||||
iterator_t(first, 0, step_size),
|
||||
iterator_t(first, num_steps, step_size));
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
* Copyright (c) 2009 Helge Bahmann
|
||||
* Copyright (c) 2013 Tim Blechmann
|
||||
* Copyright (c) 2012 - 2014 Andrey Semashev
|
||||
*/
|
||||
/*!
|
||||
* \file atomic/detail/caps_windows.hpp
|
||||
*
|
||||
* This header defines feature capabilities macros
|
||||
*/
|
||||
|
||||
#ifndef BOOST_ATOMIC_DETAIL_CAPS_WINDOWS_HPP_INCLUDED_
|
||||
#define BOOST_ATOMIC_DETAIL_CAPS_WINDOWS_HPP_INCLUDED_
|
||||
|
||||
#include <boost/atomic/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_INT8_LOCK_FREE 2
|
||||
#define BOOST_ATOMIC_INT16_LOCK_FREE 2
|
||||
#define BOOST_ATOMIC_INT32_LOCK_FREE 2
|
||||
#define BOOST_ATOMIC_POINTER_LOCK_FREE 2
|
||||
|
||||
#define BOOST_ATOMIC_THREAD_FENCE 2
|
||||
#define BOOST_ATOMIC_SIGNAL_FENCE 2
|
||||
|
||||
#endif // BOOST_ATOMIC_DETAIL_CAPS_WINDOWS_HPP_INCLUDED_
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Glen Fernandes
|
||||
*
|
||||
* 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_SWAP_HPP
|
||||
#define BOOST_SWAP_HPP
|
||||
|
||||
// The header file at this path is deprecated;
|
||||
// use boost/core/swap.hpp instead.
|
||||
|
||||
#include <boost/core/swap.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,284 @@
|
||||
/* boost random/uniform_on_sphere.hpp header file
|
||||
*
|
||||
* Copyright Jens Maurer 2000-2001
|
||||
* Copyright Steven Watanabe 2011
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org for most recent version including documentation.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Revision history
|
||||
* 2001-02-18 moved to individual header files
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RANDOM_UNIFORM_ON_SPHERE_HPP
|
||||
#define BOOST_RANDOM_UNIFORM_ON_SPHERE_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm> // std::transform
|
||||
#include <functional> // std::bind2nd, std::divides
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/random/detail/config.hpp>
|
||||
#include <boost/random/detail/operators.hpp>
|
||||
#include <boost/random/normal_distribution.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace random {
|
||||
|
||||
/**
|
||||
* Instantiations of class template uniform_on_sphere model a
|
||||
* \random_distribution. Such a distribution produces random
|
||||
* numbers uniformly distributed on the unit sphere of arbitrary
|
||||
* dimension @c dim. The @c Cont template parameter must be a STL-like
|
||||
* container type with begin and end operations returning non-const
|
||||
* ForwardIterators of type @c Cont::iterator.
|
||||
*/
|
||||
template<class RealType = double, class Cont = std::vector<RealType> >
|
||||
class uniform_on_sphere
|
||||
{
|
||||
public:
|
||||
typedef RealType input_type;
|
||||
typedef Cont result_type;
|
||||
|
||||
class param_type
|
||||
{
|
||||
public:
|
||||
|
||||
typedef uniform_on_sphere distribution_type;
|
||||
|
||||
/**
|
||||
* Constructs the parameters of a uniform_on_sphere
|
||||
* distribution, given the dimension of the sphere.
|
||||
*/
|
||||
explicit param_type(int dim_arg = 2) : _dim(dim_arg)
|
||||
{
|
||||
BOOST_ASSERT(_dim >= 0);
|
||||
}
|
||||
|
||||
/** Returns the dimension of the sphere. */
|
||||
int dim() const { return _dim; }
|
||||
|
||||
/** Writes the parameters to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm)
|
||||
{
|
||||
os << parm._dim;
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads the parameters from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm)
|
||||
{
|
||||
is >> parm._dim;
|
||||
return is;
|
||||
}
|
||||
|
||||
/** Returns true if the two sets of parameters are equal. */
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs)
|
||||
{ return lhs._dim == rhs._dim; }
|
||||
|
||||
/** Returns true if the two sets of parameters are different. */
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type)
|
||||
|
||||
private:
|
||||
int _dim;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a @c uniform_on_sphere distribution.
|
||||
* @c dim is the dimension of the sphere.
|
||||
*
|
||||
* Requires: dim >= 0
|
||||
*/
|
||||
explicit uniform_on_sphere(int dim_arg = 2)
|
||||
: _container(dim_arg), _dim(dim_arg) { }
|
||||
|
||||
/**
|
||||
* Constructs a @c uniform_on_sphere distribution from its parameters.
|
||||
*/
|
||||
explicit uniform_on_sphere(const param_type& parm)
|
||||
: _container(parm.dim()), _dim(parm.dim()) { }
|
||||
|
||||
// compiler-generated copy ctor and assignment operator are fine
|
||||
|
||||
/** Returns the dimension of the sphere. */
|
||||
int dim() const { return _dim; }
|
||||
|
||||
/** Returns the parameters of the distribution. */
|
||||
param_type param() const { return param_type(_dim); }
|
||||
/** Sets the parameters of the distribution. */
|
||||
void param(const param_type& parm)
|
||||
{
|
||||
_dim = parm.dim();
|
||||
_container.resize(_dim);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the smallest value that the distribution can produce.
|
||||
* Note that this is required to approximate the standard library's
|
||||
* requirements. The behavior is defined according to lexicographical
|
||||
* comparison so that for a container type of std::vector,
|
||||
* dist.min() <= x <= dist.max() where x is any value produced
|
||||
* by the distribution.
|
||||
*/
|
||||
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{
|
||||
result_type result(_dim);
|
||||
if(_dim != 0) {
|
||||
result.front() = RealType(-1.0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Returns the largest value that the distribution can produce.
|
||||
* Note that this is required to approximate the standard library's
|
||||
* requirements. The behavior is defined according to lexicographical
|
||||
* comparison so that for a container type of std::vector,
|
||||
* dist.min() <= x <= dist.max() where x is any value produced
|
||||
* by the distribution.
|
||||
*/
|
||||
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{
|
||||
result_type result(_dim);
|
||||
if(_dim != 0) {
|
||||
result.front() = RealType(1.0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Effects: Subsequent uses of the distribution do not depend
|
||||
* on values produced by any engine prior to invoking reset.
|
||||
*/
|
||||
void reset() {}
|
||||
|
||||
/**
|
||||
* Returns a point uniformly distributed over the surface of
|
||||
* a sphere of dimension dim().
|
||||
*/
|
||||
template<class Engine>
|
||||
const result_type & operator()(Engine& eng)
|
||||
{
|
||||
using std::sqrt;
|
||||
switch(_dim)
|
||||
{
|
||||
case 0: break;
|
||||
case 1:
|
||||
{
|
||||
if(uniform_01<RealType>()(eng) < 0.5) {
|
||||
*_container.begin() = -1;
|
||||
} else {
|
||||
*_container.begin() = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
uniform_01<RealType> uniform;
|
||||
RealType sqsum;
|
||||
RealType x, y;
|
||||
do {
|
||||
x = uniform(eng) * 2 - 1;
|
||||
y = uniform(eng) * 2 - 1;
|
||||
sqsum = x*x + y*y;
|
||||
} while(sqsum == 0 || sqsum > 1);
|
||||
RealType mult = 1/sqrt(sqsum);
|
||||
typename Cont::iterator iter = _container.begin();
|
||||
*iter = x * mult;
|
||||
iter++;
|
||||
*iter = y * mult;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
uniform_01<RealType> uniform;
|
||||
RealType sqsum;
|
||||
RealType x, y;
|
||||
do {
|
||||
x = uniform(eng) * 2 - 1;
|
||||
y = uniform(eng) * 2 - 1;
|
||||
sqsum = x*x + y*y;
|
||||
} while(sqsum > 1);
|
||||
RealType mult = 2 * sqrt(1 - sqsum);
|
||||
typename Cont::iterator iter = _container.begin();
|
||||
*iter = x * mult;
|
||||
++iter;
|
||||
*iter = y * mult;
|
||||
++iter;
|
||||
*iter = 2 * sqsum - 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
detail::unit_normal_distribution<RealType> normal;
|
||||
RealType sqsum;
|
||||
do {
|
||||
sqsum = 0;
|
||||
for(typename Cont::iterator it = _container.begin();
|
||||
it != _container.end();
|
||||
++it) {
|
||||
RealType val = normal(eng);
|
||||
*it = val;
|
||||
sqsum += val * val;
|
||||
}
|
||||
} while(sqsum == 0);
|
||||
// for all i: result[i] /= sqrt(sqsum)
|
||||
std::transform(_container.begin(), _container.end(), _container.begin(),
|
||||
std::bind2nd(std::multiplies<RealType>(), 1/sqrt(sqsum)));
|
||||
}
|
||||
}
|
||||
return _container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a point uniformly distributed over the surface of
|
||||
* a sphere of dimension param.dim().
|
||||
*/
|
||||
template<class Engine>
|
||||
result_type operator()(Engine& eng, const param_type& parm) const
|
||||
{
|
||||
return uniform_on_sphere(parm)(eng);
|
||||
}
|
||||
|
||||
/** Writes the distribution to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, uniform_on_sphere, sd)
|
||||
{
|
||||
os << sd._dim;
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads the distribution from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, uniform_on_sphere, sd)
|
||||
{
|
||||
is >> sd._dim;
|
||||
sd._container.resize(sd._dim);
|
||||
return is;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the two distributions will produce identical
|
||||
* sequences of values, given equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(uniform_on_sphere, lhs, rhs)
|
||||
{ return lhs._dim == rhs._dim; }
|
||||
|
||||
/**
|
||||
* Returns true if the two distributions may produce different
|
||||
* sequences of values, given equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(uniform_on_sphere)
|
||||
|
||||
private:
|
||||
result_type _container;
|
||||
int _dim;
|
||||
};
|
||||
|
||||
} // namespace random
|
||||
|
||||
using random::uniform_on_sphere;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_RANDOM_UNIFORM_ON_SPHERE_HPP
|
||||
@@ -0,0 +1,321 @@
|
||||
/* 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_ITER_ADAPTOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ITER_ADAPTOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/operators.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
/* Poor man's version of boost::iterator_adaptor. Used instead of the
|
||||
* original as compile times for the latter are significantly higher.
|
||||
* The interface is not replicated exactly, only to the extent necessary
|
||||
* for internal consumption.
|
||||
*/
|
||||
|
||||
/* NB. The purpose of the (non-inclass) global operators ==, < and - defined
|
||||
* above is to partially alleviate a problem of MSVC++ 6.0 by * which
|
||||
* friend-injected operators on T are not visible if T is instantiated only
|
||||
* in template code where T is a dependent type.
|
||||
*/
|
||||
|
||||
class iter_adaptor_access
|
||||
{
|
||||
public:
|
||||
template<class Class>
|
||||
static typename Class::reference dereference(const Class& x)
|
||||
{
|
||||
return x.dereference();
|
||||
}
|
||||
|
||||
template<class Class>
|
||||
static bool equal(const Class& x,const Class& y)
|
||||
{
|
||||
return x.equal(y);
|
||||
}
|
||||
|
||||
template<class Class>
|
||||
static void increment(Class& x)
|
||||
{
|
||||
x.increment();
|
||||
}
|
||||
|
||||
template<class Class>
|
||||
static void decrement(Class& x)
|
||||
{
|
||||
x.decrement();
|
||||
}
|
||||
|
||||
template<class Class>
|
||||
static void advance(Class& x,typename Class::difference_type n)
|
||||
{
|
||||
x.advance(n);
|
||||
}
|
||||
|
||||
template<class Class>
|
||||
static typename Class::difference_type distance_to(
|
||||
const Class& x,const Class& y)
|
||||
{
|
||||
return x.distance_to(y);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Category>
|
||||
struct iter_adaptor_selector;
|
||||
|
||||
template<class Derived,class Base>
|
||||
class forward_iter_adaptor_base:
|
||||
public forward_iterator_helper<
|
||||
Derived,
|
||||
typename Base::value_type,
|
||||
typename Base::difference_type,
|
||||
typename Base::pointer,
|
||||
typename Base::reference>
|
||||
{
|
||||
public:
|
||||
typedef typename Base::reference reference;
|
||||
|
||||
reference operator*()const
|
||||
{
|
||||
return iter_adaptor_access::dereference(final());
|
||||
}
|
||||
|
||||
friend bool operator==(const Derived& x,const Derived& y)
|
||||
{
|
||||
return iter_adaptor_access::equal(x,y);
|
||||
}
|
||||
|
||||
Derived& operator++()
|
||||
{
|
||||
iter_adaptor_access::increment(final());
|
||||
return final();
|
||||
}
|
||||
|
||||
private:
|
||||
Derived& final(){return *static_cast<Derived*>(this);}
|
||||
const Derived& final()const{return *static_cast<const Derived*>(this);}
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
bool operator==(
|
||||
const forward_iter_adaptor_base<Derived,Base>& x,
|
||||
const forward_iter_adaptor_base<Derived,Base>& y)
|
||||
{
|
||||
return iter_adaptor_access::equal(
|
||||
static_cast<const Derived&>(x),static_cast<const Derived&>(y));
|
||||
}
|
||||
|
||||
template<>
|
||||
struct iter_adaptor_selector<std::forward_iterator_tag>
|
||||
{
|
||||
template<class Derived,class Base>
|
||||
struct apply
|
||||
{
|
||||
typedef forward_iter_adaptor_base<Derived,Base> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
class bidirectional_iter_adaptor_base:
|
||||
public bidirectional_iterator_helper<
|
||||
Derived,
|
||||
typename Base::value_type,
|
||||
typename Base::difference_type,
|
||||
typename Base::pointer,
|
||||
typename Base::reference>
|
||||
{
|
||||
public:
|
||||
typedef typename Base::reference reference;
|
||||
|
||||
reference operator*()const
|
||||
{
|
||||
return iter_adaptor_access::dereference(final());
|
||||
}
|
||||
|
||||
friend bool operator==(const Derived& x,const Derived& y)
|
||||
{
|
||||
return iter_adaptor_access::equal(x,y);
|
||||
}
|
||||
|
||||
Derived& operator++()
|
||||
{
|
||||
iter_adaptor_access::increment(final());
|
||||
return final();
|
||||
}
|
||||
|
||||
Derived& operator--()
|
||||
{
|
||||
iter_adaptor_access::decrement(final());
|
||||
return final();
|
||||
}
|
||||
|
||||
private:
|
||||
Derived& final(){return *static_cast<Derived*>(this);}
|
||||
const Derived& final()const{return *static_cast<const Derived*>(this);}
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
bool operator==(
|
||||
const bidirectional_iter_adaptor_base<Derived,Base>& x,
|
||||
const bidirectional_iter_adaptor_base<Derived,Base>& y)
|
||||
{
|
||||
return iter_adaptor_access::equal(
|
||||
static_cast<const Derived&>(x),static_cast<const Derived&>(y));
|
||||
}
|
||||
|
||||
template<>
|
||||
struct iter_adaptor_selector<std::bidirectional_iterator_tag>
|
||||
{
|
||||
template<class Derived,class Base>
|
||||
struct apply
|
||||
{
|
||||
typedef bidirectional_iter_adaptor_base<Derived,Base> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
class random_access_iter_adaptor_base:
|
||||
public random_access_iterator_helper<
|
||||
Derived,
|
||||
typename Base::value_type,
|
||||
typename Base::difference_type,
|
||||
typename Base::pointer,
|
||||
typename Base::reference>
|
||||
{
|
||||
public:
|
||||
typedef typename Base::reference reference;
|
||||
typedef typename Base::difference_type difference_type;
|
||||
|
||||
reference operator*()const
|
||||
{
|
||||
return iter_adaptor_access::dereference(final());
|
||||
}
|
||||
|
||||
friend bool operator==(const Derived& x,const Derived& y)
|
||||
{
|
||||
return iter_adaptor_access::equal(x,y);
|
||||
}
|
||||
|
||||
friend bool operator<(const Derived& x,const Derived& y)
|
||||
{
|
||||
return iter_adaptor_access::distance_to(x,y)>0;
|
||||
}
|
||||
|
||||
Derived& operator++()
|
||||
{
|
||||
iter_adaptor_access::increment(final());
|
||||
return final();
|
||||
}
|
||||
|
||||
Derived& operator--()
|
||||
{
|
||||
iter_adaptor_access::decrement(final());
|
||||
return final();
|
||||
}
|
||||
|
||||
Derived& operator+=(difference_type n)
|
||||
{
|
||||
iter_adaptor_access::advance(final(),n);
|
||||
return final();
|
||||
}
|
||||
|
||||
Derived& operator-=(difference_type n)
|
||||
{
|
||||
iter_adaptor_access::advance(final(),-n);
|
||||
return final();
|
||||
}
|
||||
|
||||
friend difference_type operator-(const Derived& x,const Derived& y)
|
||||
{
|
||||
return iter_adaptor_access::distance_to(y,x);
|
||||
}
|
||||
|
||||
private:
|
||||
Derived& final(){return *static_cast<Derived*>(this);}
|
||||
const Derived& final()const{return *static_cast<const Derived*>(this);}
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
bool operator==(
|
||||
const random_access_iter_adaptor_base<Derived,Base>& x,
|
||||
const random_access_iter_adaptor_base<Derived,Base>& y)
|
||||
{
|
||||
return iter_adaptor_access::equal(
|
||||
static_cast<const Derived&>(x),static_cast<const Derived&>(y));
|
||||
}
|
||||
|
||||
template<class Derived,class Base>
|
||||
bool operator<(
|
||||
const random_access_iter_adaptor_base<Derived,Base>& x,
|
||||
const random_access_iter_adaptor_base<Derived,Base>& y)
|
||||
{
|
||||
return iter_adaptor_access::distance_to(
|
||||
static_cast<const Derived&>(x),static_cast<const Derived&>(y))>0;
|
||||
}
|
||||
|
||||
template<class Derived,class Base>
|
||||
typename random_access_iter_adaptor_base<Derived,Base>::difference_type
|
||||
operator-(
|
||||
const random_access_iter_adaptor_base<Derived,Base>& x,
|
||||
const random_access_iter_adaptor_base<Derived,Base>& y)
|
||||
{
|
||||
return iter_adaptor_access::distance_to(
|
||||
static_cast<const Derived&>(y),static_cast<const Derived&>(x));
|
||||
}
|
||||
|
||||
template<>
|
||||
struct iter_adaptor_selector<std::random_access_iterator_tag>
|
||||
{
|
||||
template<class Derived,class Base>
|
||||
struct apply
|
||||
{
|
||||
typedef random_access_iter_adaptor_base<Derived,Base> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
struct iter_adaptor_base
|
||||
{
|
||||
typedef iter_adaptor_selector<
|
||||
typename Base::iterator_category> selector;
|
||||
typedef typename mpl::apply2<
|
||||
selector,Derived,Base>::type type;
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
class iter_adaptor:public iter_adaptor_base<Derived,Base>::type
|
||||
{
|
||||
protected:
|
||||
iter_adaptor(){}
|
||||
explicit iter_adaptor(const Base& b_):b(b_){}
|
||||
|
||||
const Base& base_reference()const{return b;}
|
||||
Base& base_reference(){return b;}
|
||||
|
||||
private:
|
||||
Base b;
|
||||
};
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SEGMENTED_END_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_SEGMENTED_END_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
|
||||
#include <boost/fusion/container/list/cons_fwd.hpp>
|
||||
#include <boost/fusion/support/is_segmented.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template <typename First, typename Last>
|
||||
struct iterator_range;
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
//auto segmented_end_impl( seq, stack )
|
||||
//{
|
||||
// assert(is_segmented(seq));
|
||||
// auto it = end(segments(seq));
|
||||
// return cons(iterator_range(it, it), stack);
|
||||
//}
|
||||
|
||||
template <typename Sequence, typename Stack>
|
||||
struct segmented_end_impl
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_segmented<Sequence>));
|
||||
|
||||
typedef
|
||||
typename result_of::end<
|
||||
typename remove_reference<
|
||||
typename add_const<
|
||||
typename result_of::segments<Sequence>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
end_type;
|
||||
|
||||
typedef iterator_range<end_type, end_type> pair_type;
|
||||
typedef cons<pair_type, Stack> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static pair_type make_pair(end_type end)
|
||||
{
|
||||
return pair_type(end, end);
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Sequence & seq, Stack stack)
|
||||
{
|
||||
return type(
|
||||
make_pair(fusion::end(fusion::segments(seq))),
|
||||
stack);
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/proto/detail/preprocessed/funop.hpp>
|
||||
|
||||
#elif !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
#define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
|
||||
typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \
|
||||
/**/
|
||||
|
||||
#define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
|
||||
proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \
|
||||
/**/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/funop.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// funop.hpp
|
||||
// Contains definition of funop[n]\<\> class template.
|
||||
//
|
||||
// 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)
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/funop.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_PROTO_AS_CHILD
|
||||
#undef BOOST_PROTO_AS_CHILD_TYPE
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/// \brief A helper metafunction for computing the
|
||||
/// return type of \c proto::expr\<\>::operator().
|
||||
template<typename Expr, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A)>
|
||||
struct BOOST_PP_CAT(funop, BOOST_PP_ITERATION())
|
||||
{
|
||||
typedef typename proto::base_expr<
|
||||
Domain
|
||||
, tag::function
|
||||
, BOOST_PP_CAT(list, BOOST_PP_INC(BOOST_PP_ITERATION()))<
|
||||
Expr &
|
||||
BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD_TYPE, ~)
|
||||
>
|
||||
>::type type;
|
||||
|
||||
BOOST_FORCEINLINE
|
||||
static type const call(
|
||||
Expr &e
|
||||
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(BOOST_PP_ITERATION(), A, &a)
|
||||
)
|
||||
{
|
||||
type that = {
|
||||
e
|
||||
BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD, ~)
|
||||
};
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief A helper metafunction for computing the
|
||||
/// return type of \c proto::expr\<\>::operator().
|
||||
template<typename Expr BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A), typename This, typename Domain>
|
||||
struct funop<Expr(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), This, Domain>
|
||||
: BOOST_PP_CAT(funop, BOOST_PP_ITERATION())<
|
||||
typename detail::same_cv<Expr, This>::type
|
||||
, Domain
|
||||
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
|
||||
BOOST_PP_ITERATION()
|
||||
, typename remove_reference<A
|
||||
, >::type BOOST_PP_INTERCEPT
|
||||
)
|
||||
>
|
||||
{};
|
||||
|
||||
#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
|
||||
Reference in New Issue
Block a user