Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,233 @@
set (LANGUAGES
en
)
set (common_SRCS
common/communication.adoc
common/license.adoc
common/links.adoc
)
set (UG_SRCS
docinfo.html
docinfo.xml
acknowledgements.adoc
astro_data.adoc
config-details.adoc
controls-functions-center.adoc
controls-functions-left.adoc
controls-functions-main-window.adoc
controls-functions-menus.adoc
controls-functions-messages.adoc
controls-functions-status-bar.adoc
controls-functions-wide-graph.adoc
cooperating-programs.adoc
faq.adoc
font-sizes.adoc
install-from-source.adoc
install-linux.adoc
install-mac.adoc
install-windows.adoc
introduction.adoc
protocols.adoc
logging.adoc
make-qso.adoc
new_features.adoc
odds_and_ends.adoc
platform-dependencies.adoc
protocols.adoc
settings-advanced.adoc
settings-audio.adoc
settings-colors.adoc
settings-frequencies.adoc
settings-general.adoc
settings-radio.adoc
settings-reporting.adoc
settings-txmacros.adoc
support.adoc
system-requirements.adoc
transceiver-setup.adoc
tutorial-example1.adoc
tutorial-example2.adoc
tutorial-example3.adoc
tutorial-main-window.adoc
tutorial-wide-graph-settings.adoc
utilities.adoc
vhf-features.adoc
wsjtx-main.adoc
wspr.adoc
)
set (UG_IMGS
images/130610_2343-wav-80.png
images/170709_135615.wav.png
images/AstroData_2.png
images/Astronomical_data.png
images/band-settings.png
images/colors.png
images/config-menu.png
images/decode-menu.png
images/decodes.png
images/download_samples.png
images/file-menu.png
images/freemsg.png
images/ft8_decodes.png
images/help-menu.png
images/JT4F.png
images/JT65B.png
images/MSK144.png
images/QRA64.png
images/WSPR_WideGraphControls.png
images/WSPR_1a.png
images/WSPR_2.png
images/jtalert.png
images/keyboard-shortcuts.png
images/log-qso.png
images/MacAppMenu.png
images/main-ui.png
images/main-ui-controls.png
images/misc-controls-center.png
images/misc-main-ui.png
images/mode-menu.png
images/new-msg-box.png
images/psk-reporter.png
images/r3666-config-screen-80.png
images/r3666-main-ui-80.png
images/r4148-txmac-ui.png
images/RadioTab.png
images/reporting.png
images/save-menu.png
images/settings-advanced.png
images/settings-audio.png
images/settings-frequencies.png
images/settings-general.png
images/setup-menu.png
images/special-mouse-commands.png
images/status-bar-a.png
images/traditional-msg-box.png
images/tx-macros.png
images/view-menu.png
images/wide-graph-controls.png
)
find_program (ASCIIDOCTOR_EXECUTABLE NAMES asciidoctor)
if (NOT ASCIIDOCTOR_EXECUTABLE)
message (FATAL_ERROR "asciidoctor is required to build the documentation
Building the documenation may optionally be turned off by setting the CMake
option WSJT_GENERATE_DOCS to OFF.")
endif (NOT ASCIIDOCTOR_EXECUTABLE)
find_program (FOPUB_EXECUTABLE NAMES fopub)
include (CMakeParseArguments)
# generate a document from asciidoc text files(s)
#
# HTML - generate an HTML document
# PDF - generate a PDF document
# SOURCE - top level asciidoc file
# ASCIIDOCTOR_OPTIONS - asciidoctor command options
# DEPENDS - dependent files
function (document)
cmake_parse_arguments (_args "HTML" "SOURCE;LANG;OUTPUT" "ASCIIDOCTOR_OPTIONS;PDF;DEPENDS" ${ARGN})
get_filename_component (_source_path ${_args_SOURCE} PATH)
get_filename_component (_source_name ${_args_SOURCE} NAME)
get_filename_component (_output_name_we ${_args_SOURCE} NAME_WE)
# HTML
if (${_args_HTML})
set (_html_file ${CMAKE_CURRENT_BINARY_DIR}/${_output_name_we}_${lang}.html)
add_custom_command (
OUTPUT ${_html_file}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_source_path}/${lang}
COMMAND ${ASCIIDOCTOR_EXECUTABLE} ${_args_ASCIIDOCTOR_OPTIONS}
-b html5
-a VERSION_MAJOR=${WSJTX_VERSION_MAJOR}
-a VERSION_MINOR=${WSJTX_VERSION_MINOR}
-a VERSION_PATCH=${WSJTX_VERSION_PATCH}
-a VERSION=${wsjtx_VERSION}
--out-file=${_html_file} ${_source_name}
DEPENDS ${_args_DEPENDS}
COMMENT "Generating ${_html_file}"
)
list (APPEND _output_files ${_html_file})
endif (${_args_HTML})
# PDF
if (_args_PDF AND EXISTS ${FOPUB_EXECUTABLE})
set (_docbook_file ${CMAKE_CURRENT_BINARY_DIR}/${_output_name_we}_${lang}.xml)
set (_pdf_file_we ${CMAKE_CURRENT_BINARY_DIR}/${_output_name_we}_${lang})
if (${lang} MATCHES "^(en|es|fr)$") # en-us, fr-ca and es-{mx,co} use US-Letter or equivalent
set (_usl_commands
COMMAND ${FOPUB_EXECUTABLE} ARGS ${_docbook_file} ${_args_PDF} -param paper.type USLetter
COMMAND ${CMAKE_COMMAND} ARGS -E rename ${_pdf_file_we}.pdf '${_pdf_file_we} \(USLetter\).pdf'
)
list (APPEND _output_files "${_pdf_file_we} (USLetter).pdf")
endif ()
list (APPEND _output_files "${_pdf_file_we}.pdf")
add_custom_command (
OUTPUT ${_docbook_file} ${_output_files}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_source_path}/${lang}
COMMAND ${ASCIIDOCTOR_EXECUTABLE} ARGS ${_args_ASCIIDOCTOR_OPTIONS}
-b docbook
-a data-uri!
-a VERSION_MAJOR=${WSJTX_VERSION_MAJOR}
-a VERSION_MINOR=${WSJTX_VERSION_MINOR}
-a VERSION_PATCH=${WSJTX_VERSION_PATCH}
-a VERSION=${wsjtx_VERSION}
-D ${CMAKE_CURRENT_BINARY_DIR}
-o ${_docbook_file} ${_source_name}
${_usl_commands}
COMMAND ${FOPUB_EXECUTABLE} ARGS ${_docbook_file} ${_args_PDF} -param paper.type A4
COMMAND ${CMAKE_COMMAND} ARGS -E rename ${_pdf_file_we}.pdf '${_pdf_file_we}.pdf'
DEPENDS ${_args_DEPENDS}
COMMENT "Generating ${_output_files}"
)
endif (_args_PDF AND EXISTS ${FOPUB_EXECUTABLE})
set (${_args_OUTPUT} ${_output_files} PARENT_SCOPE)
endfunction (document)
set (htmls)
set (pdfs)
foreach (lang ${LANGUAGES})
set (_sources)
foreach (_src ${UG_SRCS} ${UG_IMGS})
list (APPEND _sources "user_guide/${lang}/${_src}")
endforeach ()
document(
HTML
SOURCE user_guide/wsjtx-main.adoc
LANG "${lang}"
OUTPUT html
ASCIIDOCTOR_OPTIONS -d book -a data-uri -a toc=left -a max-width=1024px
DEPENDS ${common_SRCS} ${_sources}
)
document(
PDF -param body.font.master 11 -param body.font.family "'Noto Sans, Helvetica, sans-serif'" -param title.font.family "'Noto Serif, Times New Roman, serif'" -param page.margin.inner 1cm -param page.margin.outer 1cm -param page.margin.top 0.75cm -param page.margin.bottom 0.5cm -param generate.toc 0
SOURCE user_guide/wsjtx-main.adoc
LANG "${lang}"
OUTPUT pdf
ASCIIDOCTOR_OPTIONS -d book
DEPENDS ${common_SRCS} ${_sources}
)
list (APPEND htmls "${html}")
list (APPEND pdfs "${pdf}")
endforeach ()
add_custom_target (docs ALL DEPENDS ${htmls} ${pdfs})
foreach (_html ${htmls})
get_filename_component (_path ${_html} PATH)
get_filename_component (_nwe ${_html} NAME_WE)
get_filename_component (_ext ${_html} EXT)
string (REGEX REPLACE "_en$" "" _nwe ${_nwe})
install (FILES
${_html}
DESTINATION ${CMAKE_INSTALL_DOCDIR}
RENAME ${_nwe}-${wsjtx_VERSION}${_ext}
#COMPONENT runtime
)
endforeach ()
@@ -0,0 +1,292 @@
/* boost random/gamma_distribution.hpp header file
*
* Copyright Jens Maurer 2002
* Copyright Steven Watanabe 2010
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id$
*
*/
#ifndef BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP
#define BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <istream>
#include <iosfwd>
#include <boost/assert.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/exponential_distribution.hpp>
namespace boost {
namespace random {
// The algorithm is taken from Knuth
/**
* The gamma distribution is a continuous distribution with two
* parameters alpha and beta. It produces values > 0.
*
* It has
* \f$\displaystyle p(x) = x^{\alpha-1}\frac{e^{-x/\beta}}{\beta^\alpha\Gamma(\alpha)}\f$.
*/
template<class RealType = double>
class gamma_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
class param_type
{
public:
typedef gamma_distribution distribution_type;
/**
* Constructs a @c param_type object from the "alpha" and "beta"
* parameters.
*
* Requires: alpha > 0 && beta > 0
*/
param_type(const RealType& alpha_arg = RealType(1.0),
const RealType& beta_arg = RealType(1.0))
: _alpha(alpha_arg), _beta(beta_arg)
{
}
/** Returns the "alpha" parameter of the distribution. */
RealType alpha() const { return _alpha; }
/** Returns the "beta" parameter of the distribution. */
RealType beta() const { return _beta; }
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/** Writes the parameters to a @c std::ostream. */
template<class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os,
const param_type& parm)
{
os << parm._alpha << ' ' << parm._beta;
return os;
}
/** Reads the parameters from a @c std::istream. */
template<class CharT, class Traits>
friend std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, param_type& parm)
{
is >> parm._alpha >> std::ws >> parm._beta;
return is;
}
#endif
/** Returns true if the two sets of parameters are the same. */
friend bool operator==(const param_type& lhs, const param_type& rhs)
{
return lhs._alpha == rhs._alpha && lhs._beta == rhs._beta;
}
/** Returns true if the two sets fo parameters are different. */
friend bool operator!=(const param_type& lhs, const param_type& rhs)
{
return !(lhs == rhs);
}
private:
RealType _alpha;
RealType _beta;
};
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
/**
* Creates a new gamma_distribution with parameters "alpha" and "beta".
*
* Requires: alpha > 0 && beta > 0
*/
explicit gamma_distribution(const result_type& alpha_arg = result_type(1.0),
const result_type& beta_arg = result_type(1.0))
: _exp(result_type(1)), _alpha(alpha_arg), _beta(beta_arg)
{
BOOST_ASSERT(_alpha > result_type(0));
BOOST_ASSERT(_beta > result_type(0));
init();
}
/** Constructs a @c gamma_distribution from its parameters. */
explicit gamma_distribution(const param_type& parm)
: _exp(result_type(1)), _alpha(parm.alpha()), _beta(parm.beta())
{
init();
}
// compiler-generated copy ctor and assignment operator are fine
/** Returns the "alpha" paramter of the distribution. */
RealType alpha() const { return _alpha; }
/** Returns the "beta" parameter of the distribution. */
RealType beta() const { return _beta; }
/** Returns the smallest value that the distribution can produce. */
RealType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
/* Returns the largest value that the distribution can produce. */
RealType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return (std::numeric_limits<RealType>::infinity)(); }
/** Returns the parameters of the distribution. */
param_type param() const { return param_type(_alpha, _beta); }
/** Sets the parameters of the distribution. */
void param(const param_type& parm)
{
_alpha = parm.alpha();
_beta = parm.beta();
init();
}
/**
* Effects: Subsequent uses of the distribution do not depend
* on values produced by any engine prior to invoking reset.
*/
void reset() { _exp.reset(); }
/**
* Returns a random variate distributed according to
* the gamma distribution.
*/
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::tan; using std::sqrt; using std::exp; using std::log;
using std::pow;
#endif
if(_alpha == result_type(1)) {
return _exp(eng) * _beta;
} else if(_alpha > result_type(1)) {
// Can we have a boost::mathconst please?
const result_type pi = result_type(3.14159265358979323846);
for(;;) {
result_type y = tan(pi * uniform_01<RealType>()(eng));
result_type x = sqrt(result_type(2)*_alpha-result_type(1))*y
+ _alpha-result_type(1);
if(x <= result_type(0))
continue;
if(uniform_01<RealType>()(eng) >
(result_type(1)+y*y) * exp((_alpha-result_type(1))
*log(x/(_alpha-result_type(1)))
- sqrt(result_type(2)*_alpha
-result_type(1))*y))
continue;
return x * _beta;
}
} else /* alpha < 1.0 */ {
for(;;) {
result_type u = uniform_01<RealType>()(eng);
result_type y = _exp(eng);
result_type x, q;
if(u < _p) {
x = exp(-y/_alpha);
q = _p*exp(-x);
} else {
x = result_type(1)+y;
q = _p + (result_type(1)-_p) * pow(x,_alpha-result_type(1));
}
if(u >= q)
continue;
return x * _beta;
}
}
}
template<class URNG>
RealType operator()(URNG& urng, const param_type& parm) const
{
return gamma_distribution(parm)(urng);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/** Writes a @c gamma_distribution to a @c std::ostream. */
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const gamma_distribution& gd)
{
os << gd.param();
return os;
}
/** Reads a @c gamma_distribution from a @c std::istream. */
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, gamma_distribution& gd)
{
gd.read(is);
return is;
}
#endif
/**
* Returns true if the two distributions will produce identical
* sequences of random variates given equal generators.
*/
friend bool operator==(const gamma_distribution& lhs,
const gamma_distribution& rhs)
{
return lhs._alpha == rhs._alpha
&& lhs._beta == rhs._beta
&& lhs._exp == rhs._exp;
}
/**
* Returns true if the two distributions can produce different
* sequences of random variates, given equal generators.
*/
friend bool operator!=(const gamma_distribution& lhs,
const gamma_distribution& rhs)
{
return !(lhs == rhs);
}
private:
/// \cond hide_private_members
template<class CharT, class Traits>
void read(std::basic_istream<CharT, Traits>& is)
{
param_type parm;
if(is >> parm) {
param(parm);
}
}
void init()
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::exp;
#endif
_p = exp(result_type(1)) / (_alpha + exp(result_type(1)));
}
/// \endcond
exponential_distribution<RealType> _exp;
result_type _alpha;
result_type _beta;
// some data precomputed from the parameters
result_type _p;
};
} // namespace random
using random::gamma_distribution;
} // namespace boost
#endif // BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP
@@ -0,0 +1,25 @@
#ifndef DATE_TIME_SPECIAL_DEFS_HPP__
#define DATE_TIME_SPECIAL_DEFS_HPP__
/* Copyright (c) 2002,2003 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
* $Date$
*/
namespace boost {
namespace date_time {
enum special_values {not_a_date_time,
neg_infin, pos_infin,
min_date_time, max_date_time,
not_special, NumSpecialValues};
} } //namespace date_time
#endif
@@ -0,0 +1,338 @@
//---------------------------------------------------------------------------//
// 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_EVENT_HPP
#define BOOST_COMPUTE_EVENT_HPP
#include <boost/function.hpp>
#include <boost/compute/config.hpp>
#include <boost/compute/exception.hpp>
#include <boost/compute/detail/duration.hpp>
#include <boost/compute/detail/get_object_info.hpp>
#include <boost/compute/detail/assert_cl_success.hpp>
#include <boost/compute/types/fundamental.hpp>
namespace boost {
namespace compute {
/// \class event
/// \brief An event corresponding to an operation on a compute device
///
/// Event objects are used to track operations running on the device (such as
/// kernel executions and memory transfers). Event objects are returned by the
/// various \c enqueue_* methods of the command_queue class.
///
/// Events can be used to synchronize operations between the host and the
/// device. The \c wait() method will block execution on the host until the
/// operation corresponding to the event on the device has completed. The
/// status of the operation can also be polled with the \c status() method.
///
/// Event objects can also be used for performance profiling. In order to use
/// events for profiling, the command queue must be constructed with the
/// \c CL_QUEUE_PROFILING_ENABLE flag. Then the \c duration() method can be
/// used to retrieve the total duration of the operation on the device:
/// \code
/// std::cout << "time = " << e.duration<std::chrono::milliseconds>().count() << "ms\n";
/// \endcode
///
/// \see \ref future "future<T>", wait_list
class event
{
public:
/// \internal_
enum execution_status {
complete = CL_COMPLETE,
running = CL_RUNNING,
submitted = CL_SUBMITTED,
queued = CL_QUEUED
};
/// \internal_
enum command_type {
ndrange_kernel = CL_COMMAND_NDRANGE_KERNEL,
task = CL_COMMAND_TASK,
native_kernel = CL_COMMAND_NATIVE_KERNEL,
read_buffer = CL_COMMAND_READ_BUFFER,
write_buffer = CL_COMMAND_WRITE_BUFFER,
copy_buffer = CL_COMMAND_COPY_BUFFER,
read_image = CL_COMMAND_READ_IMAGE,
write_image = CL_COMMAND_WRITE_IMAGE,
copy_image = CL_COMMAND_COPY_IMAGE,
copy_image_to_buffer = CL_COMMAND_COPY_IMAGE_TO_BUFFER,
copy_buffer_to_image = CL_COMMAND_COPY_BUFFER_TO_IMAGE,
map_buffer = CL_COMMAND_MAP_BUFFER,
map_image = CL_COMMAND_MAP_IMAGE,
unmap_mem_object = CL_COMMAND_UNMAP_MEM_OBJECT,
marker = CL_COMMAND_MARKER,
aquire_gl_objects = CL_COMMAND_ACQUIRE_GL_OBJECTS,
release_gl_object = CL_COMMAND_RELEASE_GL_OBJECTS
#if defined(CL_VERSION_1_1)
,
read_buffer_rect = CL_COMMAND_READ_BUFFER_RECT,
write_buffer_rect = CL_COMMAND_WRITE_BUFFER_RECT,
copy_buffer_rect = CL_COMMAND_COPY_BUFFER_RECT
#endif
};
/// \internal_
enum profiling_info {
profiling_command_queued = CL_PROFILING_COMMAND_QUEUED,
profiling_command_submit = CL_PROFILING_COMMAND_SUBMIT,
profiling_command_start = CL_PROFILING_COMMAND_START,
profiling_command_end = CL_PROFILING_COMMAND_END
};
/// Creates a null event object.
event()
: m_event(0)
{
}
explicit event(cl_event event, bool retain = true)
: m_event(event)
{
if(m_event && retain){
clRetainEvent(event);
}
}
/// Makes a new event as a copy of \p other.
event(const event &other)
: m_event(other.m_event)
{
if(m_event){
clRetainEvent(m_event);
}
}
/// Copies the event object from \p other to \c *this.
event& operator=(const event &other)
{
if(this != &other){
if(m_event){
clReleaseEvent(m_event);
}
m_event = other.m_event;
if(m_event){
clRetainEvent(m_event);
}
}
return *this;
}
#ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
/// Move-constructs a new event object from \p other.
event(event&& other) BOOST_NOEXCEPT
: m_event(other.m_event)
{
other.m_event = 0;
}
/// Move-assigns the event from \p other to \c *this.
event& operator=(event&& other) BOOST_NOEXCEPT
{
if(m_event){
clReleaseEvent(m_event);
}
m_event = other.m_event;
other.m_event = 0;
return *this;
}
#endif // BOOST_COMPUTE_NO_RVALUE_REFERENCES
/// Destroys the event object.
~event()
{
if(m_event){
BOOST_COMPUTE_ASSERT_CL_SUCCESS(
clReleaseEvent(m_event)
);
}
}
/// Returns a reference to the underlying OpenCL event object.
cl_event& get() const
{
return const_cast<cl_event &>(m_event);
}
/// Returns the status of the event.
cl_int status() const
{
return get_info<cl_int>(CL_EVENT_COMMAND_EXECUTION_STATUS);
}
/// Returns the command type for the event.
cl_command_type get_command_type() const
{
return get_info<cl_command_type>(CL_EVENT_COMMAND_TYPE);
}
/// Returns information about the event.
///
/// \see_opencl_ref{clGetEventInfo}
template<class T>
T get_info(cl_event_info info) const
{
return detail::get_object_info<T>(clGetEventInfo, m_event, info);
}
/// \overload
template<int Enum>
typename detail::get_object_info_type<event, Enum>::type
get_info() const;
/// Returns profiling information for the event.
///
/// \see event::duration()
///
/// \see_opencl_ref{clGetEventProfilingInfo}
template<class T>
T get_profiling_info(cl_profiling_info info) const
{
return detail::get_object_info<T>(clGetEventProfilingInfo,
m_event,
info);
}
/// Blocks until the actions corresponding to the event have
/// completed.
void wait() const
{
cl_int ret = clWaitForEvents(1, &m_event);
if(ret != CL_SUCCESS){
BOOST_THROW_EXCEPTION(opencl_error(ret));
}
}
#if defined(CL_VERSION_1_1) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
/// Registers a function to be called when the event status changes to
/// \p status (by default CL_COMPLETE). The callback is passed the OpenCL
/// event object, the event status, and a pointer to arbitrary user data.
///
/// \see_opencl_ref{clSetEventCallback}
///
/// \opencl_version_warning{1,1}
void set_callback(void (BOOST_COMPUTE_CL_CALLBACK *callback)(
cl_event event, cl_int status, void *user_data
),
cl_int status = CL_COMPLETE,
void *user_data = 0)
{
cl_int ret = clSetEventCallback(m_event, status, callback, user_data);
if(ret != CL_SUCCESS){
BOOST_THROW_EXCEPTION(opencl_error(ret));
}
}
/// Registers a generic function to be called when the event status
/// changes to \p status (by default \c CL_COMPLETE).
///
/// The function specified by \p callback must be invokable with zero
/// arguments (e.g. \c callback()).
///
/// \opencl_version_warning{1,1}
template<class Function>
void set_callback(Function callback, cl_int status = CL_COMPLETE)
{
set_callback(
event_callback_invoker,
status,
new boost::function<void()>(callback)
);
}
#endif // CL_VERSION_1_1
/// Returns the total duration of the event from \p start to \p end.
///
/// For example, to print the number of milliseconds the event took to
/// execute:
/// \code
/// std::cout << event.duration<std::chrono::milliseconds>().count() << " ms" << std::endl;
/// \endcode
///
/// \see event::get_profiling_info()
template<class Duration>
Duration duration(cl_profiling_info start = CL_PROFILING_COMMAND_START,
cl_profiling_info end = CL_PROFILING_COMMAND_END) const
{
const ulong_ nanoseconds =
get_profiling_info<ulong_>(end) - get_profiling_info<ulong_>(start);
return detail::make_duration_from_nanoseconds(Duration(), nanoseconds);
}
/// Returns \c true if the event is the same as \p other.
bool operator==(const event &other) const
{
return m_event == other.m_event;
}
/// Returns \c true if the event is different from \p other.
bool operator!=(const event &other) const
{
return m_event != other.m_event;
}
/// \internal_
operator cl_event() const
{
return m_event;
}
/// \internal_ (deprecated)
cl_int get_status() const
{
return status();
}
private:
#ifdef CL_VERSION_1_1
/// \internal_
static void BOOST_COMPUTE_CL_CALLBACK
event_callback_invoker(cl_event, cl_int, void *user_data)
{
boost::function<void()> *callback =
static_cast<boost::function<void()> *>(user_data);
(*callback)();
delete callback;
}
#endif // CL_VERSION_1_1
protected:
cl_event m_event;
};
/// \internal_ define get_info() specializations for event
BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(event,
((cl_command_queue, CL_EVENT_COMMAND_QUEUE))
((cl_command_type, CL_EVENT_COMMAND_TYPE))
((cl_int, CL_EVENT_COMMAND_EXECUTION_STATUS))
((cl_uint, CL_EVENT_REFERENCE_COUNT))
)
#ifdef CL_VERSION_1_1
BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(event,
((cl_context, CL_EVENT_CONTEXT))
)
#endif
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_EVENT_HPP
@@ -0,0 +1,84 @@
/*==============================================================================
Copyright (c) 2001-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_OBJECT_NEW_HPP
#define BOOST_PHOENIX_OBJECT_NEW_HPP
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/object/detail/target.hpp>
#include <boost/phoenix/support/iterate.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#ifdef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
# include <boost/phoenix/object/detail/cpp03/new_expr.hpp>
#else
BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG(
(boost)(phoenix)(new_)
, (proto::terminal<detail::target<proto::_> >)
(meta_grammar)
, _
)
#endif
namespace boost { namespace phoenix
{
struct new_eval
{
template <typename Sig>
struct result;
#if defined(BOOST_PHOENIX_NO_VARIADIC_OBJECT)
template <typename This, typename A0, typename Context>
struct result<This(A0, Context)>
{
typedef typename detail::result_of::target<A0> target_type;
typedef typename target_type::type * type;
};
template <typename Target, typename Context>
typename detail::result_of::target<Target>::type *
operator()(Target, Context const &) const
{
return new typename detail::result_of::target<Target>::type;
}
// Bring in the rest
#include <boost/phoenix/object/detail/cpp03/new_eval.hpp>
#else
// TODO:
#endif
};
template <typename Dummy>
struct default_actions::when<rule::new_, Dummy>
: call<new_eval, Dummy>
{};
#if defined(BOOST_PHOENIX_NO_VARIADIC_OBJECT)
template <typename T>
inline
typename expression::new_<detail::target<T> >::type const
new_()
{
return
expression::
new_<detail::target<T> >::
make(detail::target<T>());
}
// Bring in the rest
#include <boost/phoenix/object/detail/cpp03/new.hpp>
#else
// TODO:
#endif
}}
#endif
@@ -0,0 +1,150 @@
/*==============================================================================
Copyright (c) 2001-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_CORE_REFERENCE_HPP
#define BOOST_PHOENIX_CORE_REFERENCE_HPP
#include <boost/phoenix/core/limits.hpp>
#include <boost/ref.hpp>
#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/terminal.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace phoenix
{
/////////////////////////////////////////////////////////////////////////////
//
// reference
//
// function for evaluating references, e.g. ref(123)
//
/////////////////////////////////////////////////////////////////////////////
namespace expression
{
template <typename T>
struct reference
: expression::terminal<reference_wrapper<T> >
{
typedef
typename expression::terminal<reference_wrapper<T> >::type
type;
static const type make(T & t)
{
typename reference<T>::type const e = {{boost::ref(t)}};
return e;
}
};
template <typename T>
struct reference<T const>
: expression::terminal<reference_wrapper<T const> >
{
typedef
typename expression::terminal<reference_wrapper<T const> >::type
type;
static const type make(T const & t)
{
typename reference<T const>::type const e = {{boost::cref(t)}};
return e;
}
};
}
namespace rule
{
struct reference
: expression::reference<proto::_>
{};
}
template <typename T>
inline
typename expression::reference<T>::type const
ref(T & t)
{
return expression::reference<T>::make(t);
}
template <typename T>
inline
typename expression::reference<T const>::type const
cref(T const & t)
{
return expression::reference<T const>::make(t);
}
// Call out boost::reference_wrapper for special handling
template<typename T>
struct is_custom_terminal<boost::reference_wrapper<T> >
: mpl::true_
{};
// Special handling for boost::reference_wrapper
template<typename T>
struct custom_terminal<boost::reference_wrapper<T> >
{
typedef T &result_type;
template <typename Context>
T &operator()(boost::reference_wrapper<T> r, Context &) const
{
return r;
}
};
template<typename Expr>
struct custom_terminal<boost::reference_wrapper<actor<Expr> > >
{
template <typename Sig>
struct result;
template <typename This, typename Context>
struct result<This(boost::reference_wrapper<actor<Expr> > const &, Context)>
: boost::result_of<evaluator(actor<Expr> &, Context)>
{};
template <typename This, typename Context>
struct result<This(boost::reference_wrapper<actor<Expr> > &, Context)>
: boost::result_of<evaluator(actor<Expr> &, Context)>
{};
template <typename Context>
typename boost::result_of<evaluator(actor<Expr> &, Context const &)>::type
operator()(boost::reference_wrapper<actor<Expr> > & r, Context const & ctx) const
{
return boost::phoenix::eval(r, ctx);
}
};
template<typename Expr>
struct custom_terminal<boost::reference_wrapper<actor<Expr> const> >
{
template <typename Sig>
struct result;
template <typename This, typename Context>
struct result<This(boost::reference_wrapper<actor<Expr> const> const &, Context)>
: boost::result_of<evaluator(actor<Expr> const&, Context)>
{};
template <typename This, typename Context>
struct result<This(boost::reference_wrapper<actor<Expr> const> &, Context)>
: boost::result_of<evaluator(actor<Expr> const&, Context)>
{};
template <typename Context>
typename boost::result_of<evaluator(actor<Expr> const&, Context const &)>::type
operator()(boost::reference_wrapper<actor<Expr> const> const & r, Context & ctx) const
{
return boost::phoenix::eval(unwrap_ref(r), ctx);
}
};
}}
#endif
@@ -0,0 +1,10 @@
snr psuccess ntrials 100, r6321, r6333
-26.0 0.003 0.003
-25.5 0.033 0.037
-25.0 0.113 0.113
-24.5 0.315 0.330
-24.0 0.635 0.670
-23.5 0.908 0.903
-23.0 0.977 0.984
-22.5 0.9986 0.999
-22.0 1.0 1.0
@@ -0,0 +1,56 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright 2005 Daniel Wallin.
// Copyright 2005 Joel de Guzman.
// Copyright 2015 John Fletcher
//
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Modeled after range_ex, Copyright 2004 Eric Niebler
///////////////////////////////////////////////////////////////////////////////
//
// has_find.hpp
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_PHOENIX_HAS_FIND_EN_14_12_2004
#define BOOST_PHOENIX_HAS_FIND_EN_14_12_2004
#include <boost/mpl/or.hpp>
#include "./is_std_map.hpp"
#include "./is_std_set.hpp"
#include "./is_std_hash_map.hpp"
#include "./is_std_hash_set.hpp"
#include "./is_unordered_set_or_map.hpp"
namespace boost
{
// Specialize this for user-defined types
template<typename T>
struct has_find
: boost::mpl::or_<
boost::mpl::or_<
is_std_map<T>
, is_std_multimap<T>
, is_std_set<T>
, is_std_multiset<T>
>
, boost::mpl::or_<
is_std_hash_map<T>
, is_std_hash_multimap<T>
, is_std_hash_set<T>
, is_std_hash_multiset<T>
>
, boost::mpl::or_<
is_std_unordered_map<T>
, is_std_unordered_multimap<T>
, is_std_unordered_set<T>
, is_std_unordered_multiset<T>
>
>
{
};
}
#endif
@@ -0,0 +1,21 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//
#ifndef BOOST_COMPUTE_UTILITY_HPP
#define BOOST_COMPUTE_UTILITY_HPP
#include <boost/compute/utility/dim.hpp>
#include <boost/compute/utility/extents.hpp>
#include <boost/compute/utility/invoke.hpp>
#include <boost/compute/utility/program_cache.hpp>
#include <boost/compute/utility/source.hpp>
#include <boost/compute/utility/wait_list.hpp>
#endif // BOOST_COMPUTE_UTILITY_HPP
@@ -0,0 +1,34 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP
#define BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP
#include <boost/units/derived_dimension.hpp>
#include <boost/units/physical_dimensions/length.hpp>
#include <boost/units/physical_dimensions/mass.hpp>
#include <boost/units/physical_dimensions/time.hpp>
#include <boost/units/physical_dimensions/current.hpp>
namespace boost {
namespace units {
/// derived dimension for permittivity : L^-3 M^-1 T^4 I^2
typedef derived_dimension<length_base_dimension,-3,
mass_base_dimension,-1,
time_base_dimension,4,
current_base_dimension,2>::type permittivity_dimension;
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP
@@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_HAS_KEY_10022005_1617)
#define FUSION_HAS_KEY_10022005_1617
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/has_key.hpp>
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
namespace boost { namespace mpl
{
template <typename Tag>
struct has_key_impl;
template <>
struct has_key_impl<fusion::fusion_sequence_tag>
{
template <typename Sequence, typename Key>
struct apply : fusion::result_of::has_key<Sequence, Key> {};
};
}}
#endif
@@ -0,0 +1,134 @@
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/bitor.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct bitor_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< bitor_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< bitor_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct bitor_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct bitor_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct bitor_impl< integral_c_tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct bitor_tag
{
typedef typename T::tag type;
};
/// forward declaration
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct bitor_2;
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
, typename N3 = na, typename N4 = na, typename N5 = na
>
struct bitor_
: if_<
is_na<N3>
, bitor_2< N1,N2 >
, bitor_<
bitor_2< N1,N2 >
, N3, N4, N5
>
>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, bitor_
, ( N1, N2, N3, N4, N5 )
)
};
template<
typename N1
, typename N2
>
struct bitor_2
: bitor_impl<
typename bitor_tag<N1>::type
, typename bitor_tag<N2>::type
>::template apply< N1,N2 >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, bitor_2, (N1, N2))
};
BOOST_MPL_AUX_NA_SPEC2(2, 5, bitor_)
}}
namespace boost { namespace mpl {
template<>
struct bitor_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: integral_c<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
| BOOST_MPL_AUX_VALUE_WKND(N2)::value
)
>
{
};
};
}}
@@ -0,0 +1,56 @@
/*
Copyright Rene Rivera 2008-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_COMPILER_PALM_H
#define BOOST_PREDEF_COMPILER_PALM_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_COMP_PALM`]
Palm C/C++ compiler.
Version number available as major, minor, and patch.
[table
[[__predef_symbol__] [__predef_version__]]
[[`_PACC_VER`] [__predef_detection__]]
[[`_PACC_VER`] [V.R.P]]
]
*/
#define BOOST_COMP_PALM BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(_PACC_VER)
# define BOOST_COMP_PALM_DETECTION BOOST_PREDEF_MAKE_0X_VRRPP000(_PACC_VER)
#endif
#ifdef BOOST_COMP_PALM_DETECTION
# if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
# define BOOST_COMP_PALM_EMULATED BOOST_COMP_PALM_DETECTION
# else
# undef BOOST_COMP_PALM
# define BOOST_COMP_PALM BOOST_COMP_PALM_DETECTION
# endif
# define BOOST_COMP_PALM_AVAILABLE
# include <boost/predef/detail/comp_detected.h>
#endif
#define BOOST_COMP_PALM_NAME "Palm C/C++"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PALM,BOOST_COMP_PALM_NAME)
#ifdef BOOST_COMP_PALM_EMULATED
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PALM_EMULATED,BOOST_COMP_PALM_NAME)
#endif
@@ -0,0 +1,98 @@
#ifndef MESSAGE_CLIENT_HPP__
#define MESSAGE_CLIENT_HPP__
#include <QObject>
#include <QTime>
#include <QDateTime>
#include <QString>
#include "Radio.hpp"
#include "pimpl_h.hpp"
class QByteArray;
class QHostAddress;
//
// MessageClient - Manage messages sent and replies received from a
// matching server (MessageServer) at the other end of
// the wire
//
//
// Each outgoing message type is a Qt slot
//
class MessageClient
: public QObject
{
Q_OBJECT;
public:
using Frequency = Radio::Frequency;
using port_type = quint16;
// instantiate and initiate a host lookup on the server
//
// messages will be silently dropped until a server host lookup is complete
MessageClient (QString const& id, QString const& version, QString const& revision,
QString const& server, port_type server_port, QObject * parent = nullptr);
// query server details
QHostAddress server_address () const;
port_type server_port () const;
// initiate a new server host lookup or is the server name is empty
// the sending of messages is disabled
Q_SLOT void set_server (QString const& server = QString {});
// change the server port messages are sent to
Q_SLOT void set_server_port (port_type server_port = 0u);
// outgoing messages
Q_SLOT void status_update (Frequency, QString const& mode, QString const& dx_call, QString const& report
, QString const& tx_mode, bool tx_enabled, bool transmitting, bool decoding
, qint32 rx_df, qint32 tx_df, QString const& de_call, QString const& de_grid
, QString const& dx_grid, bool watchdog_timeout, QString const& sub_mode
, bool fast_mode);
Q_SLOT void decode (bool is_new, QTime time, qint32 snr, float delta_time, quint32 delta_frequency
, QString const& mode, QString const& message, bool low_confidence
, bool off_air);
Q_SLOT void WSPR_decode (bool is_new, QTime time, qint32 snr, float delta_time, Frequency
, qint32 drift, QString const& callsign, QString const& grid, qint32 power
, bool off_air);
Q_SLOT void clear_decodes ();
Q_SLOT void qso_logged (QDateTime time_off, QString const& dx_call, QString const& dx_grid
, Frequency dial_frequency, QString const& mode, QString const& report_sent
, QString const& report_received, QString const& tx_power, QString const& comments
, QString const& name, QDateTime time_on);
// this slot may be used to send arbitrary UDP datagrams to and
// destination allowing the underlying socket to be used for general
// UDP messaging if desired
Q_SLOT void send_raw_datagram (QByteArray const&, QHostAddress const& dest_address, port_type dest_port);
// this signal is emitted if the server sends us a reply, the only
// reply supported is reply to a prior CQ or QRZ message
Q_SIGNAL void reply (QTime, qint32 snr, float delta_time, quint32 delta_frequency, QString const& mode
, QString const& message_text, bool low_confidence, quint8 modifiers);
// this signal is emitted if the server has requested a replay of
// all decodes
Q_SIGNAL void replay ();
// this signal is emitted if the server has requested immediate (or
// auto Tx if auto_only is true) transmission to halt
Q_SIGNAL void halt_tx (bool auto_only);
// this signal is emitted if the server has requested a new free
// message text
Q_SIGNAL void free_text (QString const&, bool send);
// this signal is emitted when network errors occur or if a host
// lookup fails
Q_SIGNAL void error (QString const&) const;
private:
class impl;
pimpl<impl> m_;
};
#endif
@@ -0,0 +1,87 @@
<HTML><HEAD>
<TITLE> Examples of LDPC Program Usage </TITLE>
</HEAD><BODY>
<H1> Examples of LDPC Program Usage </H1>
<P>Below, are some command files containing examples of the use of
the <A HREF="progs.html">LDPC programs</A>, together with the output I
obtained for these examples. Output on other machines might
conceivably be slightly different, due to different round-off errors.
The <A HREF="run-examples"><TT>run-examples</TT></A> script runs all the example
scripts and compares their output with the outputs that I obtained (on
a Pentium machine).
<P><A HREF="ex-ham7b">ex-ham7b</A>,
output in <A HREF="ex-ham7b-out">ex-ham7b-out</A>
<BLOCKQUOTE>
A (7,4) Hamming code used with a BSC.
Demonstrates encoding of random messages and decoding to minimize
bit error rate by exhaustive enumeration.
</BLOCKQUOTE>
<P><A HREF="ex-ham7a">ex-ham7a</A>,
output in <A HREF="ex-ham7a-out">ex-ham7a-out</A>
<BLOCKQUOTE>
A (7,4) Hamming code used with an AWGN channel. Tested using zero messages.
Decoded by exhaustive enumeration to minimize either block or bit error rate,
and by probability propagation.
</BLOCKQUOTE>
<P><A HREF="ex-dep">ex-dep</A>,
output in <A HREF="ex-dep-out">ex-dep-out</A>
<BLOCKQUOTE>
Examples of how parity check matrices with linearly dependent rows (ie,
redundant parity checks) are handled. This is probably not of
great interest to most users.
</BLOCKQUOTE>
<P><A HREF="ex-ldpc-encode">ex-ldpc-encode</A>,
output in <A HREF="ex-ldpc-encode-out">ex-ldpc-encode-out</A>
<BLOCKQUOTE>
Encodes messages with an LDPC code using sparse, dense, and mixed
representations of the generator matrix.
</BLOCKQUOTE>
<P><A HREF="ex-ldpc36-1000a">ex-ldpc36-1000a</A>,
output in <A HREF="ex-ldpc36-1000a-out">ex-ldpc36-1000a-out</A>
<BLOCKQUOTE>
A (2000,1000) LDPC code with 3 checks per bit and 6 bits per check.
Three encoding methods are tried out, and the code is
tested on an AWGN channel at various noise levels, using random messages.
</BLOCKQUOTE>
<P><A HREF="ex-ldpc36-5000a">ex-ldpc36-5000a</A>,
output in <A HREF="ex-ldpc36-5000a-out">ex-ldpc36-5000a-out</A>
<BLOCKQUOTE>
A (10000,5000) LDPC code with 3 checks per bit and 6 bits per check.
Tested on an AWGN channel at various noise levels, using random messages.
Pipes are used to avoid creating lots of files.
</BLOCKQUOTE>
<P><A HREF="ex-ldpcvar-5000a">ex-ldpcvar-5000a</A>,
output in <A HREF="ex-ldpcvar-5000a-out">ex-ldpcvar-5000a-out</A>
<BLOCKQUOTE>
A (10000,5000) LDPC code with the number of checks per bit varying from 2 to 7.
Tested on an AWGN channel at various noise levels, using random messages.
Pipes are used to avoid creating lots of files. Performance is better than
for the code above in which the number of checks is the same for all bits.
</BLOCKQUOTE>
<P><A HREF="ex-wrong-model">ex-wrong-model</A>,
output in <A HREF="ex-wrong-model-out">ex-wrong-model-out</A>
<BLOCKQUOTE>
Tests what happens when messages are decoded using the wrong noise
model, including using the right type of model but with the wrong
noise level, and using the wrong type of model (ie, using an AWLN model
for messages transmitted through an AWGN channel, or vice versa).
</BLOCKQUOTE>
<HR>
<A HREF="index.html">Back to index for LDPC software</A>
</BODY></HTML>
@@ -0,0 +1,15 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_ZIP_VIEW_23012006_0811)
#define FUSION_ZIP_VIEW_23012006_0811
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/zip_view/zip_view.hpp>
#include <boost/fusion/view/zip_view/zip_view_iterator.hpp>
#endif
@@ -0,0 +1,318 @@
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file is machine generated, do not edit by hand
// Polynomial evaluation using second order Horners rule
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_9_HPP
#define BOOST_MATH_TOOLS_RAT_EVAL_9_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(0);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[4] * x2 + a[2];
t[1] = a[3] * x2 + a[1];
t[2] = b[4] * x2 + b[2];
t[3] = b[3] * x2 + b[1];
t[0] *= x2;
t[2] *= x2;
t[0] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[0]);
t[1] *= x;
t[3] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[2] *= z2;
t[0] += static_cast<V>(a[4]);
t[2] += static_cast<V>(b[4]);
t[1] *= z;
t[3] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[5] * x2 + a[3];
t[1] = a[4] * x2 + a[2];
t[2] = b[5] * x2 + b[3];
t[3] = b[4] * x2 + b[2];
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[1]);
t[3] += static_cast<V>(b[0]);
t[0] *= x;
t[2] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[5]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[5]);
t[0] *= z;
t[2] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[6] * x2 + a[4];
t[1] = a[5] * x2 + a[3];
t[2] = b[6] * x2 + b[4];
t[3] = b[5] * x2 + b[3];
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[2] += static_cast<V>(b[2]);
t[3] += static_cast<V>(b[1]);
t[0] *= x2;
t[2] *= x2;
t[0] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[0]);
t[1] *= x;
t[3] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[5]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[5]);
t[0] *= z2;
t[2] *= z2;
t[0] += static_cast<V>(a[6]);
t[2] += static_cast<V>(b[6]);
t[1] *= z;
t[3] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[7] * x2 + a[5];
t[1] = a[6] * x2 + a[4];
t[2] = b[7] * x2 + b[5];
t[3] = b[6] * x2 + b[4];
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[3]);
t[1] += static_cast<V>(a[2]);
t[2] += static_cast<V>(b[3]);
t[3] += static_cast<V>(b[2]);
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[1]);
t[1] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[1]);
t[3] += static_cast<V>(b[0]);
t[0] *= x;
t[2] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[5]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[5]);
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[7]);
t[2] += static_cast<V>(b[6]);
t[3] += static_cast<V>(b[7]);
t[0] *= z;
t[2] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
V t[4];
t[0] = a[8] * x2 + a[6];
t[1] = a[7] * x2 + a[5];
t[2] = b[8] * x2 + b[6];
t[3] = b[7] * x2 + b[5];
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[3]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[3]);
t[0] *= x2;
t[1] *= x2;
t[2] *= x2;
t[3] *= x2;
t[0] += static_cast<V>(a[2]);
t[1] += static_cast<V>(a[1]);
t[2] += static_cast<V>(b[2]);
t[3] += static_cast<V>(b[1]);
t[0] *= x2;
t[2] *= x2;
t[0] += static_cast<V>(a[0]);
t[2] += static_cast<V>(b[0]);
t[1] *= x;
t[3] *= x;
return (t[0] + t[1]) / (t[2] + t[3]);
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
V t[4];
t[0] = a[0] * z2 + a[2];
t[1] = a[1] * z2 + a[3];
t[2] = b[0] * z2 + b[2];
t[3] = b[1] * z2 + b[3];
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[4]);
t[1] += static_cast<V>(a[5]);
t[2] += static_cast<V>(b[4]);
t[3] += static_cast<V>(b[5]);
t[0] *= z2;
t[1] *= z2;
t[2] *= z2;
t[3] *= z2;
t[0] += static_cast<V>(a[6]);
t[1] += static_cast<V>(a[7]);
t[2] += static_cast<V>(b[6]);
t[3] += static_cast<V>(b[7]);
t[0] *= z2;
t[2] *= z2;
t[0] += static_cast<V>(a[8]);
t[2] += static_cast<V>(b[8]);
t[1] *= z;
t[3] *= z;
return (t[0] + t[1]) / (t[2] + t[3]);
}
}
}}}} // namespaces
#endif // include guard
@@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler
Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_ANY_05052005_1230)
#define FUSION_ANY_05052005_1230
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/algorithm/query/detail/any.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename F>
struct any
{
typedef bool type;
};
}
template <typename Sequence, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline bool
any(Sequence const& seq, F f)
{
return detail::any(seq, f, typename traits::category_of<Sequence>::type());
}
}}
#endif
@@ -0,0 +1,9 @@
3; 3; 64
7; 11;128
39; 47;192
95;115;217
151;179;231
187;203;239
219;227;247
255;255;255
255;253;108
@@ -0,0 +1,31 @@
// 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_REAL_CAST_HPP
#define BOOST_MATH_TOOLS_REAL_CAST_HPP
#include <boost/math/tools/config.hpp>
#ifdef _MSC_VER
#pragma once
#endif
namespace boost{ namespace math
{
namespace tools
{
template <class To, class T>
inline BOOST_MATH_CONSTEXPR To real_cast(T t) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && BOOST_MATH_IS_FLOAT(To))
{
return static_cast<To>(t);
}
} // namespace tools
} // namespace math
} // namespace boost
#endif // BOOST_MATH_TOOLS_REAL_CAST_HPP
@@ -0,0 +1,128 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file
/// \brief base unit (meter, kg, sec...).
/// \details base unit definition registration.
#ifndef BOOST_UNITS_BASE_UNIT_HPP
#define BOOST_UNITS_BASE_UNIT_HPP
#include <boost/units/config.hpp>
#include <boost/units/heterogeneous_system.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/units_fwd.hpp>
#include <boost/units/unit.hpp>
#include <boost/units/detail/dimension_list.hpp>
#include <boost/units/detail/ordinal.hpp>
#include <boost/units/detail/prevent_redefinition.hpp>
namespace boost {
namespace units {
/// This must be in namespace boost::units so that ADL
/// will work with friend functions defined inline.
/// Base dimensions and base units are independent.
/// INTERNAL ONLY
template<long N> struct base_unit_ordinal { };
/// INTERNAL ONLY
template<class T, long N> struct base_unit_pair { };
/// INTERNAL ONLY
template<class T, long N>
struct check_base_unit {
enum {
value =
sizeof(boost_units_unit_is_registered(units::base_unit_ordinal<N>())) == sizeof(detail::yes) &&
sizeof(boost_units_unit_is_registered(units::base_unit_pair<T, N>())) != sizeof(detail::yes)
};
};
/// Defines a base unit. To define a unit you need to provide
/// the derived class (CRTP), a dimension list and a unique integer.
/// @code
/// struct my_unit : boost::units::base_unit<my_unit, length_dimension, 1> {};
/// @endcode
/// It is designed so that you will get an error message if you try
/// to use the same value in multiple definitions.
template<class Derived,
class Dim,
long N
#if !defined(BOOST_UNITS_DOXYGEN) && !defined(__BORLANDC__)
,
class = typename detail::ordinal_has_already_been_defined<
check_base_unit<Derived, N>::value
>::type
#endif
>
class base_unit :
public ordinal<N>
{
public:
/// INTERNAL ONLY
typedef void boost_units_is_base_unit_type;
/// INTERNAL ONLY
typedef base_unit this_type;
/// The dimensions of this base unit.
typedef Dim dimension_type;
/// Provided for mpl compatability.
typedef Derived type;
/// The unit corresponding to this base unit.
#ifndef BOOST_UNITS_DOXYGEN
typedef unit<
Dim,
heterogeneous_system<
heterogeneous_system_impl<
list<
heterogeneous_system_dim<Derived,static_rational<1> >,
dimensionless_type
>,
Dim,
no_scale
>
>
> unit_type;
#else
typedef detail::unspecified unit_type;
#endif
private:
/// Check for C++0x. In C++0x, we have to have identical
/// arguments but a different return type to trigger an
/// error. Note that this is only needed for clang as
/// check_base_unit will trigger an error earlier
/// for compilers with less strict name lookup.
/// INTERNAL ONLY
friend Derived*
check_double_register(const units::base_unit_ordinal<N>&)
{ return(0); }
/// Register this ordinal
/// INTERNAL ONLY
friend detail::yes
boost_units_unit_is_registered(const units::base_unit_ordinal<N>&)
{ detail::yes result; return(result); }
/// But make sure we can identify the current instantiation!
/// INTERNAL ONLY
friend detail::yes
boost_units_unit_is_registered(const units::base_unit_pair<Derived, N>&)
{ detail::yes result; return(result); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNIT_HPP
@@ -0,0 +1,46 @@
// Copyright David Abrahams 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)
#ifndef REFERENCE_EXISTING_OBJECT_DWA200222_HPP
# define REFERENCE_EXISTING_OBJECT_DWA200222_HPP
# include <boost/python/detail/prefix.hpp>
# include <boost/python/detail/indirect_traits.hpp>
# include <boost/mpl/if.hpp>
# include <boost/python/to_python_indirect.hpp>
# include <boost/type_traits/composite_traits.hpp>
namespace boost { namespace python {
namespace detail
{
template <class R>
struct reference_existing_object_requires_a_pointer_or_reference_return_type
# if defined(__GNUC__) || defined(__EDG__)
{}
# endif
;
}
template <class T> struct to_python_value;
struct reference_existing_object
{
template <class T>
struct apply
{
BOOST_STATIC_CONSTANT(
bool, ok = is_pointer<T>::value || is_reference<T>::value);
typedef typename mpl::if_c<
ok
, to_python_indirect<T, detail::make_reference_holder>
, detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T>
>::type type;
};
};
}} // namespace boost::python
#endif // REFERENCE_EXISTING_OBJECT_DWA200222_HPP
@@ -0,0 +1,329 @@
#include "Modulator.hpp"
#include <limits>
#include <qmath.h>
#include <QDateTime>
#include <QDebug>
#include "mainwindow.h"
#include "soundout.h"
#include "moc_Modulator.cpp"
extern float gran(); // Noise generator (for tests only)
#define RAMP_INCREMENT 64 // MUST be an integral factor of 2^16
#if defined (WSJT_SOFT_KEYING)
# define SOFT_KEYING WSJT_SOFT_KEYING
#else
# define SOFT_KEYING 1
#endif
double constexpr Modulator::m_twoPi;
// float wpm=20.0;
// unsigned m_nspd=1.2*48000.0/wpm;
// m_nspd=3072; //18.75 WPM
Modulator::Modulator (unsigned frameRate, unsigned periodLengthInSeconds,
QObject * parent)
: AudioDevice {parent}
, m_quickClose {false}
, m_phi {0.0}
, m_toneSpacing {0.0}
, m_fSpread {0.0}
, m_frameRate {frameRate}
, m_period {periodLengthInSeconds}
, m_state {Idle}
, m_tuning {false}
, m_cwLevel {false}
, m_j0 {-1}
, m_toneFrequency0 {1500.0}
{
}
void Modulator::start (unsigned symbolsLength, double framesPerSymbol,
double frequency, double toneSpacing,
SoundOutput * stream, Channel channel,
bool synchronize, bool fastMode, double dBSNR, int TRperiod)
{
Q_ASSERT (stream);
// Time according to this computer which becomes our base time
qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000;
if (m_state != Idle)
{
stop ();
}
m_quickClose = false;
m_symbolsLength = symbolsLength;
m_isym0 = std::numeric_limits<unsigned>::max (); // big number
m_frequency0 = 0.;
m_phi = 0.;
m_addNoise = dBSNR < 0.;
m_nsps = framesPerSymbol;
m_frequency = frequency;
m_amp = std::numeric_limits<qint16>::max ();
m_toneSpacing = toneSpacing;
m_bFastMode=fastMode;
m_TRperiod=TRperiod;
unsigned delay_ms = 1920 == m_nsps && 15 == m_period ? 500 : 1000;
// noise generator parameters
if (m_addNoise) {
m_snr = qPow (10.0, 0.05 * (dBSNR - 6.0));
m_fac = 3000.0;
if (m_snr > 1.0) m_fac = 3000.0 / m_snr;
}
unsigned mstr = ms0 % (1000 * m_period); // ms in period
// round up to an exact portion of a second that allows for startup
// delays
m_ic = (mstr / delay_ms) * m_frameRate * delay_ms / 1000;
if(m_bFastMode) m_ic=0;
m_silentFrames = 0;
// calculate number of silent frames to send
if (synchronize && !m_tuning && !m_bFastMode) {
m_silentFrames = m_ic + m_frameRate / (1000 / delay_ms) - (mstr * (m_frameRate / 1000));
}
initialize (QIODevice::ReadOnly, channel);
Q_EMIT stateChanged ((m_state = (synchronize && m_silentFrames) ?
Synchronizing : Active));
m_stream = stream;
if (m_stream) m_stream->restart (this);
}
void Modulator::tune (bool newState)
{
m_tuning = newState;
if (!m_tuning) stop (true);
}
void Modulator::stop (bool quick)
{
m_quickClose = quick;
close ();
}
void Modulator::close ()
{
if (m_stream)
{
if (m_quickClose)
{
m_stream->reset ();
}
else
{
m_stream->stop ();
}
}
if (m_state != Idle)
{
Q_EMIT stateChanged ((m_state = Idle));
}
AudioDevice::close ();
}
qint64 Modulator::readData (char * data, qint64 maxSize)
{
double toneFrequency=1500.0;
if(m_nsps==6) {
toneFrequency=1000.0;
m_frequency=1000.0;
m_frequency0=1000.0;
}
if(maxSize==0) return 0;
Q_ASSERT (!(maxSize % qint64 (bytesPerFrame ()))); // no torn frames
Q_ASSERT (isOpen ());
qint64 numFrames (maxSize / bytesPerFrame ());
qint16 * samples (reinterpret_cast<qint16 *> (data));
qint16 * end (samples + numFrames * (bytesPerFrame () / sizeof (qint16)));
qint64 framesGenerated (0);
switch (m_state)
{
case Synchronizing:
{
if (m_silentFrames) { // send silence up to first second
framesGenerated = qMin (m_silentFrames, numFrames);
for ( ; samples != end; samples = load (0, samples)) { // silence
}
m_silentFrames -= framesGenerated;
return framesGenerated * bytesPerFrame ();
}
Q_EMIT stateChanged ((m_state = Active));
m_cwLevel = false;
m_ramp = 0; // prepare for CW wave shaping
}
// fall through
case Active:
{
unsigned int isym=0;
if(!m_tuning) isym=m_ic/(4.0*m_nsps); // Actual fsample=48000
bool slowCwId=((isym >= m_symbolsLength) && (icw[0] > 0)) && (!m_bFastMode);
if(m_TRperiod==3) slowCwId=false;
bool fastCwId=false;
static bool bCwId=false;
qint64 ms = QDateTime::currentMSecsSinceEpoch();
float tsec=0.001*(ms % (1000*m_TRperiod));
if(m_bFastMode and (icw[0]>0) and (tsec>(m_TRperiod-5.0))) fastCwId=true;
if(!m_bFastMode) m_nspd=2560; // 22.5 WPM
if(slowCwId or fastCwId) { // Transmit CW ID?
m_dphi = m_twoPi*m_frequency/m_frameRate;
if(m_bFastMode and !bCwId) {
m_frequency=1500; // Set params for CW ID
m_dphi = m_twoPi*m_frequency/m_frameRate;
m_symbolsLength=126;
m_nsps=4096.0*12000.0/11025.0;
m_ic=2246949;
m_nspd=2560; // 22.5 WPM
if(icw[0]*m_nspd/48000.0 > 4.0) m_nspd=4.0*48000.0/icw[0]; //Faster CW for long calls
}
bCwId=true;
unsigned ic0 = m_symbolsLength * 4 * m_nsps;
unsigned j(0);
while (samples != end) {
j = (m_ic - ic0)/m_nspd + 1; // symbol of this sample
bool level {bool (icw[j])};
m_phi += m_dphi;
if (m_phi > m_twoPi) m_phi -= m_twoPi;
qint16 sample=0;
float amp=32767.0;
float x=0;
if(m_ramp!=0) {
x=qSin(float(m_phi));
if(SOFT_KEYING) {
amp=qAbs(qint32(m_ramp));
if(amp>32767.0) amp=32767.0;
}
sample=round(amp*x);
}
if(m_bFastMode) {
sample=0;
if(level) sample=32767.0*x;
}
if (int (j) <= icw[0] && j < NUM_CW_SYMBOLS) { // stop condition
samples = load (postProcessSample (sample), samples);
++framesGenerated;
++m_ic;
} else {
Q_EMIT stateChanged ((m_state = Idle));
return framesGenerated * bytesPerFrame ();
}
// adjust ramp
if ((m_ramp != 0 && m_ramp != std::numeric_limits<qint16>::min ()) || level != m_cwLevel) {
// either ramp has terminated at max/min or direction has changed
m_ramp += RAMP_INCREMENT; // ramp
}
m_cwLevel = level;
}
return framesGenerated * bytesPerFrame ();
} else {
bCwId=false;
} //End of code for CW ID
double const baud (12000.0 / m_nsps);
// fade out parameters (no fade out for tuning)
unsigned int i0,i1;
if(m_tuning) {
i1 = i0 = (m_bFastMode ? 999999 : 9999) * m_nsps;
} else {
i0=(m_symbolsLength - 0.017) * 4.0 * m_nsps;
i1= m_symbolsLength * 4.0 * m_nsps;
}
if(m_bFastMode and !m_tuning) {
i1=m_TRperiod*48000 - 24000;
i0=i1-816;
}
for (unsigned i = 0; i < numFrames && m_ic <= i1; ++i) {
isym=0;
if(!m_tuning and m_TRperiod!=3) isym=m_ic / (4.0 * m_nsps); //Actual
//fsample=48000
if(m_bFastMode) isym=isym%m_symbolsLength;
if (isym != m_isym0 || m_frequency != m_frequency0) {
if(itone[0]>=100) {
m_toneFrequency0=itone[0];
} else {
if(m_toneSpacing==0.0) {
m_toneFrequency0=m_frequency + itone[isym]*baud;
} else {
m_toneFrequency0=m_frequency + itone[isym]*m_toneSpacing;
}
}
// qDebug() << "B" << m_bFastMode << m_ic << numFrames << isym << itone[isym]
// << m_toneFrequency0 << m_nsps;
m_dphi = m_twoPi * m_toneFrequency0 / m_frameRate;
m_isym0 = isym;
m_frequency0 = m_frequency; //???
}
int j=m_ic/480;
if(m_fSpread>0.0 and j!=m_j0) {
float x1=(float)qrand()/RAND_MAX;
float x2=(float)qrand()/RAND_MAX;
toneFrequency = m_toneFrequency0 + 0.5*m_fSpread*(x1+x2-1.0);
m_dphi = m_twoPi * toneFrequency / m_frameRate;
m_j0=j;
}
m_phi += m_dphi;
if (m_phi > m_twoPi) m_phi -= m_twoPi;
if (m_ic > i0) m_amp = 0.98 * m_amp;
if (m_ic > i1) m_amp = 0.0;
samples = load (postProcessSample (m_amp * qSin (m_phi)), samples);
++framesGenerated;
++m_ic;
}
if (m_amp == 0.0) { // TODO G4WJS: compare double with zero might not be wise
if (icw[0] == 0) {
// no CW ID to send
Q_EMIT stateChanged ((m_state = Idle));
return framesGenerated * bytesPerFrame ();
}
m_phi = 0.0;
}
m_frequency0 = m_frequency;
// done for this chunk - continue on next call
return framesGenerated * bytesPerFrame ();
}
// fall through
case Idle:
break;
}
Q_ASSERT (Idle == m_state);
return 0;
}
qint16 Modulator::postProcessSample (qint16 sample) const
{
if (m_addNoise) { // Test frame, we'll add noise
qint32 s = m_fac * (gran () + sample * m_snr / 32768.0);
if (s > std::numeric_limits<qint16>::max ()) {
s = std::numeric_limits<qint16>::max ();
}
if (s < std::numeric_limits<qint16>::min ()) {
s = std::numeric_limits<qint16>::min ();
}
sample = s;
}
return sample;
}
@@ -0,0 +1,42 @@
#include "countriesworked.h"
void CountriesWorked::init(const QStringList countryNames)
{
_data.clear();
foreach(QString name,countryNames)
_data.insert(name,false);
}
void CountriesWorked::setAsWorked(const QString countryName)
{
if (_data.contains(countryName))
_data.insert(countryName,true);
}
bool CountriesWorked::getHasWorked(const QString countryName) const
{
if (_data.contains(countryName))
return _data.value(countryName);
return false;
}
int CountriesWorked::getWorkedCount() const
{
int count = 0;
foreach (bool value,_data)
if (value)
count += 1;
return count;
}
int CountriesWorked::getSize() const
{
return _data.count();
}
@@ -0,0 +1,121 @@
// Copyright David Abrahams 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)
#ifndef OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP
# define OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP
# include <boost/python/detail/prefix.hpp>
# include <boost/python/detail/referent_storage.hpp>
# include <boost/python/detail/destroy.hpp>
# include <boost/python/detail/construct.hpp>
# include <boost/python/converter/object_manager.hpp>
# include <boost/python/detail/raw_pyobject.hpp>
# include <boost/python/tag.hpp>
//
// arg_from_python converters for Python type wrappers, to be used as
// base classes for specializations.
//
namespace boost { namespace python { namespace converter {
template <class T>
struct object_manager_value_arg_from_python
{
typedef T result_type;
object_manager_value_arg_from_python(PyObject*);
bool convertible() const;
T operator()() const;
private:
PyObject* m_source;
};
// Used for converting reference-to-object-manager arguments from
// python. The process used here is a little bit odd. Upon
// construction, we build the object manager object in the m_result
// object, *forcing* it to accept the source Python object by casting
// its pointer to detail::borrowed_reference. This is supposed to
// bypass any type checking of the source object. The convertible
// check then extracts the owned object and checks it. If the check
// fails, nothing else in the program ever gets to touch this strange
// "forced" object.
template <class Ref>
struct object_manager_ref_arg_from_python
{
typedef Ref result_type;
object_manager_ref_arg_from_python(PyObject*);
bool convertible() const;
Ref operator()() const;
~object_manager_ref_arg_from_python();
private:
typename python::detail::referent_storage<Ref>::type m_result;
};
//
// implementations
//
template <class T>
inline object_manager_value_arg_from_python<T>::object_manager_value_arg_from_python(PyObject* x)
: m_source(x)
{
}
template <class T>
inline bool object_manager_value_arg_from_python<T>::convertible() const
{
return object_manager_traits<T>::check(m_source);
}
template <class T>
inline T object_manager_value_arg_from_python<T>::operator()() const
{
return T(python::detail::borrowed_reference(m_source));
}
template <class Ref>
inline object_manager_ref_arg_from_python<Ref>::object_manager_ref_arg_from_python(PyObject* x)
{
# if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243
// needed for warning suppression
python::detail::borrowed_reference x_ = python::detail::borrowed_reference(x);
python::detail::construct_referent<Ref>(&m_result.bytes, x_);
# else
python::detail::construct_referent<Ref>(&m_result.bytes, (python::detail::borrowed_reference)x);
# endif
}
template <class Ref>
inline object_manager_ref_arg_from_python<Ref>::~object_manager_ref_arg_from_python()
{
python::detail::destroy_referent<Ref>(this->m_result.bytes);
}
namespace detail
{
template <class T>
inline bool object_manager_ref_check(T const& x)
{
return object_manager_traits<T>::check(get_managed_object(x, tag));
}
}
template <class Ref>
inline bool object_manager_ref_arg_from_python<Ref>::convertible() const
{
return detail::object_manager_ref_check(
python::detail::void_ptr_to_reference(this->m_result.bytes, (Ref(*)())0));
}
template <class Ref>
inline Ref object_manager_ref_arg_from_python<Ref>::operator()() const
{
return python::detail::void_ptr_to_reference(
this->m_result.bytes, (Ref(*)())0);
}
}}} // namespace boost::python::converter
#endif // OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP
@@ -0,0 +1,159 @@
// Boost string_algo library replace_storage.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
#define BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <algorithm>
#include <boost/mpl/bool.hpp>
#include <boost/algorithm/string/sequence_traits.hpp>
#include <boost/algorithm/string/detail/sequence.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// storage handling routines -----------------------------------------------//
template< typename StorageT, typename OutputIteratorT >
inline OutputIteratorT move_from_storage(
StorageT& Storage,
OutputIteratorT DestBegin,
OutputIteratorT DestEnd )
{
OutputIteratorT OutputIt=DestBegin;
while( !Storage.empty() && OutputIt!=DestEnd )
{
*OutputIt=Storage.front();
Storage.pop_front();
++OutputIt;
}
return OutputIt;
}
template< typename StorageT, typename WhatT >
inline void copy_to_storage(
StorageT& Storage,
const WhatT& What )
{
Storage.insert( Storage.end(), ::boost::begin(What), ::boost::end(What) );
}
// process segment routine -----------------------------------------------//
template< bool HasStableIterators >
struct process_segment_helper
{
// Optimized version of process_segment for generic sequence
template<
typename StorageT,
typename InputT,
typename ForwardIteratorT >
ForwardIteratorT operator()(
StorageT& Storage,
InputT& /*Input*/,
ForwardIteratorT InsertIt,
ForwardIteratorT SegmentBegin,
ForwardIteratorT SegmentEnd )
{
// Copy data from the storage until the beginning of the segment
ForwardIteratorT It=::boost::algorithm::detail::move_from_storage( Storage, InsertIt, SegmentBegin );
// 3 cases are possible :
// a) Storage is empty, It==SegmentBegin
// b) Storage is empty, It!=SegmentBegin
// c) Storage is not empty
if( Storage.empty() )
{
if( It==SegmentBegin )
{
// Case a) everything is grand, just return end of segment
return SegmentEnd;
}
else
{
// Case b) move the segment backwards
return std::copy( SegmentBegin, SegmentEnd, It );
}
}
else
{
// Case c) -> shift the segment to the left and keep the overlap in the storage
while( It!=SegmentEnd )
{
// Store value into storage
Storage.push_back( *It );
// Get the top from the storage and put it here
*It=Storage.front();
Storage.pop_front();
// Advance
++It;
}
return It;
}
}
};
template<>
struct process_segment_helper< true >
{
// Optimized version of process_segment for list-like sequence
template<
typename StorageT,
typename InputT,
typename ForwardIteratorT >
ForwardIteratorT operator()(
StorageT& Storage,
InputT& Input,
ForwardIteratorT InsertIt,
ForwardIteratorT SegmentBegin,
ForwardIteratorT SegmentEnd )
{
// Call replace to do the job
::boost::algorithm::detail::replace( Input, InsertIt, SegmentBegin, Storage );
// Empty the storage
Storage.clear();
// Iterators were not changed, simply return the end of segment
return SegmentEnd;
}
};
// Process one segment in the replace_all algorithm
template<
typename StorageT,
typename InputT,
typename ForwardIteratorT >
inline ForwardIteratorT process_segment(
StorageT& Storage,
InputT& Input,
ForwardIteratorT InsertIt,
ForwardIteratorT SegmentBegin,
ForwardIteratorT SegmentEnd )
{
return
process_segment_helper<
has_stable_iterators<InputT>::value>()(
Storage, Input, InsertIt, SegmentBegin, SegmentEnd );
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
@@ -0,0 +1,156 @@
// (C) Copyright Gennadiy Rozental 2001.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//
/// @file
/// @brief Deprecated implementation of simple minimal testing
/// @deprecated
/// To convert to Unit Test Framework simply rewrite:
/// @code
/// #include <boost/test/minimal.hpp>
///
/// int test_main( int, char *[] )
/// {
/// ...
/// }
/// @endcode
/// as
/// @code
/// #include <boost/test/included/unit_test.hpp>
///
/// BOOST_AUTO_TEST_CASE(test_main)
/// {
/// ...
/// }
/// @endcode
// ***************************************************************************
#ifndef BOOST_TEST_MINIMAL_HPP_071894GER
#define BOOST_TEST_MINIMAL_HPP_071894GER
#define BOOST_CHECK(exp) \
( (exp) \
? static_cast<void>(0) \
: boost::minimal_test::report_error(#exp,__FILE__,__LINE__, BOOST_CURRENT_FUNCTION) )
#define BOOST_REQUIRE(exp) \
( (exp) \
? static_cast<void>(0) \
: boost::minimal_test::report_critical_error(#exp,__FILE__,__LINE__,BOOST_CURRENT_FUNCTION))
#define BOOST_ERROR( msg_ ) \
boost::minimal_test::report_error( (msg_),__FILE__,__LINE__, BOOST_CURRENT_FUNCTION, true )
#define BOOST_FAIL( msg_ ) \
boost::minimal_test::report_critical_error( (msg_),__FILE__,__LINE__, BOOST_CURRENT_FUNCTION, true )
//____________________________________________________________________________//
// Boost.Test
#include <boost/test/detail/global_typedef.hpp>
#include <boost/test/impl/execution_monitor.ipp>
#include <boost/test/impl/debug.ipp>
#include <boost/test/utils/class_properties.hpp>
#include <boost/test/utils/basic_cstring/io.hpp>
// Boost
#include <boost/cstdlib.hpp> // for exit codes
#include <boost/current_function.hpp> // for BOOST_CURRENT_FUNCTION
// STL
#include <iostream> // std::cerr, std::endl
#include <string> // std::string
#include <boost/test/detail/suppress_warnings.hpp>
//____________________________________________________________________________//
int test_main( int argc, char* argv[] ); // prototype for users test_main()
namespace boost {
namespace minimal_test {
typedef boost::unit_test::const_string const_string;
inline unit_test::counter_t& errors_counter() { static unit_test::counter_t ec = 0; return ec; }
inline void
report_error( const char* msg, const char* file, int line, const_string func_name, bool is_msg = false )
{
++errors_counter();
std::cerr << file << "(" << line << "): ";
if( is_msg )
std::cerr << msg;
else
std::cerr << "test " << msg << " failed";
if( func_name != "(unknown)" )
std::cerr << " in function: '" << func_name << "'";
std::cerr << std::endl;
}
inline void
report_critical_error( const char* msg, const char* file, int line, const_string func_name, bool is_msg = false )
{
report_error( msg, file, line, func_name, is_msg );
throw boost::execution_aborted();
}
class caller {
public:
// constructor
caller( int argc, char** argv )
: m_argc( argc ), m_argv( argv ) {}
// execution monitor hook implementation
int operator()() { return test_main( m_argc, m_argv ); }
private:
// Data members
int m_argc;
char** m_argv;
}; // monitor
} // namespace minimal_test
} // namespace boost
//____________________________________________________________________________//
int BOOST_TEST_CALL_DECL main( int argc, char* argv[] )
{
using namespace boost::minimal_test;
try {
::boost::execution_monitor ex_mon;
int run_result = ex_mon.execute( caller( argc, argv ) );
BOOST_CHECK( run_result == 0 || run_result == boost::exit_success );
}
catch( boost::execution_exception const& exex ) {
if( exex.code() != boost::execution_exception::no_error )
BOOST_ERROR( (std::string( "exception \"" ) + exex.what() + "\" caught").c_str() );
std::cerr << "\n**** Testing aborted.";
}
if( boost::minimal_test::errors_counter() != 0 ) {
std::cerr << "\n**** " << errors_counter()
<< " error" << (errors_counter() > 1 ? "s" : "" ) << " detected\n";
return boost::exit_test_failure;
}
std::cout << "\n**** no errors detected\n";
return boost::exit_success;
}
//____________________________________________________________________________//
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_MINIMAL_HPP_071894GER
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,52 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// detail/sp_forward.hpp
//
// Copyright 2008,2012 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/config.hpp>
namespace boost
{
namespace detail
{
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
#if defined( BOOST_GCC ) && __GNUC__ * 100 + __GNUC_MINOR__ <= 404
// GCC 4.4 supports an outdated version of rvalue references and creates a copy of the forwarded object.
// This results in warnings 'returning reference to temporary'. Therefore we use a special version similar to std::forward.
template< class T > T&& sp_forward( T && t ) BOOST_NOEXCEPT
{
return t;
}
#else
template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT
{
return static_cast< T&& >( t );
}
#endif
#endif
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
@@ -0,0 +1,115 @@
/* boost random/detail/seed.hpp header file
*
* Copyright Steven Watanabe 2009
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_SEED_HPP
#define BOOST_RANDOM_DETAIL_SEED_HPP
#include <boost/config.hpp>
// Sun seems to have trouble with the use of SFINAE for the
// templated constructor. So does Borland.
#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(__BORLANDC__)
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/mpl/bool.hpp>
namespace boost {
namespace random {
namespace detail {
template<class T>
struct disable_seed : boost::disable_if<boost::is_arithmetic<T> > {};
template<class Engine, class T>
struct disable_constructor : disable_seed<T> {};
template<class Engine>
struct disable_constructor<Engine, Engine> {};
#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \
template<class Generator> \
explicit Self(Generator& gen, typename ::boost::random::detail::disable_constructor<Self, Generator>::type* = 0)
#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \
template<class Generator> \
void seed(Generator& gen, typename ::boost::random::detail::disable_seed<Generator>::type* = 0)
#define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \
template<class SeedSeq> \
explicit Self(SeedSeq& seq, typename ::boost::random::detail::disable_constructor<Self, SeedSeq>::type* = 0)
#define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \
template<class SeedSeq> \
void seed(SeedSeq& seq, typename ::boost::random::detail::disable_seed<SeedSeq>::type* = 0)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \
explicit Self(const T& x)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \
void seed(const T& x)
}
}
}
#else
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/mpl/bool.hpp>
#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \
Self(Self& other) { *this = other; } \
Self(const Self& other) { *this = other; } \
template<class Generator> \
explicit Self(Generator& gen) { \
boost_random_constructor_impl(gen, ::boost::is_arithmetic<Generator>());\
} \
template<class Generator> \
void boost_random_constructor_impl(Generator& gen, ::boost::mpl::false_)
#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \
template<class Generator> \
void seed(Generator& gen) { \
boost_random_seed_impl(gen, ::boost::is_arithmetic<Generator>());\
}\
template<class Generator>\
void boost_random_seed_impl(Generator& gen, ::boost::mpl::false_)
#define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \
Self(Self& other) { *this = other; } \
Self(const Self& other) { *this = other; } \
template<class SeedSeq> \
explicit Self(SeedSeq& seq) { \
boost_random_constructor_impl(seq, ::boost::is_arithmetic<SeedSeq>());\
} \
template<class SeedSeq> \
void boost_random_constructor_impl(SeedSeq& seq, ::boost::mpl::false_)
#define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \
template<class SeedSeq> \
void seed(SeedSeq& seq) { \
boost_random_seed_impl(seq, ::boost::is_arithmetic<SeedSeq>()); \
} \
template<class SeedSeq> \
void boost_random_seed_impl(SeedSeq& seq, ::boost::mpl::false_)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \
explicit Self(const T& x) { boost_random_constructor_impl(x, ::boost::mpl::true_()); }\
void boost_random_constructor_impl(const T& x, ::boost::mpl::true_)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \
void seed(const T& x) { boost_random_seed_impl(x, ::boost::mpl::true_()); }\
void boost_random_seed_impl(const T& x, ::boost::mpl::true_)
#endif
#endif
@@ -0,0 +1,44 @@
// (C) Copyright 2009-2011 Frederic Bron.
//
// 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_HAS_PRE_INCREMENT_HPP_INCLUDED
#define BOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED
#include <boost/type_traits/is_array.hpp>
#define BOOST_TT_TRAIT_NAME has_pre_increment
#define BOOST_TT_TRAIT_OP ++
#define BOOST_TT_FORBIDDEN_IF\
(\
/* bool */\
::boost::is_same< bool, Rhs_nocv >::value || \
/* void* */\
(\
::boost::is_pointer< Rhs_noref >::value && \
::boost::is_void< Rhs_noptr >::value\
) || \
/* (fundamental or pointer) and const */\
(\
( \
::boost::is_fundamental< Rhs_nocv >::value || \
::boost::is_pointer< Rhs_noref >::value\
) && \
::boost::is_const< Rhs_noref >::value\
)||\
/* Arrays */ \
::boost::is_array<Rhs_noref>::value\
)
#include <boost/type_traits/detail/has_prefix_operator.hpp>
#undef BOOST_TT_TRAIT_NAME
#undef BOOST_TT_TRAIT_OP
#undef BOOST_TT_FORBIDDEN_IF
#endif
@@ -0,0 +1,41 @@
// Copyright (C) 2005, 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Allows broadcast of skeletons via proxy.
// This header may only be included after both the broadcast.hpp and
// and skeleton_and_content.hpp headers have been included.
#ifndef BOOST_MPI_BROADCAST_SC_HPP
#define BOOST_MPI_BROADCAST_SC_HPP
namespace boost { namespace mpi {
template<typename T>
inline void
broadcast(const communicator& comm, skeleton_proxy<T>& proxy, int root)
{
const skeleton_proxy<T>& const_proxy(proxy);
broadcast(comm, const_proxy, root);
}
template<typename T>
void
broadcast(const communicator& comm, const skeleton_proxy<T>& proxy, int root)
{
if (comm.rank() == root) {
packed_skeleton_oarchive oa(comm);
oa << proxy.object;
broadcast(comm, oa, root);
} else {
packed_skeleton_iarchive ia(comm);
broadcast(comm, ia, root);
ia >> proxy.object;
}
}
} } // end namespace boost::mpi
#endif // BOOST_MPI_BROADCAST_SC_HPP
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,129 @@
/*
Copyright Charly Chevalier 2015
Copyright Joel Falcou 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H
#define BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H
#include <boost/predef/version_number.h>
/*`
Those defines represent x86 SIMD extensions versions.
[note You *MUST* compare them with the predef `BOOST_HW_SIMD_X86`.]
*/
// ---------------------------------
/*`
[heading `BOOST_HW_SIMD_X86_MMX_VERSION`]
The [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension
version number.
Version number is: *0.99.0*.
*/
#define BOOST_HW_SIMD_X86_MMX_VERSION BOOST_VERSION_NUMBER(0, 99, 0)
/*`
[heading `BOOST_HW_SIMD_X86_SSE_VERSION`]
The [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension
version number.
Version number is: *1.0.0*.
*/
#define BOOST_HW_SIMD_X86_SSE_VERSION BOOST_VERSION_NUMBER(1, 0, 0)
/*`
[heading `BOOST_HW_SIMD_X86_SSE2_VERSION`]
The [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension version number.
Version number is: *2.0.0*.
*/
#define BOOST_HW_SIMD_X86_SSE2_VERSION BOOST_VERSION_NUMBER(2, 0, 0)
/*`
[heading `BOOST_HW_SIMD_X86_SSE3_VERSION`]
The [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension version number.
Version number is: *3.0.0*.
*/
#define BOOST_HW_SIMD_X86_SSE3_VERSION BOOST_VERSION_NUMBER(3, 0, 0)
/*`
[heading `BOOST_HW_SIMD_X86_SSSE3_VERSION`]
The [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension version number.
Version number is: *3.1.0*.
*/
#define BOOST_HW_SIMD_X86_SSSE3_VERSION BOOST_VERSION_NUMBER(3, 1, 0)
/*`
[heading `BOOST_HW_SIMD_X86_SSE4_1_VERSION`]
The [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension version
number.
Version number is: *4.1.0*.
*/
#define BOOST_HW_SIMD_X86_SSE4_1_VERSION BOOST_VERSION_NUMBER(4, 1, 0)
/*`
[heading `BOOST_HW_SIMD_X86_SSE4_2_VERSION`]
The [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension version
number.
Version number is: *4.2.0*.
*/
#define BOOST_HW_SIMD_X86_SSE4_2_VERSION BOOST_VERSION_NUMBER(4, 2, 0)
/*`
[heading `BOOST_HW_SIMD_X86_AVX_VERSION`]
The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86
extension version number.
Version number is: *5.0.0*.
*/
#define BOOST_HW_SIMD_X86_AVX_VERSION BOOST_VERSION_NUMBER(5, 0, 0)
/*`
[heading `BOOST_HW_SIMD_X86_FMA3_VERSION`]
The [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension
version number.
Version number is: *5.2.0*.
*/
#define BOOST_HW_SIMD_X86_FMA3_VERSION BOOST_VERSION_NUMBER(5, 2, 0)
/*`
[heading `BOOST_HW_SIMD_X86_AVX2_VERSION`]
The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2]
x86 extension version number.
Version number is: *5.3.0*.
*/
#define BOOST_HW_SIMD_X86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0)
/*`
[heading `BOOST_HW_SIMD_X86_MIC_VERSION`]
The [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension
version number.
Version number is: *9.0.0*.
*/
#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER(9, 0, 0)
#endif