Initial Commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
#ifndef BOOST_MPL_PRIOR_HPP_INCLUDED
|
||||
#define BOOST_MPL_PRIOR_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 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/next_prior.hpp>
|
||||
|
||||
#endif // BOOST_MPL_PRIOR_HPP_INCLUDED
|
||||
@@ -0,0 +1,205 @@
|
||||
// (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: 74248 $
|
||||
//
|
||||
// Description : defines level of indiration facilitating workarounds for non printable types
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_TOOLS_IMPL_COMMON_HPP_012705GER
|
||||
#define BOOST_TEST_TOOLS_IMPL_COMMON_HPP_012705GER
|
||||
|
||||
// Boost.Test
|
||||
#include <boost/test/detail/config.hpp>
|
||||
#include <boost/test/detail/global_typedef.hpp>
|
||||
#include <boost/test/detail/workaround.hpp>
|
||||
|
||||
// Boost
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#include <boost/type_traits/has_left_shift.hpp>
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace test_tools {
|
||||
namespace tt_detail {
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** print_log_value ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
template<typename T>
|
||||
struct print_log_value {
|
||||
BOOST_STATIC_ASSERT_MSG( (boost::has_left_shift<std::ostream,T>::value),
|
||||
"Type has to implement operator<< to be printable");
|
||||
|
||||
void operator()( std::ostream& ostr, T const& t )
|
||||
{
|
||||
typedef typename mpl::or_<is_array<T>,is_function<T>,is_abstract<T> >::type cant_use_nl;
|
||||
|
||||
std::streamsize old_precision = set_precision( ostr, cant_use_nl() );
|
||||
|
||||
ostr << t;
|
||||
|
||||
if( old_precision != (std::streamsize)-1 )
|
||||
ostr.precision( old_precision );
|
||||
}
|
||||
|
||||
std::streamsize set_precision( std::ostream& ostr, mpl::false_ )
|
||||
{
|
||||
if( std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::radix == 2 )
|
||||
return ostr.precision( 2 + std::numeric_limits<T>::digits * 301/1000 );
|
||||
else if ( std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::radix == 10 ) {
|
||||
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
|
||||
// (was BOOST_NO_NUMERIC_LIMITS_LOWEST but now deprecated).
|
||||
// No support for std::numeric_limits<double>::max_digits10,
|
||||
// so guess that a couple of guard digits more than digits10 will display any difference.
|
||||
return ostr.precision( 2 + std::numeric_limits<T>::digits10 );
|
||||
#else
|
||||
// std::numeric_limits<double>::max_digits10; IS supported.
|
||||
// Any noisy or guard digits needed to display any difference are included in max_digits10.
|
||||
return ostr.precision( std::numeric_limits<T>::max_digits10 );
|
||||
#endif
|
||||
}
|
||||
// else if T is not specialized for std::numeric_limits<>,
|
||||
// then will just get the default precision of 6 digits.
|
||||
return (std::streamsize)-1;
|
||||
}
|
||||
|
||||
std::streamsize set_precision( std::ostream&, mpl::true_ ) { return (std::streamsize)-1; }
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
template<typename T, std::size_t N >
|
||||
struct print_log_value< T[N] > {
|
||||
void operator()( std::ostream& ostr, T const* t )
|
||||
{
|
||||
ostr << t;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<>
|
||||
struct BOOST_TEST_DECL print_log_value<bool> {
|
||||
void operator()( std::ostream& ostr, bool t )
|
||||
{
|
||||
ostr << std::boolalpha << t;
|
||||
}
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<>
|
||||
struct BOOST_TEST_DECL print_log_value<char> {
|
||||
void operator()( std::ostream& ostr, char t );
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<>
|
||||
struct BOOST_TEST_DECL print_log_value<unsigned char> {
|
||||
void operator()( std::ostream& ostr, unsigned char t );
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<>
|
||||
struct BOOST_TEST_DECL print_log_value<char const*> {
|
||||
void operator()( std::ostream& ostr, char const* t );
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<>
|
||||
struct BOOST_TEST_DECL print_log_value<wchar_t const*> {
|
||||
void operator()( std::ostream& ostr, wchar_t const* t );
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** print_helper ************** //
|
||||
// ************************************************************************** //
|
||||
// Adds level of indirection to the output operation, allowing us to customize
|
||||
// it for types that do not support operator << directly or for any other reason
|
||||
|
||||
template<typename T>
|
||||
struct print_helper_t {
|
||||
explicit print_helper_t( T const& t ) : m_t( t ) {}
|
||||
|
||||
T const& m_t;
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
// Borland suffers premature pointer decay passing arrays by reference
|
||||
template<typename T, std::size_t N >
|
||||
struct print_helper_t< T[N] > {
|
||||
explicit print_helper_t( T const * t ) : m_t( t ) {}
|
||||
|
||||
T const * m_t;
|
||||
};
|
||||
#endif
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename T>
|
||||
inline print_helper_t<T>
|
||||
print_helper( T const& t )
|
||||
{
|
||||
return print_helper_t<T>( t );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
template<typename T>
|
||||
inline std::ostream&
|
||||
operator<<( std::ostream& ostr, print_helper_t<T> const& ph )
|
||||
{
|
||||
print_log_value<T>()( ostr, ph.m_t );
|
||||
|
||||
return ostr;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
} // namespace tt_detail
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** BOOST_TEST_DONT_PRINT_LOG_VALUE ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
#define BOOST_TEST_DONT_PRINT_LOG_VALUE( the_type ) \
|
||||
namespace boost{ namespace test_tools{ namespace tt_detail{ \
|
||||
template<> \
|
||||
struct print_log_value<the_type > { \
|
||||
void operator()( std::ostream&, the_type const& ) {} \
|
||||
}; \
|
||||
}}} \
|
||||
/**/
|
||||
|
||||
} // namespace test_tools
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_TOOLS_IMPL_COMMON_HPP_012705GER
|
||||
@@ -0,0 +1,20 @@
|
||||
subroutine encode4(message,ncode)
|
||||
|
||||
use packjt
|
||||
parameter (MAXCALLS=7000,MAXRPT=63)
|
||||
integer ncode(206)
|
||||
character*22 message !Message to be generated
|
||||
character*3 cok !' ' or 'OOO'
|
||||
integer dgen(13)
|
||||
integer*1 data0(13),symbol(216)
|
||||
|
||||
call chkmsg(message,cok,nspecial,flip)
|
||||
call packmsg(message,dgen,itype,.false.) !Pack 72-bit message into 12 six-bit symbols
|
||||
call entail(dgen,data0)
|
||||
call encode232(data0,206,symbol) !Convolutional encoding
|
||||
call interleave4(symbol,1) !Apply JT4 interleaving
|
||||
do i=1,206
|
||||
ncode(i)=symbol(i)
|
||||
enddo
|
||||
|
||||
end subroutine encode4
|
||||
@@ -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_DEQUE_SIZE <= 10
|
||||
#include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp>
|
||||
#elif FUSION_MAX_DEQUE_SIZE <= 20
|
||||
#include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp>
|
||||
#elif FUSION_MAX_DEQUE_SIZE <= 30
|
||||
#include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp>
|
||||
#elif FUSION_MAX_DEQUE_SIZE <= 40
|
||||
#include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp>
|
||||
#elif FUSION_MAX_DEQUE_SIZE <= 50
|
||||
#include <boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp>
|
||||
#else
|
||||
#error "FUSION_MAX_DEQUE_SIZE out of bounds for preprocessed headers"
|
||||
#endif
|
||||
@@ -0,0 +1,242 @@
|
||||
#include "displaytext.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
#include <QDateTime>
|
||||
#include <QTextCharFormat>
|
||||
#include <QTextCursor>
|
||||
#include <QTextBlock>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
|
||||
#include "qt_helpers.hpp"
|
||||
|
||||
#include "moc_displaytext.cpp"
|
||||
|
||||
DisplayText::DisplayText(QWidget *parent)
|
||||
: QTextEdit(parent)
|
||||
, erase_action_ {new QAction {tr ("&Erase"), this}}
|
||||
{
|
||||
setReadOnly (true);
|
||||
viewport ()->setCursor (Qt::ArrowCursor);
|
||||
setWordWrapMode (QTextOption::NoWrap);
|
||||
|
||||
// max lines to limit heap usage
|
||||
document ()->setMaximumBlockCount (5000);
|
||||
|
||||
// context menu erase action
|
||||
setContextMenuPolicy (Qt::CustomContextMenu);
|
||||
connect (this, &DisplayText::customContextMenuRequested, [this] (QPoint const& position) {
|
||||
auto * menu = createStandardContextMenu (position);
|
||||
menu->addAction (erase_action_);
|
||||
menu->exec (mapToGlobal (position));
|
||||
delete menu;
|
||||
});
|
||||
connect (erase_action_, &QAction::triggered, this, &DisplayText::erase);
|
||||
}
|
||||
|
||||
void DisplayText::erase ()
|
||||
{
|
||||
clear ();
|
||||
Q_EMIT erased ();
|
||||
}
|
||||
|
||||
void DisplayText::setContentFont(QFont const& font)
|
||||
{
|
||||
char_font_ = font;
|
||||
selectAll ();
|
||||
auto cursor = textCursor ();
|
||||
cursor.beginEditBlock ();
|
||||
auto char_format = cursor.charFormat ();
|
||||
char_format.setFont (char_font_);
|
||||
cursor.mergeCharFormat (char_format);
|
||||
cursor.clearSelection ();
|
||||
cursor.movePosition (QTextCursor::End);
|
||||
|
||||
// position so viewport scrolled to left
|
||||
cursor.movePosition (QTextCursor::Up);
|
||||
cursor.movePosition (QTextCursor::StartOfLine);
|
||||
cursor.endEditBlock ();
|
||||
|
||||
setTextCursor (cursor);
|
||||
ensureCursorVisible ();
|
||||
}
|
||||
|
||||
void DisplayText::mouseDoubleClickEvent(QMouseEvent *e)
|
||||
{
|
||||
bool shift = (e->modifiers() & Qt::ShiftModifier);
|
||||
bool ctrl = (e->modifiers() & Qt::ControlModifier);
|
||||
bool alt = (e->modifiers() & Qt::AltModifier);
|
||||
emit(selectCallsign(shift,ctrl,alt));
|
||||
QTextEdit::mouseDoubleClickEvent(e);
|
||||
}
|
||||
|
||||
void DisplayText::insertLineSpacer(QString const& line)
|
||||
{
|
||||
appendText (line, "#d3d3d3");
|
||||
}
|
||||
|
||||
void DisplayText::appendText(QString const& text, QColor bg)
|
||||
{
|
||||
auto cursor = textCursor ();
|
||||
cursor.movePosition (QTextCursor::End);
|
||||
auto block_format = cursor.blockFormat ();
|
||||
block_format.setBackground (bg);
|
||||
if (0 == cursor.position ())
|
||||
{
|
||||
cursor.setBlockFormat (block_format);
|
||||
auto char_format = cursor.charFormat ();
|
||||
char_format.setFont (char_font_);
|
||||
cursor.setCharFormat (char_format);
|
||||
}
|
||||
else
|
||||
{
|
||||
cursor.insertBlock (block_format);
|
||||
}
|
||||
cursor.insertText (text);
|
||||
|
||||
// position so viewport scrolled to left
|
||||
cursor.movePosition (QTextCursor::StartOfLine);
|
||||
setTextCursor (cursor);
|
||||
ensureCursorVisible ();
|
||||
document ()->setMaximumBlockCount (document ()->maximumBlockCount ());
|
||||
}
|
||||
|
||||
|
||||
QString DisplayText::appendDXCCWorkedB4(QString message, QString const& callsign, QColor * bg,
|
||||
LogBook const& logBook, QColor color_CQ,
|
||||
QColor color_DXCC,
|
||||
QColor color_NewCall)
|
||||
{
|
||||
// allow for seconds
|
||||
int padding {message.indexOf (" ") > 4 ? 2 : 0};
|
||||
QString call = callsign;
|
||||
QString countryName;
|
||||
bool callWorkedBefore;
|
||||
bool countryWorkedBefore;
|
||||
|
||||
if(call.length()==2) {
|
||||
int i0=message.indexOf("CQ "+call);
|
||||
call=message.mid(i0+6,-1);
|
||||
i0=call.indexOf(" ");
|
||||
call=call.mid(0,i0);
|
||||
}
|
||||
if(call.length()<3) return message;
|
||||
if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message;
|
||||
|
||||
logBook.match(/*in*/call,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
||||
|
||||
message = message.trimmed ();
|
||||
QString appendage;
|
||||
if (!countryWorkedBefore) // therefore not worked call either
|
||||
{
|
||||
appendage += "!";
|
||||
*bg = color_DXCC;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!callWorkedBefore) // but have worked the country
|
||||
{
|
||||
appendage += "~";
|
||||
*bg = color_NewCall;
|
||||
}
|
||||
else
|
||||
{
|
||||
appendage += " "; // have worked this call before
|
||||
*bg = color_CQ;
|
||||
}
|
||||
}
|
||||
|
||||
// do some obvious abbreviations
|
||||
countryName.replace ("Islands", "Is.");
|
||||
countryName.replace ("Island", "Is.");
|
||||
countryName.replace ("North ", "N. ");
|
||||
countryName.replace ("Northern ", "N. ");
|
||||
countryName.replace ("South ", "S. ");
|
||||
countryName.replace ("East ", "E. ");
|
||||
countryName.replace ("Eastern ", "E. ");
|
||||
countryName.replace ("West ", "W. ");
|
||||
countryName.replace ("Western ", "W. ");
|
||||
countryName.replace ("Central ", "C. ");
|
||||
countryName.replace (" and ", " & ");
|
||||
countryName.replace ("Republic", "Rep.");
|
||||
countryName.replace ("United States", "U.S.A.");
|
||||
countryName.replace ("Fed. Rep. of ", "");
|
||||
countryName.replace ("French ", "Fr.");
|
||||
countryName.replace ("Asiatic", "AS");
|
||||
countryName.replace ("European", "EU");
|
||||
countryName.replace ("African", "AF");
|
||||
|
||||
appendage += countryName;
|
||||
|
||||
// use a nbsp to save the start of appended text so we can find
|
||||
// it again later, align appended data at a fixed column if
|
||||
// there is space otherwise let it float to the right
|
||||
int space_count {40 + padding - message.size ()};
|
||||
if (space_count > 0)
|
||||
{
|
||||
message += QString {space_count, QChar {' '}};
|
||||
}
|
||||
message += QChar::Nbsp + appendage;
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall,
|
||||
bool displayDXCCEntity, LogBook const& logBook,
|
||||
QColor color_CQ, QColor color_MyCall,
|
||||
QColor color_DXCC, QColor color_NewCall)
|
||||
{
|
||||
QColor bg {Qt::white};
|
||||
bool CQcall = false;
|
||||
if (decodedText.string ().contains (" CQ ")
|
||||
|| decodedText.string ().contains (" CQDX ")
|
||||
|| decodedText.string ().contains (" QRZ "))
|
||||
{
|
||||
CQcall = true;
|
||||
bg = color_CQ;
|
||||
}
|
||||
if (myCall != "" and (
|
||||
decodedText.indexOf (" " + myCall + " ") >= 0
|
||||
or decodedText.indexOf (" " + myCall + "/") >= 0
|
||||
or decodedText.indexOf ("/" + myCall + " ") >= 0
|
||||
or decodedText.indexOf ("<" + myCall + " ") >= 0
|
||||
or decodedText.indexOf (" " + myCall + ">") >= 0)) {
|
||||
bg = color_MyCall;
|
||||
}
|
||||
auto message = decodedText.string ();
|
||||
message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info
|
||||
if (displayDXCCEntity && CQcall)
|
||||
// if enabled add the DXCC entity and B4 status to the end of the
|
||||
// preformated text line t1
|
||||
message = appendDXCCWorkedB4 (message, decodedText.CQersCall (), &bg, logBook, color_CQ,
|
||||
color_DXCC, color_NewCall);
|
||||
appendText (message.trimmed (), bg);
|
||||
}
|
||||
|
||||
|
||||
void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 txFreq,
|
||||
QColor color_TxMsg, bool bFastMode)
|
||||
{
|
||||
QString t1=" @ ";
|
||||
if(modeTx=="FT8") t1=" ~ ";
|
||||
if(modeTx=="JT4") t1=" $ ";
|
||||
if(modeTx=="JT65") t1=" # ";
|
||||
if(modeTx=="MSK144") t1=" & ";
|
||||
QString t2;
|
||||
t2.sprintf("%4d",txFreq);
|
||||
QString t;
|
||||
if(bFastMode or modeTx=="FT8") {
|
||||
t = QDateTime::currentDateTimeUtc().toString("hhmmss") + \
|
||||
" Tx " + t2 + t1 + text;
|
||||
} else {
|
||||
t = QDateTime::currentDateTimeUtc().toString("hhmm") + \
|
||||
" Tx " + t2 + t1 + text;
|
||||
}
|
||||
appendText (t, color_TxMsg);
|
||||
}
|
||||
|
||||
void DisplayText::displayQSY(QString text)
|
||||
{
|
||||
QString t = QDateTime::currentDateTimeUtc().toString("hhmmss") + " " + text;
|
||||
appendText (t, "hotpink");
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_PREPROCESSOR_DEFAULT_PARAMS_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_PREPROCESSOR_DEFAULT_PARAMS_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_/config/preprocessor.hpp>
|
||||
|
||||
// BOOST_MPL_PP_DEFAULT_PARAMS(0,T,int): <nothing>
|
||||
// BOOST_MPL_PP_DEFAULT_PARAMS(1,T,int): T1 = int
|
||||
// BOOST_MPL_PP_DEFAULT_PARAMS(2,T,int): T1 = int, T2 = int
|
||||
// BOOST_MPL_PP_DEFAULT_PARAMS(n,T,int): T1 = int, T2 = int, .., Tn = int
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
|
||||
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS(n,p,v) \
|
||||
BOOST_PP_CAT(BOOST_MPL_PP_DEFAULT_PARAMS_,n)(p,v) \
|
||||
/**/
|
||||
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_0(p,v)
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_1(p,v) p##1=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_2(p,v) p##1=v,p##2=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_3(p,v) p##1=v,p##2=v,p##3=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_4(p,v) p##1=v,p##2=v,p##3=v,p##4=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_5(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_6(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_7(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v,p##7=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_8(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v,p##7=v,p##8=v
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS_9(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v,p##7=v,p##8=v,p##9=v
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
# include <boost/preprocessor/repeat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
|
||||
# define BOOST_MPL_PP_AUX_DEFAULT_PARAM_FUNC(unused, i, pv) \
|
||||
BOOST_PP_COMMA_IF(i) \
|
||||
BOOST_PP_CAT( BOOST_PP_TUPLE_ELEM(2,0,pv), BOOST_PP_INC(i) ) \
|
||||
= BOOST_PP_TUPLE_ELEM(2,1,pv) \
|
||||
/**/
|
||||
|
||||
# define BOOST_MPL_PP_DEFAULT_PARAMS(n, param, value) \
|
||||
BOOST_PP_REPEAT( \
|
||||
n \
|
||||
, BOOST_MPL_PP_AUX_DEFAULT_PARAM_FUNC \
|
||||
, (param,value) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_PREPROCESSOR_DEFAULT_PARAMS_HPP_INCLUDED
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
make-ldpc ex-ldpc-encode.pchk 200 400 1 evenboth 3
|
||||
|
||||
make-gen ex-ldpc-encode.pchk ex-ldpc-encode.genf sparse first
|
||||
Number of 1s per check in L is 6.4, U is 6.4, B is 3.0, total is 15.8
|
||||
make-gen ex-ldpc-encode.pchk ex-ldpc-encode.genc sparse mincol
|
||||
Number of 1s per check in L is 3.0, U is 3.3, B is 3.0, total is 9.3
|
||||
make-gen ex-ldpc-encode.pchk ex-ldpc-encode.genp sparse minprod
|
||||
Number of 1s per check in L is 2.4, U is 3.2, B is 3.0, total is 8.6
|
||||
make-gen ex-ldpc-encode.pchk ex-ldpc-encode.gend dense ex-ldpc-encode.genp
|
||||
Number of 1s per check in Inv(A) X B is 69.2
|
||||
make-gen ex-ldpc-encode.pchk ex-ldpc-encode.genm mixed ex-ldpc-encode.genp
|
||||
Number of 1s per check in Inv(A) is 64.7, in B is 3.0, total is 67.7
|
||||
|
||||
rand-src ex-ldpc-encode.src 1 200x10
|
||||
|
||||
encode ex-ldpc-encode.pchk ex-ldpc-encode.genf ex-ldpc-encode.src \
|
||||
ex-ldpc-encode.encf
|
||||
Encoded 10 blocks, source block size 200, encoded block size 400
|
||||
encode ex-ldpc-encode.pchk ex-ldpc-encode.genc ex-ldpc-encode.src \
|
||||
ex-ldpc-encode.encc
|
||||
Encoded 10 blocks, source block size 200, encoded block size 400
|
||||
encode ex-ldpc-encode.pchk ex-ldpc-encode.genp ex-ldpc-encode.src \
|
||||
ex-ldpc-encode.encp
|
||||
Encoded 10 blocks, source block size 200, encoded block size 400
|
||||
encode ex-ldpc-encode.pchk ex-ldpc-encode.gend ex-ldpc-encode.src \
|
||||
ex-ldpc-encode.encd
|
||||
Encoded 10 blocks, source block size 200, encoded block size 400
|
||||
encode ex-ldpc-encode.pchk ex-ldpc-encode.genm ex-ldpc-encode.src \
|
||||
ex-ldpc-encode.encm
|
||||
Encoded 10 blocks, source block size 200, encoded block size 400
|
||||
|
||||
cmp ex-ldpc-encode.encp ex-ldpc-encode.encd
|
||||
cmp ex-ldpc-encode.encp ex-ldpc-encode.encm
|
||||
|
||||
verify ex-ldpc-encode.pchk ex-ldpc-encode.encf ex-ldpc-encode.genf \
|
||||
ex-ldpc-encode.src
|
||||
Block counts: tot 10, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
verify ex-ldpc-encode.pchk ex-ldpc-encode.encc ex-ldpc-encode.genc \
|
||||
ex-ldpc-encode.src
|
||||
Block counts: tot 10, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
verify ex-ldpc-encode.pchk ex-ldpc-encode.encp ex-ldpc-encode.genp \
|
||||
ex-ldpc-encode.src
|
||||
Block counts: tot 10, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
@@ -0,0 +1,128 @@
|
||||
// (C) Copyright David Abrahams 2002.
|
||||
// (C) Copyright Jeremy Siek 2002.
|
||||
// (C) Copyright Thomas Witt 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)
|
||||
|
||||
// no include guard multiple inclusion intended
|
||||
|
||||
//
|
||||
// This is a temporary workaround until the bulk of this is
|
||||
// available in boost config.
|
||||
// 23/02/03 thw
|
||||
//
|
||||
|
||||
#include <boost/config.hpp> // for prior
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#ifdef BOOST_ITERATOR_CONFIG_DEF
|
||||
# error you have nested config_def #inclusion.
|
||||
#else
|
||||
# define BOOST_ITERATOR_CONFIG_DEF
|
||||
#endif
|
||||
|
||||
// We enable this always now. Otherwise, the simple case in
|
||||
// libs/iterator/test/constant_iterator_arrow.cpp fails to compile
|
||||
// because the operator-> return is improperly deduced as a non-const
|
||||
// pointer.
|
||||
#if 1 || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531))
|
||||
|
||||
// Recall that in general, compilers without partial specialization
|
||||
// can't strip constness. Consider counting_iterator, which normally
|
||||
// passes a const Value to iterator_facade. As a result, any code
|
||||
// which makes a std::vector of the iterator's value_type will fail
|
||||
// when its allocator declares functions overloaded on reference and
|
||||
// const_reference (the same type).
|
||||
//
|
||||
// Furthermore, Borland 5.5.1 drops constness in enough ways that we
|
||||
// end up using a proxy for operator[] when we otherwise shouldn't.
|
||||
// Using reference constness gives it an extra hint that it can
|
||||
// return the value_type from operator[] directly, but is not
|
||||
// strictly necessary. Not sure how best to resolve this one.
|
||||
|
||||
# define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x5A0)) \
|
||||
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|
||||
|| BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) \
|
||||
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
|
||||
|
||||
# define BOOST_NO_LVALUE_RETURN_DETECTION
|
||||
|
||||
# if 0 // test code
|
||||
struct v {};
|
||||
|
||||
typedef char (&no)[3];
|
||||
|
||||
template <class T>
|
||||
no foo(T const&, ...);
|
||||
|
||||
template <class T>
|
||||
char foo(T&, int);
|
||||
|
||||
|
||||
struct value_iterator
|
||||
{
|
||||
v operator*() const;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct lvalue_deref_helper
|
||||
{
|
||||
static T& x;
|
||||
enum { value = (sizeof(foo(*x,0)) == 1) };
|
||||
};
|
||||
|
||||
int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
|
||||
int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
|
||||
# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types"
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
# define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile:
|
||||
|
||||
# if 0 // test code
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
template <class T>
|
||||
struct foo
|
||||
{
|
||||
foo(T);
|
||||
|
||||
template <class U>
|
||||
foo(foo<U> const& other) : p(other.p) { }
|
||||
|
||||
T p;
|
||||
};
|
||||
|
||||
bool x = boost::is_convertible<foo<int const*>, foo<int*> >::value;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
|
||||
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
||||
#endif
|
||||
|
||||
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
|
||||
// GCC-2.95 (obsolete) eagerly instantiates templated constructors and conversion
|
||||
// operators in convertibility checks, causing premature errors.
|
||||
//
|
||||
// Borland's problems are harder to diagnose due to lack of an
|
||||
// instantiation stack backtrace. They may be due in part to the fact
|
||||
// that it drops cv-qualification willy-nilly in templates.
|
||||
# define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
|
||||
# endif
|
||||
|
||||
// no include guard; multiple inclusion intended
|
||||
@@ -0,0 +1,534 @@
|
||||
// qra12_63_64_irr_b.c
|
||||
// Encoding/Decoding tables for Q-ary RA code (12,63) over GF(64)
|
||||
// Code Name: qra12_63_64_irr_b
|
||||
// (12,63) RA Code over GF(64) - RF=333344455567
|
||||
|
||||
// (c) 2016 - Nico Palermo - IV3NWV - Microtelecom Srl, Italy
|
||||
|
||||
// This file is part of the qracodes project, a Forward Error Control
|
||||
// encoding/decoding package based on Q-ary RA (Repeat and Accumulate) LDPC codes.
|
||||
//
|
||||
// qracodes is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
// qracodes is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with qracodes source distribution.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "qra12_63_64_irr_b.h"
|
||||
|
||||
#define qra_K 12 // number of information symbols
|
||||
#define qra_N 63 // codeword length in symbols
|
||||
#define qra_m 6 // bits/symbol
|
||||
#define qra_M 64 // Symbol alphabet cardinality
|
||||
#define qra_a 1 // grouping factor
|
||||
#define qra_NC 51 // number of check symbols (N-K)
|
||||
|
||||
// Defines used by the message passing decoder --------
|
||||
|
||||
#define qra_V 63 // number of variables in the code graph (N)
|
||||
#define qra_C 115 // number of factors in the code graph (N +(N-K)+1)
|
||||
#define qra_NMSG 217 // number of msgs in the code graph
|
||||
#define qra_MAXVDEG 8 // maximum variable degree
|
||||
#define qra_MAXCDEG 3 // maximum factor degree
|
||||
#define qra_R 0.19048f // code rate (K/N)
|
||||
#define CODE_NAME "qra_12_63_64_irr_b"
|
||||
|
||||
|
||||
// table of the systematic symbols indexes in the accumulator chain
|
||||
static const int qra_acc_input_idx[qra_NC+1] = {
|
||||
3, 11, 0, 1, 7, 8, 6, 5, 10, 4,
|
||||
11, 9, 0, 2, 6, 7, 8, 4, 11, 5,
|
||||
10, 2, 1, 9, 3, 8, 4, 11, 5, 7,
|
||||
10, 9, 6, 3, 11, 5, 8, 10, 0, 7,
|
||||
9, 11, 4, 2, 10, 6, 8, 1, 9, 7,
|
||||
11, 10
|
||||
};
|
||||
|
||||
// table of the systematic symbols weight logarithms over GF(M)
|
||||
static const int qra_acc_input_wlog[qra_NC+1] = {
|
||||
39, 0, 34, 16, 25, 0, 34, 48, 19, 13,
|
||||
29, 56, 0, 5, 39, 42, 31, 0, 10, 0,
|
||||
57, 62, 33, 43, 0, 14, 22, 48, 28, 20,
|
||||
5, 45, 16, 43, 17, 4, 32, 0, 31, 0,
|
||||
0, 28, 57, 0, 18, 0, 60, 0, 10, 31,
|
||||
57, 27
|
||||
};
|
||||
|
||||
// table of the logarithms of the elements of GF(M) (log(0) never used)
|
||||
static const int qra_log[qra_M] = {
|
||||
-1, 0, 1, 6, 2, 12, 7, 26, 3, 32,
|
||||
13, 35, 8, 48, 27, 18, 4, 24, 33, 16,
|
||||
14, 52, 36, 54, 9, 45, 49, 38, 28, 41,
|
||||
19, 56, 5, 62, 25, 11, 34, 31, 17, 47,
|
||||
15, 23, 53, 51, 37, 44, 55, 40, 10, 61,
|
||||
46, 30, 50, 22, 39, 43, 29, 60, 42, 21,
|
||||
20, 59, 57, 58
|
||||
};
|
||||
|
||||
// table of GF(M) elements given their logarithm
|
||||
static const int qra_exp[qra_M-1] = {
|
||||
1, 2, 4, 8, 16, 32, 3, 6, 12, 24,
|
||||
48, 35, 5, 10, 20, 40, 19, 38, 15, 30,
|
||||
60, 59, 53, 41, 17, 34, 7, 14, 28, 56,
|
||||
51, 37, 9, 18, 36, 11, 22, 44, 27, 54,
|
||||
47, 29, 58, 55, 45, 25, 50, 39, 13, 26,
|
||||
52, 43, 21, 42, 23, 46, 31, 62, 63, 61,
|
||||
57, 49, 33
|
||||
};
|
||||
|
||||
// table of the messages weight logarithms over GF(M)
|
||||
static const int qra_msgw[qra_NMSG] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 39, 0, 34, 16, 25, 0, 34,
|
||||
48, 19, 13, 29, 56, 0, 5, 39, 42, 31,
|
||||
0, 10, 0, 57, 62, 33, 43, 0, 14, 22,
|
||||
48, 28, 20, 5, 45, 16, 43, 17, 4, 32,
|
||||
0, 31, 0, 0, 28, 57, 0, 18, 0, 60,
|
||||
0, 10, 31, 57, 27, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
// table of the degrees of the variable nodes
|
||||
static const int qra_vdeg[qra_V] = {
|
||||
4, 4, 4, 4, 5, 5, 5, 6, 6, 6,
|
||||
7, 8, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3
|
||||
};
|
||||
|
||||
// table of the degrees of the factor nodes
|
||||
static const int qra_cdeg[qra_C] = {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 2, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 2
|
||||
};
|
||||
|
||||
// table (uncompressed) of the v->c message indexes (-1=unused entry)
|
||||
static const int qra_v2cmidx[qra_V*qra_MAXVDEG] = {
|
||||
0, 65, 75, 101, -1, -1, -1, -1,
|
||||
1, 66, 85, 110, -1, -1, -1, -1,
|
||||
2, 76, 84, 106, -1, -1, -1, -1,
|
||||
3, 63, 87, 96, -1, -1, -1, -1,
|
||||
4, 72, 80, 89, 105, -1, -1, -1,
|
||||
5, 70, 82, 91, 98, -1, -1, -1,
|
||||
6, 69, 77, 95, 108, -1, -1, -1,
|
||||
7, 67, 78, 92, 102, 112, -1, -1,
|
||||
8, 68, 79, 88, 99, 109, -1, -1,
|
||||
9, 74, 86, 94, 103, 111, -1, -1,
|
||||
10, 71, 83, 93, 100, 107, 114, -1,
|
||||
11, 64, 73, 81, 90, 97, 104, 113,
|
||||
12, 115, 116, -1, -1, -1, -1, -1,
|
||||
13, 117, 118, -1, -1, -1, -1, -1,
|
||||
14, 119, 120, -1, -1, -1, -1, -1,
|
||||
15, 121, 122, -1, -1, -1, -1, -1,
|
||||
16, 123, 124, -1, -1, -1, -1, -1,
|
||||
17, 125, 126, -1, -1, -1, -1, -1,
|
||||
18, 127, 128, -1, -1, -1, -1, -1,
|
||||
19, 129, 130, -1, -1, -1, -1, -1,
|
||||
20, 131, 132, -1, -1, -1, -1, -1,
|
||||
21, 133, 134, -1, -1, -1, -1, -1,
|
||||
22, 135, 136, -1, -1, -1, -1, -1,
|
||||
23, 137, 138, -1, -1, -1, -1, -1,
|
||||
24, 139, 140, -1, -1, -1, -1, -1,
|
||||
25, 141, 142, -1, -1, -1, -1, -1,
|
||||
26, 143, 144, -1, -1, -1, -1, -1,
|
||||
27, 145, 146, -1, -1, -1, -1, -1,
|
||||
28, 147, 148, -1, -1, -1, -1, -1,
|
||||
29, 149, 150, -1, -1, -1, -1, -1,
|
||||
30, 151, 152, -1, -1, -1, -1, -1,
|
||||
31, 153, 154, -1, -1, -1, -1, -1,
|
||||
32, 155, 156, -1, -1, -1, -1, -1,
|
||||
33, 157, 158, -1, -1, -1, -1, -1,
|
||||
34, 159, 160, -1, -1, -1, -1, -1,
|
||||
35, 161, 162, -1, -1, -1, -1, -1,
|
||||
36, 163, 164, -1, -1, -1, -1, -1,
|
||||
37, 165, 166, -1, -1, -1, -1, -1,
|
||||
38, 167, 168, -1, -1, -1, -1, -1,
|
||||
39, 169, 170, -1, -1, -1, -1, -1,
|
||||
40, 171, 172, -1, -1, -1, -1, -1,
|
||||
41, 173, 174, -1, -1, -1, -1, -1,
|
||||
42, 175, 176, -1, -1, -1, -1, -1,
|
||||
43, 177, 178, -1, -1, -1, -1, -1,
|
||||
44, 179, 180, -1, -1, -1, -1, -1,
|
||||
45, 181, 182, -1, -1, -1, -1, -1,
|
||||
46, 183, 184, -1, -1, -1, -1, -1,
|
||||
47, 185, 186, -1, -1, -1, -1, -1,
|
||||
48, 187, 188, -1, -1, -1, -1, -1,
|
||||
49, 189, 190, -1, -1, -1, -1, -1,
|
||||
50, 191, 192, -1, -1, -1, -1, -1,
|
||||
51, 193, 194, -1, -1, -1, -1, -1,
|
||||
52, 195, 196, -1, -1, -1, -1, -1,
|
||||
53, 197, 198, -1, -1, -1, -1, -1,
|
||||
54, 199, 200, -1, -1, -1, -1, -1,
|
||||
55, 201, 202, -1, -1, -1, -1, -1,
|
||||
56, 203, 204, -1, -1, -1, -1, -1,
|
||||
57, 205, 206, -1, -1, -1, -1, -1,
|
||||
58, 207, 208, -1, -1, -1, -1, -1,
|
||||
59, 209, 210, -1, -1, -1, -1, -1,
|
||||
60, 211, 212, -1, -1, -1, -1, -1,
|
||||
61, 213, 214, -1, -1, -1, -1, -1,
|
||||
62, 215, 216, -1, -1, -1, -1, -1
|
||||
};
|
||||
|
||||
// table (uncompressed) of the c->v message indexes (-1=unused entry)
|
||||
static const int qra_c2vmidx[qra_C*qra_MAXCDEG] = {
|
||||
0, -1, -1, 1, -1, -1, 2, -1, -1, 3, -1, -1,
|
||||
4, -1, -1, 5, -1, -1, 6, -1, -1, 7, -1, -1,
|
||||
8, -1, -1, 9, -1, -1, 10, -1, -1, 11, -1, -1,
|
||||
12, -1, -1, 13, -1, -1, 14, -1, -1, 15, -1, -1,
|
||||
16, -1, -1, 17, -1, -1, 18, -1, -1, 19, -1, -1,
|
||||
20, -1, -1, 21, -1, -1, 22, -1, -1, 23, -1, -1,
|
||||
24, -1, -1, 25, -1, -1, 26, -1, -1, 27, -1, -1,
|
||||
28, -1, -1, 29, -1, -1, 30, -1, -1, 31, -1, -1,
|
||||
32, -1, -1, 33, -1, -1, 34, -1, -1, 35, -1, -1,
|
||||
36, -1, -1, 37, -1, -1, 38, -1, -1, 39, -1, -1,
|
||||
40, -1, -1, 41, -1, -1, 42, -1, -1, 43, -1, -1,
|
||||
44, -1, -1, 45, -1, -1, 46, -1, -1, 47, -1, -1,
|
||||
48, -1, -1, 49, -1, -1, 50, -1, -1, 51, -1, -1,
|
||||
52, -1, -1, 53, -1, -1, 54, -1, -1, 55, -1, -1,
|
||||
56, -1, -1, 57, -1, -1, 58, -1, -1, 59, -1, -1,
|
||||
60, -1, -1, 61, -1, -1, 62, -1, -1, 63, 115, -1,
|
||||
64, 116, 117, 65, 118, 119, 66, 120, 121, 67, 122, 123,
|
||||
68, 124, 125, 69, 126, 127, 70, 128, 129, 71, 130, 131,
|
||||
72, 132, 133, 73, 134, 135, 74, 136, 137, 75, 138, 139,
|
||||
76, 140, 141, 77, 142, 143, 78, 144, 145, 79, 146, 147,
|
||||
80, 148, 149, 81, 150, 151, 82, 152, 153, 83, 154, 155,
|
||||
84, 156, 157, 85, 158, 159, 86, 160, 161, 87, 162, 163,
|
||||
88, 164, 165, 89, 166, 167, 90, 168, 169, 91, 170, 171,
|
||||
92, 172, 173, 93, 174, 175, 94, 176, 177, 95, 178, 179,
|
||||
96, 180, 181, 97, 182, 183, 98, 184, 185, 99, 186, 187,
|
||||
100, 188, 189, 101, 190, 191, 102, 192, 193, 103, 194, 195,
|
||||
104, 196, 197, 105, 198, 199, 106, 200, 201, 107, 202, 203,
|
||||
108, 204, 205, 109, 206, 207, 110, 208, 209, 111, 210, 211,
|
||||
112, 212, 213, 113, 214, 215, 114, 216, -1
|
||||
};
|
||||
|
||||
// permutation matrix to compute Prob(x*alfa^logw)
|
||||
static const int qra_pmat[qra_M*qra_M] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
||||
0, 33, 1, 32, 2, 35, 3, 34, 4, 37, 5, 36, 6, 39, 7, 38,
|
||||
8, 41, 9, 40, 10, 43, 11, 42, 12, 45, 13, 44, 14, 47, 15, 46,
|
||||
16, 49, 17, 48, 18, 51, 19, 50, 20, 53, 21, 52, 22, 55, 23, 54,
|
||||
24, 57, 25, 56, 26, 59, 27, 58, 28, 61, 29, 60, 30, 63, 31, 62,
|
||||
0, 49, 33, 16, 1, 48, 32, 17, 2, 51, 35, 18, 3, 50, 34, 19,
|
||||
4, 53, 37, 20, 5, 52, 36, 21, 6, 55, 39, 22, 7, 54, 38, 23,
|
||||
8, 57, 41, 24, 9, 56, 40, 25, 10, 59, 43, 26, 11, 58, 42, 27,
|
||||
12, 61, 45, 28, 13, 60, 44, 29, 14, 63, 47, 30, 15, 62, 46, 31,
|
||||
0, 57, 49, 8, 33, 24, 16, 41, 1, 56, 48, 9, 32, 25, 17, 40,
|
||||
2, 59, 51, 10, 35, 26, 18, 43, 3, 58, 50, 11, 34, 27, 19, 42,
|
||||
4, 61, 53, 12, 37, 28, 20, 45, 5, 60, 52, 13, 36, 29, 21, 44,
|
||||
6, 63, 55, 14, 39, 30, 22, 47, 7, 62, 54, 15, 38, 31, 23, 46,
|
||||
0, 61, 57, 4, 49, 12, 8, 53, 33, 28, 24, 37, 16, 45, 41, 20,
|
||||
1, 60, 56, 5, 48, 13, 9, 52, 32, 29, 25, 36, 17, 44, 40, 21,
|
||||
2, 63, 59, 6, 51, 14, 10, 55, 35, 30, 26, 39, 18, 47, 43, 22,
|
||||
3, 62, 58, 7, 50, 15, 11, 54, 34, 31, 27, 38, 19, 46, 42, 23,
|
||||
0, 63, 61, 2, 57, 6, 4, 59, 49, 14, 12, 51, 8, 55, 53, 10,
|
||||
33, 30, 28, 35, 24, 39, 37, 26, 16, 47, 45, 18, 41, 22, 20, 43,
|
||||
1, 62, 60, 3, 56, 7, 5, 58, 48, 15, 13, 50, 9, 54, 52, 11,
|
||||
32, 31, 29, 34, 25, 38, 36, 27, 17, 46, 44, 19, 40, 23, 21, 42,
|
||||
0, 62, 63, 1, 61, 3, 2, 60, 57, 7, 6, 56, 4, 58, 59, 5,
|
||||
49, 15, 14, 48, 12, 50, 51, 13, 8, 54, 55, 9, 53, 11, 10, 52,
|
||||
33, 31, 30, 32, 28, 34, 35, 29, 24, 38, 39, 25, 37, 27, 26, 36,
|
||||
16, 46, 47, 17, 45, 19, 18, 44, 41, 23, 22, 40, 20, 42, 43, 21,
|
||||
0, 31, 62, 33, 63, 32, 1, 30, 61, 34, 3, 28, 2, 29, 60, 35,
|
||||
57, 38, 7, 24, 6, 25, 56, 39, 4, 27, 58, 37, 59, 36, 5, 26,
|
||||
49, 46, 15, 16, 14, 17, 48, 47, 12, 19, 50, 45, 51, 44, 13, 18,
|
||||
8, 23, 54, 41, 55, 40, 9, 22, 53, 42, 11, 20, 10, 21, 52, 43,
|
||||
0, 46, 31, 49, 62, 16, 33, 15, 63, 17, 32, 14, 1, 47, 30, 48,
|
||||
61, 19, 34, 12, 3, 45, 28, 50, 2, 44, 29, 51, 60, 18, 35, 13,
|
||||
57, 23, 38, 8, 7, 41, 24, 54, 6, 40, 25, 55, 56, 22, 39, 9,
|
||||
4, 42, 27, 53, 58, 20, 37, 11, 59, 21, 36, 10, 5, 43, 26, 52,
|
||||
0, 23, 46, 57, 31, 8, 49, 38, 62, 41, 16, 7, 33, 54, 15, 24,
|
||||
63, 40, 17, 6, 32, 55, 14, 25, 1, 22, 47, 56, 30, 9, 48, 39,
|
||||
61, 42, 19, 4, 34, 53, 12, 27, 3, 20, 45, 58, 28, 11, 50, 37,
|
||||
2, 21, 44, 59, 29, 10, 51, 36, 60, 43, 18, 5, 35, 52, 13, 26,
|
||||
0, 42, 23, 61, 46, 4, 57, 19, 31, 53, 8, 34, 49, 27, 38, 12,
|
||||
62, 20, 41, 3, 16, 58, 7, 45, 33, 11, 54, 28, 15, 37, 24, 50,
|
||||
63, 21, 40, 2, 17, 59, 6, 44, 32, 10, 55, 29, 14, 36, 25, 51,
|
||||
1, 43, 22, 60, 47, 5, 56, 18, 30, 52, 9, 35, 48, 26, 39, 13,
|
||||
0, 21, 42, 63, 23, 2, 61, 40, 46, 59, 4, 17, 57, 44, 19, 6,
|
||||
31, 10, 53, 32, 8, 29, 34, 55, 49, 36, 27, 14, 38, 51, 12, 25,
|
||||
62, 43, 20, 1, 41, 60, 3, 22, 16, 5, 58, 47, 7, 18, 45, 56,
|
||||
33, 52, 11, 30, 54, 35, 28, 9, 15, 26, 37, 48, 24, 13, 50, 39,
|
||||
0, 43, 21, 62, 42, 1, 63, 20, 23, 60, 2, 41, 61, 22, 40, 3,
|
||||
46, 5, 59, 16, 4, 47, 17, 58, 57, 18, 44, 7, 19, 56, 6, 45,
|
||||
31, 52, 10, 33, 53, 30, 32, 11, 8, 35, 29, 54, 34, 9, 55, 28,
|
||||
49, 26, 36, 15, 27, 48, 14, 37, 38, 13, 51, 24, 12, 39, 25, 50,
|
||||
0, 52, 43, 31, 21, 33, 62, 10, 42, 30, 1, 53, 63, 11, 20, 32,
|
||||
23, 35, 60, 8, 2, 54, 41, 29, 61, 9, 22, 34, 40, 28, 3, 55,
|
||||
46, 26, 5, 49, 59, 15, 16, 36, 4, 48, 47, 27, 17, 37, 58, 14,
|
||||
57, 13, 18, 38, 44, 24, 7, 51, 19, 39, 56, 12, 6, 50, 45, 25,
|
||||
0, 26, 52, 46, 43, 49, 31, 5, 21, 15, 33, 59, 62, 36, 10, 16,
|
||||
42, 48, 30, 4, 1, 27, 53, 47, 63, 37, 11, 17, 20, 14, 32, 58,
|
||||
23, 13, 35, 57, 60, 38, 8, 18, 2, 24, 54, 44, 41, 51, 29, 7,
|
||||
61, 39, 9, 19, 22, 12, 34, 56, 40, 50, 28, 6, 3, 25, 55, 45,
|
||||
0, 13, 26, 23, 52, 57, 46, 35, 43, 38, 49, 60, 31, 18, 5, 8,
|
||||
21, 24, 15, 2, 33, 44, 59, 54, 62, 51, 36, 41, 10, 7, 16, 29,
|
||||
42, 39, 48, 61, 30, 19, 4, 9, 1, 12, 27, 22, 53, 56, 47, 34,
|
||||
63, 50, 37, 40, 11, 6, 17, 28, 20, 25, 14, 3, 32, 45, 58, 55,
|
||||
0, 39, 13, 42, 26, 61, 23, 48, 52, 19, 57, 30, 46, 9, 35, 4,
|
||||
43, 12, 38, 1, 49, 22, 60, 27, 31, 56, 18, 53, 5, 34, 8, 47,
|
||||
21, 50, 24, 63, 15, 40, 2, 37, 33, 6, 44, 11, 59, 28, 54, 17,
|
||||
62, 25, 51, 20, 36, 3, 41, 14, 10, 45, 7, 32, 16, 55, 29, 58,
|
||||
0, 50, 39, 21, 13, 63, 42, 24, 26, 40, 61, 15, 23, 37, 48, 2,
|
||||
52, 6, 19, 33, 57, 11, 30, 44, 46, 28, 9, 59, 35, 17, 4, 54,
|
||||
43, 25, 12, 62, 38, 20, 1, 51, 49, 3, 22, 36, 60, 14, 27, 41,
|
||||
31, 45, 56, 10, 18, 32, 53, 7, 5, 55, 34, 16, 8, 58, 47, 29,
|
||||
0, 25, 50, 43, 39, 62, 21, 12, 13, 20, 63, 38, 42, 51, 24, 1,
|
||||
26, 3, 40, 49, 61, 36, 15, 22, 23, 14, 37, 60, 48, 41, 2, 27,
|
||||
52, 45, 6, 31, 19, 10, 33, 56, 57, 32, 11, 18, 30, 7, 44, 53,
|
||||
46, 55, 28, 5, 9, 16, 59, 34, 35, 58, 17, 8, 4, 29, 54, 47,
|
||||
0, 45, 25, 52, 50, 31, 43, 6, 39, 10, 62, 19, 21, 56, 12, 33,
|
||||
13, 32, 20, 57, 63, 18, 38, 11, 42, 7, 51, 30, 24, 53, 1, 44,
|
||||
26, 55, 3, 46, 40, 5, 49, 28, 61, 16, 36, 9, 15, 34, 22, 59,
|
||||
23, 58, 14, 35, 37, 8, 60, 17, 48, 29, 41, 4, 2, 47, 27, 54,
|
||||
0, 55, 45, 26, 25, 46, 52, 3, 50, 5, 31, 40, 43, 28, 6, 49,
|
||||
39, 16, 10, 61, 62, 9, 19, 36, 21, 34, 56, 15, 12, 59, 33, 22,
|
||||
13, 58, 32, 23, 20, 35, 57, 14, 63, 8, 18, 37, 38, 17, 11, 60,
|
||||
42, 29, 7, 48, 51, 4, 30, 41, 24, 47, 53, 2, 1, 54, 44, 27,
|
||||
0, 58, 55, 13, 45, 23, 26, 32, 25, 35, 46, 20, 52, 14, 3, 57,
|
||||
50, 8, 5, 63, 31, 37, 40, 18, 43, 17, 28, 38, 6, 60, 49, 11,
|
||||
39, 29, 16, 42, 10, 48, 61, 7, 62, 4, 9, 51, 19, 41, 36, 30,
|
||||
21, 47, 34, 24, 56, 2, 15, 53, 12, 54, 59, 1, 33, 27, 22, 44,
|
||||
0, 29, 58, 39, 55, 42, 13, 16, 45, 48, 23, 10, 26, 7, 32, 61,
|
||||
25, 4, 35, 62, 46, 51, 20, 9, 52, 41, 14, 19, 3, 30, 57, 36,
|
||||
50, 47, 8, 21, 5, 24, 63, 34, 31, 2, 37, 56, 40, 53, 18, 15,
|
||||
43, 54, 17, 12, 28, 1, 38, 59, 6, 27, 60, 33, 49, 44, 11, 22,
|
||||
0, 47, 29, 50, 58, 21, 39, 8, 55, 24, 42, 5, 13, 34, 16, 63,
|
||||
45, 2, 48, 31, 23, 56, 10, 37, 26, 53, 7, 40, 32, 15, 61, 18,
|
||||
25, 54, 4, 43, 35, 12, 62, 17, 46, 1, 51, 28, 20, 59, 9, 38,
|
||||
52, 27, 41, 6, 14, 33, 19, 60, 3, 44, 30, 49, 57, 22, 36, 11,
|
||||
0, 54, 47, 25, 29, 43, 50, 4, 58, 12, 21, 35, 39, 17, 8, 62,
|
||||
55, 1, 24, 46, 42, 28, 5, 51, 13, 59, 34, 20, 16, 38, 63, 9,
|
||||
45, 27, 2, 52, 48, 6, 31, 41, 23, 33, 56, 14, 10, 60, 37, 19,
|
||||
26, 44, 53, 3, 7, 49, 40, 30, 32, 22, 15, 57, 61, 11, 18, 36,
|
||||
0, 27, 54, 45, 47, 52, 25, 2, 29, 6, 43, 48, 50, 41, 4, 31,
|
||||
58, 33, 12, 23, 21, 14, 35, 56, 39, 60, 17, 10, 8, 19, 62, 37,
|
||||
55, 44, 1, 26, 24, 3, 46, 53, 42, 49, 28, 7, 5, 30, 51, 40,
|
||||
13, 22, 59, 32, 34, 57, 20, 15, 16, 11, 38, 61, 63, 36, 9, 18,
|
||||
0, 44, 27, 55, 54, 26, 45, 1, 47, 3, 52, 24, 25, 53, 2, 46,
|
||||
29, 49, 6, 42, 43, 7, 48, 28, 50, 30, 41, 5, 4, 40, 31, 51,
|
||||
58, 22, 33, 13, 12, 32, 23, 59, 21, 57, 14, 34, 35, 15, 56, 20,
|
||||
39, 11, 60, 16, 17, 61, 10, 38, 8, 36, 19, 63, 62, 18, 37, 9,
|
||||
0, 22, 44, 58, 27, 13, 55, 33, 54, 32, 26, 12, 45, 59, 1, 23,
|
||||
47, 57, 3, 21, 52, 34, 24, 14, 25, 15, 53, 35, 2, 20, 46, 56,
|
||||
29, 11, 49, 39, 6, 16, 42, 60, 43, 61, 7, 17, 48, 38, 28, 10,
|
||||
50, 36, 30, 8, 41, 63, 5, 19, 4, 18, 40, 62, 31, 9, 51, 37,
|
||||
0, 11, 22, 29, 44, 39, 58, 49, 27, 16, 13, 6, 55, 60, 33, 42,
|
||||
54, 61, 32, 43, 26, 17, 12, 7, 45, 38, 59, 48, 1, 10, 23, 28,
|
||||
47, 36, 57, 50, 3, 8, 21, 30, 52, 63, 34, 41, 24, 19, 14, 5,
|
||||
25, 18, 15, 4, 53, 62, 35, 40, 2, 9, 20, 31, 46, 37, 56, 51,
|
||||
0, 36, 11, 47, 22, 50, 29, 57, 44, 8, 39, 3, 58, 30, 49, 21,
|
||||
27, 63, 16, 52, 13, 41, 6, 34, 55, 19, 60, 24, 33, 5, 42, 14,
|
||||
54, 18, 61, 25, 32, 4, 43, 15, 26, 62, 17, 53, 12, 40, 7, 35,
|
||||
45, 9, 38, 2, 59, 31, 48, 20, 1, 37, 10, 46, 23, 51, 28, 56,
|
||||
0, 18, 36, 54, 11, 25, 47, 61, 22, 4, 50, 32, 29, 15, 57, 43,
|
||||
44, 62, 8, 26, 39, 53, 3, 17, 58, 40, 30, 12, 49, 35, 21, 7,
|
||||
27, 9, 63, 45, 16, 2, 52, 38, 13, 31, 41, 59, 6, 20, 34, 48,
|
||||
55, 37, 19, 1, 60, 46, 24, 10, 33, 51, 5, 23, 42, 56, 14, 28,
|
||||
0, 9, 18, 27, 36, 45, 54, 63, 11, 2, 25, 16, 47, 38, 61, 52,
|
||||
22, 31, 4, 13, 50, 59, 32, 41, 29, 20, 15, 6, 57, 48, 43, 34,
|
||||
44, 37, 62, 55, 8, 1, 26, 19, 39, 46, 53, 60, 3, 10, 17, 24,
|
||||
58, 51, 40, 33, 30, 23, 12, 5, 49, 56, 35, 42, 21, 28, 7, 14,
|
||||
0, 37, 9, 44, 18, 55, 27, 62, 36, 1, 45, 8, 54, 19, 63, 26,
|
||||
11, 46, 2, 39, 25, 60, 16, 53, 47, 10, 38, 3, 61, 24, 52, 17,
|
||||
22, 51, 31, 58, 4, 33, 13, 40, 50, 23, 59, 30, 32, 5, 41, 12,
|
||||
29, 56, 20, 49, 15, 42, 6, 35, 57, 28, 48, 21, 43, 14, 34, 7,
|
||||
0, 51, 37, 22, 9, 58, 44, 31, 18, 33, 55, 4, 27, 40, 62, 13,
|
||||
36, 23, 1, 50, 45, 30, 8, 59, 54, 5, 19, 32, 63, 12, 26, 41,
|
||||
11, 56, 46, 29, 2, 49, 39, 20, 25, 42, 60, 15, 16, 35, 53, 6,
|
||||
47, 28, 10, 57, 38, 21, 3, 48, 61, 14, 24, 43, 52, 7, 17, 34,
|
||||
0, 56, 51, 11, 37, 29, 22, 46, 9, 49, 58, 2, 44, 20, 31, 39,
|
||||
18, 42, 33, 25, 55, 15, 4, 60, 27, 35, 40, 16, 62, 6, 13, 53,
|
||||
36, 28, 23, 47, 1, 57, 50, 10, 45, 21, 30, 38, 8, 48, 59, 3,
|
||||
54, 14, 5, 61, 19, 43, 32, 24, 63, 7, 12, 52, 26, 34, 41, 17,
|
||||
0, 28, 56, 36, 51, 47, 11, 23, 37, 57, 29, 1, 22, 10, 46, 50,
|
||||
9, 21, 49, 45, 58, 38, 2, 30, 44, 48, 20, 8, 31, 3, 39, 59,
|
||||
18, 14, 42, 54, 33, 61, 25, 5, 55, 43, 15, 19, 4, 24, 60, 32,
|
||||
27, 7, 35, 63, 40, 52, 16, 12, 62, 34, 6, 26, 13, 17, 53, 41,
|
||||
0, 14, 28, 18, 56, 54, 36, 42, 51, 61, 47, 33, 11, 5, 23, 25,
|
||||
37, 43, 57, 55, 29, 19, 1, 15, 22, 24, 10, 4, 46, 32, 50, 60,
|
||||
9, 7, 21, 27, 49, 63, 45, 35, 58, 52, 38, 40, 2, 12, 30, 16,
|
||||
44, 34, 48, 62, 20, 26, 8, 6, 31, 17, 3, 13, 39, 41, 59, 53,
|
||||
0, 7, 14, 9, 28, 27, 18, 21, 56, 63, 54, 49, 36, 35, 42, 45,
|
||||
51, 52, 61, 58, 47, 40, 33, 38, 11, 12, 5, 2, 23, 16, 25, 30,
|
||||
37, 34, 43, 44, 57, 62, 55, 48, 29, 26, 19, 20, 1, 6, 15, 8,
|
||||
22, 17, 24, 31, 10, 13, 4, 3, 46, 41, 32, 39, 50, 53, 60, 59,
|
||||
0, 34, 7, 37, 14, 44, 9, 43, 28, 62, 27, 57, 18, 48, 21, 55,
|
||||
56, 26, 63, 29, 54, 20, 49, 19, 36, 6, 35, 1, 42, 8, 45, 15,
|
||||
51, 17, 52, 22, 61, 31, 58, 24, 47, 13, 40, 10, 33, 3, 38, 4,
|
||||
11, 41, 12, 46, 5, 39, 2, 32, 23, 53, 16, 50, 25, 59, 30, 60,
|
||||
0, 17, 34, 51, 7, 22, 37, 52, 14, 31, 44, 61, 9, 24, 43, 58,
|
||||
28, 13, 62, 47, 27, 10, 57, 40, 18, 3, 48, 33, 21, 4, 55, 38,
|
||||
56, 41, 26, 11, 63, 46, 29, 12, 54, 39, 20, 5, 49, 32, 19, 2,
|
||||
36, 53, 6, 23, 35, 50, 1, 16, 42, 59, 8, 25, 45, 60, 15, 30,
|
||||
0, 41, 17, 56, 34, 11, 51, 26, 7, 46, 22, 63, 37, 12, 52, 29,
|
||||
14, 39, 31, 54, 44, 5, 61, 20, 9, 32, 24, 49, 43, 2, 58, 19,
|
||||
28, 53, 13, 36, 62, 23, 47, 6, 27, 50, 10, 35, 57, 16, 40, 1,
|
||||
18, 59, 3, 42, 48, 25, 33, 8, 21, 60, 4, 45, 55, 30, 38, 15,
|
||||
0, 53, 41, 28, 17, 36, 56, 13, 34, 23, 11, 62, 51, 6, 26, 47,
|
||||
7, 50, 46, 27, 22, 35, 63, 10, 37, 16, 12, 57, 52, 1, 29, 40,
|
||||
14, 59, 39, 18, 31, 42, 54, 3, 44, 25, 5, 48, 61, 8, 20, 33,
|
||||
9, 60, 32, 21, 24, 45, 49, 4, 43, 30, 2, 55, 58, 15, 19, 38,
|
||||
0, 59, 53, 14, 41, 18, 28, 39, 17, 42, 36, 31, 56, 3, 13, 54,
|
||||
34, 25, 23, 44, 11, 48, 62, 5, 51, 8, 6, 61, 26, 33, 47, 20,
|
||||
7, 60, 50, 9, 46, 21, 27, 32, 22, 45, 35, 24, 63, 4, 10, 49,
|
||||
37, 30, 16, 43, 12, 55, 57, 2, 52, 15, 1, 58, 29, 38, 40, 19,
|
||||
0, 60, 59, 7, 53, 9, 14, 50, 41, 21, 18, 46, 28, 32, 39, 27,
|
||||
17, 45, 42, 22, 36, 24, 31, 35, 56, 4, 3, 63, 13, 49, 54, 10,
|
||||
34, 30, 25, 37, 23, 43, 44, 16, 11, 55, 48, 12, 62, 2, 5, 57,
|
||||
51, 15, 8, 52, 6, 58, 61, 1, 26, 38, 33, 29, 47, 19, 20, 40,
|
||||
0, 30, 60, 34, 59, 37, 7, 25, 53, 43, 9, 23, 14, 16, 50, 44,
|
||||
41, 55, 21, 11, 18, 12, 46, 48, 28, 2, 32, 62, 39, 57, 27, 5,
|
||||
17, 15, 45, 51, 42, 52, 22, 8, 36, 58, 24, 6, 31, 1, 35, 61,
|
||||
56, 38, 4, 26, 3, 29, 63, 33, 13, 19, 49, 47, 54, 40, 10, 20,
|
||||
0, 15, 30, 17, 60, 51, 34, 45, 59, 52, 37, 42, 7, 8, 25, 22,
|
||||
53, 58, 43, 36, 9, 6, 23, 24, 14, 1, 16, 31, 50, 61, 44, 35,
|
||||
41, 38, 55, 56, 21, 26, 11, 4, 18, 29, 12, 3, 46, 33, 48, 63,
|
||||
28, 19, 2, 13, 32, 47, 62, 49, 39, 40, 57, 54, 27, 20, 5, 10,
|
||||
0, 38, 15, 41, 30, 56, 17, 55, 60, 26, 51, 21, 34, 4, 45, 11,
|
||||
59, 29, 52, 18, 37, 3, 42, 12, 7, 33, 8, 46, 25, 63, 22, 48,
|
||||
53, 19, 58, 28, 43, 13, 36, 2, 9, 47, 6, 32, 23, 49, 24, 62,
|
||||
14, 40, 1, 39, 16, 54, 31, 57, 50, 20, 61, 27, 44, 10, 35, 5,
|
||||
0, 19, 38, 53, 15, 28, 41, 58, 30, 13, 56, 43, 17, 2, 55, 36,
|
||||
60, 47, 26, 9, 51, 32, 21, 6, 34, 49, 4, 23, 45, 62, 11, 24,
|
||||
59, 40, 29, 14, 52, 39, 18, 1, 37, 54, 3, 16, 42, 57, 12, 31,
|
||||
7, 20, 33, 50, 8, 27, 46, 61, 25, 10, 63, 44, 22, 5, 48, 35,
|
||||
0, 40, 19, 59, 38, 14, 53, 29, 15, 39, 28, 52, 41, 1, 58, 18,
|
||||
30, 54, 13, 37, 56, 16, 43, 3, 17, 57, 2, 42, 55, 31, 36, 12,
|
||||
60, 20, 47, 7, 26, 50, 9, 33, 51, 27, 32, 8, 21, 61, 6, 46,
|
||||
34, 10, 49, 25, 4, 44, 23, 63, 45, 5, 62, 22, 11, 35, 24, 48,
|
||||
0, 20, 40, 60, 19, 7, 59, 47, 38, 50, 14, 26, 53, 33, 29, 9,
|
||||
15, 27, 39, 51, 28, 8, 52, 32, 41, 61, 1, 21, 58, 46, 18, 6,
|
||||
30, 10, 54, 34, 13, 25, 37, 49, 56, 44, 16, 4, 43, 63, 3, 23,
|
||||
17, 5, 57, 45, 2, 22, 42, 62, 55, 35, 31, 11, 36, 48, 12, 24,
|
||||
0, 10, 20, 30, 40, 34, 60, 54, 19, 25, 7, 13, 59, 49, 47, 37,
|
||||
38, 44, 50, 56, 14, 4, 26, 16, 53, 63, 33, 43, 29, 23, 9, 3,
|
||||
15, 5, 27, 17, 39, 45, 51, 57, 28, 22, 8, 2, 52, 62, 32, 42,
|
||||
41, 35, 61, 55, 1, 11, 21, 31, 58, 48, 46, 36, 18, 24, 6, 12,
|
||||
0, 5, 10, 15, 20, 17, 30, 27, 40, 45, 34, 39, 60, 57, 54, 51,
|
||||
19, 22, 25, 28, 7, 2, 13, 8, 59, 62, 49, 52, 47, 42, 37, 32,
|
||||
38, 35, 44, 41, 50, 55, 56, 61, 14, 11, 4, 1, 26, 31, 16, 21,
|
||||
53, 48, 63, 58, 33, 36, 43, 46, 29, 24, 23, 18, 9, 12, 3, 6,
|
||||
0, 35, 5, 38, 10, 41, 15, 44, 20, 55, 17, 50, 30, 61, 27, 56,
|
||||
40, 11, 45, 14, 34, 1, 39, 4, 60, 31, 57, 26, 54, 21, 51, 16,
|
||||
19, 48, 22, 53, 25, 58, 28, 63, 7, 36, 2, 33, 13, 46, 8, 43,
|
||||
59, 24, 62, 29, 49, 18, 52, 23, 47, 12, 42, 9, 37, 6, 32, 3,
|
||||
0, 48, 35, 19, 5, 53, 38, 22, 10, 58, 41, 25, 15, 63, 44, 28,
|
||||
20, 36, 55, 7, 17, 33, 50, 2, 30, 46, 61, 13, 27, 43, 56, 8,
|
||||
40, 24, 11, 59, 45, 29, 14, 62, 34, 18, 1, 49, 39, 23, 4, 52,
|
||||
60, 12, 31, 47, 57, 9, 26, 42, 54, 6, 21, 37, 51, 3, 16, 32,
|
||||
0, 24, 48, 40, 35, 59, 19, 11, 5, 29, 53, 45, 38, 62, 22, 14,
|
||||
10, 18, 58, 34, 41, 49, 25, 1, 15, 23, 63, 39, 44, 52, 28, 4,
|
||||
20, 12, 36, 60, 55, 47, 7, 31, 17, 9, 33, 57, 50, 42, 2, 26,
|
||||
30, 6, 46, 54, 61, 37, 13, 21, 27, 3, 43, 51, 56, 32, 8, 16,
|
||||
0, 12, 24, 20, 48, 60, 40, 36, 35, 47, 59, 55, 19, 31, 11, 7,
|
||||
5, 9, 29, 17, 53, 57, 45, 33, 38, 42, 62, 50, 22, 26, 14, 2,
|
||||
10, 6, 18, 30, 58, 54, 34, 46, 41, 37, 49, 61, 25, 21, 1, 13,
|
||||
15, 3, 23, 27, 63, 51, 39, 43, 44, 32, 52, 56, 28, 16, 4, 8,
|
||||
0, 6, 12, 10, 24, 30, 20, 18, 48, 54, 60, 58, 40, 46, 36, 34,
|
||||
35, 37, 47, 41, 59, 61, 55, 49, 19, 21, 31, 25, 11, 13, 7, 1,
|
||||
5, 3, 9, 15, 29, 27, 17, 23, 53, 51, 57, 63, 45, 43, 33, 39,
|
||||
38, 32, 42, 44, 62, 56, 50, 52, 22, 16, 26, 28, 14, 8, 2, 4,
|
||||
0, 3, 6, 5, 12, 15, 10, 9, 24, 27, 30, 29, 20, 23, 18, 17,
|
||||
48, 51, 54, 53, 60, 63, 58, 57, 40, 43, 46, 45, 36, 39, 34, 33,
|
||||
35, 32, 37, 38, 47, 44, 41, 42, 59, 56, 61, 62, 55, 52, 49, 50,
|
||||
19, 16, 21, 22, 31, 28, 25, 26, 11, 8, 13, 14, 7, 4, 1, 2,
|
||||
0, 32, 3, 35, 6, 38, 5, 37, 12, 44, 15, 47, 10, 42, 9, 41,
|
||||
24, 56, 27, 59, 30, 62, 29, 61, 20, 52, 23, 55, 18, 50, 17, 49,
|
||||
48, 16, 51, 19, 54, 22, 53, 21, 60, 28, 63, 31, 58, 26, 57, 25,
|
||||
40, 8, 43, 11, 46, 14, 45, 13, 36, 4, 39, 7, 34, 2, 33, 1,
|
||||
0, 16, 32, 48, 3, 19, 35, 51, 6, 22, 38, 54, 5, 21, 37, 53,
|
||||
12, 28, 44, 60, 15, 31, 47, 63, 10, 26, 42, 58, 9, 25, 41, 57,
|
||||
24, 8, 56, 40, 27, 11, 59, 43, 30, 14, 62, 46, 29, 13, 61, 45,
|
||||
20, 4, 52, 36, 23, 7, 55, 39, 18, 2, 50, 34, 17, 1, 49, 33,
|
||||
0, 8, 16, 24, 32, 40, 48, 56, 3, 11, 19, 27, 35, 43, 51, 59,
|
||||
6, 14, 22, 30, 38, 46, 54, 62, 5, 13, 21, 29, 37, 45, 53, 61,
|
||||
12, 4, 28, 20, 44, 36, 60, 52, 15, 7, 31, 23, 47, 39, 63, 55,
|
||||
10, 2, 26, 18, 42, 34, 58, 50, 9, 1, 25, 17, 41, 33, 57, 49,
|
||||
0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
|
||||
3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63,
|
||||
6, 2, 14, 10, 22, 18, 30, 26, 38, 34, 46, 42, 54, 50, 62, 58,
|
||||
5, 1, 13, 9, 21, 17, 29, 25, 37, 33, 45, 41, 53, 49, 61, 57,
|
||||
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,
|
||||
32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62,
|
||||
3, 1, 7, 5, 11, 9, 15, 13, 19, 17, 23, 21, 27, 25, 31, 29,
|
||||
35, 33, 39, 37, 43, 41, 47, 45, 51, 49, 55, 53, 59, 57, 63, 61
|
||||
};
|
||||
|
||||
const qracode qra_12_63_64_irr_b = {
|
||||
qra_K,
|
||||
qra_N,
|
||||
qra_m,
|
||||
qra_M,
|
||||
qra_a,
|
||||
qra_NC,
|
||||
qra_V,
|
||||
qra_C,
|
||||
qra_NMSG,
|
||||
qra_MAXVDEG,
|
||||
qra_MAXCDEG,
|
||||
QRATYPE_NORMAL,
|
||||
qra_R,
|
||||
CODE_NAME,
|
||||
qra_acc_input_idx,
|
||||
qra_acc_input_wlog,
|
||||
qra_log,
|
||||
qra_exp,
|
||||
qra_msgw,
|
||||
qra_vdeg,
|
||||
qra_cdeg,
|
||||
qra_v2cmidx,
|
||||
qra_c2vmidx,
|
||||
qra_pmat
|
||||
};
|
||||
|
||||
#undef qra_K
|
||||
#undef qra_N
|
||||
#undef qra_m
|
||||
#undef qra_M
|
||||
#undef qra_a
|
||||
#undef qra_NC
|
||||
#undef qra_V
|
||||
#undef qra_C
|
||||
#undef qra_NMSG
|
||||
#undef qra_MAXVDEG
|
||||
#undef qra_MAXCDEG
|
||||
#undef qra_R
|
||||
#undef CODE_NAME
|
||||
@@ -0,0 +1,50 @@
|
||||
program genmet
|
||||
|
||||
character*12 arg
|
||||
integer hist(-128:128)
|
||||
lim(x)=min(127,max(-128,nint(scale*x)))
|
||||
|
||||
nargs=iargc()
|
||||
if(nargs.ne.4) then
|
||||
print*,'Usage: genmet bw scale snr iters'
|
||||
print*,'Example: genmet 1.46 20 -24 1000000'
|
||||
go to 999
|
||||
endif
|
||||
call getarg(1,arg)
|
||||
read(arg,*) bw
|
||||
call getarg(2,arg)
|
||||
read(arg,*) scale
|
||||
call getarg(3,arg)
|
||||
read(arg,*) snr
|
||||
call getarg(4,arg)
|
||||
read(arg,*) iters
|
||||
|
||||
hist=0
|
||||
s=sqrt(2500.0/bw) * 10.0**(0.05*snr)
|
||||
fac=1.0/sqrt(2.0)
|
||||
do iter=1,iters
|
||||
x1=fac*gran()
|
||||
y1=fac*gran()
|
||||
x0=fac*gran()
|
||||
y0=fac*gran()
|
||||
r=(x1+s)**2 + y1*y1 - x0*x0 - y0*y0
|
||||
hist(lim(r))=hist(lim(r))+1
|
||||
enddo
|
||||
|
||||
xln2=log(2.0)
|
||||
do i=-128,127
|
||||
p1=hist(i)/dfloat(iters)
|
||||
j=-i
|
||||
if(j.gt.127) j=127
|
||||
p0=hist(j)/dfloat(iters)
|
||||
xlhd0=log(max(0.001,2.0*p0/(p0+p1)))/xln2
|
||||
xlhd1=log(max(0.001,2.0*p1/(p0+p1)))/xln2
|
||||
write(13,1010) i/scale,hist(i)/dfloat(iters)
|
||||
1010 format(f8.3,f12.9)
|
||||
write(14,1012) i+128,xlhd0,xlhd1
|
||||
1012 format(i4,2f8.3)
|
||||
enddo
|
||||
|
||||
999 end program genmet
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef BOOST_PTHREAD_MUTEX_SCOPED_LOCK_HPP
|
||||
#define BOOST_PTHREAD_MUTEX_SCOPED_LOCK_HPP
|
||||
// (C) Copyright 2007-8 Anthony Williams
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <pthread.h>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace pthread
|
||||
{
|
||||
class pthread_mutex_scoped_lock
|
||||
{
|
||||
pthread_mutex_t* m;
|
||||
bool locked;
|
||||
public:
|
||||
explicit pthread_mutex_scoped_lock(pthread_mutex_t* m_):
|
||||
m(m_),locked(true)
|
||||
{
|
||||
BOOST_VERIFY(!pthread_mutex_lock(m));
|
||||
}
|
||||
void unlock()
|
||||
{
|
||||
BOOST_VERIFY(!pthread_mutex_unlock(m));
|
||||
locked=false;
|
||||
}
|
||||
|
||||
~pthread_mutex_scoped_lock()
|
||||
{
|
||||
if(locked)
|
||||
{
|
||||
unlock();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class pthread_mutex_scoped_unlock
|
||||
{
|
||||
pthread_mutex_t* m;
|
||||
public:
|
||||
explicit pthread_mutex_scoped_unlock(pthread_mutex_t* m_):
|
||||
m(m_)
|
||||
{
|
||||
BOOST_VERIFY(!pthread_mutex_unlock(m));
|
||||
}
|
||||
~pthread_mutex_scoped_unlock()
|
||||
{
|
||||
BOOST_VERIFY(!pthread_mutex_lock(m));
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/config/abi_suffix.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
// 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 AS_TO_PYTHON_FUNCTION_DWA2002121_HPP
|
||||
# define AS_TO_PYTHON_FUNCTION_DWA2002121_HPP
|
||||
# include <boost/python/converter/to_python_function_type.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace converter {
|
||||
|
||||
// Given a typesafe to_python conversion function, produces a
|
||||
// to_python_function_t which can be registered in the usual way.
|
||||
template <class T, class ToPython>
|
||||
struct as_to_python_function
|
||||
{
|
||||
// Assertion functions used to prevent wrapping of converters
|
||||
// which take non-const reference parameters. The T* argument in
|
||||
// the first overload ensures it isn't used in case T is a
|
||||
// reference.
|
||||
template <class U>
|
||||
static void convert_function_must_take_value_or_const_reference(U(*)(T), int, T* = 0) {}
|
||||
template <class U>
|
||||
static void convert_function_must_take_value_or_const_reference(U(*)(T const&), long ...) {}
|
||||
|
||||
static PyObject* convert(void const* x)
|
||||
{
|
||||
convert_function_must_take_value_or_const_reference(&ToPython::convert, 1L);
|
||||
|
||||
// Yes, the const_cast below opens a hole in const-correctness,
|
||||
// but it's needed to convert auto_ptr<U> to python.
|
||||
//
|
||||
// How big a hole is it? It allows ToPython::convert() to be
|
||||
// a function which modifies its argument. The upshot is that
|
||||
// client converters applied to const objects may invoke
|
||||
// undefined behavior. The damage, however, is limited by the
|
||||
// use of the assertion function. Thus, the only way this can
|
||||
// modify its argument is if T is an auto_ptr-like type. There
|
||||
// is still a const-correctness hole w.r.t. auto_ptr<U> const,
|
||||
// but c'est la vie.
|
||||
return ToPython::convert(*const_cast<T*>(static_cast<T const*>(x)));
|
||||
}
|
||||
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
|
||||
static PyTypeObject const * get_pytype() { return ToPython::get_pytype(); }
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::python::converter
|
||||
|
||||
#endif // AS_TO_PYTHON_FUNCTION_DWA2002121_HPP
|
||||
@@ -0,0 +1,105 @@
|
||||
=== AP Decoding
|
||||
|
||||
With the QRA64 decoder Nico Palermo, IV3NWV, introduced a technique
|
||||
for decoding with the aid of information that naturally accumulates
|
||||
during a minimal QSO. This _a priori_ (AP) information can be
|
||||
used to increase the sensitivity of the decoder.
|
||||
|
||||
When an operator decides to answer a CQ, he already knows his own
|
||||
callsign and that of his potential QSO partner. He therefore knows
|
||||
what to expect for at least 56 of the 72 message bits in a
|
||||
standard-format response to his call. The _WSJT-X_ decoders for QRA64
|
||||
and FT8 can use these and similar AP bits to decode messages
|
||||
containing them with higher sensitivity than otherwise possible.
|
||||
|
||||
We have implemented AP decoding in slightly different ways in QRA64
|
||||
and FT8. To provide some explicit examples for users, we provide here
|
||||
a brief description of the FT8 behavior.
|
||||
|
||||
AP decoding attempts effectively set the AP bits to the hypothesized
|
||||
values, as if they had been received correctly. The decoder then
|
||||
proceeds to determine whether the remaining message and parity bits
|
||||
are consistent with the hypothesized AP bits. If a codeword is found
|
||||
that the decoder judges to have high (but not overwhelmingly high)
|
||||
probability of being correct, a ? character is appended when the
|
||||
decoded message is displayed. To avoid misleading spots of occasional
|
||||
false decodes, messages so marked are not forwarded to {pskreporter}.
|
||||
|
||||
Successful AP decodes are always labeled with an end-of-line indicator
|
||||
of the form aP, where P is one of the single-digit AP decoding types
|
||||
listed in Table 1. For example, an `a2` designator says that the
|
||||
successful decode used MyCall as hypothetically known information.
|
||||
|
||||
[[AP_INFO_TABLE]]
|
||||
.AP information types
|
||||
[width="35%",cols="h10,<m20",frame=topbot,options="header"]
|
||||
|===============================================
|
||||
|P | Message components
|
||||
|1 | CQ     ?     ?
|
||||
|2 | MyCall     ?     ?
|
||||
|3 | MyCall DxCall     ?
|
||||
|4 | MyCall DxCall RRR
|
||||
|5 | MyCall DxCall 73
|
||||
|6 | MyCall DxCall RR73
|
||||
|===============================================
|
||||
|
||||
Table 2 lists the six possible QSO states that are tracked by the
|
||||
WSJT-X auto-sequencer, along with the type of AP decoding that would
|
||||
be attempted in each state.
|
||||
|
||||
[[AP decoding types for each QSO state]]
|
||||
[width="35%",cols="h10,<m20",frame=topbot,options="header"]
|
||||
|===========================================
|
||||
|State |AP type
|
||||
|CALLING | 1, 2
|
||||
|REPLYING | 2, 3
|
||||
|REPORT | 2, 3
|
||||
|ROGER_REPORT | 3, 4, 5, 6
|
||||
|ROGERS | 3, 4, 5, 6
|
||||
|SIGNOFF | 3, 1, 2
|
||||
|===========================================
|
||||
|
||||
|
||||
=== Decoded Lines
|
||||
|
||||
Displayed information accompanying decoded messages generally includes UTC,
|
||||
signal-to-noise ratio in dB, time offset DT in seconds, and
|
||||
audio frequency in Hz. Some modes include additional information such
|
||||
as frequency offset from nominal (DF), frequency drift (Drift or F1),
|
||||
or distance (km or mi).
|
||||
|
||||
There may also be some cryptic characters with special meanings
|
||||
summarized in the following Table:
|
||||
|
||||
[[DECODED_LINES_TABLE]]
|
||||
.Notations used on decoded text lines
|
||||
[width="50%",cols="h,3*^",frame=topbot,options="header"]
|
||||
|===========================================
|
||||
|Mode |Mode character|Sync character|End of line information
|
||||
|FT8 | ~ | | ?   aP
|
||||
|JT4 | $ | *, # | f, fN, dNC
|
||||
|JT9 | @ | |
|
||||
|JT65 | # | |
|
||||
|JT65 VHF| # | *, # | f, fN, dNC
|
||||
|QRA64 | : | * | R
|
||||
|ISCAT | | * | M N C T
|
||||
|MSK144 | & | | N H E
|
||||
|===========================================
|
||||
Sync character::
|
||||
`*` - Normal sync +
|
||||
`#` - Alternate sync
|
||||
|
||||
End of line information::
|
||||
`?` - Decoded with lower confidence +
|
||||
`a` - Decoded with aid of some a priori (AP) information +
|
||||
`C` - Confidence indicator [ISCAT and Deep Search; (0-9,*)] +
|
||||
`d` - Deep Search algorithm +
|
||||
`E` - Size of MSK eye diagram opening - if negative, the eye is closed +
|
||||
`f` - Franke-Taylor or Fano algorithm +
|
||||
`H` - Number of bit errors corrected +
|
||||
`M` - Message length (characters) +
|
||||
`N` - Number of Rx intervals or frames averaged +
|
||||
`P` - Number indicating type of AP information (Table 1, above) +
|
||||
`R` - Return code from QRA64 decoder +
|
||||
`T` - Length of analyzed region (s)
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_ALGORITHM_DETAIL_SERIAL_FIND_EXTREMA_HPP
|
||||
#define BOOST_COMPUTE_ALGORITHM_DETAIL_SERIAL_FIND_EXTREMA_HPP
|
||||
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/types/fundamental.hpp>
|
||||
#include <boost/compute/detail/meta_kernel.hpp>
|
||||
#include <boost/compute/detail/iterator_range_size.hpp>
|
||||
#include <boost/compute/container/detail/scalar.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
namespace detail {
|
||||
|
||||
template<class InputIterator, class Compare>
|
||||
inline InputIterator serial_find_extrema(InputIterator first,
|
||||
InputIterator last,
|
||||
Compare compare,
|
||||
const bool find_minimum,
|
||||
command_queue &queue)
|
||||
{
|
||||
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
|
||||
typedef typename std::iterator_traits<InputIterator>::difference_type difference_type;
|
||||
|
||||
const context &context = queue.get_context();
|
||||
|
||||
meta_kernel k("serial_find_extrema");
|
||||
|
||||
k <<
|
||||
k.decl<value_type>("value") << " = " << first[k.expr<uint_>("0")] << ";\n" <<
|
||||
k.decl<uint_>("value_index") << " = 0;\n" <<
|
||||
"for(uint i = 1; i < size; i++){\n" <<
|
||||
" " << k.decl<value_type>("candidate") << "="
|
||||
<< first[k.expr<uint_>("i")] << ";\n" <<
|
||||
|
||||
"#ifndef BOOST_COMPUTE_FIND_MAXIMUM\n" <<
|
||||
" if(" << compare(k.var<value_type>("candidate"),
|
||||
k.var<value_type>("value")) << "){\n" <<
|
||||
"#else\n" <<
|
||||
" if(" << compare(k.var<value_type>("value"),
|
||||
k.var<value_type>("candidate")) << "){\n" <<
|
||||
"#endif\n" <<
|
||||
|
||||
" value = candidate;\n" <<
|
||||
" value_index = i;\n" <<
|
||||
" }\n" <<
|
||||
"}\n" <<
|
||||
"*index = value_index;\n";
|
||||
|
||||
size_t index_arg_index = k.add_arg<uint_ *>(memory_object::global_memory, "index");
|
||||
size_t size_arg_index = k.add_arg<uint_>("size");
|
||||
|
||||
std::string options;
|
||||
if(!find_minimum){
|
||||
options = "-DBOOST_COMPUTE_FIND_MAXIMUM";
|
||||
}
|
||||
kernel kernel = k.compile(context, options);
|
||||
|
||||
// setup index buffer
|
||||
scalar<uint_> index(context);
|
||||
kernel.set_arg(index_arg_index, index.get_buffer());
|
||||
|
||||
// setup count
|
||||
size_t count = iterator_range_size(first, last);
|
||||
kernel.set_arg(size_arg_index, static_cast<uint_>(count));
|
||||
|
||||
// run kernel
|
||||
queue.enqueue_task(kernel);
|
||||
|
||||
// read index and return iterator
|
||||
return first + static_cast<difference_type>(index.read(queue));
|
||||
}
|
||||
|
||||
} // end detail namespace
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_ALGORITHM_DETAIL_SERIAL_FIND_EXTREMA_HPP
|
||||
@@ -0,0 +1,33 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_ILLUMINANCE_HPP
|
||||
#define BOOST_UNITS_SI_ILLUMINANCE_HPP
|
||||
|
||||
#include <boost/units/systems/si/base.hpp>
|
||||
#include <boost/units/physical_dimensions/illuminance.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
typedef unit<illuminance_dimension,si::system> illuminance;
|
||||
|
||||
BOOST_UNITS_STATIC_CONSTANT(lux,illuminance);
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_SI_ILLUMINANCE_HPP
|
||||
@@ -0,0 +1,65 @@
|
||||
// Status=review
|
||||
|
||||
Debian, Ubuntu, and other Debian-based systems including Raspbian:
|
||||
|
||||
* 32-bit: {debian32}
|
||||
- To install:
|
||||
+
|
||||
[example]
|
||||
sudo dpkg -i wsjtx_{VERSION}_i386.deb
|
||||
|
||||
- Uninstall:
|
||||
+
|
||||
[example]
|
||||
sudo dpkg -P wsjtx
|
||||
|
||||
* 64-bit: {debian64}
|
||||
- To install:
|
||||
+
|
||||
[example]
|
||||
sudo dpkg -i wsjtx_{VERSION}_amd64.deb
|
||||
|
||||
* 64-bit: {raspbian}
|
||||
- To install:
|
||||
+
|
||||
[example]
|
||||
sudo dpkg -i wsjtx_{VERSION}_armhf.deb
|
||||
|
||||
- Uninstall:
|
||||
+
|
||||
[example]
|
||||
sudo dpkg -P wsjtx
|
||||
|
||||
You may also need to execute the following command in a terminal:
|
||||
|
||||
[example]
|
||||
sudo apt install libqt5multimedia5-plugins libqt5serialport5 libfftw3-single3
|
||||
|
||||
Fedora, Red Hat, and other rpm-based systems:
|
||||
|
||||
* 32-bit: {fedora32}
|
||||
- To install:
|
||||
+
|
||||
[example]
|
||||
sudo rpm -i wsjtx-{VERSION}-i686.rpm
|
||||
|
||||
- Uninstall:
|
||||
+
|
||||
[example]
|
||||
sudo rpm -e wsjtx
|
||||
|
||||
* 64-bit: {fedora64}
|
||||
- To install:
|
||||
+
|
||||
[example]
|
||||
sudo rpm -i wsjtx-{VERSION}-x86_64.rpm
|
||||
|
||||
- Uninstall:
|
||||
+
|
||||
[example]
|
||||
sudo rpm -e wsjtx
|
||||
|
||||
You may also need to execute the following command in a terminal:
|
||||
|
||||
[example]
|
||||
sudo dnf install fftw-libs-single qt5-qtmultimedia qt5-qtserialport
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/derived_dimension.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
#include <boost/units/physical_dimensions/current.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// derived dimension for capacitance : L^-2 M^-1 T^4 I^2
|
||||
typedef derived_dimension<length_base_dimension,-2,
|
||||
mass_base_dimension,-1,
|
||||
time_base_dimension,4,
|
||||
current_base_dimension,2>::type capacitance_dimension;
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (C) 2013 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)
|
||||
|
||||
|
||||
#if defined BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,954 @@
|
||||
// Copyright John Maddock 2008.
|
||||
// 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)
|
||||
//
|
||||
// Wrapper that works with mpfr_class defined in gmpfrxx.h
|
||||
// See http://math.berkeley.edu/~wilken/code/gmpfrxx/
|
||||
// Also requires the gmp and mpfr libraries.
|
||||
//
|
||||
|
||||
#ifndef BOOST_MATH_MPLFR_BINDINGS_HPP
|
||||
#define BOOST_MATH_MPLFR_BINDINGS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
//
|
||||
// We get a lot of warnings from the gmp, mpfr and gmpfrxx headers,
|
||||
// disable them here, so we only see warnings from *our* code:
|
||||
//
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4127 4800 4512)
|
||||
#endif
|
||||
|
||||
#include <gmpfrxx.h>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/math/tools/precision.hpp>
|
||||
#include <boost/math/tools/real_cast.hpp>
|
||||
#include <boost/math/policies/policy.hpp>
|
||||
#include <boost/math/distributions/fwd.hpp>
|
||||
#include <boost/math/special_functions/math_fwd.hpp>
|
||||
#include <boost/math/bindings/detail/big_digamma.hpp>
|
||||
#include <boost/math/bindings/detail/big_lanczos.hpp>
|
||||
#include <boost/math/tools/big_constant.hpp>
|
||||
|
||||
inline mpfr_class fabs(const mpfr_class& v)
|
||||
{
|
||||
return abs(v);
|
||||
}
|
||||
template <class T, class U>
|
||||
inline mpfr_class fabs(const __gmp_expr<T,U>& v)
|
||||
{
|
||||
return abs(static_cast<mpfr_class>(v));
|
||||
}
|
||||
|
||||
inline mpfr_class pow(const mpfr_class& b, const mpfr_class& e)
|
||||
{
|
||||
mpfr_class result;
|
||||
mpfr_pow(result.__get_mp(), b.__get_mp(), e.__get_mp(), GMP_RNDN);
|
||||
return result;
|
||||
}
|
||||
/*
|
||||
template <class T, class U, class V, class W>
|
||||
inline mpfr_class pow(const __gmp_expr<T,U>& b, const __gmp_expr<V,W>& e)
|
||||
{
|
||||
return pow(static_cast<mpfr_class>(b), static_cast<mpfr_class>(e));
|
||||
}
|
||||
*/
|
||||
inline mpfr_class ldexp(const mpfr_class& v, int e)
|
||||
{
|
||||
//int e = mpfr_get_exp(*v.__get_mp());
|
||||
mpfr_class result(v);
|
||||
mpfr_set_exp(result.__get_mp(), e);
|
||||
return result;
|
||||
}
|
||||
template <class T, class U>
|
||||
inline mpfr_class ldexp(const __gmp_expr<T,U>& v, int e)
|
||||
{
|
||||
return ldexp(static_cast<mpfr_class>(v), e);
|
||||
}
|
||||
|
||||
inline mpfr_class frexp(const mpfr_class& v, int* expon)
|
||||
{
|
||||
int e = mpfr_get_exp(v.__get_mp());
|
||||
mpfr_class result(v);
|
||||
mpfr_set_exp(result.__get_mp(), 0);
|
||||
*expon = e;
|
||||
return result;
|
||||
}
|
||||
template <class T, class U>
|
||||
inline mpfr_class frexp(const __gmp_expr<T,U>& v, int* expon)
|
||||
{
|
||||
return frexp(static_cast<mpfr_class>(v), expon);
|
||||
}
|
||||
|
||||
inline mpfr_class fmod(const mpfr_class& v1, const mpfr_class& v2)
|
||||
{
|
||||
mpfr_class n;
|
||||
if(v1 < 0)
|
||||
n = ceil(v1 / v2);
|
||||
else
|
||||
n = floor(v1 / v2);
|
||||
return v1 - n * v2;
|
||||
}
|
||||
template <class T, class U, class V, class W>
|
||||
inline mpfr_class fmod(const __gmp_expr<T,U>& v1, const __gmp_expr<V,W>& v2)
|
||||
{
|
||||
return fmod(static_cast<mpfr_class>(v1), static_cast<mpfr_class>(v2));
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline mpfr_class modf(const mpfr_class& v, long long* ipart, const Policy& pol)
|
||||
{
|
||||
*ipart = lltrunc(v, pol);
|
||||
return v - boost::math::tools::real_cast<mpfr_class>(*ipart);
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline mpfr_class modf(const __gmp_expr<T,U>& v, long long* ipart, const Policy& pol)
|
||||
{
|
||||
return modf(static_cast<mpfr_class>(v), ipart, pol);
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline int iround(mpfr_class const& x, const Policy&)
|
||||
{
|
||||
return boost::math::tools::real_cast<int>(boost::math::round(x, typename boost::math::policies::normalise<Policy, boost::math::policies::rounding_error< boost::math::policies::throw_on_error> >::type()));
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline int iround(__gmp_expr<T,U> const& x, const Policy& pol)
|
||||
{
|
||||
return iround(static_cast<mpfr_class>(x), pol);
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline long lround(mpfr_class const& x, const Policy&)
|
||||
{
|
||||
return boost::math::tools::real_cast<long>(boost::math::round(x, typename boost::math::policies::normalise<Policy, boost::math::policies::rounding_error< boost::math::policies::throw_on_error> >::type()));
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline long lround(__gmp_expr<T,U> const& x, const Policy& pol)
|
||||
{
|
||||
return lround(static_cast<mpfr_class>(x), pol);
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline long long llround(mpfr_class const& x, const Policy&)
|
||||
{
|
||||
return boost::math::tools::real_cast<long long>(boost::math::round(x, typename boost::math::policies::normalise<Policy, boost::math::policies::rounding_error< boost::math::policies::throw_on_error> >::type()));
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline long long llround(__gmp_expr<T,U> const& x, const Policy& pol)
|
||||
{
|
||||
return llround(static_cast<mpfr_class>(x), pol);
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline int itrunc(mpfr_class const& x, const Policy&)
|
||||
{
|
||||
return boost::math::tools::real_cast<int>(boost::math::trunc(x, typename boost::math::policies::normalise<Policy, boost::math::policies::rounding_error< boost::math::policies::throw_on_error> >::type()));
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline int itrunc(__gmp_expr<T,U> const& x, const Policy& pol)
|
||||
{
|
||||
return itrunc(static_cast<mpfr_class>(x), pol);
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline long ltrunc(mpfr_class const& x, const Policy&)
|
||||
{
|
||||
return boost::math::tools::real_cast<long>(boost::math::trunc(x, typename boost::math::policies::normalise<Policy, boost::math::policies::rounding_error< boost::math::policies::throw_on_error> >::type()));
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline long ltrunc(__gmp_expr<T,U> const& x, const Policy& pol)
|
||||
{
|
||||
return ltrunc(static_cast<mpfr_class>(x), pol);
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline long long lltrunc(mpfr_class const& x, const Policy&)
|
||||
{
|
||||
return boost::math::tools::real_cast<long long>(boost::math::trunc(x, typename boost::math::policies::normalise<Policy, boost::math::policies::rounding_error< boost::math::policies::throw_on_error> >::type()));
|
||||
}
|
||||
template <class T, class U, class Policy>
|
||||
inline long long lltrunc(__gmp_expr<T,U> const& x, const Policy& pol)
|
||||
{
|
||||
return lltrunc(static_cast<mpfr_class>(x), pol);
|
||||
}
|
||||
|
||||
namespace boost{
|
||||
|
||||
#ifdef BOOST_MATH_USE_FLOAT128
|
||||
template<> struct is_convertible<BOOST_MATH_FLOAT128_TYPE, mpfr_class> : public boost::integral_constant<bool, false>{};
|
||||
#endif
|
||||
template<> struct is_convertible<long long, mpfr_class> : public boost::integral_constant<bool, false>{};
|
||||
|
||||
namespace math{
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ < 4)
|
||||
using ::iround;
|
||||
using ::lround;
|
||||
using ::llround;
|
||||
using ::itrunc;
|
||||
using ::ltrunc;
|
||||
using ::lltrunc;
|
||||
using ::modf;
|
||||
#endif
|
||||
|
||||
namespace lanczos{
|
||||
|
||||
struct mpfr_lanczos
|
||||
{
|
||||
static mpfr_class lanczos_sum(const mpfr_class& z)
|
||||
{
|
||||
unsigned long p = z.get_dprec();
|
||||
if(p <= 72)
|
||||
return lanczos13UDT::lanczos_sum(z);
|
||||
else if(p <= 120)
|
||||
return lanczos22UDT::lanczos_sum(z);
|
||||
else if(p <= 170)
|
||||
return lanczos31UDT::lanczos_sum(z);
|
||||
else //if(p <= 370) approx 100 digit precision:
|
||||
return lanczos61UDT::lanczos_sum(z);
|
||||
}
|
||||
static mpfr_class lanczos_sum_expG_scaled(const mpfr_class& z)
|
||||
{
|
||||
unsigned long p = z.get_dprec();
|
||||
if(p <= 72)
|
||||
return lanczos13UDT::lanczos_sum_expG_scaled(z);
|
||||
else if(p <= 120)
|
||||
return lanczos22UDT::lanczos_sum_expG_scaled(z);
|
||||
else if(p <= 170)
|
||||
return lanczos31UDT::lanczos_sum_expG_scaled(z);
|
||||
else //if(p <= 370) approx 100 digit precision:
|
||||
return lanczos61UDT::lanczos_sum_expG_scaled(z);
|
||||
}
|
||||
static mpfr_class lanczos_sum_near_1(const mpfr_class& z)
|
||||
{
|
||||
unsigned long p = z.get_dprec();
|
||||
if(p <= 72)
|
||||
return lanczos13UDT::lanczos_sum_near_1(z);
|
||||
else if(p <= 120)
|
||||
return lanczos22UDT::lanczos_sum_near_1(z);
|
||||
else if(p <= 170)
|
||||
return lanczos31UDT::lanczos_sum_near_1(z);
|
||||
else //if(p <= 370) approx 100 digit precision:
|
||||
return lanczos61UDT::lanczos_sum_near_1(z);
|
||||
}
|
||||
static mpfr_class lanczos_sum_near_2(const mpfr_class& z)
|
||||
{
|
||||
unsigned long p = z.get_dprec();
|
||||
if(p <= 72)
|
||||
return lanczos13UDT::lanczos_sum_near_2(z);
|
||||
else if(p <= 120)
|
||||
return lanczos22UDT::lanczos_sum_near_2(z);
|
||||
else if(p <= 170)
|
||||
return lanczos31UDT::lanczos_sum_near_2(z);
|
||||
else //if(p <= 370) approx 100 digit precision:
|
||||
return lanczos61UDT::lanczos_sum_near_2(z);
|
||||
}
|
||||
static mpfr_class g()
|
||||
{
|
||||
unsigned long p = mpfr_class::get_dprec();
|
||||
if(p <= 72)
|
||||
return lanczos13UDT::g();
|
||||
else if(p <= 120)
|
||||
return lanczos22UDT::g();
|
||||
else if(p <= 170)
|
||||
return lanczos31UDT::g();
|
||||
else //if(p <= 370) approx 100 digit precision:
|
||||
return lanczos61UDT::g();
|
||||
}
|
||||
};
|
||||
|
||||
template<class Policy>
|
||||
struct lanczos<mpfr_class, Policy>
|
||||
{
|
||||
typedef mpfr_lanczos type;
|
||||
};
|
||||
|
||||
} // namespace lanczos
|
||||
|
||||
namespace constants{
|
||||
|
||||
template <class Real, class Policy>
|
||||
struct construction_traits;
|
||||
|
||||
template <class Policy>
|
||||
struct construction_traits<mpfr_class, Policy>
|
||||
{
|
||||
typedef mpl::int_<0> type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace tools
|
||||
{
|
||||
|
||||
template <class T, class U>
|
||||
struct promote_arg<__gmp_expr<T,U> >
|
||||
{ // If T is integral type, then promote to double.
|
||||
typedef mpfr_class type;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline int digits<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class)) BOOST_NOEXCEPT
|
||||
{
|
||||
return mpfr_class::get_dprec();
|
||||
}
|
||||
|
||||
namespace detail{
|
||||
|
||||
template<class I>
|
||||
void convert_to_long_result(mpfr_class const& r, I& result)
|
||||
{
|
||||
result = 0;
|
||||
I last_result(0);
|
||||
mpfr_class t(r);
|
||||
double term;
|
||||
do
|
||||
{
|
||||
term = real_cast<double>(t);
|
||||
last_result = result;
|
||||
result += static_cast<I>(term);
|
||||
t -= term;
|
||||
}while(result != last_result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template <>
|
||||
inline mpfr_class real_cast<mpfr_class, long long>(long long t)
|
||||
{
|
||||
mpfr_class result;
|
||||
int expon = 0;
|
||||
int sign = 1;
|
||||
if(t < 0)
|
||||
{
|
||||
sign = -1;
|
||||
t = -t;
|
||||
}
|
||||
while(t)
|
||||
{
|
||||
result += ldexp((double)(t & 0xffffL), expon);
|
||||
expon += 32;
|
||||
t >>= 32;
|
||||
}
|
||||
return result * sign;
|
||||
}
|
||||
template <>
|
||||
inline unsigned real_cast<unsigned, mpfr_class>(mpfr_class t)
|
||||
{
|
||||
return t.get_ui();
|
||||
}
|
||||
template <>
|
||||
inline int real_cast<int, mpfr_class>(mpfr_class t)
|
||||
{
|
||||
return t.get_si();
|
||||
}
|
||||
template <>
|
||||
inline double real_cast<double, mpfr_class>(mpfr_class t)
|
||||
{
|
||||
return t.get_d();
|
||||
}
|
||||
template <>
|
||||
inline float real_cast<float, mpfr_class>(mpfr_class t)
|
||||
{
|
||||
return static_cast<float>(t.get_d());
|
||||
}
|
||||
template <>
|
||||
inline long real_cast<long, mpfr_class>(mpfr_class t)
|
||||
{
|
||||
long result;
|
||||
detail::convert_to_long_result(t, result);
|
||||
return result;
|
||||
}
|
||||
template <>
|
||||
inline long long real_cast<long long, mpfr_class>(mpfr_class t)
|
||||
{
|
||||
long long result;
|
||||
detail::convert_to_long_result(t, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline mpfr_class max_value<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class))
|
||||
{
|
||||
static bool has_init = false;
|
||||
static mpfr_class val;
|
||||
if(!has_init)
|
||||
{
|
||||
val = 0.5;
|
||||
mpfr_set_exp(val.__get_mp(), mpfr_get_emax());
|
||||
has_init = true;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline mpfr_class min_value<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class))
|
||||
{
|
||||
static bool has_init = false;
|
||||
static mpfr_class val;
|
||||
if(!has_init)
|
||||
{
|
||||
val = 0.5;
|
||||
mpfr_set_exp(val.__get_mp(), mpfr_get_emin());
|
||||
has_init = true;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline mpfr_class log_max_value<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class))
|
||||
{
|
||||
static bool has_init = false;
|
||||
static mpfr_class val = max_value<mpfr_class>();
|
||||
if(!has_init)
|
||||
{
|
||||
val = log(val);
|
||||
has_init = true;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline mpfr_class log_min_value<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class))
|
||||
{
|
||||
static bool has_init = false;
|
||||
static mpfr_class val = max_value<mpfr_class>();
|
||||
if(!has_init)
|
||||
{
|
||||
val = log(val);
|
||||
has_init = true;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline mpfr_class epsilon<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class))
|
||||
{
|
||||
return ldexp(mpfr_class(1), 1-boost::math::policies::digits<mpfr_class, boost::math::policies::policy<> >());
|
||||
}
|
||||
|
||||
} // namespace tools
|
||||
|
||||
namespace policies{
|
||||
|
||||
template <class T, class U, class Policy>
|
||||
struct evaluation<__gmp_expr<T, U>, Policy>
|
||||
{
|
||||
typedef mpfr_class type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline mpfr_class skewness(const extreme_value_distribution<mpfr_class, Policy>& /*dist*/)
|
||||
{
|
||||
//
|
||||
// This is 12 * sqrt(6) * zeta(3) / pi^3:
|
||||
// See http://mathworld.wolfram.com/ExtremeValueDistribution.html
|
||||
//
|
||||
return boost::lexical_cast<mpfr_class>("1.1395470994046486574927930193898461120875997958366");
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline mpfr_class skewness(const rayleigh_distribution<mpfr_class, Policy>& /*dist*/)
|
||||
{
|
||||
// using namespace boost::math::constants;
|
||||
return boost::lexical_cast<mpfr_class>("0.63111065781893713819189935154422777984404221106391");
|
||||
// Computed using NTL at 150 bit, about 50 decimal digits.
|
||||
// return 2 * root_pi<RealType>() * pi_minus_three<RealType>() / pow23_four_minus_pi<RealType>();
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline mpfr_class kurtosis(const rayleigh_distribution<mpfr_class, Policy>& /*dist*/)
|
||||
{
|
||||
// using namespace boost::math::constants;
|
||||
return boost::lexical_cast<mpfr_class>("3.2450893006876380628486604106197544154170667057995");
|
||||
// Computed using NTL at 150 bit, about 50 decimal digits.
|
||||
// return 3 - (6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
|
||||
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
|
||||
}
|
||||
|
||||
template <class Policy>
|
||||
inline mpfr_class kurtosis_excess(const rayleigh_distribution<mpfr_class, Policy>& /*dist*/)
|
||||
{
|
||||
//using namespace boost::math::constants;
|
||||
// Computed using NTL at 150 bit, about 50 decimal digits.
|
||||
return boost::lexical_cast<mpfr_class>("0.2450893006876380628486604106197544154170667057995");
|
||||
// return -(6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
|
||||
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
|
||||
} // kurtosis
|
||||
|
||||
namespace detail{
|
||||
|
||||
//
|
||||
// Version of Digamma accurate to ~100 decimal digits.
|
||||
//
|
||||
template <class Policy>
|
||||
mpfr_class digamma_imp(mpfr_class x, const mpl::int_<0>* , const Policy& pol)
|
||||
{
|
||||
//
|
||||
// This handles reflection of negative arguments, and all our
|
||||
// empfr_classor handling, then forwards to the T-specific approximation.
|
||||
//
|
||||
BOOST_MATH_STD_USING // ADL of std functions.
|
||||
|
||||
mpfr_class result = 0;
|
||||
//
|
||||
// Check for negative arguments and use reflection:
|
||||
//
|
||||
if(x < 0)
|
||||
{
|
||||
// Reflect:
|
||||
x = 1 - x;
|
||||
// Argument reduction for tan:
|
||||
mpfr_class remainder = x - floor(x);
|
||||
// Shift to negative if > 0.5:
|
||||
if(remainder > 0.5)
|
||||
{
|
||||
remainder -= 1;
|
||||
}
|
||||
//
|
||||
// check for evaluation at a negative pole:
|
||||
//
|
||||
if(remainder == 0)
|
||||
{
|
||||
return policies::raise_pole_error<mpfr_class>("boost::math::digamma<%1%>(%1%)", 0, (1-x), pol);
|
||||
}
|
||||
result = constants::pi<mpfr_class>() / tan(constants::pi<mpfr_class>() * remainder);
|
||||
}
|
||||
result += big_digamma(x);
|
||||
return result;
|
||||
}
|
||||
//
|
||||
// Specialisations of this function provides the initial
|
||||
// starting guess for Halley iteration:
|
||||
//
|
||||
template <class Policy>
|
||||
inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Policy&, const boost::mpl::int_<64>*)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std names.
|
||||
|
||||
mpfr_class result = 0;
|
||||
|
||||
if(p <= 0.5)
|
||||
{
|
||||
//
|
||||
// Evaluate inverse erf using the rational approximation:
|
||||
//
|
||||
// x = p(p+10)(Y+R(p))
|
||||
//
|
||||
// Where Y is a constant, and R(p) is optimised for a low
|
||||
// absolute empfr_classor compared to |Y|.
|
||||
//
|
||||
// double: Max empfr_classor found: 2.001849e-18
|
||||
// long double: Max empfr_classor found: 1.017064e-20
|
||||
// Maximum Deviation Found (actual empfr_classor term at infinite precision) 8.030e-21
|
||||
//
|
||||
static const float Y = 0.0891314744949340820313f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.000508781949658280665617,
|
||||
-0.00836874819741736770379,
|
||||
0.0334806625409744615033,
|
||||
-0.0126926147662974029034,
|
||||
-0.0365637971411762664006,
|
||||
0.0219878681111168899165,
|
||||
0.00822687874676915743155,
|
||||
-0.00538772965071242932965
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
-0.970005043303290640362,
|
||||
-1.56574558234175846809,
|
||||
1.56221558398423026363,
|
||||
0.662328840472002992063,
|
||||
-0.71228902341542847553,
|
||||
-0.0527396382340099713954,
|
||||
0.0795283687341571680018,
|
||||
-0.00233393759374190016776,
|
||||
0.000886216390456424707504
|
||||
};
|
||||
mpfr_class g = p * (p + 10);
|
||||
mpfr_class r = tools::evaluate_polynomial(P, p) / tools::evaluate_polynomial(Q, p);
|
||||
result = g * Y + g * r;
|
||||
}
|
||||
else if(q >= 0.25)
|
||||
{
|
||||
//
|
||||
// Rational approximation for 0.5 > q >= 0.25
|
||||
//
|
||||
// x = sqrt(-2*log(q)) / (Y + R(q))
|
||||
//
|
||||
// Where Y is a constant, and R(q) is optimised for a low
|
||||
// absolute empfr_classor compared to Y.
|
||||
//
|
||||
// double : Max empfr_classor found: 7.403372e-17
|
||||
// long double : Max empfr_classor found: 6.084616e-20
|
||||
// Maximum Deviation Found (empfr_classor term) 4.811e-20
|
||||
//
|
||||
static const float Y = 2.249481201171875f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.202433508355938759655,
|
||||
0.105264680699391713268,
|
||||
8.37050328343119927838,
|
||||
17.6447298408374015486,
|
||||
-18.8510648058714251895,
|
||||
-44.6382324441786960818,
|
||||
17.445385985570866523,
|
||||
21.1294655448340526258,
|
||||
-3.67192254707729348546
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
6.24264124854247537712,
|
||||
3.9713437953343869095,
|
||||
-28.6608180499800029974,
|
||||
-20.1432634680485188801,
|
||||
48.5609213108739935468,
|
||||
10.8268667355460159008,
|
||||
-22.6436933413139721736,
|
||||
1.72114765761200282724
|
||||
};
|
||||
mpfr_class g = sqrt(-2 * log(q));
|
||||
mpfr_class xs = q - 0.25;
|
||||
mpfr_class r = tools::evaluate_polynomial(P, xs) / tools::evaluate_polynomial(Q, xs);
|
||||
result = g / (Y + r);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// For q < 0.25 we have a series of rational approximations all
|
||||
// of the general form:
|
||||
//
|
||||
// let: x = sqrt(-log(q))
|
||||
//
|
||||
// Then the result is given by:
|
||||
//
|
||||
// x(Y+R(x-B))
|
||||
//
|
||||
// where Y is a constant, B is the lowest value of x for which
|
||||
// the approximation is valid, and R(x-B) is optimised for a low
|
||||
// absolute empfr_classor compared to Y.
|
||||
//
|
||||
// Note that almost all code will really go through the first
|
||||
// or maybe second approximation. After than we're dealing with very
|
||||
// small input values indeed: 80 and 128 bit long double's go all the
|
||||
// way down to ~ 1e-5000 so the "tail" is rather long...
|
||||
//
|
||||
mpfr_class x = sqrt(-log(q));
|
||||
if(x < 3)
|
||||
{
|
||||
// Max empfr_classor found: 1.089051e-20
|
||||
static const float Y = 0.807220458984375f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.131102781679951906451,
|
||||
-0.163794047193317060787,
|
||||
0.117030156341995252019,
|
||||
0.387079738972604337464,
|
||||
0.337785538912035898924,
|
||||
0.142869534408157156766,
|
||||
0.0290157910005329060432,
|
||||
0.00214558995388805277169,
|
||||
-0.679465575181126350155e-6,
|
||||
0.285225331782217055858e-7,
|
||||
-0.681149956853776992068e-9
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
3.46625407242567245975,
|
||||
5.38168345707006855425,
|
||||
4.77846592945843778382,
|
||||
2.59301921623620271374,
|
||||
0.848854343457902036425,
|
||||
0.152264338295331783612,
|
||||
0.01105924229346489121
|
||||
};
|
||||
mpfr_class xs = x - 1.125;
|
||||
mpfr_class R = tools::evaluate_polynomial(P, xs) / tools::evaluate_polynomial(Q, xs);
|
||||
result = Y * x + R * x;
|
||||
}
|
||||
else if(x < 6)
|
||||
{
|
||||
// Max empfr_classor found: 8.389174e-21
|
||||
static const float Y = 0.93995571136474609375f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.0350353787183177984712,
|
||||
-0.00222426529213447927281,
|
||||
0.0185573306514231072324,
|
||||
0.00950804701325919603619,
|
||||
0.00187123492819559223345,
|
||||
0.000157544617424960554631,
|
||||
0.460469890584317994083e-5,
|
||||
-0.230404776911882601748e-9,
|
||||
0.266339227425782031962e-11
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
1.3653349817554063097,
|
||||
0.762059164553623404043,
|
||||
0.220091105764131249824,
|
||||
0.0341589143670947727934,
|
||||
0.00263861676657015992959,
|
||||
0.764675292302794483503e-4
|
||||
};
|
||||
mpfr_class xs = x - 3;
|
||||
mpfr_class R = tools::evaluate_polynomial(P, xs) / tools::evaluate_polynomial(Q, xs);
|
||||
result = Y * x + R * x;
|
||||
}
|
||||
else if(x < 18)
|
||||
{
|
||||
// Max empfr_classor found: 1.481312e-19
|
||||
static const float Y = 0.98362827301025390625f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.0167431005076633737133,
|
||||
-0.00112951438745580278863,
|
||||
0.00105628862152492910091,
|
||||
0.000209386317487588078668,
|
||||
0.149624783758342370182e-4,
|
||||
0.449696789927706453732e-6,
|
||||
0.462596163522878599135e-8,
|
||||
-0.281128735628831791805e-13,
|
||||
0.99055709973310326855e-16
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
0.591429344886417493481,
|
||||
0.138151865749083321638,
|
||||
0.0160746087093676504695,
|
||||
0.000964011807005165528527,
|
||||
0.275335474764726041141e-4,
|
||||
0.282243172016108031869e-6
|
||||
};
|
||||
mpfr_class xs = x - 6;
|
||||
mpfr_class R = tools::evaluate_polynomial(P, xs) / tools::evaluate_polynomial(Q, xs);
|
||||
result = Y * x + R * x;
|
||||
}
|
||||
else if(x < 44)
|
||||
{
|
||||
// Max empfr_classor found: 5.697761e-20
|
||||
static const float Y = 0.99714565277099609375f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.0024978212791898131227,
|
||||
-0.779190719229053954292e-5,
|
||||
0.254723037413027451751e-4,
|
||||
0.162397777342510920873e-5,
|
||||
0.396341011304801168516e-7,
|
||||
0.411632831190944208473e-9,
|
||||
0.145596286718675035587e-11,
|
||||
-0.116765012397184275695e-17
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
0.207123112214422517181,
|
||||
0.0169410838120975906478,
|
||||
0.000690538265622684595676,
|
||||
0.145007359818232637924e-4,
|
||||
0.144437756628144157666e-6,
|
||||
0.509761276599778486139e-9
|
||||
};
|
||||
mpfr_class xs = x - 18;
|
||||
mpfr_class R = tools::evaluate_polynomial(P, xs) / tools::evaluate_polynomial(Q, xs);
|
||||
result = Y * x + R * x;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Max empfr_classor found: 1.279746e-20
|
||||
static const float Y = 0.99941349029541015625f;
|
||||
static const mpfr_class P[] = {
|
||||
-0.000539042911019078575891,
|
||||
-0.28398759004727721098e-6,
|
||||
0.899465114892291446442e-6,
|
||||
0.229345859265920864296e-7,
|
||||
0.225561444863500149219e-9,
|
||||
0.947846627503022684216e-12,
|
||||
0.135880130108924861008e-14,
|
||||
-0.348890393399948882918e-21
|
||||
};
|
||||
static const mpfr_class Q[] = {
|
||||
1,
|
||||
0.0845746234001899436914,
|
||||
0.00282092984726264681981,
|
||||
0.468292921940894236786e-4,
|
||||
0.399968812193862100054e-6,
|
||||
0.161809290887904476097e-8,
|
||||
0.231558608310259605225e-11
|
||||
};
|
||||
mpfr_class xs = x - 44;
|
||||
mpfr_class R = tools::evaluate_polynomial(P, xs) / tools::evaluate_polynomial(Q, xs);
|
||||
result = Y * x + R * x;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
inline mpfr_class bessel_i0(mpfr_class x)
|
||||
{
|
||||
static const mpfr_class P1[] = {
|
||||
boost::lexical_cast<mpfr_class>("-2.2335582639474375249e+15"),
|
||||
boost::lexical_cast<mpfr_class>("-5.5050369673018427753e+14"),
|
||||
boost::lexical_cast<mpfr_class>("-3.2940087627407749166e+13"),
|
||||
boost::lexical_cast<mpfr_class>("-8.4925101247114157499e+11"),
|
||||
boost::lexical_cast<mpfr_class>("-1.1912746104985237192e+10"),
|
||||
boost::lexical_cast<mpfr_class>("-1.0313066708737980747e+08"),
|
||||
boost::lexical_cast<mpfr_class>("-5.9545626019847898221e+05"),
|
||||
boost::lexical_cast<mpfr_class>("-2.4125195876041896775e+03"),
|
||||
boost::lexical_cast<mpfr_class>("-7.0935347449210549190e+00"),
|
||||
boost::lexical_cast<mpfr_class>("-1.5453977791786851041e-02"),
|
||||
boost::lexical_cast<mpfr_class>("-2.5172644670688975051e-05"),
|
||||
boost::lexical_cast<mpfr_class>("-3.0517226450451067446e-08"),
|
||||
boost::lexical_cast<mpfr_class>("-2.6843448573468483278e-11"),
|
||||
boost::lexical_cast<mpfr_class>("-1.5982226675653184646e-14"),
|
||||
boost::lexical_cast<mpfr_class>("-5.2487866627945699800e-18"),
|
||||
};
|
||||
static const mpfr_class Q1[] = {
|
||||
boost::lexical_cast<mpfr_class>("-2.2335582639474375245e+15"),
|
||||
boost::lexical_cast<mpfr_class>("7.8858692566751002988e+12"),
|
||||
boost::lexical_cast<mpfr_class>("-1.2207067397808979846e+10"),
|
||||
boost::lexical_cast<mpfr_class>("1.0377081058062166144e+07"),
|
||||
boost::lexical_cast<mpfr_class>("-4.8527560179962773045e+03"),
|
||||
boost::lexical_cast<mpfr_class>("1.0"),
|
||||
};
|
||||
static const mpfr_class P2[] = {
|
||||
boost::lexical_cast<mpfr_class>("-2.2210262233306573296e-04"),
|
||||
boost::lexical_cast<mpfr_class>("1.3067392038106924055e-02"),
|
||||
boost::lexical_cast<mpfr_class>("-4.4700805721174453923e-01"),
|
||||
boost::lexical_cast<mpfr_class>("5.5674518371240761397e+00"),
|
||||
boost::lexical_cast<mpfr_class>("-2.3517945679239481621e+01"),
|
||||
boost::lexical_cast<mpfr_class>("3.1611322818701131207e+01"),
|
||||
boost::lexical_cast<mpfr_class>("-9.6090021968656180000e+00"),
|
||||
};
|
||||
static const mpfr_class Q2[] = {
|
||||
boost::lexical_cast<mpfr_class>("-5.5194330231005480228e-04"),
|
||||
boost::lexical_cast<mpfr_class>("3.2547697594819615062e-02"),
|
||||
boost::lexical_cast<mpfr_class>("-1.1151759188741312645e+00"),
|
||||
boost::lexical_cast<mpfr_class>("1.3982595353892851542e+01"),
|
||||
boost::lexical_cast<mpfr_class>("-6.0228002066743340583e+01"),
|
||||
boost::lexical_cast<mpfr_class>("8.5539563258012929600e+01"),
|
||||
boost::lexical_cast<mpfr_class>("-3.1446690275135491500e+01"),
|
||||
boost::lexical_cast<mpfr_class>("1.0"),
|
||||
};
|
||||
mpfr_class value, factor, r;
|
||||
|
||||
BOOST_MATH_STD_USING
|
||||
using namespace boost::math::tools;
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
x = -x; // even function
|
||||
}
|
||||
if (x == 0)
|
||||
{
|
||||
return static_cast<mpfr_class>(1);
|
||||
}
|
||||
if (x <= 15) // x in (0, 15]
|
||||
{
|
||||
mpfr_class y = x * x;
|
||||
value = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y);
|
||||
}
|
||||
else // x in (15, \infty)
|
||||
{
|
||||
mpfr_class y = 1 / x - mpfr_class(1) / 15;
|
||||
r = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y);
|
||||
factor = exp(x) / sqrt(x);
|
||||
value = factor * r;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline mpfr_class bessel_i1(mpfr_class x)
|
||||
{
|
||||
static const mpfr_class P1[] = {
|
||||
static_cast<mpfr_class>("-1.4577180278143463643e+15"),
|
||||
static_cast<mpfr_class>("-1.7732037840791591320e+14"),
|
||||
static_cast<mpfr_class>("-6.9876779648010090070e+12"),
|
||||
static_cast<mpfr_class>("-1.3357437682275493024e+11"),
|
||||
static_cast<mpfr_class>("-1.4828267606612366099e+09"),
|
||||
static_cast<mpfr_class>("-1.0588550724769347106e+07"),
|
||||
static_cast<mpfr_class>("-5.1894091982308017540e+04"),
|
||||
static_cast<mpfr_class>("-1.8225946631657315931e+02"),
|
||||
static_cast<mpfr_class>("-4.7207090827310162436e-01"),
|
||||
static_cast<mpfr_class>("-9.1746443287817501309e-04"),
|
||||
static_cast<mpfr_class>("-1.3466829827635152875e-06"),
|
||||
static_cast<mpfr_class>("-1.4831904935994647675e-09"),
|
||||
static_cast<mpfr_class>("-1.1928788903603238754e-12"),
|
||||
static_cast<mpfr_class>("-6.5245515583151902910e-16"),
|
||||
static_cast<mpfr_class>("-1.9705291802535139930e-19"),
|
||||
};
|
||||
static const mpfr_class Q1[] = {
|
||||
static_cast<mpfr_class>("-2.9154360556286927285e+15"),
|
||||
static_cast<mpfr_class>("9.7887501377547640438e+12"),
|
||||
static_cast<mpfr_class>("-1.4386907088588283434e+10"),
|
||||
static_cast<mpfr_class>("1.1594225856856884006e+07"),
|
||||
static_cast<mpfr_class>("-5.1326864679904189920e+03"),
|
||||
static_cast<mpfr_class>("1.0"),
|
||||
};
|
||||
static const mpfr_class P2[] = {
|
||||
static_cast<mpfr_class>("1.4582087408985668208e-05"),
|
||||
static_cast<mpfr_class>("-8.9359825138577646443e-04"),
|
||||
static_cast<mpfr_class>("2.9204895411257790122e-02"),
|
||||
static_cast<mpfr_class>("-3.4198728018058047439e-01"),
|
||||
static_cast<mpfr_class>("1.3960118277609544334e+00"),
|
||||
static_cast<mpfr_class>("-1.9746376087200685843e+00"),
|
||||
static_cast<mpfr_class>("8.5591872901933459000e-01"),
|
||||
static_cast<mpfr_class>("-6.0437159056137599999e-02"),
|
||||
};
|
||||
static const mpfr_class Q2[] = {
|
||||
static_cast<mpfr_class>("3.7510433111922824643e-05"),
|
||||
static_cast<mpfr_class>("-2.2835624489492512649e-03"),
|
||||
static_cast<mpfr_class>("7.4212010813186530069e-02"),
|
||||
static_cast<mpfr_class>("-8.5017476463217924408e-01"),
|
||||
static_cast<mpfr_class>("3.2593714889036996297e+00"),
|
||||
static_cast<mpfr_class>("-3.8806586721556593450e+00"),
|
||||
static_cast<mpfr_class>("1.0"),
|
||||
};
|
||||
mpfr_class value, factor, r, w;
|
||||
|
||||
BOOST_MATH_STD_USING
|
||||
using namespace boost::math::tools;
|
||||
|
||||
w = abs(x);
|
||||
if (x == 0)
|
||||
{
|
||||
return static_cast<mpfr_class>(0);
|
||||
}
|
||||
if (w <= 15) // w in (0, 15]
|
||||
{
|
||||
mpfr_class y = x * x;
|
||||
r = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y);
|
||||
factor = w;
|
||||
value = factor * r;
|
||||
}
|
||||
else // w in (15, \infty)
|
||||
{
|
||||
mpfr_class y = 1 / w - mpfr_class(1) / 15;
|
||||
r = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y);
|
||||
factor = exp(w) / sqrt(w);
|
||||
value = factor * r;
|
||||
}
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
value *= -value; // odd function
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
}
|
||||
|
||||
template<> struct is_convertible<long double, mpfr_class> : public mpl::false_{};
|
||||
|
||||
}
|
||||
|
||||
#endif // BOOST_MATH_MPLFR_BINDINGS_HPP
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
|
||||
#ifndef BOOST_RANGE_ADAPTOR_FILTERED_HPP
|
||||
#define BOOST_RANGE_ADAPTOR_FILTERED_HPP
|
||||
|
||||
#include <boost/range/adaptor/argument_fwd.hpp>
|
||||
#include <boost/range/detail/default_constructible_unary_fn.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/iterator/filter_iterator.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
template< class P, class R >
|
||||
struct filtered_range :
|
||||
boost::iterator_range<
|
||||
boost::filter_iterator<
|
||||
typename default_constructible_unary_fn_gen<P, bool>::type,
|
||||
typename range_iterator<R>::type
|
||||
>
|
||||
>
|
||||
{
|
||||
private:
|
||||
typedef boost::iterator_range<
|
||||
boost::filter_iterator<
|
||||
typename default_constructible_unary_fn_gen<P, bool>::type,
|
||||
typename range_iterator<R>::type
|
||||
>
|
||||
> base;
|
||||
public:
|
||||
typedef typename default_constructible_unary_fn_gen<P, bool>::type
|
||||
pred_t;
|
||||
|
||||
filtered_range(P p, R& r)
|
||||
: base(make_filter_iterator(pred_t(p),
|
||||
boost::begin(r), boost::end(r)),
|
||||
make_filter_iterator(pred_t(p),
|
||||
boost::end(r), boost::end(r)))
|
||||
{ }
|
||||
};
|
||||
|
||||
template< class T >
|
||||
struct filter_holder : holder<T>
|
||||
{
|
||||
filter_holder( T r ) : holder<T>(r)
|
||||
{ }
|
||||
};
|
||||
|
||||
template< class SinglePassRange, class Predicate >
|
||||
inline filtered_range<Predicate, SinglePassRange>
|
||||
operator|(SinglePassRange& r,
|
||||
const filter_holder<Predicate>& f)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange>));
|
||||
return filtered_range<Predicate, SinglePassRange>( f.val, r );
|
||||
}
|
||||
|
||||
template< class SinglePassRange, class Predicate >
|
||||
inline filtered_range<Predicate, const SinglePassRange>
|
||||
operator|(const SinglePassRange& r,
|
||||
const filter_holder<Predicate>& f )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<const SinglePassRange>));
|
||||
return filtered_range<Predicate, const SinglePassRange>( f.val, r );
|
||||
}
|
||||
|
||||
} // 'range_detail'
|
||||
|
||||
// Unusual use of 'using' is intended to bring filter_range into the boost namespace
|
||||
// while leaving the mechanics of the '|' operator in range_detail and maintain
|
||||
// argument dependent lookup.
|
||||
// filter_range logically needs to be in the boost namespace to allow user of
|
||||
// the library to define the return type for filter()
|
||||
using range_detail::filtered_range;
|
||||
|
||||
namespace adaptors
|
||||
{
|
||||
namespace
|
||||
{
|
||||
const range_detail::forwarder<range_detail::filter_holder>
|
||||
filtered =
|
||||
range_detail::forwarder<range_detail::filter_holder>();
|
||||
}
|
||||
|
||||
template<class SinglePassRange, class Predicate>
|
||||
inline filtered_range<Predicate, SinglePassRange>
|
||||
filter(SinglePassRange& rng, Predicate filter_pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<SinglePassRange>));
|
||||
|
||||
return range_detail::filtered_range<
|
||||
Predicate, SinglePassRange>( filter_pred, rng );
|
||||
}
|
||||
|
||||
template<class SinglePassRange, class Predicate>
|
||||
inline filtered_range<Predicate, const SinglePassRange>
|
||||
filter(const SinglePassRange& rng, Predicate filter_pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT((
|
||||
SinglePassRangeConcept<const SinglePassRange>));
|
||||
|
||||
return range_detail::filtered_range<
|
||||
Predicate, const SinglePassRange>( filter_pred, rng );
|
||||
}
|
||||
} // 'adaptors'
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,128 @@
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_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$
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/prior.hpp>
|
||||
# include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/unrolling.hpp>
|
||||
# include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
// forward declaration
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
|
||||
struct advance_backward
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef typename apply_wrap1<
|
||||
advance_backward<BOOST_MPL_LIMIT_UNROLLING>
|
||||
, Iterator
|
||||
>::type chunk_result_;
|
||||
|
||||
typedef typename apply_wrap1<
|
||||
advance_backward<(
|
||||
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
|
||||
? 0
|
||||
: N - BOOST_MPL_LIMIT_UNROLLING
|
||||
)>
|
||||
, chunk_result_
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<>
|
||||
struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef Iterator iter0;
|
||||
|
||||
#if i_ > 0
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
#endif
|
||||
|
||||
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
|
||||
/// ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
|
||||
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
|
||||
|
||||
typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
|
||||
|
||||
# undef AUX778076_ITER_1
|
||||
# undef AUX778076_ITER_0
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,40 @@
|
||||
CC = gcc
|
||||
FC = gfortran
|
||||
|
||||
FFLAGS = -O2 -Wall -Wno-conversion
|
||||
CFLAGS= -I/JTSDK/fftw3f -Wall -Wno-missing-braces -O2
|
||||
#LDFLAGS = -L/JTSDK/fftw3f -Wl,--stack,4000000
|
||||
LDFLAGS = -L/JTSDK/fftw3f
|
||||
LIBS = c:/JTSDK/fftw3f/libfftw3-3.dll -lm
|
||||
|
||||
# Default rules
|
||||
%.o: %.c $(DEPS)
|
||||
${CC} ${CFLAGS} -c $<
|
||||
%.o: %.f
|
||||
${FC} ${FFLAGS} -c $<
|
||||
%.o: %.F
|
||||
${FC} ${FFLAGS} -c $<
|
||||
%.o: %.f90
|
||||
${FC} ${FFLAGS} -c $<
|
||||
%.o: %.F90
|
||||
${FC} ${FFLAGS} -c $<
|
||||
|
||||
all: wsprd.exe wsprsim.exe wsprd_exp.exe
|
||||
|
||||
DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h
|
||||
|
||||
OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o
|
||||
wsprd.exe: $(OBJS1)
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
|
||||
|
||||
OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o
|
||||
wsprsim.exe: $(OBJS2)
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
|
||||
|
||||
OBJS3 = wsprd_exp.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o \
|
||||
nhash.o
|
||||
wsprd_exp.exe: $(OBJS3)
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm *.o wsprd.exe wsprsim.exe wsprd_exp.exe
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "AudioDevice.hpp"
|
||||
|
||||
bool AudioDevice::initialize (OpenMode mode, Channel channel)
|
||||
{
|
||||
m_channel = channel;
|
||||
|
||||
// open and ensure we are unbuffered if possible
|
||||
return QIODevice::open (mode | QIODevice::Unbuffered);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user