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,61 @@
// Status=review
Two arrangements of controls are provided for generating and selecting
Tx messages. Controls familiar to users of program _WSJT_
appear on *Tab 1*, providing six fields for message entry.
Pre-formatted messages for the standard minimal QSO are generated when
you click *Generate Std Msgs* or double-click on an appropriate line
in one of the decoded text windows.
//.Traditional Message Menu
image::traditional-msg-box.png[align="center",alt="Traditional Message Menu"]
* Select the next message to be transmitted (at the start of your next
Tx sequence) by clicking on the circle under *Next*.
* To change to a specified Tx message immediately during a
transmission, click on a rectangular button under the *Now* label.
Changing a Tx message in mid-stream will slightly reduce the chance of
a correct decode, but it is usually OK if done in the first 10-15 s of
a transmission.
* All six Tx message fields are editable. You can modify an
automatically generated message or enter a desired message, keeping in
mind the limits on message content. See <<PROTOCOLS,Protocol
Specifications>> for details.
* Click on the pull-down arrow for message #5 to select one of the
pre-stored messages entered on the *Settings | Tx Macros* tab.
Pressing *Enter* on a modified message #5 automatically adds that
message to the stored macros.
* In some circumstances it may be desirable to make your QSOs as
shiort as possible. To configure the program to start contacts with
message #2, disable message #1 by double-clicking on its round
radio-button or rectangular *Tx 1* button. Similarly, to send RR73
rather than RRR for message #4, double-click on one of its buttons.
The second arrangement of controls for generating and selecting
Tx messages appears on *Tab 2* of the Message Control Panel:
//.New Message Menu
image::new-msg-box.png[align="center",alt="New Message Menu"]
With this setup you normally follow a top-to-bottom sequence of
transmissions from the left column if you are calling CQ, or the right
column if answering a CQ.
* Clicking a button puts the appropriate message in the *Gen Msg* box.
If you are already transmitting, the Tx message is changed
immediately.
* You can enter and transmit anything (up to 13 characters, including
spaces) in the *Free Msg* box.
* Click on the pull-down arrow in the *Free Msg* box to select a
pre-stored macro. Pressing *Enter* on a modified message here
automatically adds that message to the table of stored macros.
TIP: During a transmission the actual message being sent always
appears in the first box of the status bar (bottom left of the main
screen).
@@ -0,0 +1,306 @@
//---------------------------------------------------------------------------//
// 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_ALGORITHM_FILL_HPP
#define BOOST_COMPUTE_ALGORITHM_FILL_HPP
#include <iterator>
#include <boost/mpl/int.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/compute/cl.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/async/future.hpp>
#include <boost/compute/iterator/constant_iterator.hpp>
#include <boost/compute/iterator/discard_iterator.hpp>
#include <boost/compute/detail/is_buffer_iterator.hpp>
#include <boost/compute/detail/iterator_range_size.hpp>
namespace boost {
namespace compute {
namespace detail {
namespace mpl = boost::mpl;
// fills the range [first, first + count) with value using copy()
template<class BufferIterator, class T>
inline void fill_with_copy(BufferIterator first,
size_t count,
const T &value,
command_queue &queue)
{
::boost::compute::copy(
::boost::compute::make_constant_iterator(value, 0),
::boost::compute::make_constant_iterator(value, count),
first,
queue
);
}
// fills the range [first, first + count) with value using copy_async()
template<class BufferIterator, class T>
inline future<void> fill_async_with_copy(BufferIterator first,
size_t count,
const T &value,
command_queue &queue)
{
return ::boost::compute::copy_async(
::boost::compute::make_constant_iterator(value, 0),
::boost::compute::make_constant_iterator(value, count),
first,
queue
);
}
#if defined(CL_VERSION_1_2)
// meta-function returing true if Iterator points to a range of values
// that can be filled using clEnqueueFillBuffer(). to meet this criteria
// it must have a buffer accessible through iter.get_buffer() and the
// size of its value_type must by in {1, 2, 4, 8, 16, 32, 64, 128}.
template<class Iterator>
struct is_valid_fill_buffer_iterator :
public mpl::and_<
is_buffer_iterator<Iterator>,
mpl::contains<
mpl::vector<
mpl::int_<1>,
mpl::int_<2>,
mpl::int_<4>,
mpl::int_<8>,
mpl::int_<16>,
mpl::int_<32>,
mpl::int_<64>,
mpl::int_<128>
>,
mpl::int_<
sizeof(typename std::iterator_traits<Iterator>::value_type)
>
>
>::type { };
template<>
struct is_valid_fill_buffer_iterator<discard_iterator> : public boost::false_type {};
// specialization which uses clEnqueueFillBuffer for buffer iterators
template<class BufferIterator, class T>
inline void
dispatch_fill(BufferIterator first,
size_t count,
const T &value,
command_queue &queue,
typename boost::enable_if<
is_valid_fill_buffer_iterator<BufferIterator>
>::type* = 0)
{
typedef typename std::iterator_traits<BufferIterator>::value_type value_type;
if(count == 0){
// nothing to do
return;
}
// check if the device supports OpenCL 1.2 (required for enqueue_fill_buffer)
if(!queue.check_device_version(1, 2)){
return fill_with_copy(first, count, value, queue);
}
value_type pattern = static_cast<value_type>(value);
size_t offset = static_cast<size_t>(first.get_index());
if(count == 1){
// use clEnqueueWriteBuffer() directly when writing a single value
// to the device buffer. this is potentially more efficient and also
// works around a bug in the intel opencl driver.
queue.enqueue_write_buffer(
first.get_buffer(),
offset * sizeof(value_type),
sizeof(value_type),
&pattern
);
}
else {
queue.enqueue_fill_buffer(
first.get_buffer(),
&pattern,
sizeof(value_type),
offset * sizeof(value_type),
count * sizeof(value_type)
);
}
}
template<class BufferIterator, class T>
inline future<void>
dispatch_fill_async(BufferIterator first,
size_t count,
const T &value,
command_queue &queue,
typename boost::enable_if<
is_valid_fill_buffer_iterator<BufferIterator>
>::type* = 0)
{
typedef typename std::iterator_traits<BufferIterator>::value_type value_type;
// check if the device supports OpenCL 1.2 (required for enqueue_fill_buffer)
if(!queue.check_device_version(1, 2)){
return fill_async_with_copy(first, count, value, queue);
}
value_type pattern = static_cast<value_type>(value);
size_t offset = static_cast<size_t>(first.get_index());
event event_ =
queue.enqueue_fill_buffer(first.get_buffer(),
&pattern,
sizeof(value_type),
offset * sizeof(value_type),
count * sizeof(value_type));
return future<void>(event_);
}
#ifdef CL_VERSION_2_0
// specializations for svm_ptr<T>
template<class T>
inline void dispatch_fill(svm_ptr<T> first,
size_t count,
const T &value,
command_queue &queue)
{
if(count == 0){
return;
}
queue.enqueue_svm_fill(
first.get(), &value, sizeof(T), count * sizeof(T)
);
}
template<class T>
inline future<void> dispatch_fill_async(svm_ptr<T> first,
size_t count,
const T &value,
command_queue &queue)
{
if(count == 0){
return future<void>();
}
event event_ = queue.enqueue_svm_fill(
first.get(), &value, sizeof(T), count * sizeof(T)
);
return future<void>(event_);
}
#endif // CL_VERSION_2_0
// default implementations
template<class BufferIterator, class T>
inline void
dispatch_fill(BufferIterator first,
size_t count,
const T &value,
command_queue &queue,
typename boost::disable_if<
is_valid_fill_buffer_iterator<BufferIterator>
>::type* = 0)
{
fill_with_copy(first, count, value, queue);
}
template<class BufferIterator, class T>
inline future<void>
dispatch_fill_async(BufferIterator first,
size_t count,
const T &value,
command_queue &queue,
typename boost::disable_if<
is_valid_fill_buffer_iterator<BufferIterator>
>::type* = 0)
{
return fill_async_with_copy(first, count, value, queue);
}
#else
template<class BufferIterator, class T>
inline void dispatch_fill(BufferIterator first,
size_t count,
const T &value,
command_queue &queue)
{
fill_with_copy(first, count, value, queue);
}
template<class BufferIterator, class T>
inline future<void> dispatch_fill_async(BufferIterator first,
size_t count,
const T &value,
command_queue &queue)
{
return fill_async_with_copy(first, count, value, queue);
}
#endif // !defined(CL_VERSION_1_2)
} // end detail namespace
/// Fills the range [\p first, \p last) with \p value.
///
/// \param first first element in the range to fill
/// \param last last element in the range to fill
/// \param value value to copy to each element
/// \param queue command queue to perform the operation
///
/// For example, to fill a vector on the device with sevens:
/// \code
/// // vector on the device
/// boost::compute::vector<int> vec(10, context);
///
/// // fill vector with sevens
/// boost::compute::fill(vec.begin(), vec.end(), 7, queue);
/// \endcode
///
/// \see boost::compute::fill_n()
template<class BufferIterator, class T>
inline void fill(BufferIterator first,
BufferIterator last,
const T &value,
command_queue &queue = system::default_queue())
{
size_t count = detail::iterator_range_size(first, last);
if(count == 0){
return;
}
detail::dispatch_fill(first, count, value, queue);
}
template<class BufferIterator, class T>
inline future<void> fill_async(BufferIterator first,
BufferIterator last,
const T &value,
command_queue &queue = system::default_queue())
{
size_t count = detail::iterator_range_size(first, last);
if(count == 0){
return future<void>();
}
return detail::dispatch_fill_async(first, count, value, queue);
}
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_ALGORITHM_FILL_HPP
@@ -0,0 +1,48 @@
// 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)
#ifndef BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
#define BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
#include <string>
#include <boost/units/config.hpp>
#include <boost/units/base_unit.hpp>
#include <boost/units/physical_dimensions/solid_angle.hpp>
namespace boost {
namespace units {
namespace angle {
struct steradian_base_unit : public base_unit<steradian_base_unit, solid_angle_dimension, -1>
{
static std::string name() { return("steradian"); }
static std::string symbol() { return("sr"); }
};
} // namespace angle
} // namespace units
} // namespace boost
#if BOOST_UNITS_HAS_BOOST_TYPEOF
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::steradian_base_unit)
#endif
//#include <boost/units/base_units/angle/conversions.hpp>
#endif // BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
@@ -0,0 +1,49 @@
///////////////////////////////////////////////////////////////////////////////
/// \file push_front.hpp
/// Proto callables Fusion push_front
//
// Copyright 2010 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_FRONT_HPP_EAN_11_27_2010
#define BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_FRONT_HPP_EAN_11_27_2010
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/fusion/include/push_front.hpp>
#include <boost/proto/proto_fwd.hpp>
namespace boost { namespace proto { namespace functional
{
/// \brief A PolymorphicFunctionObject type that invokes the
/// \c fusion::push_front() algorithm on its argument.
///
/// A PolymorphicFunctionObject type that invokes the
/// \c fusion::push_front() algorithm on its argument.
struct push_front
{
BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
template<typename This, typename Seq, typename T>
struct result<This(Seq, T)>
: fusion::result_of::push_front<
typename boost::add_const<typename boost::remove_reference<Seq>::type>::type
, typename boost::remove_const<typename boost::remove_reference<T>::type>::type
>
{};
template<typename Seq, typename T>
typename fusion::result_of::push_front<Seq const, T>::type
operator ()(Seq const &seq, T const &t) const
{
return fusion::push_front(seq, t);
}
};
}}}
#endif
@@ -0,0 +1,38 @@
/*
(c) 2014-2016 Glen Joseph Fernandes
<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
http://boost.org/LICENSE_1_0.txt
*/
#ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP
#define BOOST_ALIGN_DETAIL_ALIGN_HPP
#include <boost/align/detail/is_alignment.hpp>
#include <boost/assert.hpp>
namespace boost {
namespace alignment {
inline void* align(std::size_t alignment, std::size_t size,
void*& ptr, std::size_t& space)
{
BOOST_ASSERT(detail::is_alignment(alignment));
if (size <= space) {
char* p = (char*)(((std::size_t)ptr + alignment - 1) &
~(alignment - 1));
std::size_t n = space - (p - static_cast<char*>(ptr));
if (size <= n) {
ptr = p;
space = n;
return p;
}
}
return 0;
}
} /* .alignment */
} /* .boost */
#endif
@@ -0,0 +1,73 @@
///////////////////////////////////////////////////////////////////////////////
/// \file expand_pack.hpp
/// Contains helpers for pseudo-pack expansion.
//
// Copyright 2012 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
template<typename Tfx, typename Ret >
struct expand_pattern_helper<Tfx, Ret()>
{
typedef Ret (*type)();
typedef mpl::bool_< false> applied;
};
template<typename Tfx, typename Ret , typename A0>
struct expand_pattern_helper<Tfx, Ret(A0)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1>
struct expand_pattern_helper<Tfx, Ret(A0 , A1)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type , typename expand_pattern_helper<Tfx, A7>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || expand_pattern_helper<Tfx, A7>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type , typename expand_pattern_helper<Tfx, A7>::type , typename expand_pattern_helper<Tfx, A8>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || expand_pattern_helper<Tfx, A7>::applied::value || expand_pattern_helper<Tfx, A8>::applied::value || false> applied;
};
template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
{
typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type , typename expand_pattern_helper<Tfx, A7>::type , typename expand_pattern_helper<Tfx, A8>::type , typename expand_pattern_helper<Tfx, A9>::type);
typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || expand_pattern_helper<Tfx, A7>::applied::value || expand_pattern_helper<Tfx, A8>::applied::value || expand_pattern_helper<Tfx, A9>::applied::value || false> applied;
};
@@ -0,0 +1,419 @@
/* boost random/uniform_int_distribution.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-04-08 added min<max assertion (N. Becker)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_UNIFORM_INT_DISTRIBUTION_HPP
#define BOOST_RANDOM_UNIFORM_INT_DISTRIBUTION_HPP
#include <iosfwd>
#include <ios>
#include <istream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/operators.hpp>
#include <boost/random/detail/uniform_int_float.hpp>
#include <boost/random/detail/signed_unsigned_tools.hpp>
#include <boost/random/traits.hpp>
#include <boost/mpl/bool.hpp>
#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#include <boost/mpl/if.hpp>
#endif
namespace boost {
namespace random {
namespace detail {
#ifdef BOOST_MSVC
#pragma warning(push)
// disable division by zero warning, since we can't
// actually divide by zero.
#pragma warning(disable:4723)
#endif
template<class Engine, class T>
T generate_uniform_int(
Engine& eng, T min_value, T max_value,
boost::mpl::true_ /** is_integral<Engine::result_type> */)
{
typedef T result_type;
typedef typename boost::random::traits::make_unsigned_or_unbounded<T>::type range_type;
typedef typename Engine::result_type base_result;
// ranges are always unsigned or unbounded
typedef typename boost::random::traits::make_unsigned_or_unbounded<base_result>::type base_unsigned;
const range_type range = random::detail::subtract<result_type>()(max_value, min_value);
const base_result bmin = (eng.min)();
const base_unsigned brange =
random::detail::subtract<base_result>()((eng.max)(), (eng.min)());
if(range == 0) {
return min_value;
} else if(brange == range) {
// this will probably never happen in real life
// basically nothing to do; just take care we don't overflow / underflow
base_unsigned v = random::detail::subtract<base_result>()(eng(), bmin);
return random::detail::add<base_unsigned, result_type>()(v, min_value);
} else if(brange < range) {
// use rejection method to handle things like 0..3 --> 0..4
for(;;) {
// concatenate several invocations of the base RNG
// take extra care to avoid overflows
// limit == floor((range+1)/(brange+1))
// Therefore limit*(brange+1) <= range+1
range_type limit;
if(range == (std::numeric_limits<range_type>::max)()) {
limit = range/(range_type(brange)+1);
if(range % (range_type(brange)+1) == range_type(brange))
++limit;
} else {
limit = (range+1)/(range_type(brange)+1);
}
// We consider "result" as expressed to base (brange+1):
// For every power of (brange+1), we determine a random factor
range_type result = range_type(0);
range_type mult = range_type(1);
// loop invariants:
// result < mult
// mult <= range
while(mult <= limit) {
// Postcondition: result <= range, thus no overflow
//
// limit*(brange+1)<=range+1 def. of limit (1)
// eng()-bmin<=brange eng() post. (2)
// and mult<=limit. loop condition (3)
// Therefore mult*(eng()-bmin+1)<=range+1 by (1),(2),(3) (4)
// Therefore mult*(eng()-bmin)+mult<=range+1 rearranging (4) (5)
// result<mult loop invariant (6)
// Therefore result+mult*(eng()-bmin)<range+1 by (5), (6) (7)
//
// Postcondition: result < mult*(brange+1)
//
// result<mult loop invariant (1)
// eng()-bmin<=brange eng() post. (2)
// Therefore result+mult*(eng()-bmin) <
// mult+mult*(eng()-bmin) by (1) (3)
// Therefore result+(eng()-bmin)*mult <
// mult+mult*brange by (2), (3) (4)
// Therefore result+(eng()-bmin)*mult <
// mult*(brange+1) by (4)
result += static_cast<range_type>(static_cast<range_type>(random::detail::subtract<base_result>()(eng(), bmin)) * mult);
// equivalent to (mult * (brange+1)) == range+1, but avoids overflow.
if(mult * range_type(brange) == range - mult + 1) {
// The destination range is an integer power of
// the generator's range.
return(result);
}
// Postcondition: mult <= range
//
// limit*(brange+1)<=range+1 def. of limit (1)
// mult<=limit loop condition (2)
// Therefore mult*(brange+1)<=range+1 by (1), (2) (3)
// mult*(brange+1)!=range+1 preceding if (4)
// Therefore mult*(brange+1)<range+1 by (3), (4) (5)
//
// Postcondition: result < mult
//
// See the second postcondition on the change to result.
mult *= range_type(brange)+range_type(1);
}
// loop postcondition: range/mult < brange+1
//
// mult > limit loop condition (1)
// Suppose range/mult >= brange+1 Assumption (2)
// range >= mult*(brange+1) by (2) (3)
// range+1 > mult*(brange+1) by (3) (4)
// range+1 > (limit+1)*(brange+1) by (1), (4) (5)
// (range+1)/(brange+1) > limit+1 by (5) (6)
// limit < floor((range+1)/(brange+1)) by (6) (7)
// limit==floor((range+1)/(brange+1)) def. of limit (8)
// not (2) reductio (9)
//
// loop postcondition: (range/mult)*mult+(mult-1) >= range
//
// (range/mult)*mult + range%mult == range identity (1)
// range%mult < mult def. of % (2)
// (range/mult)*mult+mult > range by (1), (2) (3)
// (range/mult)*mult+(mult-1) >= range by (3) (4)
//
// Note that the maximum value of result at this point is (mult-1),
// so after this final step, we generate numbers that can be
// at least as large as range. We have to really careful to avoid
// overflow in this final addition and in the rejection. Anything
// that overflows is larger than range and can thus be rejected.
// range/mult < brange+1 -> no endless loop
range_type result_increment =
generate_uniform_int(
eng,
static_cast<range_type>(0),
static_cast<range_type>(range/mult),
boost::mpl::true_());
if(std::numeric_limits<range_type>::is_bounded && ((std::numeric_limits<range_type>::max)() / mult < result_increment)) {
// The multiplcation would overflow. Reject immediately.
continue;
}
result_increment *= mult;
// unsigned integers are guaranteed to wrap on overflow.
result += result_increment;
if(result < result_increment) {
// The addition overflowed. Reject.
continue;
}
if(result > range) {
// Too big. Reject.
continue;
}
return random::detail::add<range_type, result_type>()(result, min_value);
}
} else { // brange > range
#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
typedef typename mpl::if_c<
std::numeric_limits<range_type>::is_specialized && std::numeric_limits<base_unsigned>::is_specialized
&& (std::numeric_limits<range_type>::digits >= std::numeric_limits<base_unsigned>::digits),
range_type, base_unsigned>::type mixed_range_type;
#else
typedef base_unsigned mixed_range_type;
#endif
mixed_range_type bucket_size;
// it's safe to add 1 to range, as long as we cast it first,
// because we know that it is less than brange. However,
// we do need to be careful not to cause overflow by adding 1
// to brange. We use mixed_range_type throughout for mixed
// arithmetic between base_unsigned and range_type - in the case
// that range_type has more bits than base_unsigned it is always
// safe to use range_type for this albeit it may be more effient
// to use base_unsigned. The latter is a narrowing conversion though
// which may be disallowed if range_type is a multiprecision type
// and there are no explicit converison operators.
if(brange == (std::numeric_limits<base_unsigned>::max)()) {
bucket_size = static_cast<mixed_range_type>(brange) / (static_cast<mixed_range_type>(range)+1);
if(static_cast<mixed_range_type>(brange) % (static_cast<mixed_range_type>(range)+1) == static_cast<mixed_range_type>(range)) {
++bucket_size;
}
} else {
bucket_size = static_cast<mixed_range_type>(brange + 1) / (static_cast<mixed_range_type>(range)+1);
}
for(;;) {
mixed_range_type result =
random::detail::subtract<base_result>()(eng(), bmin);
result /= bucket_size;
// result and range are non-negative, and result is possibly larger
// than range, so the cast is safe
if(result <= static_cast<mixed_range_type>(range))
return random::detail::add<mixed_range_type, result_type>()(result, min_value);
}
}
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
template<class Engine, class T>
inline T generate_uniform_int(
Engine& eng, T min_value, T max_value,
boost::mpl::false_ /** is_integral<Engine::result_type> */)
{
uniform_int_float<Engine> wrapper(eng);
return generate_uniform_int(wrapper, min_value, max_value, boost::mpl::true_());
}
template<class Engine, class T>
inline T generate_uniform_int(Engine& eng, T min_value, T max_value)
{
typedef typename Engine::result_type base_result;
return generate_uniform_int(eng, min_value, max_value,
boost::random::traits::is_integral<base_result>());
}
}
/**
* The class template uniform_int_distribution models a \random_distribution.
* On each invocation, it returns a random integer value uniformly
* distributed in the set of integers {min, min+1, min+2, ..., max}.
*
* The template parameter IntType shall denote an integer-like value type.
*/
template<class IntType = int>
class uniform_int_distribution
{
public:
typedef IntType input_type;
typedef IntType result_type;
class param_type
{
public:
typedef uniform_int_distribution distribution_type;
/**
* Constructs the parameters of a uniform_int_distribution.
*
* Requires min <= max
*/
explicit param_type(
IntType min_arg = 0,
IntType max_arg = (std::numeric_limits<IntType>::max)())
: _min(min_arg), _max(max_arg)
{
BOOST_ASSERT(_min <= _max);
}
/** Returns the minimum value of the distribution. */
IntType a() const { return _min; }
/** Returns the maximum value of the distribution. */
IntType b() const { return _max; }
/** Writes the parameters to a @c std::ostream. */
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm)
{
os << parm._min << " " << parm._max;
return os;
}
/** Reads the parameters from a @c std::istream. */
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm)
{
IntType min_in, max_in;
if(is >> min_in >> std::ws >> max_in) {
if(min_in <= max_in) {
parm._min = min_in;
parm._max = max_in;
} else {
is.setstate(std::ios_base::failbit);
}
}
return is;
}
/** Returns true if the two sets of parameters are equal. */
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs)
{ return lhs._min == rhs._min && lhs._max == rhs._max; }
/** Returns true if the two sets of parameters are different. */
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type)
private:
IntType _min;
IntType _max;
};
/**
* Constructs a uniform_int_distribution. @c min and @c max are
* the parameters of the distribution.
*
* Requires: min <= max
*/
explicit uniform_int_distribution(
IntType min_arg = 0,
IntType max_arg = (std::numeric_limits<IntType>::max)())
: _min(min_arg), _max(max_arg)
{
BOOST_ASSERT(min_arg <= max_arg);
}
/** Constructs a uniform_int_distribution from its parameters. */
explicit uniform_int_distribution(const param_type& parm)
: _min(parm.a()), _max(parm.b()) {}
/** Returns the minimum value of the distribution */
IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; }
/** Returns the maximum value of the distribution */
IntType max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; }
/** Returns the minimum value of the distribution */
IntType a() const { return _min; }
/** Returns the maximum value of the distribution */
IntType b() const { return _max; }
/** Returns the parameters of the distribution. */
param_type param() const { return param_type(_min, _max); }
/** Sets the parameters of the distribution. */
void param(const param_type& parm)
{
_min = parm.a();
_max = parm.b();
}
/**
* Effects: Subsequent uses of the distribution do not depend
* on values produced by any engine prior to invoking reset.
*/
void reset() { }
/** Returns an integer uniformly distributed in the range [min, max]. */
template<class Engine>
result_type operator()(Engine& eng) const
{ return detail::generate_uniform_int(eng, _min, _max); }
/**
* Returns an integer uniformly distributed in the range
* [param.a(), param.b()].
*/
template<class Engine>
result_type operator()(Engine& eng, const param_type& parm) const
{ return detail::generate_uniform_int(eng, parm.a(), parm.b()); }
/** Writes the distribution to a @c std::ostream. */
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, uniform_int_distribution, ud)
{
os << ud.param();
return os;
}
/** Reads the distribution from a @c std::istream. */
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, uniform_int_distribution, ud)
{
param_type parm;
if(is >> parm) {
ud.param(parm);
}
return is;
}
/**
* Returns true if the two distributions will produce identical sequences
* of values given equal generators.
*/
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(uniform_int_distribution, lhs, rhs)
{ return lhs._min == rhs._min && lhs._max == rhs._max; }
/**
* Returns true if the two distributions may produce different sequences
* of values given equal generators.
*/
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(uniform_int_distribution)
private:
IntType _min;
IntType _max;
};
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_UNIFORM_INT_HPP
@@ -0,0 +1,174 @@
// -- Boost Lambda Library - actions.hpp ----------------------------------
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
//
// 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)
// For more information, see www.boost.org
// ----------------------------------------------------------------
#ifndef BOOST_LAMBDA_ACTIONS_HPP
#define BOOST_LAMBDA_ACTIONS_HPP
namespace boost {
namespace lambda {
template<int Arity, class Act> class action;
// these need to be defined here, since the corresponding lambda
// functions are members of lambda_functor classes
class assignment_action {};
class subscript_action {};
template <class Action> class other_action;
// action for specifying the explicit return type
template <class RET> class explicit_return_type_action {};
// action for preventing the expansion of a lambda expression
struct protect_action {};
// must be defined here, comma is a special case
struct comma_action {};
// actions, for which the existence of protect is checked in return type
// deduction.
template <class Action> struct is_protectable {
BOOST_STATIC_CONSTANT(bool, value = false);
};
// NOTE: comma action is protectable. Other protectable actions
// are listed in operator_actions.hpp
template<> struct is_protectable<other_action<comma_action> > {
BOOST_STATIC_CONSTANT(bool, value = true);
};
namespace detail {
// this type is used in return type deductions to signal that deduction
// did not find a result. It does not necessarily mean an error, it commonly
// means that something else should be tried.
class unspecified {};
}
// function action is a special case: bind functions can be called with
// the return type specialized explicitly e.g. bind<int>(foo);
// If this call syntax is used, the return type is stored in the latter
// argument of function_action template. Otherwise the argument gets the type
// 'unspecified'.
// This argument is only relevant in the return type deduction code
template <int I, class Result_type = detail::unspecified>
class function_action {};
template<class T> class function_action<1, T> {
public:
template<class RET, class A1>
static RET apply(A1& a1) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1);
}
};
template<class T> class function_action<2, T> {
public:
template<class RET, class A1, class A2>
static RET apply(A1& a1, A2& a2) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2);
}
};
template<class T> class function_action<3, T> {
public:
template<class RET, class A1, class A2, class A3>
static RET apply(A1& a1, A2& a2, A3& a3) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3);
}
};
template<class T> class function_action<4, T> {
public:
template<class RET, class A1, class A2, class A3, class A4>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4);
}
};
template<class T> class function_action<5, T> {
public:
template<class RET, class A1, class A2, class A3, class A4, class A5>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4, a5);
}
};
template<class T> class function_action<6, T> {
public:
template<class RET, class A1, class A2, class A3, class A4, class A5,
class A6>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4, a5, a6);
}
};
template<class T> class function_action<7, T> {
public:
template<class RET, class A1, class A2, class A3, class A4, class A5,
class A6, class A7>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4, a5, a6, a7);
}
};
template<class T> class function_action<8, T> {
public:
template<class RET, class A1, class A2, class A3, class A4, class A5,
class A6, class A7, class A8>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
A8& a8) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8);
}
};
template<class T> class function_action<9, T> {
public:
template<class RET, class A1, class A2, class A3, class A4, class A5,
class A6, class A7, class A8, class A9>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
A8& a8, A9& a9) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
};
template<class T> class function_action<10, T> {
public:
template<class RET, class A1, class A2, class A3, class A4, class A5,
class A6, class A7, class A8, class A9, class A10>
static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
A8& a8, A9& a9, A10& a10) {
return function_adaptor<typename boost::remove_cv<A1>::type>::
template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
}
};
} // namespace lambda
} // namespace boost
#endif
@@ -0,0 +1,156 @@
/*=============================================================================
Copyright (c) 2009 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_ITERATOR_BASIC_ITERATOR_HPP
#define BOOST_FUSION_ITERATOR_BASIC_ITERATOR_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/mpl/int.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
namespace extension
{
template <typename>
struct value_of_impl;
template <typename>
struct deref_impl;
template <typename>
struct value_of_data_impl;
template <typename>
struct key_of_impl;
template <typename>
struct deref_data_impl;
}
template<typename Tag, typename Category, typename Seq, int Index>
struct basic_iterator
: iterator_facade<basic_iterator<Tag, Category, Seq, Index>, Category>
{
typedef mpl::int_<Index> index;
typedef Seq seq_type;
template <typename It>
struct value_of
: extension::value_of_impl<Tag>::template apply<It>
{};
template <typename It>
struct deref
: extension::deref_impl<Tag>::template apply<It>
{};
template <typename It>
struct value_of_data
: extension::value_of_data_impl<Tag>::template apply<It>
{};
template <typename It>
struct key_of
: extension::key_of_impl<Tag>::template apply<It>
{};
template <typename It>
struct deref_data
: extension::deref_data_impl<Tag>::template apply<It>
{};
template <typename It, typename N>
struct advance
{
typedef
basic_iterator<Tag, Category, Seq, Index + N::value>
type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(It const& it)
{
return type(*it.seq,0);
}
};
template <typename It>
struct next
: advance<It, mpl::int_<1> >
{};
template <typename It>
struct prior
: advance<It, mpl::int_<-1> >
{};
template <typename It1, typename It2>
struct distance
{
typedef mpl::minus<typename It2::index, typename It1::index> type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static
type
call(It1 const&, It2 const&)
{
return type();
}
};
template <typename It1, typename It2>
struct equal_to
: mpl::and_<
is_same<
typename remove_const<typename It1::seq_type>::type
, typename remove_const<typename It2::seq_type>::type
>
, mpl::equal_to<typename It1::index,typename It2::index>
>
{};
template<typename OtherSeq>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
: seq(it.seq)
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator(Seq& in_seq, int)
: seq(&in_seq)
{}
template<typename OtherSeq>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator&
operator=(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
{
seq=it.seq;
return *this;
}
Seq* seq;
};
}}
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{
template <typename Tag, typename Category, typename Seq, int Index>
struct iterator_traits< ::boost::fusion::basic_iterator<Tag, Category, Seq, Index> >
{ };
}
#endif
#endif
@@ -0,0 +1,37 @@
// Boost.Assign library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/assign/
//
#ifndef BOOST_ASSIGN_STD_STACK_HPP
#define BOOST_ASSIGN_STD_STACK_HPP
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/assign/list_inserter.hpp>
#include <boost/config.hpp>
#include <stack>
namespace boost
{
namespace assign
{
template< class V, class C, class V2 >
inline list_inserter< assign_detail::call_push< std::stack<V,C> >, V >
operator+=( std::stack<V,C>& c, V2 v )
{
return push( c )( v );
}
}
}
#endif
@@ -0,0 +1,63 @@
program ft8d
! Decode FT8 data read from *.wav files.
include 'ft8_params.f90'
character*12 arg
character infile*80,datetime*13,message*22
real s(NH1,NHSYM)
real candidate(3,100)
integer ihdr(11)
integer*2 iwave(NMAX) !Generated full-length waveform
real dd(NMAX)
nargs=iargc()
if(nargs.lt.3) then
print*,'Usage: ft8d MaxIt Norder file1 [file2 ...]'
print*,'Example ft8d 40 2 *.wav'
go to 999
endif
call getarg(1,arg)
read(arg,*) max_iterations
call getarg(2,arg)
read(arg,*) norder
nfiles=nargs-2
twopi=8.0*atan(1.0)
fs=12000.0 !Sample rate
dt=1.0/fs !Sample interval (s)
tt=NSPS*dt !Duration of "itone" symbols (s)
ts=2*NSPS*dt !Duration of OQPSK symbols (s)
baud=1.0/tt !Keying rate (baud)
txt=NZ*dt !Transmission length (s)
nfa=100.0
nfb=3000.0
nfqso=1500.0
do ifile=1,nfiles
call getarg(ifile+2,infile)
open(10,file=infile,status='old',access='stream')
read(10,end=999) ihdr,iwave
close(10)
j2=index(infile,'.wav')
read(infile(j2-6:j2-1),*) nutc
datetime=infile(j2-13:j2-1)
call sync8(iwave,nfa,nfb,nfqso,s,candidate,ncand)
syncmin=2.0
dd=iwave
do icand=1,ncand
sync=candidate(3,icand)
if( sync.lt.syncmin) cycle
f1=candidate(1,icand)
xdt=candidate(2,icand)
nsnr=min(99,nint(10.0*log10(sync)-25.5))
call ft8b(dd,nfqso,f1,xdt,nharderrors,dmin,nbadcrc,message,xsnr)
nsnr=xsnr
xdt=xdt-0.6
write(*,1110) datetime,0,nsnr,xdt,f1,message,nharderrors,dmin
1110 format(a13,2i4,f6.2,f7.1,' ~ ',a22,i6,f7.1)
enddo
enddo ! ifile loop
999 end program ft8d
@@ -0,0 +1,65 @@
#ifndef BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
#define BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/aux_/joint_iter.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/size_fwd.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
namespace aux {
struct joint_view_tag;
}
template<>
struct size_impl< aux::joint_view_tag >
{
template < typename JointView > struct apply
: plus<
size<typename JointView::sequence1_>
, size<typename JointView::sequence2_>
>
{};
};
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence1_)
, typename BOOST_MPL_AUX_NA_PARAM(Sequence2_)
>
struct joint_view
{
typedef typename mpl::begin<Sequence1_>::type first1_;
typedef typename mpl::end<Sequence1_>::type last1_;
typedef typename mpl::begin<Sequence2_>::type first2_;
typedef typename mpl::end<Sequence2_>::type last2_;
// agurt, 25/may/03: for the 'size_traits' implementation above
typedef Sequence1_ sequence1_;
typedef Sequence2_ sequence2_;
typedef joint_view type;
typedef aux::joint_view_tag tag;
typedef joint_iter<first1_,last1_,first2_> begin;
typedef joint_iter<last1_,last1_,last2_> end;
};
BOOST_MPL_AUX_NA_SPEC(2, joint_view)
}}
#endif // BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
@@ -0,0 +1,43 @@
/*=============================================================================
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_VALUE_AT_IMPL_07172005_0952)
#define FUSION_VALUE_AT_IMPL_07172005_0952
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct cons_tag;
namespace extension
{
template <typename Tag>
struct value_at_impl;
template <>
struct value_at_impl<cons_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename
mpl::eval_if<
mpl::bool_<N::value == 0>
, mpl::identity<typename Sequence::car_type>
, apply<typename Sequence::cdr_type, mpl::int_<N::value-1> >
>::type
type;
};
};
}
}}
#endif
@@ -0,0 +1,19 @@
// Status=review
[[FIG_CONFIG_STATION]]
image::settings-general.png[align="center",alt="Settings Window"]
Select the *General* tab on the *Settings* window. Under _Station
Details_, enter your callsign and 4-digit or preferably 6-digit grid
locator. This information will be sufficient for initial tests.
Meanings of remaining options on the *General* tab should be
self-explanatory after you have made some QSOs using _WSJT-X_. You
may return to set these options to your preferences later.
NOTE: If you are using a callsign with an add-on prefix or
suffix, or wish to work a station using such a call, be sure to read
the section <<COMP-CALL,Compound Callsigns>>.
IMPORTANT: Enabling VHF/UHF/Microwave features necessarily disables
the wideband multi-decode capability of JT65. In most circumstances
you should turn this feature off when operating at HF.
Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

@@ -0,0 +1,193 @@
// Boost string_algo library iter_find.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_ITER_FIND_HPP
#define BOOST_STRING_ITER_FIND_HPP
#include <boost/algorithm/string/config.hpp>
#include <algorithm>
#include <iterator>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/concept.hpp>
#include <boost/algorithm/string/find_iterator.hpp>
#include <boost/algorithm/string/detail/util.hpp>
/*! \file
Defines generic split algorithms. Split algorithms can be
used to divide a sequence into several part according
to a given criteria. Result is given as a 'container
of containers' where elements are copies or references
to extracted parts.
There are two algorithms provided. One iterates over matching
substrings, the other one over the gaps between these matches.
*/
namespace boost {
namespace algorithm {
// iterate find ---------------------------------------------------//
//! Iter find algorithm
/*!
This algorithm executes a given finder in iteration on the input,
until the end of input is reached, or no match is found.
Iteration is done using built-in find_iterator, so the real
searching is performed only when needed.
In each iteration new match is found and added to the result.
\param Result A 'container container' to contain the result of search.
Both outer and inner container must have constructor taking a pair
of iterators as an argument.
Typical type of the result is
\c std::vector<boost::iterator_range<iterator>>
(each element of such a vector will container a range delimiting
a match).
\param Input A container which will be searched.
\param Finder A Finder object used for searching
\return A reference to the result
\note Prior content of the result will be overwritten.
*/
template<
typename SequenceSequenceT,
typename RangeT,
typename FinderT >
inline SequenceSequenceT&
iter_find(
SequenceSequenceT& Result,
RangeT& Input,
FinderT Finder )
{
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
));
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
typedef BOOST_STRING_TYPENAME
range_iterator<RangeT>::type input_iterator_type;
typedef find_iterator<input_iterator_type> find_iterator_type;
typedef detail::copy_iterator_rangeF<
BOOST_STRING_TYPENAME
range_value<SequenceSequenceT>::type,
input_iterator_type> copy_range_type;
input_iterator_type InputEnd=::boost::end(lit_input);
typedef transform_iterator<copy_range_type, find_iterator_type>
transform_iter_type;
transform_iter_type itBegin=
::boost::make_transform_iterator(
find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
copy_range_type());
transform_iter_type itEnd=
::boost::make_transform_iterator(
find_iterator_type(),
copy_range_type());
SequenceSequenceT Tmp(itBegin, itEnd);
Result.swap(Tmp);
return Result;
}
// iterate split ---------------------------------------------------//
//! Split find algorithm
/*!
This algorithm executes a given finder in iteration on the input,
until the end of input is reached, or no match is found.
Iteration is done using built-in find_iterator, so the real
searching is performed only when needed.
Each match is used as a separator of segments. These segments are then
returned in the result.
\param Result A 'container container' to contain the result of search.
Both outer and inner container must have constructor taking a pair
of iterators as an argument.
Typical type of the result is
\c std::vector<boost::iterator_range<iterator>>
(each element of such a vector will container a range delimiting
a match).
\param Input A container which will be searched.
\param Finder A finder object used for searching
\return A reference to the result
\note Prior content of the result will be overwritten.
*/
template<
typename SequenceSequenceT,
typename RangeT,
typename FinderT >
inline SequenceSequenceT&
iter_split(
SequenceSequenceT& Result,
RangeT& Input,
FinderT Finder )
{
BOOST_CONCEPT_ASSERT((
FinderConcept<FinderT,
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
));
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
typedef BOOST_STRING_TYPENAME
range_iterator<RangeT>::type input_iterator_type;
typedef split_iterator<input_iterator_type> find_iterator_type;
typedef detail::copy_iterator_rangeF<
BOOST_STRING_TYPENAME
range_value<SequenceSequenceT>::type,
input_iterator_type> copy_range_type;
input_iterator_type InputEnd=::boost::end(lit_input);
typedef transform_iterator<copy_range_type, find_iterator_type>
transform_iter_type;
transform_iter_type itBegin=
::boost::make_transform_iterator(
find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
copy_range_type() );
transform_iter_type itEnd=
::boost::make_transform_iterator(
find_iterator_type(),
copy_range_type() );
SequenceSequenceT Tmp(itBegin, itEnd);
Result.swap(Tmp);
return Result;
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::iter_find;
using algorithm::iter_split;
} // namespace boost
#endif // BOOST_STRING_ITER_FIND_HPP
@@ -0,0 +1,292 @@
#ifndef BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
#define BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
//
// shared_array.hpp
//
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 2002, 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)
//
// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
//
#include <boost/config.hpp> // for broken compiler workarounds
#include <memory> // TR1 cyclic inclusion fix
#include <boost/assert.hpp>
#include <boost/checked_delete.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/shared_count.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
#include <boost/detail/workaround.hpp>
#include <cstddef> // for std::ptrdiff_t
#include <algorithm> // for std::swap
#include <functional> // for std::less
namespace boost
{
//
// shared_array
//
// shared_array extends shared_ptr to arrays.
// The array pointed to is deleted when the last shared_array pointing to it
// is destroyed or reset.
//
template<class T> class shared_array
{
private:
// Borland 5.5.1 specific workarounds
typedef checked_array_deleter<T> deleter;
typedef shared_array<T> this_type;
public:
typedef T element_type;
shared_array() BOOST_NOEXCEPT : px( 0 ), pn()
{
}
#if !defined( BOOST_NO_CXX11_NULLPTR )
shared_array( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn()
{
}
#endif
template<class Y>
explicit shared_array( Y * p ): px( p ), pn( p, checked_array_deleter<Y>() )
{
boost::detail::sp_assert_convertible< Y[], T[] >();
}
//
// Requirements: D's copy constructor must not throw
//
// shared_array will release p by calling d(p)
//
template<class Y, class D> shared_array( Y * p, D d ): px( p ), pn( p, d )
{
boost::detail::sp_assert_convertible< Y[], T[] >();
}
// As above, but with allocator. A's copy constructor shall not throw.
template<class Y, class D, class A> shared_array( Y * p, D d, A a ): px( p ), pn( p, d, a )
{
boost::detail::sp_assert_convertible< Y[], T[] >();
}
// generated copy constructor, destructor are fine...
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
// ... except in C++0x, move disables the implicit copy
shared_array( shared_array const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
{
}
shared_array( shared_array && r ) BOOST_NOEXCEPT : px( r.px ), pn()
{
pn.swap( r.pn );
r.px = 0;
}
#endif
// conversion
template<class Y>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
shared_array( shared_array<Y> const & r, typename boost::detail::sp_enable_if_convertible< Y[], T[] >::type = boost::detail::sp_empty() )
#else
shared_array( shared_array<Y> const & r )
#endif
BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) // never throws
{
boost::detail::sp_assert_convertible< Y[], T[] >();
}
// aliasing
template< class Y >
shared_array( shared_array<Y> const & r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn( r.pn )
{
}
// assignment
shared_array & operator=( shared_array const & r ) BOOST_NOEXCEPT
{
this_type( r ).swap( *this );
return *this;
}
#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400)
template<class Y>
shared_array & operator=( shared_array<Y> const & r ) BOOST_NOEXCEPT
{
this_type( r ).swap( *this );
return *this;
}
#endif
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
shared_array & operator=( shared_array && r ) BOOST_NOEXCEPT
{
this_type( static_cast< shared_array && >( r ) ).swap( *this );
return *this;
}
template<class Y>
shared_array & operator=( shared_array<Y> && r ) BOOST_NOEXCEPT
{
this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this );
return *this;
}
#endif
void reset() BOOST_NOEXCEPT
{
this_type().swap( *this );
}
template<class Y> void reset( Y * p ) // Y must be complete
{
BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
this_type( p ).swap( *this );
}
template<class Y, class D> void reset( Y * p, D d )
{
this_type( p, d ).swap( *this );
}
template<class Y, class D, class A> void reset( Y * p, D d, A a )
{
this_type( p, d, a ).swap( *this );
}
template<class Y> void reset( shared_array<Y> const & r, element_type * p )
{
this_type( r, p ).swap( *this );
}
T & operator[] (std::ptrdiff_t i) const // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
{
BOOST_ASSERT(px != 0);
BOOST_ASSERT(i >= 0);
return px[i];
}
T * get() const BOOST_NOEXCEPT
{
return px;
}
// implicit conversion to "bool"
#include <boost/smart_ptr/detail/operator_bool.hpp>
bool unique() const BOOST_NOEXCEPT
{
return pn.unique();
}
long use_count() const BOOST_NOEXCEPT
{
return pn.use_count();
}
void swap(shared_array<T> & other) BOOST_NOEXCEPT
{
std::swap(px, other.px);
pn.swap(other.pn);
}
void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const
{
return pn.get_deleter( ti );
}
private:
template<class Y> friend class shared_array;
T * px; // contained pointer
detail::shared_count pn; // reference counter
}; // shared_array
template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
{
return a.get() == b.get();
}
template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
{
return a.get() != b.get();
}
#if !defined( BOOST_NO_CXX11_NULLPTR )
template<class T> inline bool operator==( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
{
return p.get() == 0;
}
template<class T> inline bool operator==( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
{
return p.get() == 0;
}
template<class T> inline bool operator!=( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
{
return p.get() != 0;
}
template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
{
return p.get() != 0;
}
#endif
template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
{
return std::less<T*>()(a.get(), b.get());
}
template<class T> void swap(shared_array<T> & a, shared_array<T> & b) BOOST_NOEXCEPT
{
a.swap(b);
}
template< class D, class T > D * get_deleter( shared_array<T> const & p )
{
return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID(D) ) );
}
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
@@ -0,0 +1,116 @@
#ifndef BOOST_SERIALIZATION_LEVEL_HPP
#define BOOST_SERIALIZATION_LEVEL_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// level.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c_tag.hpp>
#include <boost/serialization/level_enum.hpp>
namespace boost {
namespace serialization {
struct basic_traits;
// default serialization implementation level
template<class T>
struct implementation_level_impl {
template<class U>
struct traits_class_level {
typedef typename U::level type;
};
typedef mpl::integral_c_tag tag;
// note: at least one compiler complained w/o the full qualification
// on basic traits below
typedef
typename mpl::eval_if<
is_base_and_derived<boost::serialization::basic_traits, T>,
traits_class_level< T >,
//else
typename mpl::eval_if<
is_fundamental< T >,
mpl::int_<primitive_type>,
//else
typename mpl::eval_if<
is_class< T >,
mpl::int_<object_class_info>,
//else
typename mpl::eval_if<
is_array< T >,
mpl::int_<object_serializable>,
//else
typename mpl::eval_if<
is_enum< T >,
mpl::int_<primitive_type>,
//else
mpl::int_<not_serializable>
>
>
>
>
>::type type;
// vc 7.1 doesn't like enums here
BOOST_STATIC_CONSTANT(int, value = type::value);
};
template<class T>
struct implementation_level :
public implementation_level_impl<const T>
{
};
template<class T, int L>
inline bool operator>=(implementation_level< T > t, enum level_type l)
{
return t.value >= (int)l;
}
} // namespace serialization
} // namespace boost
// specify the level of serialization implementation for the class
// require that class info saved when versioning is used
#define BOOST_CLASS_IMPLEMENTATION(T, E) \
namespace boost { \
namespace serialization { \
template <> \
struct implementation_level_impl< const T > \
{ \
typedef mpl::integral_c_tag tag; \
typedef mpl::int_< E > type; \
BOOST_STATIC_CONSTANT( \
int, \
value = implementation_level_impl::type::value \
); \
}; \
} \
}
/**/
#endif // BOOST_SERIALIZATION_LEVEL_HPP
@@ -0,0 +1,23 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_MPL_31122005_1152)
#define BOOST_FUSION_MPL_31122005_1152
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/mpl/detail/begin_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/end_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/size_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/at_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/has_key_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/empty_impl.hpp>
#endif
@@ -0,0 +1,55 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_OPERATOR_ARITHMETIC_HPP
#define BOOST_PHOENIX_OPERATOR_ARITHMETIC_HPP
#include <boost/phoenix/operator/detail/define_operator.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/proto/operators.hpp>
namespace boost { namespace phoenix
{
BOOST_PHOENIX_UNARY_OPERATORS(
(negate)
(unary_plus)
(pre_inc)
(pre_dec)
(post_inc)
(post_dec)
)
BOOST_PHOENIX_BINARY_OPERATORS(
(plus_assign)
(minus_assign)
(multiplies_assign)
(divides_assign)
(modulus_assign)
(plus)
(minus)
(multiplies)
(divides)
(modulus)
)
using proto::exprns_::operator++;
using proto::exprns_::operator--;
using proto::exprns_::operator+=;
using proto::exprns_::operator-=;
using proto::exprns_::operator*=;
using proto::exprns_::operator/=;
using proto::exprns_::operator%=;
using proto::exprns_::operator+;
using proto::exprns_::operator-;
using proto::exprns_::operator*;
using proto::exprns_::operator/;
using proto::exprns_::operator%;
}}
#include <boost/phoenix/operator/detail/undef_operator.hpp>
#endif
@@ -0,0 +1,28 @@
#include <stdlib.h>
#include <math.h>
/* Generate gaussian random float with mean=0 and std_dev=1 */
float gran_()
{
float fac,rsq,v1,v2;
static float gset;
static int iset;
if(iset){
/* Already got one */
iset = 0;
return gset;
}
/* Generate two evenly distributed numbers between -1 and +1
* that are inside the unit circle
*/
do {
v1 = 2.0 * (float)rand() / RAND_MAX - 1;
v2 = 2.0 * (float)rand() / RAND_MAX - 1;
rsq = v1*v1 + v2*v2;
} while(rsq >= 1.0 || rsq == 0.0);
fac = sqrt(-2.0*log(rsq)/rsq);
gset = v1*fac;
iset++;
return v2*fac;
}
@@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if FUSION_MAX_VECTOR_SIZE <= 10
#include <boost/fusion/tuple/detail/preprocessed/tuple10.hpp>
#elif FUSION_MAX_VECTOR_SIZE <= 20
#include <boost/fusion/tuple/detail/preprocessed/tuple20.hpp>
#elif FUSION_MAX_VECTOR_SIZE <= 30
#include <boost/fusion/tuple/detail/preprocessed/tuple30.hpp>
#elif FUSION_MAX_VECTOR_SIZE <= 40
#include <boost/fusion/tuple/detail/preprocessed/tuple40.hpp>
#elif FUSION_MAX_VECTOR_SIZE <= 50
#include <boost/fusion/tuple/detail/preprocessed/tuple50.hpp>
#else
#error "FUSION_MAX_VECTOR_SIZE out of bounds for preprocessed headers"
#endif
@@ -0,0 +1,30 @@
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
// Howard Hinnant and John Maddock 2000, 2010.
// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/is_rvalue_reference.hpp>
namespace boost {
template <class T> struct is_reference
: public
integral_constant<
bool,
::boost::is_lvalue_reference<T>::value || ::boost::is_rvalue_reference<T>::value>
{};
} // namespace boost
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
@@ -0,0 +1,32 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2011.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* Revised by Paul Mensonides (2011) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_LIST_TO_SEQ_HPP
# define BOOST_PREPROCESSOR_LIST_TO_SEQ_HPP
#
# include <boost/preprocessor/list/for_each.hpp>
#
# /* BOOST_PP_LIST_TO_SEQ */
#
# define BOOST_PP_LIST_TO_SEQ(list) \
BOOST_PP_LIST_FOR_EACH(BOOST_PP_LIST_TO_SEQ_MACRO, ~, list) \
/**/
# define BOOST_PP_LIST_TO_SEQ_MACRO(r, data, elem) (elem)
#
# /* BOOST_PP_LIST_TO_SEQ_R */
#
# define BOOST_PP_LIST_TO_SEQ_R(r, list) \
BOOST_PP_LIST_FOR_EACH_R(r, BOOST_PP_LIST_TO_SEQ_MACRO, ~, list) \
/**/
#
# endif /* BOOST_PREPROCESSOR_LIST_TO_SEQ_HPP */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,39 @@
subroutine interleave9(ia,ndir,ib)
integer*1 ia(0:205),ib(0:205)
integer j0(0:205)
logical first
data first/.true./
save first,j0 !Save not working, or j0 overwritten ???
if(first) then
k=-1
do i=0,255
m=i
n=iand(m,1)
n=2*n + iand(m/2,1)
n=2*n + iand(m/4,1)
n=2*n + iand(m/8,1)
n=2*n + iand(m/16,1)
n=2*n + iand(m/32,1)
n=2*n + iand(m/64,1)
n=2*n + iand(m/128,1)
if(n.le.205) then
k=k+1
j0(k)=n
endif
enddo
! first=.false.
endif
if(ndir.gt.0) then
do i=0,205
ib(j0(i))=ia(i)
enddo
else
do i=0,205
ib(i)=ia(j0(i))
enddo
endif
return
end subroutine interleave9
@@ -0,0 +1,50 @@
// Copyright David Abrahams 2006. 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_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
# define BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concepts {
namespace detail
{
// Here we implement the metafunction that detects whether a
// constraints metafunction exists
typedef char yes;
typedef char (&no)[2];
template <class Model, void (Model::*)()>
struct wrap_constraints {};
#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) || defined(__CUDACC__)
// Work around the following bogus error in Sun Studio 11, by
// turning off the has_constraints function entirely:
// Error: complex expression not allowed in dependent template
// argument expression
inline no has_constraints_(...);
#else
template <class Model>
inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
inline no has_constraints_(...);
#endif
}
// This would be called "detail::has_constraints," but it has a strong
// tendency to show up in error messages.
template <class Model>
struct not_satisfied
{
BOOST_STATIC_CONSTANT(
bool
, value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
typedef mpl::bool_<value> type;
};
}} // namespace boost::concepts::detail
#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
@@ -0,0 +1,18 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion { namespace detail
{
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29>
struct deque_initial_size
{
typedef mpl::vector<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29> args;
typedef typename mpl::find<args, void_>::type first_void;
typedef typename mpl::distance<typename mpl::begin<args>::type, first_void>::type type;
};
}}}