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,87 @@
// Boost string_algo library find_iterator.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_FIND_ITERATOR_DETAIL_HPP
#define BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/function.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// find_iterator base -----------------------------------------------//
// Find iterator base
template<typename IteratorT>
class find_iterator_base
{
protected:
// typedefs
typedef IteratorT input_iterator_type;
typedef iterator_range<IteratorT> match_type;
typedef function2<
match_type,
input_iterator_type,
input_iterator_type> finder_type;
protected:
// Protected construction/destruction
// Default constructor
find_iterator_base() {};
// Copy construction
find_iterator_base( const find_iterator_base& Other ) :
m_Finder(Other.m_Finder) {}
// Constructor
template<typename FinderT>
find_iterator_base( FinderT Finder, int ) :
m_Finder(Finder) {}
// Destructor
~find_iterator_base() {}
// Find operation
match_type do_find(
input_iterator_type Begin,
input_iterator_type End ) const
{
if (!m_Finder.empty())
{
return m_Finder(Begin,End);
}
else
{
return match_type(End,End);
}
}
// Check
bool is_null() const
{
return m_Finder.empty();
}
private:
// Finder
finder_type m_Finder;
};
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
@@ -0,0 +1,123 @@
#ifndef BOOST_MPL_AUX_TRANSFORM_ITER_HPP_INCLUDED
#define BOOST_MPL_AUX_TRANSFORM_ITER_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/apply.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/aux_/lambda_spec.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl {
namespace aux {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template<
typename Iterator
, typename LastIterator
, typename F
>
struct transform_iter
{
typedef Iterator base;
typedef forward_iterator_tag category;
typedef transform_iter< typename mpl::next<base>::type,LastIterator,F > next;
typedef typename apply1<
F
, typename deref<base>::type
>::type type;
};
template<
typename LastIterator
, typename F
>
struct transform_iter< LastIterator,LastIterator,F >
{
typedef LastIterator base;
typedef forward_iterator_tag category;
};
#else
template<
typename Iterator
, typename LastIterator
, typename F
>
struct transform_iter;
template< bool >
struct transform_iter_impl
{
template<
typename Iterator
, typename LastIterator
, typename F
>
struct result_
{
typedef Iterator base;
typedef forward_iterator_tag category;
typedef transform_iter< typename mpl::next<Iterator>::type,LastIterator,F > next;
typedef typename apply1<
F
, typename deref<Iterator>::type
>::type type;
};
};
template<>
struct transform_iter_impl<true>
{
template<
typename Iterator
, typename LastIterator
, typename F
>
struct result_
{
typedef Iterator base;
typedef forward_iterator_tag category;
};
};
template<
typename Iterator
, typename LastIterator
, typename F
>
struct transform_iter
: transform_iter_impl<
::boost::is_same<Iterator,LastIterator>::value
>::template result_< Iterator,LastIterator,F >
{
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
} // namespace aux
BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, aux::transform_iter)
}}
#endif // BOOST_MPL_AUX_TRANSFORM_ITER_HPP_INCLUDED
@@ -0,0 +1,260 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden
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)
==============================================================================*/
#if !defined(FUSION_FIND_IF_05052005_1107)
#define FUSION_FIND_IF_05052005_1107
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/or.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/support/category_of.hpp>
namespace boost { namespace fusion {
struct random_access_traversal_tag;
namespace detail
{
template <typename Iterator, typename Pred>
struct apply_filter
{
typedef typename mpl::apply1<
Pred, Iterator>::type type;
BOOST_STATIC_CONSTANT(int, value = type::value);
};
template <typename First, typename Last, typename Pred>
struct main_find_if;
template <typename First, typename Last, typename Pred>
struct recursive_find_if
{
typedef typename
main_find_if<
typename result_of::next<First>::type, Last, Pred
>::type
type;
};
template <typename First, typename Last, typename Pred>
struct main_find_if
{
typedef mpl::or_<
result_of::equal_to<First, Last>
, apply_filter<First, Pred> >
filter;
typedef typename
mpl::eval_if<
filter
, mpl::identity<First>
, recursive_find_if<First, Last, Pred>
>::type
type;
};
template<
typename First, typename Last,
typename Pred, bool>
struct choose_find_if;
template<typename First, typename Last, typename Pred>
struct choose_find_if<First, Last, Pred, false>
: main_find_if<First, Last, Pred>
{};
template<typename Iter, typename Pred, int n, int unrolling>
struct unroll_again;
template <typename Iter, typename Pred, int offset>
struct apply_offset_filter
{
typedef typename result_of::advance_c<Iter, offset>::type Shifted;
typedef typename
mpl::apply1<
Pred
, Shifted
>::type
type;
BOOST_STATIC_CONSTANT(int, value = type::value);
};
template<typename Iter, typename Pred, int n>
struct unrolled_find_if
{
typedef typename mpl::eval_if<
apply_filter<Iter, Pred>,
mpl::identity<Iter>,
mpl::eval_if<
apply_offset_filter<Iter, Pred, 1>,
result_of::advance_c<Iter, 1>,
mpl::eval_if<
apply_offset_filter<Iter, Pred, 2>,
result_of::advance_c<Iter, 2>,
mpl::eval_if<
apply_offset_filter<Iter, Pred, 3>,
result_of::advance_c<Iter, 3>,
unroll_again<
Iter,
Pred,
n,
4> > > > >::type type;
};
template<typename Iter, typename Pred>
struct unrolled_find_if<Iter, Pred, 3>
{
typedef typename mpl::eval_if<
apply_filter<Iter, Pred>,
mpl::identity<Iter>,
mpl::eval_if<
apply_offset_filter<Iter, Pred, 1>,
result_of::advance_c<Iter, 1>,
mpl::eval_if<
apply_offset_filter<Iter, Pred, 2>,
result_of::advance_c<Iter, 2>,
result_of::advance_c<Iter, 3> > > >::type type;
};
template<typename Iter, typename Pred>
struct unrolled_find_if<Iter, Pred, 2>
{
typedef typename mpl::eval_if<
apply_filter<Iter, Pred>,
mpl::identity<Iter>,
mpl::eval_if<
apply_offset_filter<Iter, Pred, 1>,
result_of::advance_c<Iter, 1>,
result_of::advance_c<Iter, 2> > >::type type;
};
template<typename Iter, typename Pred>
struct unrolled_find_if<Iter, Pred, 1>
{
typedef typename mpl::eval_if<
apply_filter<Iter, Pred>,
mpl::identity<Iter>,
result_of::advance_c<Iter, 1> >::type type;
};
template<typename Iter, typename Pred, int n, int unrolling>
struct unroll_again
{
typedef typename unrolled_find_if<
typename result_of::advance_c<Iter, unrolling>::type,
Pred,
n-unrolling>::type type;
};
template<typename Iter, typename Pred>
struct unrolled_find_if<Iter, Pred, 0>
{
typedef Iter type;
};
template<typename First, typename Last, typename Pred>
struct choose_find_if<First, Last, Pred, true>
{
typedef typename result_of::distance<First, Last>::type N;
typedef typename unrolled_find_if<First, Pred, N::value>::type type;
};
template <typename First, typename Last, typename Pred>
struct static_find_if
{
typedef typename
choose_find_if<
First
, Last
, typename mpl::lambda<Pred>::type
, is_base_of<random_access_traversal_tag, typename traits::category_of<First>::type>::value
>::type
type;
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
recursive_call(Iterator const& iter, mpl::true_)
{
return iter;
}
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
recursive_call(Iterator const& iter, mpl::false_)
{
return recursive_call(fusion::next(iter));
}
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
recursive_call(Iterator const& iter)
{
typedef result_of::equal_to<Iterator, type> found;
return recursive_call(iter, found());
}
template <typename Iterator, typename Tag>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
choose_call(Iterator const& iter, Tag)
{
return recursive_call(iter);
}
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
choose_call(Iterator const& iter, random_access_traversal_tag)
{
typedef typename result_of::distance<Iterator, type>::type N;
return fusion::advance<N>(iter);
}
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
iter_call(Iterator const& iter)
{
return choose_call(iter, typename traits::category_of<Iterator>::type());
}
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& seq)
{
return iter_call(fusion::begin(seq));
}
};
template <typename Sequence, typename Pred>
struct result_of_find_if
{
typedef
static_find_if<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type
, Pred
>
filter;
typedef typename filter::type type;
};
}}}
#endif
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

@@ -0,0 +1,486 @@
#include "WSPRBandHopping.hpp"
#include <random>
#include <QPointer>
#include <QSettings>
#include <QBitArray>
#include <QList>
#include <QSet>
#include <QtWidgets>
#include "SettingsGroup.hpp"
#include "Configuration.hpp"
#include "Bands.hpp"
#include "FrequencyList.hpp"
#include "WsprTxScheduler.h"
#include "pimpl_impl.hpp"
#include "moc_WSPRBandHopping.cpp"
extern "C"
{
#ifndef CMAKE_BUILD
#define FC_grayline grayline_
#else
#include "FC.h"
void FC_grayline (int const * year, int const * month, int const * nday, float const * uth, char const * my_grid
, int const * nduration, int * isun
, int my_grid_len);
#endif
};
namespace
{
char const * const title = "WSPR Band Hopping";
char const * const periods[] = {"Sunrise grayline", "Day", "Sunset grayline", "Night", "Tune", "Rx only"};
size_t constexpr num_periods {sizeof (periods) / sizeof (periods[0])};
// These 10 bands are globally coordinated
QList<QString> const coordinated_bands = {"160m", "80m", "60m", "40m", "30m", "20m", "17m", "15m", "12m", "10m"};
}
//
// Dialog - maintenance of band hopping options
//
class Dialog
: public QDialog
{
public:
using BandList = QList<QString>;
Dialog (QSettings *, Configuration const *, BandList const * WSPT_bands, QBitArray * bands
, int * gray_line_duration, QWidget * parent = nullptr);
~Dialog ();
Q_SLOT void frequencies_changed ();
void resize_to_maximum ();
private:
void closeEvent (QCloseEvent *) override;
void save_window_state ();
QSettings * settings_;
Configuration const * configuration_;
BandList const * WSPR_bands_;
QBitArray * bands_;
int * gray_line_duration_;
QPointer<QTableWidget> bands_table_;
QBrush coord_background_brush_;
QPointer<QSpinBox> gray_line_width_spin_box_;
static int constexpr band_index_role {Qt::UserRole};
};
Dialog::Dialog (QSettings * settings, Configuration const * configuration, BandList const * WSPR_bands
, QBitArray * bands, int * gray_line_duration, QWidget * parent)
: QDialog {parent, Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint}
, settings_ {settings}
, configuration_ {configuration}
, WSPR_bands_ {WSPR_bands}
, bands_ {bands}
, gray_line_duration_ {gray_line_duration}
, bands_table_ {new QTableWidget {this}}
, coord_background_brush_ {Qt::yellow}
, gray_line_width_spin_box_ {new QSpinBox {this}}
{
setWindowTitle (windowTitle () + ' ' + tr (title));
{
SettingsGroup g {settings_, title};
restoreGeometry (settings_->value ("geometry", saveGeometry ()).toByteArray ());
}
QVBoxLayout * main_layout {new QVBoxLayout};
bands_table_->setRowCount (num_periods);
bands_table_->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
bands_table_->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
bands_table_->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
frequencies_changed ();
main_layout->addWidget (bands_table_);
// recalculate table when frequencies change
connect (configuration_->frequencies (), &QAbstractItemModel::layoutChanged
, this, &Dialog::frequencies_changed);
// handle changes by updating the underlying flags
connect (bands_table_.data (), &QTableWidget::itemChanged, [this] (QTableWidgetItem * item) {
auto band_number = item->data (band_index_role).toInt ();
bands_[item->row ()].setBit (band_number, Qt::Checked == item->checkState ());
});
// set up the gray line duration spin box
gray_line_width_spin_box_->setRange (1, 60 * 2);
gray_line_width_spin_box_->setSuffix ("min");
gray_line_width_spin_box_->setValue (*gray_line_duration_);
QFormLayout * form_layout = new QFormLayout;
form_layout->addRow (tr ("Gray time:"), gray_line_width_spin_box_);
connect (gray_line_width_spin_box_.data ()
, static_cast<void (QSpinBox::*) (int)> (&QSpinBox::valueChanged)
, [this] (int new_value) {*gray_line_duration_ = new_value;});
QHBoxLayout * bottom_layout = new QHBoxLayout;
bottom_layout->addStretch ();
bottom_layout->addLayout (form_layout);
main_layout->addLayout (bottom_layout);
setLayout (main_layout);
}
Dialog::~Dialog ()
{
// do this here too because ESC or parent shutdown closing this
// window doesn't queue a close event
save_window_state ();
}
void Dialog::closeEvent (QCloseEvent * e)
{
save_window_state ();
QDialog::closeEvent (e);
}
void Dialog::save_window_state ()
{
SettingsGroup g {settings_, title};
settings_->setValue ("geometry", saveGeometry ());
}
void Dialog::frequencies_changed ()
{
bands_table_->setColumnCount (WSPR_bands_->size ());
// set up and load the table of check boxes
for (auto row = 0u; row < num_periods; ++row)
{
auto vertical_header = new QTableWidgetItem {periods[row]};
vertical_header->setTextAlignment (Qt::AlignRight | Qt::AlignVCenter);
bands_table_->setVerticalHeaderItem (row, vertical_header);
int column {0};
int band_number {0};
for (auto const& band : *configuration_->bands ())
{
if (WSPR_bands_->contains (band))
{
if (0 == row)
{
auto horizontal_header = new QTableWidgetItem {band};
bands_table_->setHorizontalHeaderItem (column, horizontal_header);
}
auto item = new QTableWidgetItem;
item->setFlags (Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
item->setCheckState (bands_[row].testBit (band_number) ? Qt::Checked : Qt::Unchecked);
item->setData (band_index_role, band_number);
if (coordinated_bands.contains (band))
{
item->setBackground (coord_background_brush_);
}
bands_table_->setItem (row, column, item);
++column;
}
++band_number;
}
}
bands_table_->resizeColumnsToContents ();
auto is_visible = isVisible ();
show ();
resize_to_maximum ();
adjustSize (); // fix the size
if (!is_visible)
{
hide ();
}
}
// to get the dialog window exactly the right size to contain the
// widgets without needing scroll bars we need to measure the size of
// the table widget and set its minimum size to the measured size
void Dialog::resize_to_maximum ()
{
bands_table_->setMinimumSize ({
bands_table_->horizontalHeader ()->length ()
+ bands_table_->verticalHeader ()->width ()
+ 2 * bands_table_->frameWidth ()
, bands_table_->verticalHeader ()->length ()
+ bands_table_->horizontalHeader ()->height ()
+ 2 * bands_table_->frameWidth ()
});
bands_table_->setMaximumSize (bands_table_->minimumSize ());
}
class WSPRBandHopping::impl
{
public:
using BandList = Dialog::BandList;
impl (QSettings * settings, Configuration const * configuration, QWidget * parent_widget)
: settings_ {settings}
, configuration_ {configuration}
, tx_percent_ {0}
, parent_widget_ {parent_widget}
, last_was_tx_ {false}
, carry_ {false}
, seed_ {{rand (), rand (), rand (), rand (), rand (), rand (), rand (), rand ()}}
, gen_ {seed_}
, dist_ {1, 100}
{
auto num_bands = configuration_->bands ()->rowCount ();
for (auto& flags : bands_)
{
flags.resize (num_bands);
}
}
bool simple_scheduler ();
QSettings * settings_;
Configuration const * configuration_;
int tx_percent_;
BandList WSPR_bands_;
BandList rx_permutation_;
BandList tx_permutation_;
QWidget * parent_widget_;
// 5 x 10 bit flags representing each hopping band in each period
// and tune
QBitArray bands_[num_periods];
int gray_line_duration_;
QPointer<Dialog> dialog_;
bool last_was_tx_;
bool carry_;
std::seed_seq seed_;
std::mt19937 gen_;
std::uniform_int_distribution<int> dist_;
};
bool WSPRBandHopping::impl::simple_scheduler ()
{
auto tx = carry_ || tx_percent_ > dist_ (gen_);
if (carry_)
{
carry_ = false;
}
else if (tx_percent_ < 40 && last_was_tx_ && tx)
{
// if percentage is less than 40 then avoid consecutive tx but
// always catch up on the next round
tx = false;
carry_ = true;
}
last_was_tx_ = tx;
return tx;
}
WSPRBandHopping::WSPRBandHopping (QSettings * settings, Configuration const * configuration, QWidget * parent_widget)
: m_ {settings, configuration, parent_widget}
{
// detect changes to the working frequencies model
m_->WSPR_bands_ = m_->configuration_->frequencies ()->all_bands (Modes::WSPR).toList ();
connect (m_->configuration_->frequencies (), &QAbstractItemModel::layoutChanged
, [this] () {
m_->WSPR_bands_ = m_->configuration_->frequencies ()->all_bands (Modes::WSPR).toList ();
});
// load settings
SettingsGroup g {m_->settings_, title};
size_t size = m_->settings_->beginReadArray ("phases");
for (auto i = 0u; i < size; ++i)
{
if (i < num_periods)
{
m_->settings_->setArrayIndex (i);
m_->bands_[i] = m_->settings_->value ("bands").toBitArray ();
}
}
m_->settings_->endArray ();
m_->gray_line_duration_ = m_->settings_->value ("GrayLineDuration", 60).toUInt ();
}
WSPRBandHopping::~WSPRBandHopping ()
{
// save settings
SettingsGroup g {m_->settings_, title};
m_->settings_->beginWriteArray ("phases");
for (auto i = 0u; i < num_periods; ++i)
{
m_->settings_->setArrayIndex (i);
m_->settings_->setValue ("bands", m_->bands_[i]);
}
m_->settings_->endArray ();
m_->settings_->setValue ("GrayLineDuration", m_->gray_line_duration_);
}
// pop up the maintenance dialog window
void WSPRBandHopping::show_dialog (bool /* checked */)
{
if (!m_->dialog_)
{
m_->dialog_ = new Dialog {m_->settings_, m_->configuration_, &m_->WSPR_bands_, m_->bands_
, &m_->gray_line_duration_, m_->parent_widget_};
}
m_->dialog_->show ();
m_->dialog_->raise ();
m_->dialog_->activateWindow ();
}
int WSPRBandHopping::tx_percent () const
{
return m_->tx_percent_;
}
void WSPRBandHopping::set_tx_percent (int new_value)
{
m_->tx_percent_ = new_value;
}
// determine the parameters of the hop, if any
auto WSPRBandHopping::next_hop (bool tx_enabled) -> Hop
{
auto const& now = QDateTime::currentDateTimeUtc ();
auto const& date = now.date ();
auto year = date.year ();
auto month = date.month ();
auto day = date.day ();
auto const& time = now.time ();
float uth = time.hour () + time.minute () / 60.
+ (time.second () + .001 * time.msec ()) / 3600.;
auto my_grid = m_->configuration_->my_grid ();
int period_index;
int band_index;
int tx_next;
my_grid = (my_grid + " ").left (6); // hopping doesn't like
// short grids
// look up the period for this time
FC_grayline (&year, &month, &day, &uth, my_grid.toLatin1 ().constData ()
, &m_->gray_line_duration_, &period_index
, my_grid.size ());
band_index = next_hopping_band();
tx_next = next_is_tx () && tx_enabled;
int frequencies_index {-1};
auto const& frequencies = m_->configuration_->frequencies ();
auto const& bands = m_->configuration_->bands ();
auto band_name = bands->data (bands->index (band_index + 3, 0)).toString ();
if (m_->bands_[period_index].testBit (band_index + 3) // +3 for
// coordinated bands
&& m_->WSPR_bands_.contains (band_name))
{
// here we have a band that has been enabled in the hopping
// matrix so check it it has a configured working frequency
frequencies_index = frequencies->best_working_frequency (band_name);
}
// if we do not have a configured working frequency on the selected
// coordinated hopping band we next pick from a random permutation
// of the other enabled bands in the hopping bands matrix
if (frequencies_index < 0)
{
// build sets of available rx and tx bands
auto target_rx_bands = m_->WSPR_bands_.toSet ();
auto target_tx_bands = target_rx_bands;
for (auto i = 0; i < m_->bands_[period_index].size (); ++i)
{
auto const& band = bands->data (bands->index (i, 0)).toString ();
// remove bands that are not enabled for hopping in this phase
if (!m_->bands_[period_index].testBit (i))
{
target_rx_bands.remove (band);
target_tx_bands.remove (band);
}
// remove rx only bands from transmit list and vice versa
if (m_->bands_[5].testBit (i))
{
target_tx_bands.remove (band);
}
else
{
target_rx_bands.remove (band);
}
}
// if we have some bands to permute
if (target_rx_bands.size () + target_tx_bands.size ())
{
if (!(m_->rx_permutation_.size () + m_->tx_permutation_.size ()) // all used up
// or rx list contains a band no longer scheduled
|| !target_rx_bands.contains (m_->rx_permutation_.toSet ())
// or tx list contains a band no longer scheduled for tx
|| !target_tx_bands.contains (m_->tx_permutation_.toSet ()))
{
// build new random permutations
m_->rx_permutation_ = target_rx_bands.toList ();
std::random_shuffle (std::begin (m_->rx_permutation_), std::end (m_->rx_permutation_));
m_->tx_permutation_ = target_tx_bands.toList ();
std::random_shuffle (std::begin (m_->tx_permutation_), std::end (m_->tx_permutation_));
// qDebug () << "New random Rx permutation:" << m_->rx_permutation_
// << "random Tx permutation:" << m_->tx_permutation_;
}
if ((tx_next && m_->tx_permutation_.size ()) || !m_->rx_permutation_.size ())
{
Q_ASSERT (m_->tx_permutation_.size ());
// use one from the current random tx permutation
band_name = m_->tx_permutation_.takeFirst ();
}
else
{
Q_ASSERT (m_->rx_permutation_.size ());
// use one from the current random rx permutation
band_name = m_->rx_permutation_.takeFirst ();
}
// find the first WSPR working frequency for the chosen band
frequencies_index = frequencies->best_working_frequency (band_name);
if (frequencies_index >= 0) // should be a redundant check,
// but to be safe
{
// we can use the random choice
// qDebug () << "random:" << frequencies->data (frequencies->index (frequencies_index, FrequencyList::frequency_column)).toString ();
band_index = bands->find (band_name);
if (band_index < 0) // this shouldn't happen
{
Q_ASSERT (band_index >= 0);
frequencies_index = -1;
}
}
}
}
else
{
band_index += 3;
// qDebug () << "scheduled:" << frequencies->data (frequencies->index (frequencies_index, FrequencyList::frequency_column)).toString ();
// remove from random permutations to stop the coordinated bands
// getting too high a weighting - not perfect but surely helps
m_->rx_permutation_.removeOne (band_name);
m_->tx_permutation_.removeOne (band_name);
}
return {
periods[period_index]
, frequencies_index
, frequencies_index >= 0 // new band
&& tx_enabled // transmit is allowed
&& !tx_next // not going to Tx anyway
&& m_->bands_[4].testBit (band_index) // tune up required
&& !m_->bands_[5].testBit (band_index) // not an Rx only band
, frequencies_index >= 0 // new band
&& tx_next // Tx scheduled
&& !m_->bands_[5].testBit (band_index) // not an Rx only band
};
}
bool WSPRBandHopping::next_is_tx (bool simple_schedule)
{
if (simple_schedule)
{
return m_->simple_scheduler ();
}
if (100 == m_->tx_percent_)
{
return true;
}
else
{
// consult scheduler to determine if next period should be a tx interval
return next_tx_state(m_->tx_percent_);
}
}
@@ -0,0 +1,685 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
template <typename Expr
, typename A0 = void , typename A1 = void , typename A2 = void , typename A3 = void , typename A4 = void , typename A5 = void , typename A6 = void , typename A7 = void , typename A8 = void , typename A9 = void , typename A10 = void , typename A11 = void , typename A12 = void , typename A13 = void , typename A14 = void , typename A15 = void , typename A16 = void , typename A17 = void , typename A18 = void , typename A19 = void , typename A20 = void , typename A21 = void , typename A22 = void , typename A23 = void , typename A24 = void , typename A25 = void , typename A26 = void , typename A27 = void , typename A28 = void , typename A29 = void
, typename Dummy = void>
struct actor;
template <typename Expr>
struct nullary_actor_result
{
typedef
typename boost::phoenix::evaluator::impl<
Expr const&
, vector2<
vector1<const ::boost::phoenix::actor<Expr> *> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0>
struct actor<Expr, A0>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector2<const ::boost::phoenix::actor<Expr> *, A0> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1>
struct actor<Expr, A0 , A1>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector3<const ::boost::phoenix::actor<Expr> *, A0 , A1> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2>
struct actor<Expr, A0 , A1 , A2>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector4<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3>
struct actor<Expr, A0 , A1 , A2 , A3>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector5<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
struct actor<Expr, A0 , A1 , A2 , A3 , A4>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector6<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector7<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector8<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector9<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector10<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector11<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector12<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector13<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector14<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector15<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector16<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector17<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector18<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector19<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector20<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector21<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector22<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector23<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector24<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector25<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23 , typename A24>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector26<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23 , typename A24 , typename A25>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector27<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23 , typename A24 , typename A25 , typename A26>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector28<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23 , typename A24 , typename A25 , typename A26 , typename A27>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26 , A27>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector29<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26 , A27> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23 , typename A24 , typename A25 , typename A26 , typename A27 , typename A28>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26 , A27 , A28>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector30<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26 , A27 , A28> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
template <typename Expr, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 , typename A16 , typename A17 , typename A18 , typename A19 , typename A20 , typename A21 , typename A22 , typename A23 , typename A24 , typename A25 , typename A26 , typename A27 , typename A28 , typename A29>
struct actor<Expr, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26 , A27 , A28 , A29>
{
typedef
typename phoenix::evaluator::
impl<
Expr const&
, vector2<
vector31<const ::boost::phoenix::actor<Expr> *, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , A16 , A17 , A18 , A19 , A20 , A21 , A22 , A23 , A24 , A25 , A26 , A27 , A28 , A29> &
, default_actions
> const &
, proto::empty_env
>::result_type
type;
};
@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2009-2013.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/intrusive for documentation.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
#define BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#if defined(_MSC_VER) && (_MSC_VER <= 1310)
#include <boost/intrusive/detail/mpl.hpp>
namespace boost {
namespace intrusive {
namespace detail {
template<class ValueTraits>
struct is_stateful_value_traits
{
static const bool value = !detail::is_empty<ValueTraits>::value;
};
}}}
#else
#include <boost/intrusive/detail/function_detector.hpp>
BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_node_ptr, boost_intrusive)
BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_value_ptr, boost_intrusive)
namespace boost {
namespace intrusive {
namespace detail {
template<class ValueTraits>
struct is_stateful_value_traits
{
typedef typename ValueTraits::node_ptr node_ptr;
typedef typename ValueTraits::pointer pointer;
typedef typename ValueTraits::value_type value_type;
typedef typename ValueTraits::const_node_ptr const_node_ptr;
typedef typename ValueTraits::const_pointer const_pointer;
typedef ValueTraits value_traits;
static const bool value =
(boost::intrusive::function_detector::NonStaticFunction ==
(BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, node_ptr, to_node_ptr, (value_type&) )))
||
(boost::intrusive::function_detector::NonStaticFunction ==
(BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, pointer, to_value_ptr, (node_ptr) )))
||
(boost::intrusive::function_detector::NonStaticFunction ==
(BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_node_ptr, to_node_ptr, (const value_type&) )))
||
(boost::intrusive::function_detector::NonStaticFunction ==
(BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_pointer, to_value_ptr, (const_node_ptr) )))
;
};
}}}
#endif
#endif //@ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
@@ -0,0 +1,204 @@
// 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 INDIRECT_TRAITS_DWA2002131_HPP
# define INDIRECT_TRAITS_DWA2002131_HPP
# include <boost/type_traits/is_function.hpp>
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_pointer.hpp>
# include <boost/type_traits/is_class.hpp>
# include <boost/type_traits/is_const.hpp>
# include <boost/type_traits/is_volatile.hpp>
# include <boost/type_traits/is_member_function_pointer.hpp>
# include <boost/type_traits/is_member_pointer.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/type_traits/remove_reference.hpp>
# include <boost/type_traits/remove_pointer.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/if.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/mpl/and.hpp>
# include <boost/mpl/not.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace detail {
namespace indirect_traits {
template <class T>
struct is_reference_to_const : mpl::false_
{
};
template <class T>
struct is_reference_to_const<T const&> : mpl::true_
{
};
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
template<class T>
struct is_reference_to_const<T const volatile&> : mpl::true_
{
};
# endif
template <class T>
struct is_reference_to_function : mpl::false_
{
};
template <class T>
struct is_reference_to_function<T&> : is_function<T>
{
};
template <class T>
struct is_pointer_to_function : mpl::false_
{
};
// There's no such thing as a pointer-to-cv-function, so we don't need
// specializations for those
template <class T>
struct is_pointer_to_function<T*> : is_function<T>
{
};
template <class T>
struct is_reference_to_member_function_pointer_impl : mpl::false_
{
};
template <class T>
struct is_reference_to_member_function_pointer_impl<T&>
: is_member_function_pointer<typename remove_cv<T>::type>
{
};
template <class T>
struct is_reference_to_member_function_pointer
: is_reference_to_member_function_pointer_impl<T>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
};
template <class T>
struct is_reference_to_function_pointer_aux
: mpl::and_<
is_reference<T>
, is_pointer_to_function<
typename remove_cv<
typename remove_reference<T>::type
>::type
>
>
{
// There's no such thing as a pointer-to-cv-function, so we don't need specializations for those
};
template <class T>
struct is_reference_to_function_pointer
: mpl::if_<
is_reference_to_function<T>
, mpl::false_
, is_reference_to_function_pointer_aux<T>
>::type
{
};
template <class T>
struct is_reference_to_non_const
: mpl::and_<
is_reference<T>
, mpl::not_<
is_reference_to_const<T>
>
>
{
};
template <class T>
struct is_reference_to_volatile : mpl::false_
{
};
template <class T>
struct is_reference_to_volatile<T volatile&> : mpl::true_
{
};
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
template <class T>
struct is_reference_to_volatile<T const volatile&> : mpl::true_
{
};
# endif
template <class T>
struct is_reference_to_pointer : mpl::false_
{
};
template <class T>
struct is_reference_to_pointer<T*&> : mpl::true_
{
};
template <class T>
struct is_reference_to_pointer<T* const&> : mpl::true_
{
};
template <class T>
struct is_reference_to_pointer<T* volatile&> : mpl::true_
{
};
template <class T>
struct is_reference_to_pointer<T* const volatile&> : mpl::true_
{
};
template <class T>
struct is_reference_to_class
: mpl::and_<
is_reference<T>
, is_class<
typename remove_cv<
typename remove_reference<T>::type
>::type
>
>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
};
template <class T>
struct is_pointer_to_class
: mpl::and_<
is_pointer<T>
, is_class<
typename remove_cv<
typename remove_pointer<T>::type
>::type
>
>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
};
}
using namespace indirect_traits;
}} // namespace boost::python::detail
#endif // INDIRECT_TRAITS_DWA2002131_HPP
@@ -0,0 +1,148 @@
// 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)
//
// Preprocessed version of "boost/mpl/times.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
, BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
, BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
>
struct times_impl
: if_c<
( tag1_ > tag2_ )
, aux::cast2nd_impl< times_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< times_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct times_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct times_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct times_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 times_tag
{
typedef typename T::tag type;
};
/// forward declaration
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct times2;
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 times
: if_<
is_na<N3>
, times2< N1,N2 >
, times<
times2< N1,N2 >
, N3, N4, N5
>
>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, times
, ( N1, N2, N3, N4, N5 )
)
};
template<
typename N1
, typename N2
>
struct times2
: aux::msvc_eti_base< typename apply_wrap2<
times_impl<
typename times_tag<N1>::type
, typename times_tag<N2>::type
>
, N1
, N2
>::type >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, times2, (N1, N2))
};
BOOST_MPL_AUX_NA_SPEC2(2, 5, times)
}}
namespace boost { namespace mpl {
namespace aux {
template< typename T, T n1, T n2 >
struct times_wknd
{
BOOST_STATIC_CONSTANT(T, value = (n1 * n2));
typedef integral_c< T,value > type;
};
}
template<>
struct times_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: aux::times_wknd<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, N1::value
, N2::value
>::type
{
};
};
}}
@@ -0,0 +1,123 @@
subroutine sync8(iwave,nfa,nfb,nfqso,s,candidate,ncand)
include 'ft8_params.f90'
parameter (JZ=20)
complex cx(0:NH1)
real s(NH1,NHSYM)
real savg(NH1)
real x(NFFT1)
real sync2d(NH1,-JZ:JZ)
real red(NH1)
real candidate0(3,100)
real candidate(3,100)
integer*2 iwave(NMAX)
integer jpeak(NH1)
integer indx(NH1)
integer ii(1)
integer icos7(0:6)
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
equivalence (x,cx)
! Compute symbol spectra at half-symbol steps.
savg=0.
istep=NSPS/2 !1024
tstep=istep/12000.0 !0.085333 s
df=12000.0/NFFT1 !2.93 Hz
! Compute symbol spectra at half-symbol steps
fac=1.0/300.0
do j=1,NHSYM
ia=(j-1)*istep + 1
ib=ia+NSPS-1
x(1:NSPS)=fac*iwave(ia:ib)
x(NSPS+1:)=0.
call four2a(x,NFFT1,1,-1,0) !r2c FFT
do i=1,NH1
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
enddo
savg=savg + s(1:NH1,j) !Average spectrum
enddo
savg=savg/NHSYM
ia=max(1,nint(nfa/df))
ib=nint(nfb/df)
do i=ia,ib
do j=-JZ,JZ
t=0.
t0=0.
do n=0,6
k=j+2*n
if(k.ge.1) then
t=t + s(i+2*icos7(n),k)
t0=t0 + sum(s(i:i+12:2,k))
endif
t=t + s(i+2*icos7(n),k+72)
t0=t0 + sum(s(i:i+12:2,k+72))
if(k+144.le.NHSYM) then
t=t + s(i+2*icos7(n),k+144)
t0=t0 + sum(s(i:i+12:2,k+144))
endif
enddo
t0=(t0-t)/6.0
sync2d(i,j)=t/t0
enddo
enddo
red=0.
do i=ia,ib
ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ
j0=ii(1)
jpeak(i)=j0
red(i)=sync2d(i,j0)
! write(52,3052) i*df,red(i),db(red(i))
!3052 format(3f12.3)
enddo
iz=ib-ia+1
call indexx(red(ia:ib),iz,indx)
ibase=indx(nint(0.40*iz)) - 1 + ia
base=red(ibase)
red=red/base
candidate0=0.
k=0
syncmin=4.0
do i=1,100
n=ia + indx(iz+1-i) - 1
if(red(n).lt.syncmin) exit
k=k+1
candidate0(1,k)=n*df
candidate0(2,k)=(jpeak(n)-1)*tstep
candidate0(3,k)=red(n)
enddo
ncand=k
! Put nfqso at top of list, and save only the best of near-dupe freqs.
do i=1,ncand
if(abs(candidate0(1,i)-nfqso).lt.10.0) candidate0(1,i)=-candidate0(1,i)
if(i.ge.2) then
do j=1,i-1
fdiff=abs(candidate0(1,i))-abs(candidate0(1,j))
if(abs(fdiff).lt.4.0) then
if(candidate0(3,i).ge.candidate0(3,j)) candidate0(3,j)=0.
if(candidate0(3,i).lt.candidate0(3,j)) candidate0(3,i)=0.
endif
enddo
! write(*,3001) i,candidate0(1,i-1),candidate0(1,i),candidate0(3,i-1), &
! candidate0(3,i)
!3001 format(i2,4f8.1)
endif
enddo
fac=20.0/maxval(s)
s=fac*s
call indexx(candidate0(1,1:ncand),ncand,indx)
do i=1,ncand
j=indx(i)
candidate(1,i)=abs(candidate0(1,j))
candidate(2,i)=candidate0(2,j)
candidate(3,i)=candidate0(3,j)
enddo
return
end subroutine sync8
@@ -0,0 +1,108 @@
// (C) Copyright Gennadiy Rozental 2001.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile$
//
// Version : $Revision$
//
// Description : implements fetching absent parameter athuments from environment
// ***************************************************************************
#ifndef BOOST_TEST_UTILS_RUNTIME_ENV_FETCH_HPP
#define BOOST_TEST_UTILS_RUNTIME_ENV_FETCH_HPP
// Boost.Test Runtime parameters
#include <boost/test/utils/runtime/parameter.hpp>
#include <boost/test/utils/runtime/argument.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
// C Runtime
#include <stdlib.h>
namespace boost {
namespace runtime {
namespace env {
namespace env_detail {
#ifndef UNDER_CE
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4996) // getenv
#endif
inline std::pair<cstring,bool>
sys_read_var( cstring var_name )
{
using namespace std;
char const* res = getenv( var_name.begin() );
return std::make_pair( cstring(res), res != NULL );
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#else
inline std::pair<cstring,bool>
sys_read_var( cstring var_name )
{
return std::make_pair( cstring(), false );
}
#endif
//____________________________________________________________________________//
template<typename ReadFunc>
inline void
fetch_absent( parameters_store const& params, runtime::arguments_store& args, ReadFunc read_func )
{
BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) {
basic_param_ptr param = v.second;
if( args.has( param->p_name ) || param->p_env_var.empty() )
continue;
std::pair<cstring,bool> value = read_func( param->p_env_var );
if( !value.second )
continue;
// Validate against unexpected empty value
BOOST_TEST_I_ASSRT( !value.first.is_empty() || param->p_has_optional_value,
format_error( param->p_name )
<< "Missing an argument value for the parameter " << param->p_name
<< " in the environment." );
// Produce argument value
param->produce_argument( value.first, false, args );
}
}
//____________________________________________________________________________//
} // namespace env_detail
inline void
fetch_absent( parameters_store const& params, runtime::arguments_store& args )
{
env_detail::fetch_absent( params, args, &env_detail::sys_read_var );
}
} // namespace env
} // namespace runtime
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_UTILS_RUNTIME_ENV_FETCH_HPP
@@ -0,0 +1,43 @@
Es/No P(word error)
----------------------
0.0 0.9008E+00 0.1000E+01
0.5 0.8877E+00 0.1000E+01
1.0 0.8724E+00 0.1000E+01
1.5 0.8545E+00 0.1000E+01
2.0 0.8338E+00 0.9999E+00
2.5 0.8096E+00 0.9991E+00
3.0 0.7817E+00 0.9944E+00
3.5 0.7496E+00 0.9713E+00
4.0 0.7128E+00 0.8887E+00
4.5 0.6712E+00 0.6883E+00
5.0 0.6246E+00 0.3865E+00
5.5 0.5731E+00 0.1310E+00
6.0 0.5170E+00 0.2215E-01
6.5 0.4572E+00 0.1536E-02
7.0 0.3949E+00 0.3562E-04
7.5 0.3316E+00 0.2223E-06
8.0 0.2696E+00 0.2951E-09
8.5 0.2109E+00 0.6449E-13
9.0 0.1578E+00 0.1758E-17
9.5 0.1121E+00 0.4426E-23
10.0 0.7499E-01 0.7428E-30
10.5 0.4684E-01 -.1733E-32
11.0 0.2703E-01 0.1348E-32
11.5 0.1426E-01 0.2985E-32
12.0 0.6789E-02 -.1348E-32
12.5 0.2879E-02 -.1733E-32
13.0 0.1072E-02 -.2119E-32
13.5 0.3448E-03 0.3081E-32
14.0 0.9421E-04 0.3852E-33
14.5 0.2148E-04 -.1156E-32
15.0 0.4006E-05 -.1733E-32
15.5 0.5984E-06 0.2215E-32
16.0 0.6994E-07 -.4430E-32
16.5 0.6230E-08 -.3081E-32
17.0 0.4105E-09 -.2889E-32
17.5 0.1934E-10 -.1926E-33
18.0 0.6266E-12 0.3852E-32
18.5 0.1335E-13 -.1926E-33
19.0 0.1777E-15 0.2119E-32
19.5 0.1396E-17 0.1733E-32
20.0 0.6076E-20 -.3852E-33
@@ -0,0 +1,13 @@
/*=============================================================================
Copyright (c) 2001-2007 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_INCLUDE_ZIP_VIEW)
#define FUSION_INCLUDE_ZIP_VIEW
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/zip_view.hpp>
#endif
@@ -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_SET_SIZE <= 10
#include <boost/fusion/container/set/detail/cpp03/preprocessed/as_set10.hpp>
#elif FUSION_MAX_SET_SIZE <= 20
#include <boost/fusion/container/set/detail/cpp03/preprocessed/as_set20.hpp>
#elif FUSION_MAX_SET_SIZE <= 30
#include <boost/fusion/container/set/detail/cpp03/preprocessed/as_set30.hpp>
#elif FUSION_MAX_SET_SIZE <= 40
#include <boost/fusion/container/set/detail/cpp03/preprocessed/as_set40.hpp>
#elif FUSION_MAX_SET_SIZE <= 50
#include <boost/fusion/container/set/detail/cpp03/preprocessed/as_set50.hpp>
#else
#error "FUSION_MAX_SET_SIZE out of bounds for preprocessed headers"
#endif
@@ -0,0 +1,38 @@
subroutine libration(jd,RA,Dec,xl,b)
! Compute optical libration of moon at jd: that is, the sub-observer
! point (xl,b) in selenographic coordinates. RA and Dec are
! topocentric values.
implicit real*8 (a-h,o-z)
parameter (RADS=0.0174532925199433d0)
parameter (TWOPI=6.28318530717959d0)
real*8 jd,j2000,mjd,lambda
j2000=2451545.0d0
RA2000=RA
Dec2000=Dec
year=2000.0d0 + (jd-j2000)/365.25d0
mjd=jd-2400000.d0
call sla_PRECES('FK5',year,2000.d0,RA2000,Dec2000)
call sla_EQECL(RA2000,Dec2000,mjd,lambda,beta)
day=jd - j2000
t = day / 36525.d0
xi = 1.54242 * RADS
ft = 93.2720993 + 483202.0175273 * t - .0034029 * t * t
b= ft / 360
a = 360 * (b - floor(b))
if (a.lt.0.d0) a = 360 + a;
f=a/57.2957795131d0
omega=sla_dranrm(2.182439196d0 - t*33.7570446085d0 + t*t*3.6236526d-5)
w = lambda - omega
y = sin(w) * cos(beta) * cos(xi) - sin(beta) * sin(xi)
x = cos(w) * cos(beta)
a = sla_dranrm(atan2(y, x))
xl = a - f
if(xl.lt.-0.25*TWOPI) xl=xl+TWOPI !Fix 'round the back' angles
if(xl.gt.0.25*TWOPI) xl=xl-TWOPI
b = asin(-sin(w) * cos(beta) * sin(xi) - sin(beta) * cos(xi))
return
end subroutine libration
@@ -0,0 +1,99 @@
/*=============================================================================
Copyright (c) 2006-2007 Tobias Schwinger
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).
==============================================================================*/
#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_DETAIL_THAT_PTR_HPP_INCLUDED)
#define BOOST_FUSION_FUNCTIONAL_INVOCATION_DETAIL_THAT_PTR_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/get_pointer.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Wanted>
struct that_ptr
{
private:
typedef typename remove_reference<Wanted>::type pointee;
template <typename T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static inline pointee * do_get_pointer(T &, pointee * x)
{
return x;
}
template <typename T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static inline pointee * do_get_pointer(T & x, void const *)
{
return get_pointer(x);
}
public:
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static inline pointee * get(pointee * x)
{
return x;
}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static inline pointee * get(pointee & x)
{
return boost::addressof(x);
}
template <typename T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static inline pointee * get(T & x)
{
return do_get_pointer(x, boost::addressof(x));
}
};
template <typename PtrOrSmartPtr> struct non_const_pointee;
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
# define BOOST_FUSION_TRAIT_DECL __cdecl
#else
# define BOOST_FUSION_TRAIT_DECL /**/
#endif
namespace adl_barrier
{
using boost::get_pointer;
void const * BOOST_FUSION_TRAIT_DECL get_pointer(...); // fallback
template< typename T> char const_tester(T *);
template< typename T> long const_tester(T const *);
template <typename Ptr>
struct non_const_pointee_impl
{
static Ptr & what;
static bool const value =
sizeof(const_tester(get_pointer(what))) == 1;
};
}
template <typename PtrOrSmartPtr> struct non_const_pointee
: adl_barrier::non_const_pointee_impl<
typename remove_cv<
typename remove_reference<PtrOrSmartPtr>::type >::type >
{
typedef non_const_pointee type;
typedef bool value_type;
};
}}}
#endif
@@ -0,0 +1,138 @@
program msk144d2
! Test the msk144 decoder for WSJT-X
use options
use timer_module, only: timer
use timer_impl, only: init_timer
use readwav
character c
character*80 line
character*512 datadir
character*500 infile
character*12 mycall,hiscall
character*6 mygrid
character(len=500) optarg
logical :: display_help=.false.
logical*1 bShMsgs
logical*1 bcontest
logical*1 btrain
logical*1 bswl
type(wav_header) :: wav
integer*2 id2(30*12000)
integer*2 ichunk(7*1024)
real*8 pcoeffs(5)
type (option) :: long_options(9) = [ &
option ('ndepth',.true.,'c','ndepth',''), &
option ('dxcall',.true.,'d','hiscall',''), &
option ('evemode',.true.,'e','Must be used with -s.',''), &
option ('frequency',.true.,'f','rxfreq',''), &
option ('help',.false.,'h','Display this help message',''), &
option ('mycall',.true.,'m','mycall',''), &
option ('nftol',.true.,'n','nftol',''), &
option ('rxequalize',.false.,'r','Rx Equalize',''), &
option ('short',.false.,'s','enable Sh','') &
]
t0=0.0
ndepth=3
ntol=100
nrxfreq=1500
mycall=''
mygrid='EN50WC'
hiscall=''
bShMsgs=.false.
bcontest=.false.
btrain=.false.
bswl=.false.
datadir='.'
pcoeffs=0.d0
do
call getopt('c:d:ef:hm:n:rs',long_options,c,optarg,narglen,nstat,noffset,nremain,.true.)
if( nstat .ne. 0 ) then
exit
end if
select case (c)
case ('c')
read (optarg(:narglen), *) ndepth
case ('d')
read (optarg(:narglen), *) hiscall
case ('e')
bswl=.true.
case ('f')
read (optarg(:narglen), *) nrxfreq
case ('h')
display_help = .true.
case ('m')
read (optarg(:narglen), *) mycall
case ('n')
read (optarg(:narglen), *) ntol
case ('r')
btrain=.true.
case ('s')
bShMsgs=.true.
end select
end do
if(display_help .or. nstat.lt.0 .or. nremain.lt.1) then
print *, ''
print *, 'Usage: msk144d [OPTIONS] file1 [file2 ...]'
print *, ''
print *, ' msk144 decode pre-recorded .WAV file(s)'
print *, ''
print *, 'OPTIONS:'
do i = 1, size (long_options)
call long_options(i) % print (6)
end do
go to 999
endif
call init_timer ('timer.out')
call timer('msk144 ',0)
ndecoded=0
do ifile=noffset+1,noffset+nremain
call get_command_argument(ifile,optarg,narglen)
infile=optarg(:narglen)
call timer('read ',0)
call wav%read (infile)
i1=index(infile,'.wav')
if( i1 .eq. 0 ) i1=index(infile,'.WAV')
read(infile(i1-6:i1-1),*,err=998) nutc
inquire(FILE=infile,SIZE=isize)
npts=min((isize-216)/2,360000)
read(unit=wav%lun) id2(1:npts)
close(unit=wav%lun)
call timer('read ',1)
do i=1,npts-7*1024+1,7*512
ichunk=id2(i:i+7*1024-1)
tsec=(i-1)/12000.0
tt=sum(float(abs(id2(i:i+7*512-1))))
if( tt .ne. 0.0 ) then
call mskrtd(ichunk,nutc,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall,bShMsgs, &
bcontest,btrain,pcoeffs,bswl,datadir,line)
if( index(line,"&") .ne. 0 .or. &
index(line,"^") .ne. 0 .or. &
index(line,"!") .ne. 0 .or. &
index(line,"@") .ne. 0 ) then
write(*,*) line
endif
endif
enddo
enddo
call timer('msk144 ',1)
call timer('msk144 ',101)
go to 999
998 print*,'Cannot read from file:'
print*,infile
999 continue
end program msk144d2
@@ -0,0 +1,41 @@
#ifndef BOOST_MPL_DEREF_HPP_INCLUDED
#define BOOST_MPL_DEREF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2002-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_/msvc_type.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/config/eti.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Iterator)
>
struct deref
{
#if !defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG)
typedef typename Iterator::type type;
#else
typedef typename aux::msvc_type<Iterator>::type type;
#endif
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,deref,(Iterator))
};
BOOST_MPL_AUX_NA_SPEC(1, deref)
}}
#endif // BOOST_MPL_DEREF_HPP_INCLUDED
@@ -0,0 +1,88 @@
//---------------------------------------------------------------------------//
// 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_EXCEPTION_CONTEXT_ERROR_HPP
#define BOOST_COMPUTE_EXCEPTION_CONTEXT_ERROR_HPP
#include <exception>
namespace boost {
namespace compute {
class context;
/// \class context_error
/// \brief A run-time OpenCL context error.
///
/// The context_error exception is thrown when the OpenCL context encounters
/// an error condition. Boost.Compute is notified of these error conditions by
/// registering an error handler when creating context objects (via the
/// \c pfn_notify argument to the \c clCreateContext() function).
///
/// This exception is different than the opencl_error exception which is thrown
/// as a result of error caused when calling a single OpenCL API function.
///
/// \see opencl_error
class context_error : public std::exception
{
public:
/// Creates a new context error exception object.
context_error(const context *context,
const char *errinfo,
const void *private_info,
size_t private_info_size) throw()
: m_context(context),
m_errinfo(errinfo),
m_private_info(private_info),
m_private_info_size(private_info_size)
{
}
/// Destroys the context error object.
~context_error() throw()
{
}
/// Returns a string with a description of the error.
const char* what() const throw()
{
return m_errinfo;
}
/// Returns a pointer to the context object which generated the error
/// notification.
const context* get_context_ptr() const throw()
{
return m_context;
}
/// Returns a pointer to the private info memory block.
const void* get_private_info_ptr() const throw()
{
return m_private_info;
}
/// Returns the size of the private info memory block.
size_t get_private_info_size() const throw()
{
return m_private_info_size;
}
private:
const context *m_context;
const char *m_errinfo;
const void *m_private_info;
size_t m_private_info_size;
};
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_EXCEPTION_CONTEXT_ERROR_HPP
@@ -0,0 +1,82 @@
#ifndef WSJTX_UDP_CLIENT_WIDGET_MODEL_HPP__
#define WSJTX_UDP_CLIENT_WIDGET_MODEL_HPP__
#include <QObject>
#include <QSortFilterProxyModel>
#include <QString>
#include <QRegularExpression>
#include <QtWidgets>
#include "MessageServer.hpp"
class QAbstractItemModel;
class QModelIndex;
using Frequency = MessageServer::Frequency;
class ClientWidget
: public QDockWidget
{
Q_OBJECT;
public:
explicit ClientWidget (QAbstractItemModel * decodes_model, QAbstractItemModel * beacons_model
, QString const& id, QString const& version, QString const& revision
, QWidget * parent = nullptr);
bool fast_mode () const {return fast_mode_;}
Q_SLOT void update_status (QString const& id, Frequency f, 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_added (bool is_new, QString const& client_id, QTime, qint32 snr
, float delta_time, quint32 delta_frequency, QString const& mode
, QString const& message, bool low_confidence);
Q_SLOT void beacon_spot_added (bool is_new, QString const& client_id, QTime, qint32 snr
, float delta_time, Frequency delta_frequency, qint32 drift
, QString const& callsign, QString const& grid, qint32 power);
Q_SIGNAL void do_reply (QModelIndex const&);
Q_SIGNAL void do_halt_tx (QString const& id, bool auto_only);
Q_SIGNAL void do_free_text (QString const& id, QString const& text, bool);
private:
QString id_;
class IdFilterModel final
: public QSortFilterProxyModel
{
public:
IdFilterModel (QString const& client_id);
void de_call (QString const&);
void rx_df (int);
QVariant data (QModelIndex const& proxy_index, int role = Qt::DisplayRole) const override;
protected:
bool filterAcceptsRow (int source_row, QModelIndex const& source_parent) const override;
private:
QString client_id_;
QString call_;
QRegularExpression base_call_re_;
int rx_df_;
} decodes_proxy_model_;
QTableView * decodes_table_view_;
QTableView * beacons_table_view_;
QLineEdit * message_line_edit_;
QStackedLayout * decodes_stack_;
QAbstractButton * auto_off_button_;
QAbstractButton * halt_tx_button_;
QLabel * mode_label_;
bool fast_mode_;
QLabel * frequency_label_;
QLabel * dx_label_;
QLabel * rx_df_label_;
QLabel * tx_df_label_;
QLabel * report_label_;
};
#endif
@@ -0,0 +1,58 @@
//-----------------------------------------------------------------------------
// boost variant/detail/substitute_fwd.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2003
// Eric Friedman
//
// 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_VARIANT_DETAIL_SUBSTITUTE_FWD_HPP
#define BOOST_VARIANT_DETAIL_SUBSTITUTE_FWD_HPP
#include <boost/mpl/aux_/lambda_arity_param.hpp>
#include <boost/mpl/aux_/template_arity.hpp>
#include <boost/mpl/int_fwd.hpp>
///////////////////////////////////////////////////////////////////////////////
// BOOST_VARIANT_DETAIL_NO_SUBSTITUTE
//
// Defined if 'substitute' is not implementable on the current compiler.
//
#include <boost/mpl/aux_/config/ctps.hpp>
#include <boost/mpl/aux_/config/ttp.hpp>
#if defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
&& !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
# define BOOST_VARIANT_DETAIL_NO_SUBSTITUTE
#endif
namespace boost {
namespace detail { namespace variant {
#if !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
///////////////////////////////////////////////////////////////////////////////
// metafunction substitute
//
// Substitutes one type for another in the given type expression.
//
template <
typename T, typename Dest, typename Source
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(
typename Arity = mpl::int_< mpl::aux::template_arity<T>::value >
)
>
struct substitute;
#endif // !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
}} // namespace detail::variant
} // namespace boost
#endif // BOOST_VARIANT_DETAIL_SUBSTITUTE_FWD_HPP
@@ -0,0 +1,45 @@
#ifndef BOOST_MPL_IDENTITY_HPP_INCLUDED
#define BOOST_MPL_IDENTITY_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_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct identity
{
typedef T type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1, identity, (T))
};
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct make_identity
{
typedef identity<T> type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1, make_identity, (T))
};
BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, identity)
BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, make_identity)
}}
#endif // BOOST_MPL_IDENTITY_HPP_INCLUDED
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

@@ -0,0 +1,76 @@
subroutine cpolyfit(c,pp,id,maxn,aa,bb,zz,nhardsync)
parameter (KK=84) !Information bits (72 + CRC12)
parameter (ND=168) !Data symbols: LDPC (168,84), r=1/2
parameter (NS=65) !Sync symbols (2 x 26 + Barker 13)
parameter (NR=3) !Ramp up/down
parameter (NN=NR+NS+ND) !Total symbols (236)
parameter (NSPS=16) !Samples per MSK symbol (16)
parameter (N2=2*NSPS) !Samples per OQPSK symbol (32)
parameter (N13=13*N2) !Samples in central sync vector (416)
parameter (NZ=NSPS*NN) !Samples in baseband waveform (3760)
parameter (NFFT1=4*NSPS,NH1=NFFT1/2)
complex c(0:NZ-1) !Complex waveform
complex zz(NS+ND) !Complex symbol values (intermediate)
complex z,z0
real x(NS),yi(NS),yq(NS) !For complex polyfit
real pp(2*NSPS) !Shaped pulse for OQPSK
real aa(20),bb(20) !Fitted polyco's
integer id(NS+ND) !NRZ values (+/-1) for Sync and Data
ib=NSPS-1
ib2=N2-1
n=0
do j=1,117 !First-pass demodulation
ia=ib+1
ib=ia+N2-1
zz(j)=sum(pp*c(ia:ib))/NSPS
if(abs(id(j)).eq.2) then !Save all sync symbols
n=n+1
x(n)=float(ia+ib)/NZ - 1.0
yi(n)=real(zz(j))*0.5*id(j)
yq(n)=aimag(zz(j))*0.5*id(j)
! write(54,1225) n,x(n),yi(n),yq(n)
!1225 format(i5,3f12.4)
endif
if(j.le.116) then
zz(j+117)=sum(pp*c(ia+NSPS:ib+NSPS))/NSPS
endif
enddo
aa=0.
bb=0.
nterms=0
chisqa=0.
chisqb=0.
if(maxn.gt.0) then
npts=n
mode=0
nterms=maxn
call polyfit4(x,yi,yi,npts,nterms,mode,aa,chisqa)
call polyfit4(x,yq,yq,npts,nterms,mode,bb,chisqb)
endif
nhardsync=0
do j=1,117
if(abs(id(j)).ne.2) cycle
xx=j*2.0/117.0 - 1.0
yii=1.
yqq=0.
if(nterms.gt.0) then
yii=aa(1)
yqq=bb(1)
do i=2,nterms
yii=yii + aa(i)*xx**(i-1)
yqq=yqq + bb(i)*xx**(i-1)
enddo
endif
z0=cmplx(yii,yqq)
z=zz(j)*conjg(z0)
p=real(z)
if(p*id(j).lt.0) nhardsync=nhardsync+1
enddo
return
end subroutine cpolyfit
@@ -0,0 +1,624 @@
// -*- Mode: C++ -*-
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#ifdef QT5
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QThread>
#include <QTimer>
#include <QDateTime>
#include <QList>
#include <QAudioDeviceInfo>
#include <QScopedPointer>
#include <QDir>
#include <QProgressDialog>
#include <QAbstractSocket>
#include <QHostAddress>
#include <QPointer>
#include <QSet>
#include <QVector>
#include <QFuture>
#include <QFutureWatcher>
#include "AudioDevice.hpp"
#include "commons.h"
#include "Radio.hpp"
#include "Modes.hpp"
#include "FrequencyList.hpp"
#include "Configuration.hpp"
#include "WSPRBandHopping.hpp"
#include "Transceiver.hpp"
#include "DisplayManual.hpp"
#include "psk_reporter.h"
#include "logbook/logbook.h"
#include "decodedtext.h"
#include "commons.h"
#include "astro.h"
#include "MessageBox.hpp"
#include "NetworkAccessManager.hpp"
#define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync
#define NUM_JT65_SYMBOLS 126 //63 data + 63 sync
#define NUM_JT9_SYMBOLS 85 //69 data + 16 sync
#define NUM_WSPR_SYMBOLS 162 //(50+31)*2, embedded sync
#define NUM_WSPR_LF_SYMBOLS 412 //300 data + 109 sync + 3 ramp
#define NUM_ISCAT_SYMBOLS 1291 //30*11025/256
#define NUM_MSK144_SYMBOLS 144 //s8 + d48 + s8 + d80
#define NUM_QRA64_SYMBOLS 84 //63 data + 21 sync
#define NUM_FT8_SYMBOLS 79
#define NUM_CW_SYMBOLS 250
#define TX_SAMPLE_RATE 48000
#define N_WIDGETS 24
extern int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
extern int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID
//--------------------------------------------------------------- MainWindow
namespace Ui {
class MainWindow;
}
class QSettings;
class QLineEdit;
class QFont;
class QHostInfo;
class EchoGraph;
class FastGraph;
class WideGraph;
class LogQSO;
class Transceiver;
class MessageAveraging;
class MessageClient;
class QTime;
class WSPRBandHopping;
class HelpTextWindow;
class WSPRNet;
class SoundOutput;
class Modulator;
class SoundInput;
class Detector;
class SampleDownloader;
class MultiSettings;
class PhaseEqualizationDialog;
class MainWindow : public QMainWindow
{
Q_OBJECT;
public:
using Frequency = Radio::Frequency;
using FrequencyDelta = Radio::FrequencyDelta;
using Mode = Modes::Mode;
explicit MainWindow(QDir const& temp_directory, bool multiple, MultiSettings *,
QSharedMemory *shdmem, unsigned downSampleFactor,
QSplashScreen *,
QWidget *parent = nullptr);
~MainWindow();
public slots:
void showSoundInError(const QString& errorMsg);
void showSoundOutError(const QString& errorMsg);
void showStatusMessage(const QString& statusMsg);
void dataSink(qint64 frames);
void fastSink(qint64 frames);
void diskDat();
void freezeDecode(int n);
void guiUpdate();
void doubleClickOnCall(bool shift, bool ctrl);
void doubleClickOnCall2(bool shift, bool ctrl);
void readFromStdout();
void p1ReadFromStdout();
void setXIT(int n, Frequency base = 0u);
void setFreq4(int rxFreq, int txFreq);
void msgAvgDecode2();
void fastPick(int x0, int x1, int y);
protected:
void keyPressEvent (QKeyEvent *) override;
void closeEvent(QCloseEvent *) override;
void childEvent(QChildEvent *) override;
bool eventFilter(QObject *, QEvent *) override;
private slots:
void on_tx1_editingFinished();
void on_tx2_editingFinished();
void on_tx3_editingFinished();
void on_tx4_editingFinished();
void on_tx5_currentTextChanged (QString const&);
void on_tx6_editingFinished();
void on_actionSettings_triggered();
void on_monitorButton_clicked (bool);
void on_actionAbout_triggered();
void on_autoButton_clicked (bool);
void on_stopTxButton_clicked();
void on_stopButton_clicked();
void on_actionRelease_Notes_triggered ();
void on_actionOnline_User_Guide_triggered();
void on_actionLocal_User_Guide_triggered();
void on_actionWide_Waterfall_triggered();
void on_actionOpen_triggered();
void on_actionOpen_next_in_directory_triggered();
void on_actionDecode_remaining_files_in_directory_triggered();
void on_actionDelete_all_wav_files_in_SaveDir_triggered();
void on_actionOpen_log_directory_triggered ();
void on_actionNone_triggered();
void on_actionSave_all_triggered();
void on_actionKeyboard_shortcuts_triggered();
void on_actionSpecial_mouse_commands_triggered();
void on_DecodeButton_clicked (bool);
void decode();
void decodeBusy(bool b);
void on_EraseButton_clicked();
void on_txFirstCheckBox_stateChanged(int arg1);
void set_dateTimeQSO(int m_ntx);
void set_ntx(int n);
void on_txrb1_toggled(bool status);
void on_txrb2_toggled(bool status);
void on_txrb3_toggled(bool status);
void on_txrb4_toggled(bool status);
void on_txrb5_toggled(bool status);
void on_txrb6_toggled(bool status);
void on_txb1_clicked();
void on_txb2_clicked();
void on_txb3_clicked();
void on_txb4_clicked();
void on_txb5_clicked();
void on_txb6_clicked();
void on_lookupButton_clicked();
void on_addButton_clicked();
void on_dxCallEntry_textChanged (QString const&);
void on_dxGridEntry_textChanged (QString const&);
void on_dxCallEntry_returnPressed ();
void on_genStdMsgsPushButton_clicked();
void on_logQSOButton_clicked();
void on_actionJT9_triggered();
void on_actionJT65_triggered();
void on_actionJT9_JT65_triggered();
void on_actionJT4_triggered();
void on_actionFT8_triggered();
void on_TxFreqSpinBox_valueChanged(int arg1);
void on_actionSave_decoded_triggered();
void on_actionQuickDecode_toggled (bool);
void on_actionMediumDecode_toggled (bool);
void on_actionDeepestDecode_toggled (bool);
void on_inGain_valueChanged(int n);
void bumpFqso(int n);
void on_actionErase_ALL_TXT_triggered();
void on_actionErase_wsjtx_log_adi_triggered();
void startTx2();
void startP1();
void stopTx();
void stopTx2();
void on_pbCallCQ_clicked();
void on_pbAnswerCaller_clicked();
void on_pbSendRRR_clicked();
void on_pbAnswerCQ_clicked();
void on_pbSendReport_clicked();
void on_pbSend73_clicked();
void on_rbGenMsg_clicked(bool checked);
void on_rbFreeText_clicked(bool checked);
void on_freeTextMsg_currentTextChanged (QString const&);
void on_rptSpinBox_valueChanged(int n);
void killFile();
void on_tuneButton_clicked (bool);
void on_pbR2T_clicked();
void on_pbT2R_clicked();
void acceptQSO2(QDateTime const&, QString const& call, QString const& grid
, Frequency dial_freq, QString const& mode
, QString const& rpt_sent, QString const& rpt_received
, QString const& tx_power, QString const& comments
, QString const& name, QDateTime const&);
void on_bandComboBox_currentIndexChanged (int index);
void on_bandComboBox_activated (int index);
void on_readFreq_clicked();
void on_pbTxMode_clicked();
void on_RxFreqSpinBox_valueChanged(int n);
void on_cbTxLock_clicked(bool checked);
void on_outAttenuation_valueChanged (int);
void rigOpen ();
void handle_transceiver_update (Transceiver::TransceiverState const&);
void handle_transceiver_failure (QString const& reason);
void on_actionAstronomical_data_toggled (bool);
void on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered();
void band_changed (Frequency);
void monitor (bool);
void stop_tuning ();
void stopTuneATU();
void auto_tx_mode(bool);
void on_actionMessage_averaging_triggered();
void on_actionInclude_averaging_toggled (bool);
void on_actionInclude_correlation_toggled (bool);
void on_actionEnable_AP_DXcall_toggled (bool);
void VHF_features_enabled(bool b);
void on_sbSubmode_valueChanged(int n);
void on_cbShMsgs_toggled(bool b);
void on_cbSWL_toggled(bool b);
void on_cbTx6_toggled(bool b);
void on_cbMenus_toggled(bool b);
void on_cbFirst_toggled(bool b);
void on_cbWeak_toggled(bool b);
void networkError (QString const&);
void on_ClrAvgButton_clicked();
void on_actionWSPR_triggered();
void on_actionWSPR_LF_triggered();
void on_syncSpinBox_valueChanged(int n);
void on_TxPowerComboBox_currentIndexChanged(const QString &arg1);
void on_sbTxPercent_valueChanged(int n);
void on_cbUploadWSPR_Spots_toggled(bool b);
void WSPR_config(bool b);
void uploadSpots();
void TxAgain();
void uploadResponse(QString response);
void on_WSPRfreqSpinBox_valueChanged(int n);
void on_pbTxNext_clicked(bool b);
void on_actionEcho_Graph_triggered();
void on_actionEcho_triggered();
void on_actionISCAT_triggered();
void on_actionFast_Graph_triggered();
void fast_decode_done();
void on_actionMeasure_reference_spectrum_triggered();
void on_actionErase_reference_spectrum_triggered();
void on_actionMeasure_phase_response_triggered();
void on_sbTR_valueChanged (int);
void on_sbFtol_valueChanged (int);
void on_cbFast9_clicked(bool b);
void on_sbCQTxFreq_valueChanged(int n);
void on_cbCQTx_toggled(bool b);
void on_actionMSK144_triggered();
void on_actionQRA64_triggered();
void on_actionFreqCal_triggered();
void splash_done ();
private:
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
unsigned channels, unsigned msBuffered) const;
Q_SIGNAL void stopAudioOutputStream () const;
Q_SIGNAL void startAudioInputStream (QAudioDeviceInfo const&,
int framesPerBuffer, AudioDevice * sink,
unsigned downSampleFactor, AudioDevice::Channel) const;
Q_SIGNAL void suspendAudioInputStream () const;
Q_SIGNAL void resumeAudioInputStream () const;
Q_SIGNAL void startDetector (AudioDevice::Channel) const;
Q_SIGNAL void FFTSize (unsigned) const;
Q_SIGNAL void detectorClose () const;
Q_SIGNAL void finished () const;
Q_SIGNAL void transmitFrequency (double) const;
Q_SIGNAL void endTransmitMessage (bool quick = false) const;
Q_SIGNAL void tune (bool = true) const;
Q_SIGNAL void sendMessage (unsigned symbolsLength, double framesPerSymbol,
double frequency, double toneSpacing,
SoundOutput *, AudioDevice::Channel = AudioDevice::Mono,
bool synchronize = true, bool fastMode = false, double dBSNR = 99.,
int TRperiod=60) const;
Q_SIGNAL void outAttenuationChanged (qreal) const;
Q_SIGNAL void toggleShorthand () const;
private:
void astroUpdate ();
void writeAllTxt(QString message);
void FT8_AutoSeq(QString message);
void hideMenus(bool b);
NetworkAccessManager m_network_manager;
bool m_valid;
QSplashScreen * m_splash;
QString m_revision;
bool m_multiple;
MultiSettings * m_multi_settings;
QPushButton * m_configurations_button;
QSettings * m_settings;
QScopedPointer<Ui::MainWindow> ui;
// other windows
Configuration m_config;
WSPRBandHopping m_WSPR_band_hopping;
bool m_WSPR_tx_next;
MessageBox m_rigErrorMessageBox;
QScopedPointer<SampleDownloader> m_sampleDownloader;
QScopedPointer<PhaseEqualizationDialog> m_phaseEqualizationDialog;
QScopedPointer<WideGraph> m_wideGraph;
QScopedPointer<EchoGraph> m_echoGraph;
QScopedPointer<FastGraph> m_fastGraph;
QScopedPointer<LogQSO> m_logDlg;
QScopedPointer<Astro> m_astroWidget;
QScopedPointer<HelpTextWindow> m_shortcuts;
QScopedPointer<HelpTextWindow> m_prefixes;
QScopedPointer<HelpTextWindow> m_mouseCmnds;
QScopedPointer<MessageAveraging> m_msgAvgWidget;
Transceiver::TransceiverState m_rigState;
Frequency m_lastDialFreq;
QString m_lastBand;
Frequency m_dialFreqRxWSPR; // best guess at WSPR QRG
Detector * m_detector;
unsigned m_FFTSize;
SoundInput * m_soundInput;
Modulator * m_modulator;
SoundOutput * m_soundOutput;
QThread m_audioThread;
qint64 m_msErase;
qint64 m_secBandChanged;
qint64 m_freqMoon;
Frequency m_freqNominal;
Frequency m_freqTxNominal;
Astro::Correction m_astroCorrection;
double m_s6;
double m_tRemaining;
float m_DTtol;
float m_t0;
float m_t1;
float m_t0Pick;
float m_t1Pick;
float m_fCPUmskrtd;
qint32 m_waterfallAvg;
qint32 m_ntx;
bool m_gen_message_is_cq;
qint32 m_timeout;
qint32 m_XIT;
qint32 m_setftx;
qint32 m_ndepth;
qint32 m_sec0;
qint32 m_RxLog;
qint32 m_nutc0;
qint32 m_ntr;
qint32 m_tx;
qint32 m_hsym;
qint32 m_TRperiod;
qint32 m_nsps;
qint32 m_hsymStop;
qint32 m_inGain;
qint32 m_ncw;
qint32 m_secID;
qint32 m_idleMinutes;
qint32 m_nSubMode;
qint32 m_nclearave;
qint32 m_minSync;
qint32 m_dBm;
qint32 m_pctx;
qint32 m_nseq;
qint32 m_nWSPRdecodes;
qint32 m_k0;
qint32 m_kdone;
qint32 m_nPick;
FrequencyList::const_iterator m_frequency_list_fcal_iter;
qint32 m_nTx73;
qint32 m_UTCdisk;
qint32 m_wait;
bool m_btxok; //True if OK to transmit
bool m_diskData;
bool m_loopall;
bool m_decoderBusy;
bool m_txFirst;
bool m_auto;
bool m_restart;
bool m_startAnother;
bool m_saveDecoded;
bool m_saveAll;
bool m_widebandDecode;
bool m_call3Modified;
bool m_dataAvailable;
bool m_bDecoded;
bool m_noSuffix;
bool m_blankLine;
bool m_decodedText2;
bool m_freeText;
bool m_sentFirst73;
int m_currentMessageType;
QString m_currentMessage;
int m_lastMessageType;
QString m_lastMessageSent;
bool m_lockTxFreq;
bool m_bShMsgs;
bool m_bSWL;
bool m_uploadSpots;
bool m_uploading;
bool m_txNext;
bool m_grid6;
bool m_tuneup;
bool m_bTxTime;
bool m_rxDone;
bool m_bSimplex; // not using split even if it is available
bool m_bEchoTxOK;
bool m_bTransmittedEcho;
bool m_bEchoTxed;
bool m_bFastMode;
bool m_bFast9;
bool m_bFastDecodeCalled;
bool m_bDoubleClickAfterCQnnn;
bool m_bRefSpec;
bool m_bClearRefSpec;
bool m_bTrain;
bool m_bUseRef;
bool m_bFastDone;
bool m_bAltV;
bool m_bNoMoreFiles;
bool m_bQRAsyncWarned;
bool m_bDoubleClicked;
bool m_bCallingCQ;
int m_ihsym;
int m_nzap;
int m_npts8;
float m_px;
float m_pxmax;
float m_df3;
int m_iptt0;
bool m_btxok0;
int m_nsendingsh;
double m_onAirFreq0;
bool m_first_error;
char m_msg[100][80];
// labels in status bar
QLabel tx_status_label;
QLabel config_label;
QLabel mode_label;
QLabel last_tx_label;
QLabel auto_tx_label;
QLabel band_hopping_label;
QProgressBar progressBar;
QLabel watchdog_label;
QFuture<void> m_wav_future;
QFutureWatcher<void> m_wav_future_watcher;
QFutureWatcher<void> watcher3;
QFutureWatcher<QString> m_saveWAVWatcher;
QProcess proc_jt9;
QProcess p1;
QProcess p3;
WSPRNet *wsprNet;
QTimer m_guiTimer;
QTimer ptt1Timer; //StartTx delay
QTimer ptt0Timer; //StopTx delay
QTimer logQSOTimer;
QTimer killFileTimer;
QTimer tuneButtonTimer;
QTimer uploadTimer;
QTimer tuneATU_Timer;
QTimer TxAgainTimer;
QTimer minuteTimer;
QTimer splashTimer;
QTimer p1Timer;
QString m_path;
QString m_baseCall;
QString m_hisCall;
QString m_hisGrid;
QString m_appDir;
QString m_palette;
QString m_dateTime;
QString m_mode;
QString m_modeTx;
QString m_fnameWE; // save path without extension
QString m_rpt;
QString m_rptSent;
QString m_rptRcvd;
QString m_qsoStart;
QString m_qsoStop;
QString m_cmnd;
QString m_cmndP1;
QString m_msgSent0;
QString m_fileToSave;
QString m_calls;
QSet<QString> m_pfx;
QSet<QString> m_sfx;
QDateTime m_dateTimeQSOOn;
QSharedMemory *mem_jt9;
LogBook m_logBook;
DecodedText m_QSOText;
unsigned m_msAudioOutputBuffered;
unsigned m_framesAudioInputBuffered;
unsigned m_downSampleFactor;
QThread::Priority m_audioThreadPriority;
bool m_bandEdited;
bool m_splitMode;
bool m_monitoring;
bool m_tx_when_ready;
bool m_transmitting;
bool m_tune;
bool m_tx_watchdog; // true when watchdog triggered
bool m_block_pwr_tooltip;
bool m_PwrBandSetOK;
bool m_bVHFwarned;
Frequency m_lastMonitoredFrequency;
double m_toneSpacing;
int m_firstDecode;
QProgressDialog m_optimizingProgress;
QTimer m_heartbeat;
MessageClient * m_messageClient;
PSK_Reporter *psk_Reporter;
DisplayManual m_manual;
QHash<QString, QVariant> m_pwrBandTxMemory; // Remembers power level by band
QHash<QString, QVariant> m_pwrBandTuneMemory; // Remembers power level by band for tuning
QByteArray m_geometryNoControls;
QVector<double> m_phaseEqCoefficients;
//---------------------------------------------------- private functions
void readSettings();
void setDecodedTextFont (QFont const&);
void writeSettings();
void createStatusBar();
void updateStatusBar();
void genStdMsgs(QString rpt);
void genCQMsg();
void clearDX ();
void lookup();
void ba2msg(QByteArray ba, char* message);
void msgtype(QString t, QLineEdit* tx);
void stub();
void statusChanged();
void fixStop();
bool shortList(QString callsign);
void transmit (double snr = 99.);
void rigFailure (QString const& reason);
void pskSetLocal ();
void pskPost(DecodedText decodedtext);
void displayDialFrequency ();
void transmitDisplay (bool);
void processMessage(QString const& messages, qint32 position, bool ctrl);
void replyToCQ (QTime, qint32 snr, float delta_time, quint32 delta_frequency, QString const& mode, QString const& message_text);
void replayDecodes ();
void postDecode (bool is_new, QString const& message);
void postWSPRDecode (bool is_new, QStringList message_parts);
void enable_DXCC_entity (bool on);
void switch_mode (Mode);
void WSPR_scheduling ();
void freqCalStep();
void setRig (Frequency = 0); // zero frequency means no change
void WSPR_history(Frequency dialFreq, int ndecodes);
QString WSPR_hhmm(int n);
void fast_config(bool b);
void CQTxFreq();
QString save_wave_file (QString const& name
, short const * data
, int seconds
, QString const& my_callsign
, QString const& my_grid
, QString const& mode
, qint32 sub_mode
, Frequency frequency
, QString const& his_call
, QString const& his_grid) const;
void read_wav_file (QString const& fname);
void decodeDone ();
void subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus);
void subProcessError (QProcess *, QProcess::ProcessError);
void statusUpdate () const;
void update_watchdog_label ();
void on_the_minute ();
void add_child_to_event_filter (QObject *);
void remove_child_from_event_filter (QObject *);
void setup_status_bar (bool vhf);
void tx_watchdog (bool triggered);
int nWidgets(QString t);
void displayWidgets(int n);
void vhfWarning();
QChar current_submode () const; // returns QChar {0} if sub mode is
// not appropriate
void write_transmit_entry (QString const& file_name);
};
extern int killbyname(const char* progName);
extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
int minChan[], int maxChan[],
int minSpeed[], int maxSpeed[]);
extern int next_tx_state(int pctx);
#endif // MAINWINDOW_H
@@ -0,0 +1,99 @@
// 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/shift_right.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct shift_right_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< shift_right_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< shift_right_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct shift_right_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct shift_right_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct shift_right_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 shift_right_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct shift_right
: shift_right_impl<
typename shift_right_tag<N1>::type
, typename shift_right_tag<N2>::type
>::template apply< N1,N2 >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, shift_right, (N1, N2))
};
BOOST_MPL_AUX_NA_SPEC2(2, 2, shift_right)
}}
namespace boost { namespace mpl {
template<>
struct shift_right_impl< integral_c_tag,integral_c_tag >
{
template< typename N, typename S > struct apply
: integral_c<
typename N::value_type
, ( BOOST_MPL_AUX_VALUE_WKND(N)::value
>> BOOST_MPL_AUX_VALUE_WKND(S)::value
)
>
{
};
};
}}
@@ -0,0 +1,28 @@
// Copyright (C) 2013-2014 Vicente J. Botet Escriba
//
// 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)
//
// 2013/10 Vicente J. Botet Escriba
// Creation using interprocess::unique_ptr.
// 2014/09 Vicente J. Botet Escriba
// Adaptation to movelib::unique_ptr
#ifndef BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP
#define BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP
#include <boost/thread/csbl/memory/config.hpp>
#include <boost/move/unique_ptr.hpp>
#include <boost/move/make_unique.hpp>
namespace boost
{
namespace csbl
{
using ::boost::movelib::unique_ptr;
using ::boost::movelib::make_unique;
}
}
#endif // header
@@ -0,0 +1,522 @@
// (C) Copyright Gennadiy Rozental 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/test for the library home page.
//
//!@file
//!@brief CLA parser
// ***************************************************************************
#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_HPP
#define BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_HPP
// Boost.Test Runtime parameters
#include <boost/test/utils/runtime/argument.hpp>
#include <boost/test/utils/runtime/modifier.hpp>
#include <boost/test/utils/runtime/parameter.hpp>
#include <boost/test/utils/runtime/cla/argv_traverser.hpp>
// Boost.Test
#include <boost/test/utils/foreach.hpp>
#include <boost/test/utils/algorithm.hpp>
#include <boost/test/detail/throw_exception.hpp>
#include <boost/test/detail/global_typedef.hpp>
#include <boost/algorithm/cxx11/all_of.hpp> // !! ?? unnecessary after cxx11
// STL
// !! ?? #include <unordered_set>
#include <set>
#include <iostream>
#include <boost/test/detail/suppress_warnings.hpp>
namespace boost {
namespace runtime {
namespace cla {
// ************************************************************************** //
// ************** runtime::cla::parameter_trie ************** //
// ************************************************************************** //
namespace rt_cla_detail {
struct parameter_trie;
typedef shared_ptr<parameter_trie> parameter_trie_ptr;
typedef std::map<char,parameter_trie_ptr> trie_per_char;
typedef std::vector<boost::reference_wrapper<parameter_cla_id const> > param_cla_id_list;
struct parameter_trie {
parameter_trie() : m_has_final_candidate( false ) {}
/// If subtrie corresponding to the char c exists returns it otherwise creates new
parameter_trie_ptr make_subtrie( char c )
{
trie_per_char::const_iterator it = m_subtrie.find( c );
if( it == m_subtrie.end() )
it = m_subtrie.insert( std::make_pair( c, parameter_trie_ptr( new parameter_trie ) ) ).first;
return it->second;
}
/// Creates series of sub-tries per characters in a string
parameter_trie_ptr make_subtrie( cstring s )
{
parameter_trie_ptr res;
BOOST_TEST_FOREACH( char, c, s )
res = (res ? res->make_subtrie( c ) : make_subtrie( c ));
return res;
}
/// Registers candidate parameter for this subtrie. If final, it needs to be unique
void add_candidate_id( parameter_cla_id const& param_id, basic_param_ptr param_candidate, bool final )
{
BOOST_TEST_I_ASSRT( !m_has_final_candidate && (!final || m_id_candidates.empty()),
conflicting_param() << "Parameter cla id " << param_id.m_tag << " conflicts with the "
<< "parameter cla id " << m_id_candidates.back().get().m_tag );
m_has_final_candidate = final;
m_id_candidates.push_back( ref(param_id) );
if( m_id_candidates.size() == 1 )
m_param_candidate = param_candidate;
else
m_param_candidate.reset();
}
/// Gets subtrie for specified char if present or nullptr otherwise
parameter_trie_ptr get_subtrie( char c ) const
{
trie_per_char::const_iterator it = m_subtrie.find( c );
return it != m_subtrie.end() ? it->second : parameter_trie_ptr();
}
// Data members
trie_per_char m_subtrie;
param_cla_id_list m_id_candidates;
basic_param_ptr m_param_candidate;
bool m_has_final_candidate;
};
// ************************************************************************** //
// ************** runtime::cla::report_foreing_token ************** //
// ************************************************************************** //
static void
report_foreing_token( cstring program_name, cstring token )
{
std::cerr << "Boost.Test WARNING: token \"" << token << "\" does not correspond to the Boost.Test argument \n"
<< " and should be placed after all Boost.Test arguments and the -- separator.\n"
<< " For example: " << program_name << " --random -- " << token << "\n";
}
} // namespace rt_cla_detail
// ************************************************************************** //
// ************** runtime::cla::parser ************** //
// ************************************************************************** //
class parser {
public:
/// Initializes a parser and builds internal trie representation used for
/// parsing based on the supplied parameters
#ifndef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
template<typename Modifiers=nfp::no_params_type>
parser( parameters_store const& parameters, Modifiers const& m = nfp::no_params )
#else
template<typename Modifiers>
parser( parameters_store const& parameters, Modifiers const& m )
#endif
{
nfp::opt_assign( m_end_of_param_indicator, m, end_of_params );
nfp::opt_assign( m_negation_prefix, m, negation_prefix );
BOOST_TEST_I_ASSRT( algorithm::all_of( m_end_of_param_indicator.begin(),
m_end_of_param_indicator.end(),
parameter_cla_id::valid_prefix_char ),
invalid_cla_id() << "End of parameters indicator can only consist of prefix characters." );
BOOST_TEST_I_ASSRT( algorithm::all_of( m_negation_prefix.begin(),
m_negation_prefix.end(),
parameter_cla_id::valid_name_char ),
invalid_cla_id() << "Negation prefix can only consist of prefix characters." );
build_trie( parameters );
}
// input processing method
int
parse( int argc, char** argv, runtime::arguments_store& res )
{
// save program name for help message
m_program_name = argv[0];
cstring path_sep( "\\/" );
cstring::iterator it = unit_test::utils::find_last_of( m_program_name.begin(), m_program_name.end(),
path_sep.begin(), path_sep.end() );
if( it != m_program_name.end() )
m_program_name.trim_left( it + 1 );
// Set up the traverser
argv_traverser tr( argc, (char const**)argv );
// Loop till we reach end of input
while( !tr.eoi() ) {
cstring curr_token = tr.current_token();
cstring prefix;
cstring name;
cstring value_separator;
bool negative_form = false;
// Perform format validations and split the argument into prefix, name and separator
// False return value indicates end of params indicator is met
if( !validate_token_format( curr_token, prefix, name, value_separator, negative_form ) ) {
// get rid of "end of params" token
tr.next_token();
break;
}
// Locate trie corresponding to found prefix and skip it in the input
trie_ptr curr_trie = m_param_trie[prefix];
if( !curr_trie ) {
// format_error() << "Unrecognized parameter prefix in the argument " << tr.current_token()
rt_cla_detail::report_foreing_token( m_program_name, curr_token );
tr.save_token();
continue;
}
curr_token.trim_left( prefix.size() );
// Locate parameter based on a name and skip it in the input
locate_result locate_res = locate_parameter( curr_trie, name, curr_token );
parameter_cla_id const& found_id = locate_res.first;
basic_param_ptr found_param = locate_res.second;
if( negative_form ) {
BOOST_TEST_I_ASSRT( found_id.m_negatable,
format_error( found_param->p_name )
<< "Parameter tag " << found_id.m_tag << " is not negatable." );
curr_token.trim_left( m_negation_prefix.size() );
}
curr_token.trim_left( name.size() );
cstring value;
// Skip validations if parameter has optional value and we are at the end of token
if( !value_separator.is_empty() || !found_param->p_has_optional_value ) {
// Validate and skip value separator in the input
BOOST_TEST_I_ASSRT( found_id.m_value_separator == value_separator,
format_error( found_param->p_name )
<< "Invalid separator for the parameter "
<< found_param->p_name
<< " in the argument " << tr.current_token() );
curr_token.trim_left( value_separator.size() );
// Deduce value source
value = curr_token;
if( value.is_empty() ) {
tr.next_token();
value = tr.current_token();
}
BOOST_TEST_I_ASSRT( !value.is_empty(),
format_error( found_param->p_name )
<< "Missing an argument value for the parameter "
<< found_param->p_name
<< " in the argument " << tr.current_token() );
}
// Validate against argument duplication
BOOST_TEST_I_ASSRT( !res.has( found_param->p_name ) || found_param->p_repeatable,
duplicate_arg( found_param->p_name )
<< "Duplicate argument value for the parameter "
<< found_param->p_name
<< " in the argument " << tr.current_token() );
// Produce argument value
found_param->produce_argument( value, negative_form, res );
tr.next_token();
}
// generate the remainder and return it's size
return tr.remainder();
}
// help/usage/version
void
version( std::ostream& ostr )
{
ostr << "Boost.Test module ";
#if defined(BOOST_TEST_MODULE)
// we do not want to refer to the master test suite there
ostr << '\'' << BOOST_TEST_STRINGIZE( BOOST_TEST_MODULE ).trim( "\"" ) << "' ";
#endif
ostr << "in executable '" << m_program_name << "'\n";
ostr << "Compiled from Boost version "
<< BOOST_VERSION/100000 << "."
<< BOOST_VERSION/100 % 1000 << "."
<< BOOST_VERSION % 100 ;
ostr << " with ";
#if defined(BOOST_TEST_INCLUDED)
ostr << "single header inclusion of";
#elif defined(BOOST_TEST_DYN_LINK)
ostr << "dynamic linking to";
#else
ostr << "static linking to";
#endif
ostr << " Boost.Test\n";
ostr << "- Compiler: " << BOOST_COMPILER << '\n'
<< "- Platform: " << BOOST_PLATFORM << '\n'
<< "- STL : " << BOOST_STDLIB;
ostr << std::endl;
}
void
usage( std::ostream& ostr, cstring param_name = cstring() )
{
if( !param_name.is_empty() ) {
basic_param_ptr param = locate_parameter( m_param_trie[help_prefix], param_name, "" ).second;
param->usage( ostr, m_negation_prefix );
}
else {
ostr << "Usage: " << m_program_name << " [Boost.Test argument]... ";
if( !m_end_of_param_indicator.empty() )
ostr << m_end_of_param_indicator << " [custom test module argument]...";
ostr << "\n";
}
ostr << "\nFor detailed help on Boost.Test parameters use:\n"
<< " " << m_program_name << " --help\n"
<< "or\n"
<< " " << m_program_name << " --help=<parameter name>\n";
}
void
help( std::ostream& ostr, parameters_store const& parameters, cstring param_name )
{
if( !param_name.is_empty() ) {
basic_param_ptr param = locate_parameter( m_param_trie[help_prefix], param_name, "" ).second;
param->help( ostr, m_negation_prefix );
return;
}
ostr << "Usage: " << m_program_name << " [Boost.Test argument]... ";
if( !m_end_of_param_indicator.empty() )
ostr << m_end_of_param_indicator << " [custom test module argument]...";
ostr << "\n\nBoost.Test arguments correspond to parameters listed below. "
"All parameters are optional. You can use specify parameter value either "
"as a command line argument or as a value of corresponding environment "
"variable. In case if argument for the same parameter is specified in both "
"places, command line is taking precedence. Command line argument format "
"supports parameter name guessing, so you can use any unambiguous "
"prefix to identify a parameter.";
if( !m_end_of_param_indicator.empty() )
ostr << " All the arguments after the " << m_end_of_param_indicator << " are ignored by the Boost.Test.";
ostr << "\n\nBoost.Test supports following parameters:\n";
BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, parameters.all() ) {
basic_param_ptr param = v.second;
param->usage( ostr, m_negation_prefix );
}
ostr << "\nUse --help=<parameter name> to display detailed help for specific parameter.\n";
}
private:
typedef rt_cla_detail::parameter_trie_ptr trie_ptr;
typedef rt_cla_detail::trie_per_char trie_per_char;
typedef std::map<cstring,trie_ptr> str_to_trie;
void
build_trie( parameters_store const& parameters )
{
// Iterate over all parameters
BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, parameters.all() ) {
basic_param_ptr param = v.second;
// Register all parameter's ids in trie.
BOOST_TEST_FOREACH( parameter_cla_id const&, id, param->cla_ids() ) {
// This is the trie corresponding to the prefix.
trie_ptr next_trie = m_param_trie[id.m_prefix];
if( !next_trie )
next_trie = m_param_trie[id.m_prefix] = trie_ptr( new rt_cla_detail::parameter_trie );
// Build the trie, by following name's characters
// and register this parameter as candidate on each level
for( size_t index = 0; index < id.m_tag.size(); ++index ) {
next_trie = next_trie->make_subtrie( id.m_tag[index] );
next_trie->add_candidate_id( id, param, index == (id.m_tag.size() - 1) );
}
}
}
}
bool
validate_token_format( cstring token, cstring& prefix, cstring& name, cstring& separator, bool& negative_form )
{
// Match prefix
cstring::iterator it = token.begin();
while( it != token.end() && parameter_cla_id::valid_prefix_char( *it ) )
++it;
prefix.assign( token.begin(), it );
if( prefix.empty() )
return true;
// Match name
while( it != token.end() && parameter_cla_id::valid_name_char( *it ) )
++it;
name.assign( prefix.end(), it );
if( name.empty() ) {
if( prefix == m_end_of_param_indicator )
return false;
BOOST_TEST_I_THROW( format_error() << "Invalid format for an actual argument " << token );
}
// Match value separator
while( it != token.end() && parameter_cla_id::valid_separator_char( *it ) )
++it;
separator.assign( name.end(), it );
// Match negation prefix
negative_form = !m_negation_prefix.empty() && ( name.substr( 0, m_negation_prefix.size() ) == m_negation_prefix );
if( negative_form )
name.trim_left( m_negation_prefix.size() );
return true;
}
// C++03: cannot have references as types
typedef std::pair<parameter_cla_id, basic_param_ptr> locate_result;
locate_result
locate_parameter( trie_ptr curr_trie, cstring name, cstring token )
{
std::vector<trie_ptr> typo_candidates;
std::vector<trie_ptr> next_typo_candidates;
trie_ptr next_trie;
BOOST_TEST_FOREACH( char, c, name ) {
if( curr_trie ) {
// locate next subtrie corresponding to the char
next_trie = curr_trie->get_subtrie( c );
if( next_trie )
curr_trie = next_trie;
else {
// Initiate search for typo candicates. We will account for 'wrong char' typo
// 'missing char' typo and 'extra char' typo
BOOST_TEST_FOREACH( trie_per_char::value_type const&, typo_cand, curr_trie->m_subtrie ) {
// 'wrong char' typo
typo_candidates.push_back( typo_cand.second );
// 'missing char' typo
if( (next_trie = typo_cand.second->get_subtrie( c )) )
typo_candidates.push_back( next_trie );
}
// 'extra char' typo
typo_candidates.push_back( curr_trie );
curr_trie.reset();
}
}
else {
// go over existing typo candidates and see if they are still viable
BOOST_TEST_FOREACH( trie_ptr, typo_cand, typo_candidates ) {
trie_ptr next_typo_cand = typo_cand->get_subtrie( c );
if( next_typo_cand )
next_typo_candidates.push_back( next_typo_cand );
}
next_typo_candidates.swap( typo_candidates );
next_typo_candidates.clear();
}
}
if( !curr_trie ) {
std::vector<cstring> typo_candidate_names;
std::set<parameter_cla_id const*> unique_typo_candidate; // !! ?? unordered_set
typo_candidate_names.reserve( typo_candidates.size() );
// !! ?? unique_typo_candidate.reserve( typo_candidates.size() );
BOOST_TEST_FOREACH( trie_ptr, trie_cand, typo_candidates ) {
// avoid ambiguos candidate trie
if( trie_cand->m_id_candidates.size() > 1 )
continue;
BOOST_TEST_FOREACH( parameter_cla_id const&, param_cand, trie_cand->m_id_candidates ) {
if( !unique_typo_candidate.insert( &param_cand ).second )
continue;
typo_candidate_names.push_back( param_cand.m_tag );
}
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
BOOST_TEST_I_THROW( unrecognized_param( std::move(typo_candidate_names) )
<< "An unrecognized parameter in the argument "
<< token );
#else
BOOST_TEST_I_THROW( unrecognized_param( typo_candidate_names )
<< "An unrecognized parameter in the argument "
<< token );
#endif
}
if( curr_trie->m_id_candidates.size() > 1 ) {
std::vector<cstring> amb_names;
BOOST_TEST_FOREACH( parameter_cla_id const&, param_id, curr_trie->m_id_candidates )
amb_names.push_back( param_id.m_tag );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
BOOST_TEST_I_THROW( ambiguous_param( std::move( amb_names ) )
<< "An ambiguous parameter name in the argument " << token );
#else
BOOST_TEST_I_THROW( ambiguous_param( amb_names )
<< "An ambiguous parameter name in the argument " << token );
#endif
}
return locate_result( curr_trie->m_id_candidates.back().get(), curr_trie->m_param_candidate );
}
// Data members
cstring m_program_name;
std::string m_end_of_param_indicator;
std::string m_negation_prefix;
str_to_trie m_param_trie;
};
} // namespace cla
} // namespace runtime
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_HPP
@@ -0,0 +1,87 @@
// (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 C string comparison with enhanced reporting
// ***************************************************************************
#ifndef BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER
#define BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER
// Boost.Test
#include <boost/test/tools/assertion.hpp>
#include <boost/test/utils/is_cstring.hpp>
#include <boost/test/utils/basic_cstring/compare.hpp>
// Boost
#include <boost/utility/enable_if.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
//____________________________________________________________________________//
namespace boost {
namespace test_tools {
namespace assertion {
namespace op {
// ************************************************************************** //
// ************** string_compare ************** //
// ************************************************************************** //
#define DEFINE_CSTRING_COMPARISON( oper, name, rev ) \
template<typename Lhs,typename Rhs> \
struct name<Lhs,Rhs,typename boost::enable_if_c< \
( unit_test::is_cstring<Lhs>::value \
&& unit_test::is_cstring<Rhs>::value) \
>::type > \
{ \
typedef typename unit_test::deduce_cstring<Lhs>::type lhs_char_type; \
typedef typename unit_test::deduce_cstring<Rhs>::type rhs_char_type; \
public: \
typedef assertion_result result_type; \
\
typedef name<lhs_char_type, rhs_char_type> elem_op; \
\
static bool \
eval( Lhs const& lhs, Rhs const& rhs) \
{ \
return unit_test::basic_cstring<lhs_char_type>(lhs) oper \
unit_test::basic_cstring<rhs_char_type>(rhs); \
} \
\
template<typename PrevExprType> \
static void \
report( std::ostream& ostr, \
PrevExprType const& lhs, \
Rhs const& rhs) \
{ \
lhs.report( ostr ); \
ostr << revert() \
<< tt_detail::print_helper( rhs ); \
} \
\
static char const* revert() \
{ return " " #rev " "; } \
}; \
/**/
BOOST_TEST_FOR_EACH_COMP_OP( DEFINE_CSTRING_COMPARISON )
#undef DEFINE_CSTRING_COMPARISON
//____________________________________________________________________________//
} // namespace op
} // namespace assertion
} // namespace test_tools
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER
@@ -0,0 +1,272 @@
// (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_18_HPP
#define BOOST_MATH_TOOLS_RAT_EVAL_18_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;
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
}
}
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;
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
}
}
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;
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
}
}
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;
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
}
}
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;
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
}
}
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_<10>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
}
}
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_<11>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
}
}
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_<12>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
}
}
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_<13>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
}
}
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_<14>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
}
}
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_<15>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
}
}
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_<16>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]));
}
}
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_<17>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16] + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16] + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z));
}
}
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_<18>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((((b[17] * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) / (((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]));
}
}
}}}} // namespaces
#endif // include guard