Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,771 @@
#include "plotter.h"
#include <math.h>
#include <QDebug>
#include "commons.h"
#include "moc_plotter.cpp"
#include <fstream>
#include <iostream>
#define MAX_SCREENSIZE 2048
CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
QFrame {parent},
m_set_freq_action {new QAction {tr ("&Set Rx && Tx Offset"), this}},
m_bScaleOK {false},
m_bReference {false},
m_bReference0 {false},
m_fSpan {2000.0},
m_plotZero {0},
m_plotGain {0},
m_plot2dGain {0},
m_plot2dZero {0},
m_nSubMode {0},
m_Running {false},
m_paintEventBusy {false},
m_fftBinWidth {1500.0/2048.0},
m_dialFreq {0.},
m_sum {},
m_dBStepSize {10},
m_FreqUnits {1},
m_hdivs {HORZ_DIVS},
m_line {0},
m_fSample {12000},
m_nsps {6912},
m_Percent2DScreen {30}, //percent of screen used for 2D display
m_Percent2DScreen0 {0},
m_rxFreq {1020},
m_txFreq {0},
m_startFreq {0}
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setFocusPolicy(Qt::StrongFocus);
setAttribute(Qt::WA_PaintOnScreen,false);
setAutoFillBackground(false);
setAttribute(Qt::WA_OpaquePaintEvent, false);
setAttribute(Qt::WA_NoSystemBackground, true);
// contextual pop up menu
setContextMenuPolicy (Qt::CustomContextMenu);
connect (this, &QWidget::customContextMenuRequested, [this] (QPoint const& pos) {
QMenu menu {this};
menu.addAction (m_set_freq_action);
auto const& connection = connect (m_set_freq_action, &QAction::triggered, [this, pos] () {
int newFreq = FreqfromX (pos.x ()) + .5;
emit setFreq1 (newFreq, newFreq);
});
menu.exec (mapToGlobal (pos));
disconnect (connection);
});
}
CPlotter::~CPlotter() { } // Destructor
QSize CPlotter::minimumSizeHint() const
{
return QSize(50, 50);
}
QSize CPlotter::sizeHint() const
{
return QSize(180, 180);
}
void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent()
{
if(!size().isValid()) return;
if( m_Size != size() or (m_bReference != m_bReference0) or
m_Percent2DScreen != m_Percent2DScreen0) {
m_Size = size();
m_w = m_Size.width();
m_h = m_Size.height();
m_h2 = m_Percent2DScreen*m_h/100.0;
if(m_h2>m_h-30) m_h2=m_h-30;
if(m_bReference) m_h2=m_h-30;
if(m_h2<1) m_h2=1;
m_h1=m_h-m_h2;
m_2DPixmap = QPixmap(m_Size.width(), m_h2);
m_2DPixmap.fill(Qt::black);
m_WaterfallPixmap = QPixmap(m_Size.width(), m_h1);
m_OverlayPixmap = QPixmap(m_Size.width(), m_h2);
m_OverlayPixmap.fill(Qt::black);
m_WaterfallPixmap.fill(Qt::black);
m_2DPixmap.fill(Qt::black);
m_ScalePixmap = QPixmap(m_w,30);
m_ScalePixmap.fill(Qt::white);
m_Percent2DScreen0 = m_Percent2DScreen;
}
DrawOverlay();
}
void CPlotter::paintEvent(QPaintEvent *) // paintEvent()
{
if(m_paintEventBusy) return;
m_paintEventBusy=true;
QPainter painter(this);
painter.drawPixmap(0,0,m_ScalePixmap);
painter.drawPixmap(0,30,m_WaterfallPixmap);
painter.drawPixmap(0,m_h1,m_2DPixmap);
m_paintEventBusy=false;
}
void CPlotter::draw(float swide[], bool bScroll, bool bRed)
{
int j,j0;
static int ktop=0;
float y,y2,ymin;
double fac = sqrt(m_binsPerPixel*m_waterfallAvg/15.0);
double gain = fac*pow(10.0,0.02*m_plotGain);
double gain2d = pow(10.0,0.02*(m_plot2dGain));
if(m_bReference != m_bReference0) resizeEvent(NULL);
m_bReference0=m_bReference;
//move current data down one line (must do this before attaching a QPainter object)
if(bScroll) m_WaterfallPixmap.scroll(0,1,0,0,m_w,m_h1);
QPainter painter1(&m_WaterfallPixmap);
m_2DPixmap = m_OverlayPixmap.copy(0,0,m_w,m_h2);
QPainter painter2D(&m_2DPixmap);
if(!painter2D.isActive()) return;
QFont Font("Arial");
Font.setPointSize(12);
Font.setWeight(QFont::Normal);
painter2D.setFont(Font);
if(m_bLinearAvg) {
painter2D.setPen(Qt::yellow);
} else if(m_bReference) {
painter2D.setPen(Qt::blue);
} else {
painter2D.setPen(Qt::green);
}
static QPoint LineBuf[MAX_SCREENSIZE];
static QPoint LineBuf2[MAX_SCREENSIZE];
j=0;
j0=int(m_startFreq/m_fftBinWidth + 0.5);
int iz=XfromFreq(5000.0);
int jz=iz*m_binsPerPixel;
m_fMax=FreqfromX(iz);
m_line++;
if(bScroll) {
flat4_(swide,&iz,&m_Flatten);
flat4_(&dec_data.savg[j0],&jz,&m_Flatten);
}
ymin=1.e30;
if(swide[0]>1.e29 and swide[0]< 1.5e30) painter1.setPen(Qt::green);
if(swide[0]>1.4e30) painter1.setPen(Qt::yellow);
for(int i=0; i<iz; i++) {
y=swide[i];
if(y<ymin) ymin=y;
int y1 = 10.0*gain*y + 10*m_plotZero +40;
if (y1<0) y1=0;
if (y1>254) y1=254;
if (swide[i]<1.e29) painter1.setPen(g_ColorTbl[y1]);
painter1.drawPoint(i,0);
}
float y2min=1.e30;
float y2max=-1.e30;
for(int i=0; i<iz; i++) {
y=swide[i] - ymin;
y2=0;
if(m_bCurrent) y2 = gain2d*y + m_plot2dZero; //Current
if(bScroll) {
float sum=0.0;
int j=j0+m_binsPerPixel*i;
for(int k=0; k<m_binsPerPixel; k++) {
sum+=dec_data.savg[j++];
}
m_sum[i]=sum;
}
if(m_bCumulative) y2=gain2d*(m_sum[i]/m_binsPerPixel + m_plot2dZero);
if(m_Flatten==0) y2 += 15; //### could do better! ###
if(m_bLinearAvg) { //Linear Avg (yellow)
float sum=0.0;
int j=j0+m_binsPerPixel*i;
for(int k=0; k<m_binsPerPixel; k++) {
sum+=spectra_.syellow[j++];
}
y2=gain2d*sum/m_binsPerPixel + m_plot2dZero;
}
if(m_bReference) { //Reference (red)
float df_ref=12000.0/6912.0;
int j=FreqfromX(i)/df_ref + 0.5;
y2=spectra_.ref[j] + m_plot2dZero;
// if(gain2d>1.5) y2=spectra_.filter[j] + m_plot2dZero;
}
if(i==iz-1) {
painter2D.drawPolyline(LineBuf,j);
if(m_mode=="QRA64") {
painter2D.setPen(Qt::red);
painter2D.drawPolyline(LineBuf2,ktop);
}
}
LineBuf[j].setX(i);
LineBuf[j].setY(int(0.9*m_h2-y2*m_h2/70.0));
if(y2<y2min) y2min=y2;
if(y2>y2max) y2max=y2;
j++;
}
if(swide[0]>1.0e29) m_line=0;
if(m_line == painter1.fontMetrics ().height ()) {
painter1.setPen(Qt::white);
QString t;
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
int n=(ms/1000) % m_TRperiod;
QDateTime t1=QDateTime::currentDateTimeUtc().addSecs(-n);
if(m_TRperiod < 60) {
t=t1.toString("hh:mm:ss") + " " + m_rxBand;
} else {
t=t1.toString("hh:mm") + " " + m_rxBand;
}
painter1.drawText (5, painter1.fontMetrics ().ascent (), t);
}
if(m_mode=="JT4" or m_mode=="QRA64") {
QPen pen3(Qt::yellow); //Mark freqs of JT4 single-tone msgs
painter2D.setPen(pen3);
Font.setWeight(QFont::Bold);
painter2D.setFont(Font);
int x1=XfromFreq(m_rxFreq);
y=0.2*m_h2;
painter2D.drawText(x1-4,y,"T");
x1=XfromFreq(m_rxFreq+250);
painter2D.drawText(x1-4,y,"M");
x1=XfromFreq(m_rxFreq+500);
painter2D.drawText(x1-4,y,"R");
x1=XfromFreq(m_rxFreq+750);
painter2D.drawText(x1-4,y,"73");
}
if(bRed) {
std::ifstream f;
f.open(m_redFile.toLatin1());
if(f) {
int x,y;
float freq,sync;
float slimit=6.0;
QPen pen0(Qt::red,1);
painter1.setPen(pen0);
for(int i=0; i<99999; i++) {
f >> freq >> sync;
if(f.eof()) break;
x=XfromFreq(freq);
y=(sync-slimit)*3.0;
if(y>0) {
if(y>15.0) y=15.0;
if(x>=0 and x<=m_w) {
painter1.setPen(pen0);
painter1.drawLine(x,0,x,y);
}
}
}
f.close();
}
// m_bDecodeFinished=false;
}
update(); //trigger a new paintEvent
m_bScaleOK=true;
}
void CPlotter::drawRed(int ia, int ib, float swide[])
{
m_ia=ia;
m_ib=ib;
draw(swide,false,true);
}
void CPlotter::DrawOverlay() //DrawOverlay()
{
if(m_OverlayPixmap.isNull()) return;
if(m_WaterfallPixmap.isNull()) return;
int w = m_WaterfallPixmap.width();
int x,y,x1,x2,x3,x4,x5,x6;
float pixperdiv;
double df = m_binsPerPixel*m_fftBinWidth;
QRect rect;
QPen penOrange(QColor(255,165,0),3);
QPen penGreen(Qt::green, 3); //Mark Tol range with green line
QPen penRed(Qt::red, 3); //Mark Tx freq with red
QPainter painter(&m_OverlayPixmap);
painter.initFrom(this);
QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient
gradient.setColorAt(1, Qt::black);
gradient.setColorAt(0, Qt::darkBlue);
painter.setBrush(gradient);
painter.drawRect(0, 0, m_w, m_h2);
painter.setBrush(Qt::SolidPattern);
m_fSpan = w*df;
// int n=m_fSpan/10;
m_freqPerDiv=10;
if(m_fSpan>100) m_freqPerDiv=20;
if(m_fSpan>250) m_freqPerDiv=50;
if(m_fSpan>500) m_freqPerDiv=100;
if(m_fSpan>1000) m_freqPerDiv=200;
if(m_fSpan>2500) m_freqPerDiv=500;
pixperdiv = m_freqPerDiv/df;
m_hdivs = w*df/m_freqPerDiv + 1.9999;
float xx0=float(m_startFreq)/float(m_freqPerDiv);
xx0=xx0-int(xx0);
int x0=xx0*pixperdiv+0.5;
for( int i=1; i<m_hdivs; i++) { //draw vertical grids
x = (int)((float)i*pixperdiv ) - x0;
if(x >= 0 and x<=m_w) {
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
painter.drawLine(x, 0, x , m_h2);
}
}
pixperdiv = (float)m_h2 / (float)VERT_DIVS;
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
for( int i=1; i<VERT_DIVS; i++) { //draw horizontal grids
y = (int)( (float)i*pixperdiv );
painter.drawLine(0, y, w, y);
}
QRect rect0;
QPainter painter0(&m_ScalePixmap);
painter0.initFrom(this);
//create Font to use for scales
QFont Font("Arial");
Font.setPointSize(12);
Font.setWeight(QFont::Normal);
painter0.setFont(Font);
painter0.setPen(Qt::black);
if(m_binsPerPixel < 1) m_binsPerPixel=1;
m_hdivs = w*df/m_freqPerDiv + 0.9999;
m_ScalePixmap.fill(Qt::white);
painter0.drawRect(0, 0, w, 30);
MakeFrequencyStrs();
//draw tick marks on upper scale
pixperdiv = m_freqPerDiv/df;
for( int i=0; i<m_hdivs; i++) { //major ticks
x = (int)((m_xOffset+i)*pixperdiv );
painter0.drawLine(x,18,x,30);
}
int minor=5;
if(m_freqPerDiv==200) minor=4;
for( int i=1; i<minor*m_hdivs; i++) { //minor ticks
x = i*pixperdiv/minor;
painter0.drawLine(x,24,x,30);
}
//draw frequency values
for( int i=0; i<=m_hdivs; i++) {
x = (int)((m_xOffset+i)*pixperdiv - pixperdiv/2);
if(int(x+pixperdiv/2) > 70) {
rect0.setRect(x,0, (int)pixperdiv, 20);
painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter,m_HDivText[i]);
}
}
float bw=9.0*12000.0/m_nsps; //JT9
if(m_mode=="FT8") bw=7*12000.0/1920.0; //FT8
if(m_mode=="JT4") { //JT4
bw=3*11025.0/2520.0; //Max tone spacing (3/4 of actual BW)
if(m_nSubMode==1) bw=2*bw;
if(m_nSubMode==2) bw=4*bw;
if(m_nSubMode==3) bw=9*bw;
if(m_nSubMode==4) bw=18*bw;
if(m_nSubMode==5) bw=36*bw;
if(m_nSubMode==6) bw=72*bw;
painter0.setPen(penGreen);
x1=XfromFreq(m_rxFreq-m_tol);
x2=XfromFreq(m_rxFreq+m_tol);
painter0.drawLine(x1,29,x2,29);
for(int i=0; i<4; i++) {
x1=XfromFreq(m_rxFreq+bw*i/3.0);
int j=24;
if(i==0) j=18;
painter0.drawLine(x1,j,x1,30);
}
painter0.setPen(penRed);
for(int i=0; i<4; i++) {
x1=XfromFreq(m_txFreq+bw*i/3.0);
painter0.drawLine(x1,12,x1,18);
}
}
if(m_modeTx=="JT9" and m_nSubMode>0) { //JT9
bw=8.0*12000.0/m_nsps;
if(m_nSubMode==1) bw=2*bw; //B
if(m_nSubMode==2) bw=4*bw; //C
if(m_nSubMode==3) bw=8*bw; //D
if(m_nSubMode==4) bw=16*bw; //E
if(m_nSubMode==5) bw=32*bw; //F
if(m_nSubMode==6) bw=64*bw; //G
if(m_nSubMode==7) bw=128*bw; //H
}
if(m_mode=="QRA64") { //QRA64
bw=63.0*12000.0/m_nsps;
if(m_nSubMode==1) bw=2*bw; //B
if(m_nSubMode==2) bw=4*bw; //C
if(m_nSubMode==3) bw=8*bw; //D
if(m_nSubMode==4) bw=16*bw; //E
}
if(m_modeTx=="JT65") { //JT65
bw=65.0*11025.0/4096.0;
if(m_nSubMode==1) bw=2*bw; //B
if(m_nSubMode==2) bw=4*bw; //C
}
painter0.setPen(penGreen);
if(m_mode=="WSPR") {
x1=XfromFreq(1400);
x2=XfromFreq(1600);
painter0.drawLine(x1,29,x2,29);
}
if(m_mode=="WSPR-LF") {
x1=XfromFreq(1600);
x2=XfromFreq(1700);
painter0.drawLine(x1,29,x2,29);
}
if(m_mode=="FreqCal") { //FreqCal
x1=XfromFreq(m_rxFreq-m_tol);
x2=XfromFreq(m_rxFreq+m_tol);
painter0.drawLine(x1,29,x2,29);
x1=XfromFreq(m_rxFreq);
painter0.drawLine(x1,24,x1,30);
}
if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" or m_mode=="QRA64" or m_mode=="FT8") {
if(m_mode=="QRA64" or (m_mode=="JT65" and m_bVHF)) {
painter0.setPen(penGreen);
x1=XfromFreq(m_rxFreq-m_tol);
x2=XfromFreq(m_rxFreq+m_tol);
painter0.drawLine(x1,28,x2,28);
x1=XfromFreq(m_rxFreq);
painter0.drawLine(x1,24,x1,30);
if(m_mode=="JT65") {
painter0.setPen(penOrange);
x3=XfromFreq(m_rxFreq+20.0*bw/65.0); //RO
painter0.drawLine(x3,24,x3,30);
x4=XfromFreq(m_rxFreq+30.0*bw/65.0); //RRR
painter0.drawLine(x4,24,x4,30);
x5=XfromFreq(m_rxFreq+40.0*bw/65.0); //73
painter0.drawLine(x5,24,x5,30);
}
painter0.setPen(penGreen);
x6=XfromFreq(m_rxFreq+bw); //Highest tone
painter0.drawLine(x6,24,x6,30);
} else {
painter0.setPen(penGreen);
x1=XfromFreq(m_rxFreq);
x2=XfromFreq(m_rxFreq+bw);
painter0.drawLine(x1,24,x1,30);
painter0.drawLine(x1,28,x2,28);
painter0.drawLine(x2,24,x2,30);
}
}
if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" or
m_mode.mid(0,4)=="WSPR" or m_mode=="QRA64" or m_mode=="FT8") {
painter0.setPen(penRed);
x1=XfromFreq(m_txFreq);
x2=XfromFreq(m_txFreq+bw);
if(m_mode=="WSPR") {
bw=4*12000.0/8192.0; //WSPR
x1=XfromFreq(m_txFreq-0.5*bw);
x2=XfromFreq(m_txFreq+0.5*bw);
}
if(m_mode=="WSPR-LF") {
bw=3*12000.0/8640.0; //WSPR-LF
x1=XfromFreq(m_txFreq-0.5*bw);
x2=XfromFreq(m_txFreq+0.5*bw);
}
painter0.drawLine(x1,17,x1,21);
painter0.drawLine(x1,17,x2,17);
painter0.drawLine(x2,17,x2,21);
}
if(m_mode=="JT9+JT65") {
QPen pen2(Qt::blue, 3); //Mark the JT65 | JT9 divider
painter0.setPen(pen2);
x1=XfromFreq(m_fMin);
if(x1<2) x1=2;
x2=x1+30;
painter0.drawLine(x1,8,x1,28);
}
if(m_dialFreq>10.13 and m_dialFreq< 10.15 and m_mode.mid(0,4)!="WSPR") {
float f1=1.0e6*(10.1401 - m_dialFreq);
float f2=f1+200.0;
x1=XfromFreq(f1);
x2=XfromFreq(f2);
if(x1<=m_w and x2>=0) {
painter0.setPen(penOrange); //Mark WSPR sub-band orange
painter0.drawLine(x1,9,x2,9);
}
}
}
void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs
{
int f=(m_startFreq+m_freqPerDiv-1)/m_freqPerDiv;
f*=m_freqPerDiv;
m_xOffset=float(f-m_startFreq)/m_freqPerDiv;
for(int i=0; i<=m_hdivs; i++) {
m_HDivText[i].setNum(f);
f+=m_freqPerDiv;
}
}
int CPlotter::XfromFreq(float f) //XfromFreq()
{
// float w = m_WaterfallPixmap.width();
int x = int(m_w * (f - m_startFreq)/m_fSpan + 0.5);
if(x<0 ) return 0;
if(x>m_w) return m_w;
return x;
}
float CPlotter::FreqfromX(int x) //FreqfromX()
{
return float(m_startFreq + x*m_binsPerPixel*m_fftBinWidth);
}
void CPlotter::SetRunningState(bool running) //SetRunningState()
{
m_Running = running;
}
void CPlotter::setPlotZero(int plotZero) //setPlotZero()
{
m_plotZero=plotZero;
}
int CPlotter::plotZero() //PlotZero()
{
return m_plotZero;
}
void CPlotter::setPlotGain(int plotGain) //setPlotGain()
{
m_plotGain=plotGain;
}
int CPlotter::plotGain() //plotGain()
{
return m_plotGain;
}
int CPlotter::plot2dGain() //plot2dGain
{
return m_plot2dGain;
}
void CPlotter::setPlot2dGain(int n) //setPlot2dGain
{
m_plot2dGain=n;
update();
}
int CPlotter::plot2dZero() //plot2dZero
{
return m_plot2dZero;
}
void CPlotter::setPlot2dZero(int plot2dZero) //setPlot2dZero
{
m_plot2dZero=plot2dZero;
}
void CPlotter::setStartFreq(int f) //SetStartFreq()
{
m_startFreq=f;
resizeEvent(NULL);
update();
}
int CPlotter::startFreq() //startFreq()
{
return m_startFreq;
}
int CPlotter::plotWidth(){return m_WaterfallPixmap.width();} //plotWidth
void CPlotter::UpdateOverlay() {DrawOverlay();} //UpdateOverlay
void CPlotter::setDataFromDisk(bool b) {m_dataFromDisk=b;} //setDataFromDisk
void CPlotter::setRxRange(int fMin) //setRxRange
{
m_fMin=fMin;
}
void CPlotter::setBinsPerPixel(int n) //setBinsPerPixel
{
m_binsPerPixel = n;
DrawOverlay(); //Redraw scales and ticks
update(); //trigger a new paintEvent}
}
int CPlotter::binsPerPixel() //binsPerPixel
{
return m_binsPerPixel;
}
void CPlotter::setWaterfallAvg(int n) //setBinsPerPixel
{
m_waterfallAvg = n;
}
void CPlotter::setRxFreq (int x) //setRxFreq
{
m_rxFreq = x; // x is freq in Hz
DrawOverlay();
update();
}
int CPlotter::rxFreq() {return m_rxFreq;} //rxFreq
void CPlotter::mouseReleaseEvent (QMouseEvent * event)
{
if (Qt::LeftButton == event->button ()) {
int x=event->x();
if(x<0) x=0;
if(x>m_Size.width()) x=m_Size.width();
bool ctrl = (event->modifiers() & Qt::ControlModifier);
bool shift = (event->modifiers() & Qt::ShiftModifier);
int newFreq = int(FreqfromX(x)+0.5);
int oldTxFreq = m_txFreq;
int oldRxFreq = m_rxFreq;
if (ctrl) {
emit setFreq1 (newFreq, newFreq);
} else if (shift) {
emit setFreq1 (oldRxFreq, newFreq);
} else {
emit setFreq1(newFreq,oldTxFreq);
}
int n=1;
if(ctrl) n+=100;
emit freezeDecode1(n);
}
else {
event->ignore (); // let parent handle
}
}
void CPlotter::mouseDoubleClickEvent (QMouseEvent * event)
{
if (Qt::LeftButton == event->button ()) {
bool ctrl = (event->modifiers() & Qt::ControlModifier);
int n=2;
if(ctrl) n+=100;
emit freezeDecode1(n);
}
else {
event->ignore (); // let parent handle
}
}
void CPlotter::setNsps(int ntrperiod, int nsps) //setNsps
{
m_TRperiod=ntrperiod;
m_nsps=nsps;
m_fftBinWidth=1500.0/2048.0;
if(m_nsps==15360) m_fftBinWidth=1500.0/2048.0;
if(m_nsps==40960) m_fftBinWidth=1500.0/6144.0;
if(m_nsps==82944) m_fftBinWidth=1500.0/12288.0;
if(m_nsps==252000) m_fftBinWidth=1500.0/32768.0;
DrawOverlay(); //Redraw scales and ticks
update(); //trigger a new paintEvent}
}
void CPlotter::setTxFreq(int n) //setTxFreq
{
m_txFreq=n;
DrawOverlay();
update();
}
void CPlotter::setMode(QString mode) //setMode
{
m_mode=mode;
}
void CPlotter::setSubMode(int n) //setSubMode
{
m_nSubMode=n;
}
void CPlotter::setModeTx(QString modeTx) //setModeTx
{
m_modeTx=modeTx;
}
int CPlotter::Fmax()
{
return m_fMax;
}
void CPlotter::setDialFreq(double d)
{
m_dialFreq=d;
DrawOverlay();
update();
}
void CPlotter::setRxBand(QString band)
{
m_rxBand=band;
}
void CPlotter::setFlatten(bool b1, bool b2)
{
m_Flatten=0;
if(b1) m_Flatten=1;
if(b2) m_Flatten=2;
}
void CPlotter::setTol(int n) //setTol()
{
m_tol=n;
DrawOverlay();
}
void CPlotter::setColours(QVector<QColor> const& cl)
{
g_ColorTbl = cl;
}
void CPlotter::SetPercent2DScreen(int percent)
{
m_Percent2DScreen=percent;
resizeEvent(NULL);
update();
}
void CPlotter::setVHF(bool bVHF)
{
m_bVHF=bVHF;
}
void CPlotter::setRedFile(QString fRed)
{
m_redFile=fRed;
}
@@ -0,0 +1,202 @@
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
#include <boost/proto/transform/detail/preprocessed/make.hpp>
#elif !defined(BOOST_PP_IS_ITERATING)
#define BOOST_PROTO_MAKE_IF(Z, M, DATA) \
make_if_<BOOST_PP_CAT(A, M), Expr, State, Data> \
/**/
#define BOOST_PROTO_MAKE_IF_TYPE(Z, M, DATA) \
typename BOOST_PROTO_MAKE_IF(Z, M, DATA) ::type \
/**/
#define BOOST_PROTO_MAKE_IF_APPLIED(Z, M, DATA) \
BOOST_PROTO_MAKE_IF(Z, M, DATA) ::applied || \
/**/
#define BOOST_PROTO_CONSTRUCT_ARG(Z, M, DATA) \
detail::as_lvalue( \
typename when<_, BOOST_PP_CAT(A, M)>::template impl<Expr, State, Data>()(e, s, d) \
) \
/**/
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/make.hpp")
#endif
///////////////////////////////////////////////////////////////////////////////
/// \file make.hpp
/// Contains definition of the make<> transform.
//
// Copyright 2008 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/make.hpp>))
#include BOOST_PP_ITERATE()
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#undef BOOST_PROTO_CONSTRUCT_ARG
#undef BOOST_PROTO_MAKE_IF_APPLIED
#undef BOOST_PROTO_MAKE_IF_TYPE
#undef BOOST_PROTO_MAKE_IF
#else
#define N BOOST_PP_ITERATION()
namespace detail
{
#if N > 0
template<
template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class R
BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)
, typename Expr, typename State, typename Data
>
struct make_<
R<BOOST_PP_ENUM_PARAMS(N, A)>
, Expr, State, Data
BOOST_PROTO_TEMPLATE_ARITY_PARAM(N)
>
: nested_type_if<
R<BOOST_PP_ENUM(N, BOOST_PROTO_MAKE_IF_TYPE, ~)>
, (BOOST_PP_REPEAT(N, BOOST_PROTO_MAKE_IF_APPLIED, ~) false)
>
{};
template<
template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class R
BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)
, typename Expr, typename State, typename Data
>
struct make_<
noinvoke<R<BOOST_PP_ENUM_PARAMS(N, A)> >
, Expr, State, Data
BOOST_PROTO_TEMPLATE_ARITY_PARAM(1)
>
{
typedef R<BOOST_PP_ENUM(N, BOOST_PROTO_MAKE_IF_TYPE, ~)> type;
static bool const applied = true;
};
#endif
template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct is_applyable<R(BOOST_PP_ENUM_PARAMS(N, A))>
: mpl::true_
{};
template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct is_applyable<R(*)(BOOST_PP_ENUM_PARAMS(N, A))>
: mpl::true_
{};
template<typename T, typename A>
struct construct_<proto::expr<T, A, N>, true>
{
typedef proto::expr<T, A, N> result_type;
template<BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), typename A)>
BOOST_FORCEINLINE
result_type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_MAX(N, 1), A, &a)) const
{
return result_type::make(BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), a));
}
};
template<typename T, typename A>
struct construct_<proto::basic_expr<T, A, N>, true>
{
typedef proto::basic_expr<T, A, N> result_type;
template<BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), typename A)>
BOOST_FORCEINLINE
result_type operator ()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_MAX(N, 1), A, &a)) const
{
return result_type::make(BOOST_PP_ENUM_PARAMS(BOOST_PP_MAX(N, 1), a));
}
};
template<typename Type BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
BOOST_FORCEINLINE
Type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a))
{
return construct_<Type>()(BOOST_PP_ENUM_PARAMS(N, a));
}
} // namespace detail
/// \brief A PrimitiveTransform which computes a type by evaluating any
/// nested transforms and then constructs an object of that type with the
/// current expression, state and data, transformed according
/// to \c A0 through \c AN.
template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct make<Object(BOOST_PP_ENUM_PARAMS(N, A))>
: transform<make<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
{
template<typename Expr, typename State, typename Data>
struct impl : transform_impl<Expr, State, Data>
{
/// \brief <tt>boost::result_of\<make\<Object\>(Expr, State, Data)\>::type</tt>
typedef typename detail::make_if_<Object, Expr, State, Data>::type result_type;
/// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
/// for each \c x in <tt>[0,N]</tt>.
/// Return <tt>result_type(a0, a1,... aN)</tt>.
///
/// \param e The current expression
/// \param s The current state
/// \param d An arbitrary data
BOOST_FORCEINLINE
result_type operator ()(
typename impl::expr_param e
, typename impl::state_param s
, typename impl::data_param d
) const
{
proto::detail::ignore_unused(e);
proto::detail::ignore_unused(s);
proto::detail::ignore_unused(d);
return detail::construct<result_type>(BOOST_PP_ENUM(N, BOOST_PROTO_CONSTRUCT_ARG, DATA));
}
};
};
#if N > 0
/// \brief A PrimitiveTransform which computes a type by evaluating any
/// nested transforms and then constructs an object of that type with the
/// current expression, state and data, transformed according
/// to \c A0 through \c AN.
template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct make<Object(BOOST_PP_ENUM_PARAMS(N, A)...)>
: transform<make<Object(BOOST_PP_ENUM_PARAMS(N, A)...)> >
{
template<typename Expr, typename State, typename Data>
struct impl
: make<
typename detail::expand_pattern<
proto::arity_of<Expr>::value
, BOOST_PP_CAT(A, BOOST_PP_DEC(N))
, detail::BOOST_PP_CAT(expand_pattern_rest_, BOOST_PP_DEC(N))<
Object
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_DEC(N), A)
>
>::type
>::template impl<Expr, State, Data>
{};
};
#endif
#undef N
#endif
@@ -0,0 +1,209 @@
//---------------------------------------------------------------------------//
// 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_ITERATOR_CONSTANT_BUFFER_ITERATOR_HPP
#define BOOST_COMPUTE_ITERATOR_CONSTANT_BUFFER_ITERATOR_HPP
#include <cstddef>
#include <iterator>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/compute/buffer.hpp>
#include <boost/compute/iterator/buffer_iterator.hpp>
#include <boost/compute/type_traits/is_device_iterator.hpp>
namespace boost {
namespace compute {
// forward declaration for constant_buffer_iterator<T>
template<class T> class constant_buffer_iterator;
namespace detail {
// helper class which defines the iterator_facade super-class
// type for constant_buffer_iterator<T>
template<class T>
class constant_buffer_iterator_base
{
public:
typedef ::boost::iterator_facade<
::boost::compute::constant_buffer_iterator<T>,
T,
::std::random_access_iterator_tag,
::boost::compute::detail::buffer_value<T>
> type;
};
} // end detail namespace
/// \class constant_buffer_iterator
/// \brief An iterator for a buffer in the \c constant memory space.
///
/// The constant_buffer_iterator class provides an iterator for values in a
/// buffer in the \c constant memory space.
///
/// For iterating over values in the \c global memory space (the most common
/// case), use the buffer_iterator class.
///
/// \see buffer_iterator
template<class T>
class constant_buffer_iterator :
public detail::constant_buffer_iterator_base<T>::type
{
public:
typedef typename detail::constant_buffer_iterator_base<T>::type super_type;
typedef typename super_type::reference reference;
typedef typename super_type::difference_type difference_type;
constant_buffer_iterator()
: m_buffer(0),
m_index(0)
{
}
constant_buffer_iterator(const buffer &buffer, size_t index)
: m_buffer(&buffer),
m_index(index)
{
}
constant_buffer_iterator(const constant_buffer_iterator<T> &other)
: m_buffer(other.m_buffer),
m_index(other.m_index)
{
}
constant_buffer_iterator<T>& operator=(const constant_buffer_iterator<T> &other)
{
if(this != &other){
m_buffer = other.m_buffer;
m_index = other.m_index;
}
return *this;
}
~constant_buffer_iterator()
{
}
const buffer& get_buffer() const
{
return *m_buffer;
}
size_t get_index() const
{
return m_index;
}
T read(command_queue &queue) const
{
BOOST_ASSERT(m_buffer && m_buffer->get());
BOOST_ASSERT(m_index < m_buffer->size() / sizeof(T));
return detail::read_single_value<T>(m_buffer, m_index, queue);
}
void write(const T &value, command_queue &queue)
{
BOOST_ASSERT(m_buffer && m_buffer->get());
BOOST_ASSERT(m_index < m_buffer->size() / sizeof(T));
detail::write_single_value<T>(m_buffer, m_index, queue);
}
template<class Expr>
detail::buffer_iterator_index_expr<T, Expr>
operator[](const Expr &expr) const
{
BOOST_ASSERT(m_buffer);
BOOST_ASSERT(m_buffer->get());
return detail::buffer_iterator_index_expr<T, Expr>(
*m_buffer, m_index, memory_object::constant_memory, expr
);
}
private:
friend class ::boost::iterator_core_access;
reference dereference() const
{
return detail::buffer_value<T>(*m_buffer, m_index);
}
bool equal(const constant_buffer_iterator<T> &other) const
{
return m_buffer == other.m_buffer && m_index == other.m_index;
}
void increment()
{
m_index++;
}
void decrement()
{
m_index--;
}
void advance(difference_type n)
{
m_index = static_cast<size_t>(static_cast<difference_type>(m_index) + n);
}
difference_type distance_to(const constant_buffer_iterator<T> &other) const
{
return static_cast<difference_type>(other.m_index - m_index);
}
private:
const buffer *m_buffer;
size_t m_index;
};
/// Creates a new constant_buffer_iterator for \p buffer at \p index.
///
/// \param buffer the \ref buffer object
/// \param index the index in the buffer
///
/// \return a \c constant_buffer_iterator for \p buffer at \p index
template<class T>
inline constant_buffer_iterator<T>
make_constant_buffer_iterator(const buffer &buffer, size_t index = 0)
{
return constant_buffer_iterator<T>(buffer, index);
}
/// \internal_ (is_device_iterator specialization for constant_buffer_iterator)
template<class T>
struct is_device_iterator<constant_buffer_iterator<T> > : boost::true_type {};
namespace detail {
// is_buffer_iterator specialization for constant_buffer_iterator
template<class Iterator>
struct is_buffer_iterator<
Iterator,
typename boost::enable_if<
boost::is_same<
constant_buffer_iterator<typename Iterator::value_type>,
typename boost::remove_const<Iterator>::type
>
>::type
> : public boost::true_type {};
} // end detail namespace
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_ITERATOR_CONSTANT_BUFFER_ITERATOR_HPP
@@ -0,0 +1,303 @@
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.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)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_LIST_FOLD_LEFT_HPP
# define BOOST_PREPROCESSOR_LIST_FOLD_LEFT_HPP
#
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/control/while.hpp>
# include <boost/preprocessor/debug/error.hpp>
# include <boost/preprocessor/detail/auto_rec.hpp>
#
# /* BOOST_PP_LIST_FOLD_LEFT */
#
# if 0
# define BOOST_PP_LIST_FOLD_LEFT(op, state, list)
# endif
#
# define BOOST_PP_LIST_FOLD_LEFT BOOST_PP_CAT(BOOST_PP_LIST_FOLD_LEFT_, BOOST_PP_AUTO_REC(BOOST_PP_WHILE_P, 256))
#
# define BOOST_PP_LIST_FOLD_LEFT_257(o, s, l) BOOST_PP_ERROR(0x0004)
#
# define BOOST_PP_LIST_FOLD_LEFT_D(d, o, s, l) BOOST_PP_LIST_FOLD_LEFT_ ## d(o, s, l)
# define BOOST_PP_LIST_FOLD_LEFT_2ND BOOST_PP_LIST_FOLD_LEFT
# define BOOST_PP_LIST_FOLD_LEFT_2ND_D BOOST_PP_LIST_FOLD_LEFT_D
#
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# include <boost/preprocessor/list/detail/edg/fold_left.hpp>
# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
# include <boost/preprocessor/list/detail/dmc/fold_left.hpp>
# else
# include <boost/preprocessor/list/detail/fold_left.hpp>
# endif
#
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_NIL 1
#
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_1(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_2(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_3(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_4(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_5(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_6(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_7(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_8(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_9(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_10(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_11(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_12(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_13(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_14(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_15(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_16(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_17(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_18(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_19(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_20(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_21(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_22(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_23(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_24(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_25(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_26(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_27(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_28(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_29(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_30(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_31(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_32(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_33(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_34(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_35(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_36(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_37(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_38(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_39(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_40(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_41(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_42(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_43(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_44(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_45(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_46(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_47(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_48(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_49(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_50(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_51(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_52(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_53(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_54(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_55(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_56(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_57(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_58(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_59(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_60(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_61(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_62(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_63(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_64(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_65(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_66(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_67(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_68(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_69(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_70(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_71(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_72(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_73(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_74(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_75(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_76(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_77(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_78(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_79(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_80(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_81(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_82(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_83(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_84(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_85(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_86(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_87(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_88(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_89(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_90(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_91(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_92(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_93(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_94(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_95(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_96(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_97(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_98(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_99(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_100(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_101(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_102(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_103(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_104(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_105(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_106(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_107(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_108(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_109(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_110(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_111(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_112(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_113(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_114(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_115(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_116(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_117(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_118(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_119(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_120(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_121(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_122(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_123(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_124(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_125(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_126(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_127(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_128(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_129(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_130(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_131(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_132(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_133(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_134(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_135(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_136(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_137(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_138(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_139(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_140(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_141(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_142(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_143(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_144(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_145(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_146(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_147(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_148(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_149(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_150(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_151(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_152(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_153(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_154(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_155(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_156(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_157(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_158(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_159(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_160(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_161(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_162(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_163(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_164(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_165(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_166(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_167(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_168(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_169(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_170(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_171(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_172(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_173(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_174(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_175(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_176(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_177(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_178(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_179(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_180(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_181(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_182(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_183(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_184(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_185(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_186(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_187(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_188(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_189(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_190(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_191(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_192(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_193(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_194(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_195(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_196(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_197(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_198(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_199(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_200(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_201(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_202(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_203(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_204(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_205(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_206(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_207(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_208(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_209(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_210(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_211(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_212(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_213(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_214(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_215(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_216(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_217(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_218(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_219(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_220(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_221(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_222(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_223(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_224(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_225(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_226(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_227(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_228(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_229(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_230(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_231(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_232(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_233(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_234(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_235(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_236(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_237(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_238(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_239(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_240(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_241(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_242(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_243(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_244(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_245(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_246(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_247(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_248(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_249(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_250(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_251(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_252(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_253(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_254(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_255(o, s, l) 0
# define BOOST_PP_LIST_FOLD_LEFT_CHECK_BOOST_PP_LIST_FOLD_LEFT_256(o, s, l) 0
#
# endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,107 @@
#if !defined(BOOST_PP_IS_ITERATING)
///// header body
#ifndef BOOST_MPL_APPLY_FWD_HPP_INCLUDED
#define BOOST_MPL_APPLY_FWD_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/aux_/na.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 apply_fwd.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/arity.hpp>
# include <boost/mpl/aux_/preprocessor/params.hpp>
# include <boost/mpl/aux_/preprocessor/default_params.hpp>
# include <boost/mpl/aux_/config/ctps.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/preprocessor/comma_if.hpp>
# include <boost/preprocessor/iterate.hpp>
# include <boost/preprocessor/cat.hpp>
// agurt, 15/jan/02: top-level 'apply' template gives an ICE on MSVC
// (for known reasons)
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# define BOOST_MPL_CFG_NO_APPLY_TEMPLATE
#endif
namespace boost { namespace mpl {
// local macro, #undef-ined at the end of the header
# define AUX778076_APPLY_DEF_PARAMS(param, value) \
BOOST_MPL_PP_DEFAULT_PARAMS( \
BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
, param \
, value \
) \
/**/
# define AUX778076_APPLY_N_COMMA_PARAMS(n, param) \
BOOST_PP_COMMA_IF(n) \
BOOST_MPL_PP_PARAMS(n, param) \
/**/
# if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
// forward declaration
template<
typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na)
>
struct apply;
#else
namespace aux {
template< BOOST_AUX_NTTP_DECL(int, arity_) > struct apply_chooser;
}
#endif
# endif // BOOST_MPL_CFG_NO_APPLY_TEMPLATE
#define BOOST_PP_ITERATION_PARAMS_1 \
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply_fwd.hpp>))
#include BOOST_PP_ITERATE()
# undef AUX778076_APPLY_N_COMMA_PARAMS
# undef AUX778076_APPLY_DEF_PARAMS
}}
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_APPLY_FWD_HPP_INCLUDED
///// iteration
#else
#define i_ BOOST_PP_FRAME_ITERATION(1)
template<
typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
>
struct BOOST_PP_CAT(apply,i_);
#undef i_
#endif // BOOST_PP_IS_ITERATING
@@ -0,0 +1,165 @@
#include "MessageAggregatorMainWindow.hpp"
#include <QtWidgets>
#include <QDateTime>
#include "DecodesModel.hpp"
#include "BeaconsModel.hpp"
#include "ClientWidget.hpp"
using port_type = MessageServer::port_type;
namespace
{
char const * const headings[] = {
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Time On"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Time Off"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Callsign"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Grid"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Name"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Frequency"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Mode"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Sent"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Rec'd"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Power"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Comments"),
};
}
MessageAggregatorMainWindow::MessageAggregatorMainWindow ()
: log_ {new QStandardItemModel {0, 11, this}}
, decodes_model_ {new DecodesModel {this}}
, beacons_model_ {new BeaconsModel {this}}
, server_ {new MessageServer {this}}
, multicast_group_line_edit_ {new QLineEdit}
, log_table_view_ {new QTableView}
{
// logbook
int column {0};
for (auto const& heading : headings)
{
log_->setHeaderData (column++, Qt::Horizontal, tr (heading));
}
connect (server_, &MessageServer::qso_logged, this, &MessageAggregatorMainWindow::log_qso);
// menu bar
auto file_menu = menuBar ()->addMenu (tr ("&File"));
auto exit_action = new QAction {tr ("E&xit"), this};
exit_action->setShortcuts (QKeySequence::Quit);
exit_action->setToolTip (tr ("Exit the application"));
file_menu->addAction (exit_action);
connect (exit_action, &QAction::triggered, this, &MessageAggregatorMainWindow::close);
view_menu_ = menuBar ()->addMenu (tr ("&View"));
// central layout
auto central_layout = new QVBoxLayout;
// server details
auto port_spin_box = new QSpinBox;
port_spin_box->setMinimum (1);
port_spin_box->setMaximum (std::numeric_limits<port_type>::max ());
auto group_box_layout = new QFormLayout;
group_box_layout->addRow (tr ("Port number:"), port_spin_box);
group_box_layout->addRow (tr ("Multicast Group (blank for unicast server):"), multicast_group_line_edit_);
auto group_box = new QGroupBox {tr ("Server Details")};
group_box->setLayout (group_box_layout);
central_layout->addWidget (group_box);
log_table_view_->setModel (log_);
log_table_view_->verticalHeader ()->hide ();
central_layout->addWidget (log_table_view_);
// central widget
auto central_widget = new QWidget;
central_widget->setLayout (central_layout);
// main window setup
setCentralWidget (central_widget);
setDockOptions (AnimatedDocks | AllowNestedDocks | AllowTabbedDocks);
setTabPosition (Qt::BottomDockWidgetArea, QTabWidget::North);
// connect up server
connect (server_, &MessageServer::error, [this] (QString const& message) {
QMessageBox::warning (this, QApplication::applicationName (), tr ("Network Error"), message);
});
connect (server_, &MessageServer::client_opened, this, &MessageAggregatorMainWindow::add_client);
connect (server_, &MessageServer::client_closed, this, &MessageAggregatorMainWindow::remove_client);
connect (server_, &MessageServer::client_closed, decodes_model_, &DecodesModel::clear_decodes);
connect (server_, &MessageServer::client_closed, beacons_model_, &BeaconsModel::clear_decodes);
connect (server_, &MessageServer::decode, [this] (bool is_new, QString const& id, QTime time
, qint32 snr, float delta_time
, quint32 delta_frequency, QString const& mode
, QString const& message, bool low_confidence) {
decodes_model_->add_decode (is_new, id, time, snr, delta_time, delta_frequency, mode, message
, low_confidence, dock_widgets_[id]->fast_mode ());});
connect (server_, &MessageServer::WSPR_decode, beacons_model_, &BeaconsModel::add_beacon_spot);
connect (server_, &MessageServer::clear_decodes, decodes_model_, &DecodesModel::clear_decodes);
connect (server_, &MessageServer::clear_decodes, beacons_model_, &BeaconsModel::clear_decodes);
connect (decodes_model_, &DecodesModel::reply, server_, &MessageServer::reply);
// UI behaviour
connect (port_spin_box, static_cast<void (QSpinBox::*)(int)> (&QSpinBox::valueChanged)
, [this] (port_type port) {server_->start (port);});
connect (multicast_group_line_edit_, &QLineEdit::editingFinished, [this, port_spin_box] () {
server_->start (port_spin_box->value (), QHostAddress {multicast_group_line_edit_->text ()});
});
port_spin_box->setValue (2237); // start up in unicast mode
show ();
}
void MessageAggregatorMainWindow::log_qso (QString const& /*id*/, QDateTime timeOff, QString const& dx_call, QString const& dx_grid
, Frequency dial_frequency, QString const& mode, QString const& report_sent
, QString const& report_received, QString const& tx_power, QString const& comments
, QString const& name, QDateTime timeOn)
{
QList<QStandardItem *> row;
row << new QStandardItem {timeOn.toString ("dd-MMM-yyyy hh:mm:ss")}
<< new QStandardItem {timeOff.toString ("dd-MMM-yyyy hh:mm:ss")}
<< new QStandardItem {dx_call}
<< new QStandardItem {dx_grid}
<< new QStandardItem {name}
<< new QStandardItem {Radio::frequency_MHz_string (dial_frequency)}
<< new QStandardItem {mode}
<< new QStandardItem {report_sent}
<< new QStandardItem {report_received}
<< new QStandardItem {tx_power}
<< new QStandardItem {comments};
log_->appendRow (row);
log_table_view_->resizeColumnsToContents ();
log_table_view_->horizontalHeader ()->setStretchLastSection (true);
log_table_view_->scrollToBottom ();
}
void MessageAggregatorMainWindow::add_client (QString const& id, QString const& version, QString const& revision)
{
auto dock = new ClientWidget {decodes_model_, beacons_model_, id, version, revision, this};
dock->setAttribute (Qt::WA_DeleteOnClose);
auto view_action = dock->toggleViewAction ();
view_action->setEnabled (true);
view_menu_->addAction (view_action);
addDockWidget (Qt::BottomDockWidgetArea, dock);
connect (server_, &MessageServer::status_update, dock, &ClientWidget::update_status);
connect (server_, &MessageServer::decode, dock, &ClientWidget::decode_added);
connect (server_, &MessageServer::WSPR_decode, dock, &ClientWidget::beacon_spot_added);
connect (dock, &ClientWidget::do_reply, decodes_model_, &DecodesModel::do_reply);
connect (dock, &ClientWidget::do_halt_tx, server_, &MessageServer::halt_tx);
connect (dock, &ClientWidget::do_free_text, server_, &MessageServer::free_text);
connect (view_action, &QAction::toggled, dock, &ClientWidget::setVisible);
dock_widgets_[id] = dock;
server_->replay (id);
}
void MessageAggregatorMainWindow::remove_client (QString const& id)
{
auto iter = dock_widgets_.find (id);
if (iter != std::end (dock_widgets_))
{
(*iter)->close ();
dock_widgets_.erase (iter);
}
}
#include "moc_MessageAggregatorMainWindow.cpp"
@@ -0,0 +1,63 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2015 John Fletcher
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_CORE_IS_VALUE_HPP
#define BOOST_PHOENIX_CORE_IS_VALUE_HPP
#include <boost/mpl/bool.hpp>
// Copied from is_actor.hpp
// Note to Thomas and any future maintainer: please make this as
// lightweight as possible (as it is right now).
namespace boost { namespace phoenix
{
///////////////////////////////////////////////////////////////////////////////
//
// is_value<T>
//
// Tests if T is a value. Evaluates to mpl::true_ or mpl::false_
//
///////////////////////////////////////////////////////////////////////////////
namespace expression {
template <typename T>
struct value;
}
template <typename T, typename Enable = void>
struct is_value
: mpl::false_
{};
template <typename T>
struct is_value<T const>
: is_value<T>
{};
template <typename T>
struct is_value<T &>
: is_value<T>
{};
// This does not seem to work.
// There is an alternative in value.hpp which does work.
template <typename T>
struct is_value< expression::value<T> >
: mpl::true_
{};
template <typename T>
bool is_val(T const & /* t */)
{
return is_value<T>::value;
}
}}
#endif
@@ -0,0 +1,105 @@
Release: WSJT-X Version 1.7.0
-----------------------------
Short list of new features
--------------------------
1. New modes: ISCAT, MSK144, QRA64.
2. Newly implemented submodes: JT65B-C, JT9B-H (wide and fast).
3. FT decoder replaces KV decoder for JT65; KVASD is no longer used.
4. Improvements to JT4, JT9, and JT65 decoders.
5. Multi-pass decoding now implemented for JT65 as well as WSPR.
6. Many improvements to Rig Control.
7. Improved convenience features for EME Doppler tracking.
8. Multiple configurations can be saved and restored.
9. Sample-file download facility.
10. Optional auto-sequencing for Fast modes.
11. Power settings optionally remembered for Transmit and Tune on a
band-by-band basis.
New Modes
---------
1. MSK144 is intended for meteor scatter at 50 MHz and higher. It
uses a low-density parity check code (LDPC) designed by Steve Franke,
K9AN. The mode is a direct descendant of the now-defunct mode JTMSK,
with a number of improvements for better performance on weak and short
meteor pings. The effective character transmission rate is about 250
cps, compared with 147 cps for FSK441. Like JT4, JT9, JT65, and
QRA64, MSK144 uses strong forward error correction. Message decoding
is all or nothing: partial decodes do not occur, and you will see
little or no garbage on your screen.
Standard MSK144 message frames are 72 ms long, compared with about 120
ms for an equivalent FSK441 message. The MSK144 waveform allows
coherent demodulation, allowing up to 3 dB better sensitivity. After
QSO partners have exchanged callsigns, MSK144 can use even shorter
messages, only 20 ms long. As in all the fast modes in WSJT-X, the 72
ms (or 20 ms) messages are repeated without gaps for the duration of a
transmission cycle. For most purposes we recommend a T/R cycle
duration of 15 s, but 5 s and 10 s sequences are also supported.
Short ("Sh") messages in MSK144 are intended primarily for 144 MHz and
higher frequencies, where most pings are very short. These messages
do not contain full callsigns; instead, they contain a hash of the two
callsigns along with a report, acknowledgement, or 73. Short messages
are fully decodable only by the station to whom they are addressed, as
part of an ongoing QSO, because only then will the received hash match
that calculated using the known strings for "My Call" and "DX Call".
If you are monitoring someone else's QSO, you will not be able to
decode its Sh messages.
An MSK144 signal occupies the full bandwidth of a typical SSB
transmitter, so transmissions are always centered at an offset of
1500Hz. For best results, selectable or adjustable Rx and Tx filters
should be set to provide the flattest possible response over at least
300 - 2700 Hz. The maximum permissible frequency offset between you
and your QSO partner is 200 Hz, and less is better.
2. QRA64 is a intended for EME and other weak-signal use. Its
internal code was designed by Nico Palermo, IV3NWV, and implemented in
WSJT-X by K1JT. The protocol uses a "Q-ary Repeat Accumulate" code --
along with LDPC, another one of the latest research areas in
communication theory. The QRA64 code is inherently better than the
Reed Solomon (63,12) code used in JT65, yielding already a 1.3 dB
advantage. QRA64 uses a new synchronizing scheme based on a 7 x 7
Costas array, so you will not see a bright sync tone at the lowest
tone frequency. This change yields another 1.9 dB advantage.
In most respects our implementation of QRA64 is operationally similar
to JT65. QRA64 does not use two-tone shorthand messages, and it makes
no use of a callsign database. Rather, additional sensitivity is
gained by making use of "already known" information as a QSO
progresses -- for example, when reports are being exchanged and you
have already decoded both callsigns in a previous transmission. QRA64
presently offers no message averaging capability, though that may be
added. In our early tests, many EME QSOs have already been made using
submodes QRA64A-E on bands from 144 MHz to 10 GHz.
3. ISCAT is essentially the same as in recent versions of program WSJT.
For details consult the WSJT User Guide:
http://physics.princeton.edu/pulsar/K1JT/doc/wsjt/
Program Setup
-------------
Many of the new program capabilities are enabled when you check
"Enable VHF/UHF/Microwave features" on the Settings | General tab.
For MSK144 mode, we suggest setting "T/R 15 s" and "F Tol 100 Hz".
Check "Sh" to enable the use of short messages and "Auto Seq" for
auto-sequencing. For QRA64 mode, set Tx and Rx frequencies to 1000
Hz. We encourage you to check "Save all" when making tests, and to
save any of the resulting .wav files that might help us to improve
program performance or behavior, or to illustrate a problem that you
identify.
Final Comments
--------------
We will be grateful for any and all reports from users; these will
surely help us to make further improvements to WSJT-X. The most
helpful bug reports describe the problem clearly and include a
complete recipe to reproduce it. Feature requests are also welcome.
Send your reports to wsjtgroup@yahoogroups.com, or to the developers
list wsjt-devel@lists.sourceforge.net.
@@ -0,0 +1,24 @@
#ifndef BOOST_MPL_BACK_FWD_HPP_INCLUDED
#define BOOST_MPL_BACK_FWD_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$
namespace boost { namespace mpl {
template< typename Tag > struct back_impl;
template< typename Sequence > struct back;
}}
#endif // BOOST_MPL_BACK_FWD_HPP_INCLUDED
@@ -0,0 +1,32 @@
// 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_PRESSURE_DERIVED_DIMENSION_HPP
#define BOOST_UNITS_PRESSURE_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>
namespace boost {
namespace units {
/// derived dimension for pressure : L^-1 M T^-2
typedef derived_dimension<length_base_dimension,-1,
mass_base_dimension,1,
time_base_dimension,-2>::type pressure_dimension;
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP
@@ -0,0 +1,100 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//
#ifndef BOOST_COMPUTE_FUNCTIONAL_OPERATORS_HPP
#define BOOST_COMPUTE_FUNCTIONAL_OPERATORS_HPP
#include <string>
namespace boost {
namespace compute {
namespace detail {
template<class Expr1, class Expr2, class Result>
struct invoked_binary_operator
{
typedef Result result_type;
invoked_binary_operator(const std::string &op,
const Expr1 &arg1,
const Expr2 &arg2)
: m_op(op),
m_expr1(arg1),
m_expr2(arg2)
{
}
std::string op() const
{
return m_op;
}
Expr1 arg1() const
{
return m_expr1;
}
Expr2 arg2() const
{
return m_expr2;
}
std::string m_op;
Expr1 m_expr1;
Expr2 m_expr2;
};
} // end detail namespace
/// \internal_
#define BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(name, op, return_type, arg_type) \
template<class arg_type> \
class name : public function<return_type (arg_type, arg_type)> \
{ \
public: \
name() : function<return_type (arg_type, arg_type)>(BOOST_PP_STRINGIZE(name)) { } \
\
template<class Arg1, class Arg2> \
detail::invoked_binary_operator<Arg1, Arg2, T> \
operator()(const Arg1 &x, const Arg2 &y) const \
{ \
return detail::invoked_binary_operator<Arg1, Arg2, T>(op, x, y); \
} \
};
// arithmetic operations
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(plus, "+", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(minus, "-", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(multiplies, "*", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(divides, "/", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(modulus, "%", T, T)
// comparisons
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(equal_to, "==", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(not_equal_to, "!=", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(greater, ">", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(less, "<", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(greater_equal, ">=", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(less_equal, "<=", T, T)
// logical operators
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(logical_and, "&&", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(logical_or, "||", T, T)
// bitwise operations
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(bit_and, "&", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(bit_or, "|", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(bit_xor, "^", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(shift_left, "<<", T, T)
BOOST_COMPUTE_DECLARE_BINARY_OPERATOR(shift_right, ">>", T, T)
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_FUNCTIONAL_OPERATORS_HPP
@@ -0,0 +1,173 @@
//-----------------------------------------------------------------------------
// boost variant/detail/apply_visitor_unary.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002-2003 Eric Friedman
// Copyright (c) 2014 Antony Polukhin
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_VARIANT_DETAIL_APPLY_VISITOR_UNARY_HPP
#define BOOST_VARIANT_DETAIL_APPLY_VISITOR_UNARY_HPP
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/variant/detail/generic_result_type.hpp>
#if BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
#include <boost/core/enable_if.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_const.hpp>
#endif
#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
# include <boost/mpl/distance.hpp>
# include <boost/mpl/advance.hpp>
# include <boost/mpl/deref.hpp>
# include <boost/mpl/size.hpp>
# include <boost/utility/declval.hpp>
# include <boost/core/enable_if.hpp>
# include <boost/variant/detail/has_result_type.hpp>
#endif
namespace boost {
//////////////////////////////////////////////////////////////////////////
// function template apply_visitor(visitor, visitable)
//
// Visits visitable with visitor.
//
//
// nonconst-visitor version:
//
#if !BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
# define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
/**/
#else // EDG-based compilers
# define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
typename enable_if< \
mpl::not_< is_const< V > > \
, BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
>::type \
/**/
#endif // EDG-based compilers workaround
template <typename Visitor, typename Visitable>
inline
BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(Visitor)
apply_visitor(Visitor& visitor, Visitable& visitable)
{
return visitable.apply_visitor(visitor);
}
#undef BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE
//
// const-visitor version:
//
template <typename Visitor, typename Visitable>
inline
BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
apply_visitor(const Visitor& visitor, Visitable& visitable)
{
return visitable.apply_visitor(visitor);
}
#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
// C++14
namespace detail { namespace variant {
// This class serves only metaprogramming purposes. none of its methods must be called at runtime!
template <class Visitor, class Variant>
struct result_multideduce1 {
typedef typename Variant::types types;
typedef typename boost::mpl::begin<types>::type begin_it;
typedef typename boost::mpl::advance<
begin_it, boost::mpl::int_<boost::mpl::size<types>::type::value - 1>
>::type last_it;
// For metaprogramming purposes ONLY! Do not use this method (and class) at runtime!
static Visitor& vis() BOOST_NOEXCEPT {
// Functions that work with lambdas must be defined in same translation unit.
// Because of that, we can not use `boost::decval<Visitor&>()` here.
Visitor&(*f)() = 0; // pointer to function
return f();
}
static decltype(auto) deduce_impl(last_it, unsigned /*helper*/) {
typedef typename boost::mpl::deref<last_it>::type value_t;
return vis()( boost::declval< value_t& >() );
}
template <class It>
static decltype(auto) deduce_impl(It, unsigned helper) {
typedef typename boost::mpl::next<It>::type next_t;
typedef typename boost::mpl::deref<It>::type value_t;
if (helper == boost::mpl::distance<begin_it, It>::type::value) {
return deduce_impl(next_t(), ++helper);
}
return vis()( boost::declval< value_t& >() );
}
static decltype(auto) deduce() {
return deduce_impl(begin_it(), 0);
}
};
template <class Visitor, class Variant>
struct result_wrapper1
{
typedef decltype(result_multideduce1<Visitor, Variant>::deduce()) result_type;
Visitor& visitor_;
explicit result_wrapper1(Visitor& visitor) BOOST_NOEXCEPT
: visitor_(visitor)
{}
template <class T>
result_type operator()(T& val) const {
return visitor_(val);
}
};
}} // namespace detail::variant
template <typename Visitor, typename Visitable>
inline decltype(auto) apply_visitor(Visitor& visitor, Visitable& visitable,
typename boost::disable_if<
boost::detail::variant::has_result_type<Visitor>
>::type* = 0)
{
boost::detail::variant::result_wrapper1<Visitor, Visitable> cpp14_vis(visitor);
return visitable.apply_visitor(cpp14_vis);
}
template <typename Visitor, typename Visitable>
inline decltype(auto) apply_visitor(const Visitor& visitor, Visitable& visitable,
typename boost::disable_if<
boost::detail::variant::has_result_type<Visitor>
>::type* = 0)
{
boost::detail::variant::result_wrapper1<const Visitor, Visitable> cpp14_vis(visitor);
return visitable.apply_visitor(cpp14_vis);
}
#endif // !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
} // namespace boost
#endif // BOOST_VARIANT_DETAIL_APPLY_VISITOR_UNARY_HPP
@@ -0,0 +1,340 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
namespace result_of
{
template <
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_
, typename Extra = void_
>
struct list_tie;
}
namespace result_of
{
template <typename T0>
struct list_tie< T0 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0&> type;
};
}
template <typename T0>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0&>
list_tie(T0 & arg0)
{
return list<T0&>(
arg0);
}
namespace result_of
{
template <typename T0 , typename T1>
struct list_tie< T0 , T1 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1&> type;
};
}
template <typename T0 , typename T1>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1&>
list_tie(T0 & arg0 , T1 & arg1)
{
return list<T0& , T1&>(
arg0 , arg1);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2>
struct list_tie< T0 , T1 , T2 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2&> type;
};
}
template <typename T0 , typename T1 , typename T2>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2)
{
return list<T0& , T1& , T2&>(
arg0 , arg1 , arg2);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3>
struct list_tie< T0 , T1 , T2 , T3 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3)
{
return list<T0& , T1& , T2& , T3&>(
arg0 , arg1 , arg2 , arg3);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4>
struct list_tie< T0 , T1 , T2 , T3 , T4 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4)
{
return list<T0& , T1& , T2& , T3& , T4&>(
arg0 , arg1 , arg2 , arg3 , arg4);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5)
{
return list<T0& , T1& , T2& , T3& , T4& , T5&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , void_ , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , void_ , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13 , T14 & arg14)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , void_ , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13 , T14 & arg14 , T15 & arg15)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , void_ , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13 , T14 & arg14 , T15 & arg15 , T16 & arg16)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , void_ , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13 , T14 & arg14 , T15 & arg15 , T16 & arg16 , T17 & arg17)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , void_ , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17& , T18&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17& , T18&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13 , T14 & arg14 , T15 & arg15 , T16 & arg16 , T17 & arg17 , T18 & arg18)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17& , T18&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18);
}
namespace result_of
{
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19>
struct list_tie< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , void_ >
{
typedef list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17& , T18& , T19&> type;
};
}
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17& , T18& , T19&>
list_tie(T0 & arg0 , T1 & arg1 , T2 & arg2 , T3 & arg3 , T4 & arg4 , T5 & arg5 , T6 & arg6 , T7 & arg7 , T8 & arg8 , T9 & arg9 , T10 & arg10 , T11 & arg11 , T12 & arg12 , T13 & arg13 , T14 & arg14 , T15 & arg15 , T16 & arg16 , T17 & arg17 , T18 & arg18 , T19 & arg19)
{
return list<T0& , T1& , T2& , T3& , T4& , T5& , T6& , T7& , T8& , T9& , T10& , T11& , T12& , T13& , T14& , T15& , T16& , T17& , T18& , T19&>(
arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19);
}
}}
@@ -0,0 +1,185 @@
#ifndef BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_binary_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as native binary - this should be the fastest way
// to archive the state of a group of obects. It makes no attempt to
// convert to any canonical form.
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/integer.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/item_version_type.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
//////////////////////////////////////////////////////////////////////
// class basic_binary_oarchive - write serialized objects to a binary output stream
// note: this archive has no pretensions to portability. Archive format
// may vary across machine architectures and compilers. About the only
// guarentee is that an archive created with this code will be readable
// by a program built with the same tools for the same machne. This class
// does have the virtue of buiding the smalles archive in the minimum amount
// of time. So under some circumstances it may be he right choice.
template<class Archive>
class BOOST_SYMBOL_VISIBLE basic_binary_oarchive :
public detail::common_oarchive<Archive>
{
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public:
#else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
#else
friend class detail::interface_oarchive<Archive>;
#endif
#endif
// any datatype not specifed below will be handled by base class
typedef detail::common_oarchive<Archive> detail_common_oarchive;
template<class T>
void save_override(const T & t){
this->detail_common_oarchive::save_override(t);
}
// include these to trap a change in binary format which
// isn't specifically handled
BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool));
// upto 32K classes
BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
// upto 2G objects
BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
// binary files don't include the optional information
void save_override(const class_id_optional_type & /* t */){}
// enable this if we decide to support generation of previous versions
#if 0
void save_override(const boost::archive::version_type & t){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::uint_least16_t x = t;
* this->This() << x;
}
else{
const unsigned int x = t;
* this->This() << x;
}
}
void save_override(const boost::serialization::item_version_type & t){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::uint_least16_t x = t;
* this->This() << x;
}
else{
const unsigned int x = t;
* this->This() << x;
}
}
void save_override(class_id_type & t){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::int_least16_t x = t;
* this->This() << x;
}
else{
const int x = t;
* this->This() << x;
}
}
void save_override(class_id_reference_type & t){
save_override(static_cast<class_id_type &>(t));
}
#endif
// explicitly convert to char * to avoid compile ambiguities
void save_override(const class_name_type & t){
const std::string s(t);
* this->This() << s;
}
#if 0
void save_override(const serialization::collection_size_type & t){
if (get_library_version() < boost::archive::library_version_type(6)){
unsigned int x=0;
* this->This() >> x;
t = serialization::collection_size_type(x);
}
else{
* this->This() >> t;
}
}
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
init();
basic_binary_oarchive(unsigned int flags) :
detail::common_oarchive<Archive>(flags)
{}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
@@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_REVERSE_07212005_1230)
#define FUSION_REVERSE_07212005_1230
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/reverse_view/reverse_view.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence>
struct reverse
{
typedef reverse_view<Sequence> type;
};
}
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
enable_if<
traits::is_sequence<Sequence>
, reverse_view<Sequence const>
>::type
reverse(Sequence const& view)
{
return reverse_view<Sequence const>(view);
}
}}
#endif
@@ -0,0 +1,185 @@
/*=============================================================================
Copyright (c) 1998-2003 Joel de Guzman
http://spirit.sourceforge.net/
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_SPIRIT_MATCH_HPP)
#define BOOST_SPIRIT_MATCH_HPP
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/config.hpp>
#include <boost/spirit/home/classic/core/nil.hpp>
#include <boost/call_traits.hpp>
#include <boost/optional.hpp>
#include <boost/spirit/home/classic/core/assert.hpp>
#include <boost/spirit/home/classic/core/safe_bool.hpp>
#include <boost/spirit/home/classic/core/impl/match_attr_traits.ipp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_reference.hpp>
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////
//
// match class
//
// The match holds the result of a parser. A match object evaluates
// to true when a successful match is found, otherwise false. The
// length of the match is the number of characters (or tokens) that
// is successfully matched. This can be queried through its length()
// member function. A negative value means that the match is
// unsucessful.
//
// Each parser may have an associated attribute. This attribute is
// also returned back to the client on a successful parse through
// the match object. The match's value() member function returns the
// match's attribute.
//
// A match attribute is valid:
//
// * on a successful match
// * when its value is set through the value(val) member function
// * if it is assigned or copied from a compatible match object
// (e.g. match<double> from match<int>) with a valid attribute.
//
// The match attribute is undefined:
//
// * on an unsuccessful match
// * when an attempt to copy or assign from another match object
// with an incompatible attribute type (e.g. match<std::string>
// from match<int>).
//
// The member function has_valid_attribute() can be queried to know if
// it is safe to get the match's attribute. The attribute may be set
// through the member function value(v) where v is the new attribute
// value.
//
///////////////////////////////////////////////////////////////////////////
template <typename T = nil_t>
class match : public safe_bool<match<T> >
{
public:
typedef typename boost::optional<T> optional_type;
typedef typename optional_type::argument_type ctor_param_t;
typedef typename optional_type::reference_const_type return_t;
typedef T attr_t;
match();
explicit match(std::size_t length);
match(std::size_t length, ctor_param_t val);
bool operator!() const;
std::ptrdiff_t length() const;
bool has_valid_attribute() const;
return_t value() const;
void swap(match& other);
template <typename T2>
match(match<T2> const& other)
: len(other.length()), val()
{
impl::match_attr_traits<T>::copy(val, other);
}
template <typename T2>
match&
operator=(match<T2> const& other)
{
impl::match_attr_traits<T>::assign(val, other);
len = other.length();
return *this;
}
template <typename MatchT>
void
concat(MatchT const& other)
{
BOOST_SPIRIT_ASSERT(*this && other);
len += other.length();
}
template <typename ValueT>
void
value(ValueT const& val_)
{
impl::match_attr_traits<T>::set_value(val, val_, is_reference<T>());
}
bool operator_bool() const
{
return len >= 0;
}
private:
std::ptrdiff_t len;
optional_type val;
};
///////////////////////////////////////////////////////////////////////////
//
// match class specialization for nil_t values
//
///////////////////////////////////////////////////////////////////////////
template <>
class match<nil_t> : public safe_bool<match<nil_t> >
{
public:
typedef nil_t attr_t;
typedef nil_t return_t;
match();
explicit match(std::size_t length);
match(std::size_t length, nil_t);
bool operator!() const;
bool has_valid_attribute() const;
std::ptrdiff_t length() const;
nil_t value() const;
void value(nil_t);
void swap(match& other);
template <typename T>
match(match<T> const& other)
: len(other.length()) {}
template <typename T>
match<>&
operator=(match<T> const& other)
{
len = other.length();
return *this;
}
template <typename T>
void
concat(match<T> const& other)
{
BOOST_SPIRIT_ASSERT(*this && other);
len += other.length();
}
bool operator_bool() const
{
return len >= 0;
}
private:
std::ptrdiff_t len;
};
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
#endif
#include <boost/spirit/home/classic/core/impl/match.ipp>
@@ -0,0 +1,14 @@
// Status=review
- SSB transceiver and antenna
- Computer running Windows (XP or later), Linux, or OS X
- 1.5 GHz or faster CPU and 200 MB of available memory; faster
machines are better
- Monitor with at least 1024 x 780 resolution
- Computer-to-radio interface using a serial port or equivalent USB
device for T/R switching, or CAT control, or VOX, as required for
your radio-to-computer connections
- Audio input and output devices supported by the operating system and
configured for sample rate 48000 Hz, 16 bits
- Audio or equivalent USB connections between transceiver and computer
- A means for synchronizing the computer clock to UTC within ±1 second
@@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_REMOVE_07162005_0818)
#define FUSION_REMOVE_07162005_0818
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/filter_view/filter_view.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename T>
struct remove
{
typedef filter_view<Sequence, mpl::not_<is_same<mpl::_, T> > > type;
};
}
template <typename T, typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::remove<Sequence const, T>::type
remove(Sequence const& seq)
{
typedef typename result_of::remove<Sequence const, T>::type result_type;
return result_type(seq);
}
}}
#endif
@@ -0,0 +1,72 @@
// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/numeric/conversion
//
// Contact the author at: fernando_cacciola@hotmail.com
//
#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
#define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
#include "boost/config.hpp"
#include "boost/limits.hpp"
#include "boost/numeric/conversion/sign_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
#include "boost/mpl/integral_c.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'SignMixture'
typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
// Metafunction:
//
// get_sign_mixture<T,S>::type
//
// Selects the appropriate SignMixture Integral Constant for the combination T,S.
//
template<class T,class S>
struct get_sign_mixture
{
typedef mpl::bool_< ::std::numeric_limits<S>::is_signed > S_signed ;
typedef mpl::bool_< ::std::numeric_limits<T>::is_signed > T_signed ;
typedef typename
for_both<S_signed, T_signed, sig2sig_c, sig2unsig_c, unsig2sig_c, unsig2unsig_c>::type
type ;
} ;
// Metafunction:
//
// for_sign_mixture<SignMixture,Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig>::type
//
// {SignMixture} is one of the Integral Constants for SignMixture, declared above.
// {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions)
//
// According to the value of 'SignMixture', selects the corresponding type.
//
template<class SignMixture, class Sig2Sig, class Sig2Unsig, class Unsig2Sig, class Unsig2Unsig>
struct for_sign_mixture
{
typedef typename
ct_switch4<SignMixture
, sig2sig_c, sig2unsig_c, unsig2sig_c // default
, Sig2Sig , Sig2Unsig , Unsig2Sig , Unsig2Unsig
>::type
type ;
} ;
} } } // namespace boost::numeric::convdetail
#endif
//
///////////////////////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,15 @@
/*
Copyright Rene Rivera 2015-2016
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_VERSION_H
#define BOOST_PREDEF_VERSION_H
#include <boost/predef/version_number.h>
#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,4,1)
#endif
@@ -0,0 +1,99 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# include <boost/preprocessor/slot/detail/shared.hpp>
#
# undef BOOST_PP_ITERATION_START_3
#
# undef BOOST_PP_ITERATION_START_3_DIGIT_1
# undef BOOST_PP_ITERATION_START_3_DIGIT_2
# undef BOOST_PP_ITERATION_START_3_DIGIT_3
# undef BOOST_PP_ITERATION_START_3_DIGIT_4
# undef BOOST_PP_ITERATION_START_3_DIGIT_5
# undef BOOST_PP_ITERATION_START_3_DIGIT_6
# undef BOOST_PP_ITERATION_START_3_DIGIT_7
# undef BOOST_PP_ITERATION_START_3_DIGIT_8
# undef BOOST_PP_ITERATION_START_3_DIGIT_9
# undef BOOST_PP_ITERATION_START_3_DIGIT_10
#
# if BOOST_PP_SLOT_TEMP_3 == 0
# define BOOST_PP_ITERATION_START_3_DIGIT_3 0
# elif BOOST_PP_SLOT_TEMP_3 == 1
# define BOOST_PP_ITERATION_START_3_DIGIT_3 1
# elif BOOST_PP_SLOT_TEMP_3 == 2
# define BOOST_PP_ITERATION_START_3_DIGIT_3 2
# elif BOOST_PP_SLOT_TEMP_3 == 3
# define BOOST_PP_ITERATION_START_3_DIGIT_3 3
# elif BOOST_PP_SLOT_TEMP_3 == 4
# define BOOST_PP_ITERATION_START_3_DIGIT_3 4
# elif BOOST_PP_SLOT_TEMP_3 == 5
# define BOOST_PP_ITERATION_START_3_DIGIT_3 5
# elif BOOST_PP_SLOT_TEMP_3 == 6
# define BOOST_PP_ITERATION_START_3_DIGIT_3 6
# elif BOOST_PP_SLOT_TEMP_3 == 7
# define BOOST_PP_ITERATION_START_3_DIGIT_3 7
# elif BOOST_PP_SLOT_TEMP_3 == 8
# define BOOST_PP_ITERATION_START_3_DIGIT_3 8
# elif BOOST_PP_SLOT_TEMP_3 == 9
# define BOOST_PP_ITERATION_START_3_DIGIT_3 9
# endif
#
# if BOOST_PP_SLOT_TEMP_2 == 0
# define BOOST_PP_ITERATION_START_3_DIGIT_2 0
# elif BOOST_PP_SLOT_TEMP_2 == 1
# define BOOST_PP_ITERATION_START_3_DIGIT_2 1
# elif BOOST_PP_SLOT_TEMP_2 == 2
# define BOOST_PP_ITERATION_START_3_DIGIT_2 2
# elif BOOST_PP_SLOT_TEMP_2 == 3
# define BOOST_PP_ITERATION_START_3_DIGIT_2 3
# elif BOOST_PP_SLOT_TEMP_2 == 4
# define BOOST_PP_ITERATION_START_3_DIGIT_2 4
# elif BOOST_PP_SLOT_TEMP_2 == 5
# define BOOST_PP_ITERATION_START_3_DIGIT_2 5
# elif BOOST_PP_SLOT_TEMP_2 == 6
# define BOOST_PP_ITERATION_START_3_DIGIT_2 6
# elif BOOST_PP_SLOT_TEMP_2 == 7
# define BOOST_PP_ITERATION_START_3_DIGIT_2 7
# elif BOOST_PP_SLOT_TEMP_2 == 8
# define BOOST_PP_ITERATION_START_3_DIGIT_2 8
# elif BOOST_PP_SLOT_TEMP_2 == 9
# define BOOST_PP_ITERATION_START_3_DIGIT_2 9
# endif
#
# if BOOST_PP_SLOT_TEMP_1 == 0
# define BOOST_PP_ITERATION_START_3_DIGIT_1 0
# elif BOOST_PP_SLOT_TEMP_1 == 1
# define BOOST_PP_ITERATION_START_3_DIGIT_1 1
# elif BOOST_PP_SLOT_TEMP_1 == 2
# define BOOST_PP_ITERATION_START_3_DIGIT_1 2
# elif BOOST_PP_SLOT_TEMP_1 == 3
# define BOOST_PP_ITERATION_START_3_DIGIT_1 3
# elif BOOST_PP_SLOT_TEMP_1 == 4
# define BOOST_PP_ITERATION_START_3_DIGIT_1 4
# elif BOOST_PP_SLOT_TEMP_1 == 5
# define BOOST_PP_ITERATION_START_3_DIGIT_1 5
# elif BOOST_PP_SLOT_TEMP_1 == 6
# define BOOST_PP_ITERATION_START_3_DIGIT_1 6
# elif BOOST_PP_SLOT_TEMP_1 == 7
# define BOOST_PP_ITERATION_START_3_DIGIT_1 7
# elif BOOST_PP_SLOT_TEMP_1 == 8
# define BOOST_PP_ITERATION_START_3_DIGIT_1 8
# elif BOOST_PP_SLOT_TEMP_1 == 9
# define BOOST_PP_ITERATION_START_3_DIGIT_1 9
# endif
#
# if BOOST_PP_ITERATION_START_3_DIGIT_3
# define BOOST_PP_ITERATION_START_3 BOOST_PP_SLOT_CC_3(BOOST_PP_ITERATION_START_3_DIGIT_3, BOOST_PP_ITERATION_START_3_DIGIT_2, BOOST_PP_ITERATION_START_3_DIGIT_1)
# elif BOOST_PP_ITERATION_START_3_DIGIT_2
# define BOOST_PP_ITERATION_START_3 BOOST_PP_SLOT_CC_2(BOOST_PP_ITERATION_START_3_DIGIT_2, BOOST_PP_ITERATION_START_3_DIGIT_1)
# else
# define BOOST_PP_ITERATION_START_3 BOOST_PP_ITERATION_START_3_DIGIT_1
# endif
@@ -0,0 +1,682 @@
/* boost random/mersenne_twister.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Copyright Steven Watanabe 2010
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id$
*
* Revision history
* 2013-10-14 fixed some warnings with Wshadow (mgaunard)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_MERSENNE_TWISTER_HPP
#define BOOST_RANDOM_MERSENNE_TWISTER_HPP
#include <iosfwd>
#include <istream>
#include <stdexcept>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/integer/integer_mask.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/ptr_helper.hpp>
#include <boost/random/detail/seed.hpp>
#include <boost/random/detail/seed_impl.hpp>
#include <boost/random/detail/generator_seed_seq.hpp>
#include <boost/random/detail/polynomial.hpp>
#include <boost/random/detail/disable_warnings.hpp>
namespace boost {
namespace random {
/**
* Instantiations of class template mersenne_twister_engine model a
* \pseudo_random_number_generator. It uses the algorithm described in
*
* @blockquote
* "Mersenne Twister: A 623-dimensionally equidistributed uniform
* pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura,
* ACM Transactions on Modeling and Computer Simulation: Special Issue on
* Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
* @endblockquote
*
* @xmlnote
* The boost variant has been implemented from scratch and does not
* derive from or use mt19937.c provided on the above WWW site. However, it
* was verified that both produce identical output.
* @endxmlnote
*
* The seeding from an integer was changed in April 2005 to address a
* <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">weakness</a>.
*
* The quality of the generator crucially depends on the choice of the
* parameters. User code should employ one of the sensibly parameterized
* generators such as \mt19937 instead.
*
* The generator requires considerable amounts of memory for the storage of
* its state array. For example, \mt11213b requires about 1408 bytes and
* \mt19937 requires about 2496 bytes.
*/
template<class UIntType,
std::size_t w, std::size_t n, std::size_t m, std::size_t r,
UIntType a, std::size_t u, UIntType d, std::size_t s,
UIntType b, std::size_t t,
UIntType c, std::size_t l, UIntType f>
class mersenne_twister_engine
{
public:
typedef UIntType result_type;
BOOST_STATIC_CONSTANT(std::size_t, word_size = w);
BOOST_STATIC_CONSTANT(std::size_t, state_size = n);
BOOST_STATIC_CONSTANT(std::size_t, shift_size = m);
BOOST_STATIC_CONSTANT(std::size_t, mask_bits = r);
BOOST_STATIC_CONSTANT(UIntType, xor_mask = a);
BOOST_STATIC_CONSTANT(std::size_t, tempering_u = u);
BOOST_STATIC_CONSTANT(UIntType, tempering_d = d);
BOOST_STATIC_CONSTANT(std::size_t, tempering_s = s);
BOOST_STATIC_CONSTANT(UIntType, tempering_b = b);
BOOST_STATIC_CONSTANT(std::size_t, tempering_t = t);
BOOST_STATIC_CONSTANT(UIntType, tempering_c = c);
BOOST_STATIC_CONSTANT(std::size_t, tempering_l = l);
BOOST_STATIC_CONSTANT(UIntType, initialization_multiplier = f);
BOOST_STATIC_CONSTANT(UIntType, default_seed = 5489u);
// backwards compatibility
BOOST_STATIC_CONSTANT(UIntType, parameter_a = a);
BOOST_STATIC_CONSTANT(std::size_t, output_u = u);
BOOST_STATIC_CONSTANT(std::size_t, output_s = s);
BOOST_STATIC_CONSTANT(UIntType, output_b = b);
BOOST_STATIC_CONSTANT(std::size_t, output_t = t);
BOOST_STATIC_CONSTANT(UIntType, output_c = c);
BOOST_STATIC_CONSTANT(std::size_t, output_l = l);
// old Boost.Random concept requirements
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
/**
* Constructs a @c mersenne_twister_engine and calls @c seed().
*/
mersenne_twister_engine() { seed(); }
/**
* Constructs a @c mersenne_twister_engine and calls @c seed(value).
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(mersenne_twister_engine,
UIntType, value)
{ seed(value); }
template<class It> mersenne_twister_engine(It& first, It last)
{ seed(first,last); }
/**
* Constructs a mersenne_twister_engine and calls @c seed(gen).
*
* @xmlnote
* The copy constructor will always be preferred over
* the templated constructor.
* @endxmlnote
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(mersenne_twister_engine,
SeedSeq, seq)
{ seed(seq); }
// compiler-generated copy ctor and assignment operator are fine
/** Calls @c seed(default_seed). */
void seed() { seed(default_seed); }
/**
* Sets the state x(0) to v mod 2w. Then, iteratively,
* sets x(i) to
* (i + f * (x(i-1) xor (x(i-1) rshift w-2))) mod 2<sup>w</sup>
* for i = 1 .. n-1. x(n) is the first value to be returned by operator().
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(mersenne_twister_engine, UIntType, value)
{
// New seeding algorithm from
// http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
// In the previous versions, MSBs of the seed affected only MSBs of the
// state x[].
const UIntType mask = (max)();
x[0] = value & mask;
for (i = 1; i < n; i++) {
// See Knuth "The Art of Computer Programming"
// Vol. 2, 3rd ed., page 106
x[i] = (f * (x[i-1] ^ (x[i-1] >> (w-2))) + i) & mask;
}
normalize_state();
}
/**
* Seeds a mersenne_twister_engine using values produced by seq.generate().
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(mersenne_twister_engine, SeeqSeq, seq)
{
detail::seed_array_int<w>(seq, x);
i = n;
normalize_state();
}
/** Sets the state of the generator using values from an iterator range. */
template<class It>
void seed(It& first, It last)
{
detail::fill_array_int<w>(first, last, x);
i = n;
normalize_state();
}
/** Returns the smallest value that the generator can produce. */
static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{ return 0; }
/** Returns the largest value that the generator can produce. */
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{ return boost::low_bits_mask_t<w>::sig_bits; }
/** Produces the next value of the generator. */
result_type operator()();
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
{ detail::generate_from_int(*this, first, last); }
/**
* Advances the state of the generator by @c z steps. Equivalent to
*
* @code
* for(unsigned long long i = 0; i < z; ++i) {
* gen();
* }
* @endcode
*/
void discard(boost::uintmax_t z)
{
#ifndef BOOST_RANDOM_MERSENNE_TWISTER_DISCARD_THRESHOLD
#define BOOST_RANDOM_MERSENNE_TWISTER_DISCARD_THRESHOLD 10000000
#endif
if(z > BOOST_RANDOM_MERSENNE_TWISTER_DISCARD_THRESHOLD) {
discard_many(z);
} else {
for(boost::uintmax_t j = 0; j < z; ++j) {
(*this)();
}
}
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/** Writes a mersenne_twister_engine to a @c std::ostream */
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const mersenne_twister_engine& mt)
{
mt.print(os);
return os;
}
/** Reads a mersenne_twister_engine from a @c std::istream */
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
mersenne_twister_engine& mt)
{
for(std::size_t j = 0; j < mt.state_size; ++j)
is >> mt.x[j] >> std::ws;
// MSVC (up to 7.1) and Borland (up to 5.64) don't handle the template
// value parameter "n" available from the class template scope, so use
// the static constant with the same value
mt.i = mt.state_size;
return is;
}
#endif
/**
* Returns true if the two generators are in the same state,
* and will thus produce identical sequences.
*/
friend bool operator==(const mersenne_twister_engine& x_,
const mersenne_twister_engine& y_)
{
if(x_.i < y_.i) return x_.equal_imp(y_);
else return y_.equal_imp(x_);
}
/**
* Returns true if the two generators are in different states.
*/
friend bool operator!=(const mersenne_twister_engine& x_,
const mersenne_twister_engine& y_)
{ return !(x_ == y_); }
private:
/// \cond show_private
void twist();
/**
* Does the work of operator==. This is in a member function
* for portability. Some compilers, such as msvc 7.1 and
* Sun CC 5.10 can't access template parameters or static
* members of the class from inline friend functions.
*
* requires i <= other.i
*/
bool equal_imp(const mersenne_twister_engine& other) const
{
UIntType back[n];
std::size_t offset = other.i - i;
for(std::size_t j = 0; j + offset < n; ++j)
if(x[j] != other.x[j+offset])
return false;
rewind(&back[n-1], offset);
for(std::size_t j = 0; j < offset; ++j)
if(back[j + n - offset] != other.x[j])
return false;
return true;
}
/**
* Does the work of operator<<. This is in a member function
* for portability.
*/
template<class CharT, class Traits>
void print(std::basic_ostream<CharT, Traits>& os) const
{
UIntType data[n];
for(std::size_t j = 0; j < i; ++j) {
data[j + n - i] = x[j];
}
if(i != n) {
rewind(&data[n - i - 1], n - i);
}
os << data[0];
for(std::size_t j = 1; j < n; ++j) {
os << ' ' << data[j];
}
}
/**
* Copies z elements of the state preceding x[0] into
* the array whose last element is last.
*/
void rewind(UIntType* last, std::size_t z) const
{
const UIntType upper_mask = (~static_cast<UIntType>(0)) << r;
const UIntType lower_mask = ~upper_mask;
UIntType y0 = x[m-1] ^ x[n-1];
if(y0 & (static_cast<UIntType>(1) << (w-1))) {
y0 = ((y0 ^ a) << 1) | 1;
} else {
y0 = y0 << 1;
}
for(std::size_t sz = 0; sz < z; ++sz) {
UIntType y1 =
rewind_find(last, sz, m-1) ^ rewind_find(last, sz, n-1);
if(y1 & (static_cast<UIntType>(1) << (w-1))) {
y1 = ((y1 ^ a) << 1) | 1;
} else {
y1 = y1 << 1;
}
*(last - sz) = (y0 & upper_mask) | (y1 & lower_mask);
y0 = y1;
}
}
/**
* Converts an arbitrary array into a valid generator state.
* First we normalize x[0], so that it contains the same
* value we would get by running the generator forwards
* and then in reverse. (The low order r bits are redundant).
* Then, if the state consists of all zeros, we set the
* high order bit of x[0] to 1. This function only needs to
* be called by seed, since the state transform preserves
* this relationship.
*/
void normalize_state()
{
const UIntType upper_mask = (~static_cast<UIntType>(0)) << r;
const UIntType lower_mask = ~upper_mask;
UIntType y0 = x[m-1] ^ x[n-1];
if(y0 & (static_cast<UIntType>(1) << (w-1))) {
y0 = ((y0 ^ a) << 1) | 1;
} else {
y0 = y0 << 1;
}
x[0] = (x[0] & upper_mask) | (y0 & lower_mask);
// fix up the state if it's all zeroes.
for(std::size_t j = 0; j < n; ++j) {
if(x[j] != 0) return;
}
x[0] = static_cast<UIntType>(1) << (w-1);
}
/**
* Given a pointer to the last element of the rewind array,
* and the current size of the rewind array, finds an element
* relative to the next available slot in the rewind array.
*/
UIntType
rewind_find(UIntType* last, std::size_t size, std::size_t j) const
{
std::size_t index = (j + n - size + n - 1) % n;
if(index < n - size) {
return x[index];
} else {
return *(last - (n - 1 - index));
}
}
/**
* Optimized algorithm for large jumps.
*
* Hiroshi Haramoto, Makoto Matsumoto, and Pierre L'Ecuyer. 2008.
* A Fast Jump Ahead Algorithm for Linear Recurrences in a Polynomial
* Space. In Proceedings of the 5th international conference on
* Sequences and Their Applications (SETA '08).
* DOI=10.1007/978-3-540-85912-3_26
*/
void discard_many(boost::uintmax_t z)
{
// Compute the minimal polynomial, phi(t)
// This depends only on the transition function,
// which is constant. The characteristic
// polynomial is the same as the minimal
// polynomial for a maximum period generator
// (which should be all specializations of
// mersenne_twister.) Even if it weren't,
// the characteristic polynomial is guaranteed
// to be a multiple of the minimal polynomial,
// which is good enough.
detail::polynomial phi = get_characteristic_polynomial();
// calculate g(t) = t^z % phi(t)
detail::polynomial g = mod_pow_x(z, phi);
// h(s_0, t) = \sum_{i=0}^{2k-1}o(s_i)t^{2k-i-1}
detail::polynomial h;
const std::size_t num_bits = w*n - r;
for(std::size_t j = 0; j < num_bits * 2; ++j) {
// Yes, we're advancing the generator state
// here, but it doesn't matter because
// we're going to overwrite it completely
// in reconstruct_state.
if(i >= n) twist();
h[2*num_bits - j - 1] = x[i++] & UIntType(1);
}
// g(t)h(s_0, t)
detail::polynomial gh = g * h;
detail::polynomial result;
for(std::size_t j = 0; j <= num_bits; ++j) {
result[j] = gh[2*num_bits - j - 1];
}
reconstruct_state(result);
}
static detail::polynomial get_characteristic_polynomial()
{
const std::size_t num_bits = w*n - r;
detail::polynomial helper;
helper[num_bits - 1] = 1;
mersenne_twister_engine tmp;
tmp.reconstruct_state(helper);
// Skip the first num_bits elements, since we
// already know what they are.
for(std::size_t j = 0; j < num_bits; ++j) {
if(tmp.i >= n) tmp.twist();
if(j == num_bits - 1)
assert((tmp.x[tmp.i] & 1) == 1);
else
assert((tmp.x[tmp.i] & 1) == 0);
++tmp.i;
}
detail::polynomial phi;
phi[num_bits] = 1;
detail::polynomial next_bits = tmp.as_polynomial(num_bits);
for(std::size_t j = 0; j < num_bits; ++j) {
int val = next_bits[j] ^ phi[num_bits-j-1];
phi[num_bits-j-1] = val;
if(val) {
for(std::size_t k = j + 1; k < num_bits; ++k) {
phi[num_bits-k-1] ^= next_bits[k-j-1];
}
}
}
return phi;
}
detail::polynomial as_polynomial(std::size_t size) {
detail::polynomial result;
for(std::size_t j = 0; j < size; ++j) {
if(i >= n) twist();
result[j] = x[i++] & UIntType(1);
}
return result;
}
void reconstruct_state(const detail::polynomial& p)
{
const UIntType upper_mask = (~static_cast<UIntType>(0)) << r;
const UIntType lower_mask = ~upper_mask;
const std::size_t num_bits = w*n - r;
for(std::size_t j = num_bits - n + 1; j <= num_bits; ++j)
x[j % n] = p[j];
UIntType y0 = 0;
for(std::size_t j = num_bits + 1; j >= n - 1; --j) {
UIntType y1 = x[j % n] ^ x[(j + m) % n];
if(p[j - n + 1])
y1 = (y1 ^ a) << UIntType(1) | UIntType(1);
else
y1 = y1 << UIntType(1);
x[(j + 1) % n] = (y0 & upper_mask) | (y1 & lower_mask);
y0 = y1;
}
i = 0;
}
/// \endcond
// state representation: next output is o(x(i))
// x[0] ... x[k] x[k+1] ... x[n-1] represents
// x(i-k) ... x(i) x(i+1) ... x(i-k+n-1)
UIntType x[n];
std::size_t i;
};
/// \cond show_private
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
#define BOOST_RANDOM_MT_DEFINE_CONSTANT(type, name) \
template<class UIntType, std::size_t w, std::size_t n, std::size_t m, \
std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, \
UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f> \
const type mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::name
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, word_size);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, state_size);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, shift_size);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, mask_bits);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, xor_mask);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_u);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, tempering_d);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_s);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, tempering_b);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_t);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, tempering_c);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_l);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, initialization_multiplier);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, default_seed);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, parameter_a);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_u );
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_s);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, output_b);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_t);
BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, output_c);
BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_l);
BOOST_RANDOM_MT_DEFINE_CONSTANT(bool, has_fixed_range);
#undef BOOST_RANDOM_MT_DEFINE_CONSTANT
#endif
template<class UIntType,
std::size_t w, std::size_t n, std::size_t m, std::size_t r,
UIntType a, std::size_t u, UIntType d, std::size_t s,
UIntType b, std::size_t t,
UIntType c, std::size_t l, UIntType f>
void
mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::twist()
{
const UIntType upper_mask = (~static_cast<UIntType>(0)) << r;
const UIntType lower_mask = ~upper_mask;
const std::size_t unroll_factor = 6;
const std::size_t unroll_extra1 = (n-m) % unroll_factor;
const std::size_t unroll_extra2 = (m-1) % unroll_factor;
// split loop to avoid costly modulo operations
{ // extra scope for MSVC brokenness w.r.t. for scope
for(std::size_t j = 0; j < n-m-unroll_extra1; j++) {
UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
x[j] = x[j+m] ^ (y >> 1) ^ ((x[j+1]&1) * a);
}
}
{
for(std::size_t j = n-m-unroll_extra1; j < n-m; j++) {
UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
x[j] = x[j+m] ^ (y >> 1) ^ ((x[j+1]&1) * a);
}
}
{
for(std::size_t j = n-m; j < n-1-unroll_extra2; j++) {
UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
x[j] = x[j-(n-m)] ^ (y >> 1) ^ ((x[j+1]&1) * a);
}
}
{
for(std::size_t j = n-1-unroll_extra2; j < n-1; j++) {
UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
x[j] = x[j-(n-m)] ^ (y >> 1) ^ ((x[j+1]&1) * a);
}
}
// last iteration
UIntType y = (x[n-1] & upper_mask) | (x[0] & lower_mask);
x[n-1] = x[m-1] ^ (y >> 1) ^ ((x[0]&1) * a);
i = 0;
}
/// \endcond
template<class UIntType,
std::size_t w, std::size_t n, std::size_t m, std::size_t r,
UIntType a, std::size_t u, UIntType d, std::size_t s,
UIntType b, std::size_t t,
UIntType c, std::size_t l, UIntType f>
inline typename
mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::result_type
mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::operator()()
{
if(i == n)
twist();
// Step 4
UIntType z = x[i];
++i;
z ^= ((z >> u) & d);
z ^= ((z << s) & b);
z ^= ((z << t) & c);
z ^= (z >> l);
return z;
}
/**
* The specializations \mt11213b and \mt19937 are from
*
* @blockquote
* "Mersenne Twister: A 623-dimensionally equidistributed
* uniform pseudo-random number generator", Makoto Matsumoto
* and Takuji Nishimura, ACM Transactions on Modeling and
* Computer Simulation: Special Issue on Uniform Random Number
* Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
* @endblockquote
*/
typedef mersenne_twister_engine<uint32_t,32,351,175,19,0xccab8ee7,
11,0xffffffff,7,0x31b6ab00,15,0xffe50000,17,1812433253> mt11213b;
/**
* The specializations \mt11213b and \mt19937 are from
*
* @blockquote
* "Mersenne Twister: A 623-dimensionally equidistributed
* uniform pseudo-random number generator", Makoto Matsumoto
* and Takuji Nishimura, ACM Transactions on Modeling and
* Computer Simulation: Special Issue on Uniform Random Number
* Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
* @endblockquote
*/
typedef mersenne_twister_engine<uint32_t,32,624,397,31,0x9908b0df,
11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253> mt19937;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
typedef mersenne_twister_engine<uint64_t,64,312,156,31,
UINT64_C(0xb5026f5aa96619e9),29,UINT64_C(0x5555555555555555),17,
UINT64_C(0x71d67fffeda60000),37,UINT64_C(0xfff7eee000000000),43,
UINT64_C(6364136223846793005)> mt19937_64;
#endif
/// \cond show_deprecated
template<class UIntType,
int w, int n, int m, int r,
UIntType a, int u, std::size_t s,
UIntType b, int t,
UIntType c, int l, UIntType v>
class mersenne_twister :
public mersenne_twister_engine<UIntType,
w, n, m, r, a, u, ~(UIntType)0, s, b, t, c, l, 1812433253>
{
typedef mersenne_twister_engine<UIntType,
w, n, m, r, a, u, ~(UIntType)0, s, b, t, c, l, 1812433253> base_type;
public:
mersenne_twister() {}
BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(mersenne_twister, Gen, gen)
{ seed(gen); }
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(mersenne_twister, UIntType, val)
{ seed(val); }
template<class It>
mersenne_twister(It& first, It last) : base_type(first, last) {}
void seed() { base_type::seed(); }
BOOST_RANDOM_DETAIL_GENERATOR_SEED(mersenne_twister, Gen, gen)
{
detail::generator_seed_seq<Gen> seq(gen);
base_type::seed(seq);
}
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(mersenne_twister, UIntType, val)
{ base_type::seed(val); }
template<class It>
void seed(It& first, It last) { base_type::seed(first, last); }
};
/// \endcond
} // namespace random
using random::mt11213b;
using random::mt19937;
using random::mt19937_64;
} // namespace boost
BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt11213b)
BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt19937)
BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt19937_64)
#include <boost/random/detail/enable_warnings.hpp>
#endif // BOOST_RANDOM_MERSENNE_TWISTER_HPP
@@ -0,0 +1,68 @@
// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/numeric/conversion
//
// Contact the author at: fernando_cacciola@hotmail.com
//
#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP
#define BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP
#include "boost/numeric/conversion/conversion_traits.hpp"
#include "boost/numeric/conversion/converter_policies.hpp"
#include "boost/numeric/conversion/detail/converter.hpp"
namespace boost { namespace numeric
{
template<class T,
class S,
class Traits = conversion_traits<T,S>,
class OverflowHandler = def_overflow_handler,
class Float2IntRounder = Trunc< BOOST_DEDUCED_TYPENAME Traits::source_type> ,
class RawConverter = raw_converter<Traits>,
class UserRangeChecker = UseInternalRangeChecker
>
struct converter : convdetail::get_converter_impl<Traits,
OverflowHandler,
Float2IntRounder,
RawConverter,
UserRangeChecker
>::type
{
typedef Traits traits ;
typedef typename Traits::argument_type argument_type ;
typedef typename Traits::result_type result_type ;
result_type operator() ( argument_type s ) const { return this->convert(s) ; }
} ;
template<class S,
class OverflowHandler = def_overflow_handler,
class Float2IntRounder = Trunc<S> ,
class UserRangeChecker = UseInternalRangeChecker
>
struct make_converter_from
{
template<class T,
class Traits = conversion_traits<T,S>,
class RawConverter = raw_converter<Traits>
>
struct to
{
typedef converter<T,S,Traits,OverflowHandler,Float2IntRounder,RawConverter,UserRangeChecker> type ;
} ;
} ;
} } // namespace boost::numeric
#endif
@@ -0,0 +1,83 @@
#if !defined(BOOST_PP_IS_ITERATING)
// 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 CALL_METHOD_DWA2002411_HPP
# define CALL_METHOD_DWA2002411_HPP
# include <boost/python/detail/prefix.hpp>
# include <boost/type.hpp>
# include <boost/python/converter/arg_to_python.hpp>
# include <boost/python/converter/return_from_python.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/python/detail/void_return.hpp>
# include <boost/preprocessor/comma_if.hpp>
# include <boost/preprocessor/iterate.hpp>
# include <boost/preprocessor/repeat.hpp>
# include <boost/preprocessor/debug/line.hpp>
# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
namespace boost { namespace python {
# define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \
, converter::arg_to_python<A##n>(a##n).get()
# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/call_method.hpp>))
# include BOOST_PP_ITERATE()
# undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET
}} // namespace boost::python
# endif // CALL_METHOD_DWA2002411_HPP
// 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
# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
&& BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
# line BOOST_PP_LINE(__LINE__, call_method.hpp)
# endif
# define N BOOST_PP_ITERATION()
template <
class R
BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)
>
typename detail::returnable<R>::type
call_method(PyObject* self, char const* name
BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a)
, boost::type<R>* = 0
)
{
PyObject* const result =
PyEval_CallMethod(
self
, const_cast<char*>(name)
, const_cast<char*>("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")")
BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil)
);
// This conversion *must not* be done in the same expression as
// the call, because, in the special case where the result is a
// reference a Python object which was created by converting a C++
// argument for passing to PyEval_CallFunction, its reference
// count will be 2 until the end of the full expression containing
// the conversion, and that interferes with dangling
// pointer/reference detection.
converter::return_from_python<R> converter;
return converter(result);
}
# undef N
#endif // BOOST_PP_ITERATION_DEPTH()
#endif // BOOST_PP_IS_ITERATING
@@ -0,0 +1,139 @@
//-----------------------------------------------------------------------------
// boost detail/templated_streams.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2013 John Maddock, Antony Polukhin
//
//
// 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_DETAIL_BASIC_POINTERBUF_HPP
#define BOOST_DETAIL_BASIC_POINTERBUF_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
#include "boost/config.hpp"
#include <streambuf>
namespace boost { namespace detail {
//
// class basic_pointerbuf:
// acts as a stream buffer which wraps around a pair of pointers:
//
template <class charT, class BufferT >
class basic_pointerbuf : public BufferT {
protected:
typedef BufferT base_type;
typedef basic_pointerbuf<charT, BufferT> this_type;
typedef typename base_type::int_type int_type;
typedef typename base_type::char_type char_type;
typedef typename base_type::pos_type pos_type;
typedef ::std::streamsize streamsize;
typedef typename base_type::off_type off_type;
public:
basic_pointerbuf() : base_type() { setbuf(0, 0); }
const charT* getnext() { return this->gptr(); }
#ifndef BOOST_NO_USING_TEMPLATE
using base_type::pptr;
using base_type::pbase;
#else
charT* pptr() const { return base_type::pptr(); }
charT* pbase() const { return base_type::pbase(); }
#endif
protected:
// VC mistakenly assumes that `setbuf` and other functions are not referenced.
// Marking those functions with `inline` suppresses the warnings.
// There must be no harm from marking virtual functions as inline: inline virtual
// call can be inlined ONLY when the compiler knows the "exact class".
inline base_type* setbuf(char_type* s, streamsize n);
inline typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which);
inline typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which);
private:
basic_pointerbuf& operator=(const basic_pointerbuf&);
basic_pointerbuf(const basic_pointerbuf&);
};
template<class charT, class BufferT>
BufferT*
basic_pointerbuf<charT, BufferT>::setbuf(char_type* s, streamsize n)
{
this->setg(s, s, s + n);
return this;
}
template<class charT, class BufferT>
typename basic_pointerbuf<charT, BufferT>::pos_type
basic_pointerbuf<charT, BufferT>::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which)
{
typedef typename boost::int_t<sizeof(way) * CHAR_BIT>::least cast_type;
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
std::ptrdiff_t size = this->egptr() - this->eback();
std::ptrdiff_t pos = this->gptr() - this->eback();
charT* g = this->eback();
switch(static_cast<cast_type>(way))
{
case ::std::ios_base::beg:
if((off < 0) || (off > size))
return pos_type(off_type(-1));
else
this->setg(g, g + off, g + size);
break;
case ::std::ios_base::end:
if((off < 0) || (off > size))
return pos_type(off_type(-1));
else
this->setg(g, g + size - off, g + size);
break;
case ::std::ios_base::cur:
{
std::ptrdiff_t newpos = static_cast<std::ptrdiff_t>(pos + off);
if((newpos < 0) || (newpos > size))
return pos_type(off_type(-1));
else
this->setg(g, g + newpos, g + size);
break;
}
default: ;
}
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4244)
#endif
return static_cast<pos_type>(this->gptr() - this->eback());
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}
template<class charT, class BufferT>
typename basic_pointerbuf<charT, BufferT>::pos_type
basic_pointerbuf<charT, BufferT>::seekpos(pos_type sp, ::std::ios_base::openmode which)
{
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
off_type size = static_cast<off_type>(this->egptr() - this->eback());
charT* g = this->eback();
if(off_type(sp) <= size)
{
this->setg(g, g + off_type(sp), g + size);
}
return pos_type(off_type(-1));
}
}} // namespace boost::detail
#endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP
@@ -0,0 +1,114 @@
#ifndef DATE_DURATION_OPERATORS_HPP___
#define DATE_DURATION_OPERATORS_HPP___
/* Copyright (c) 2004 CrystalClear Software, Inc.
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or
* http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
* $Date$
*/
#include "boost/date_time/gregorian/greg_duration_types.hpp"
#include "boost/date_time/posix_time/ptime.hpp"
namespace boost {
namespace posix_time {
/*!@file date_duration_operators.hpp Operators for ptime and
* optional gregorian types. Operators use snap-to-end-of-month behavior.
* Further details on this behavior can be found in reference for
* date_time/date_duration_types.hpp and documentation for
* month and year iterators.
*/
/*! Adds a months object and a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
ptime
operator+(const ptime& t, const boost::gregorian::months& m)
{
return t + m.get_offset(t.date());
}
/*! Adds a months object to a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
ptime
operator+=(ptime& t, const boost::gregorian::months& m)
{
// get_neg_offset returns a negative duration, so we add
return t += m.get_offset(t.date());
}
/*! Subtracts a months object and a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
ptime
operator-(const ptime& t, const boost::gregorian::months& m)
{
// get_neg_offset returns a negative duration, so we add
return t + m.get_neg_offset(t.date());
}
/*! Subtracts a months object from a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
ptime
operator-=(ptime& t, const boost::gregorian::months& m)
{
return t += m.get_neg_offset(t.date());
}
// ptime & years
/*! Adds a years object and a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
ptime
operator+(const ptime& t, const boost::gregorian::years& y)
{
return t + y.get_offset(t.date());
}
/*! Adds a years object to a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
ptime
operator+=(ptime& t, const boost::gregorian::years& y)
{
return t += y.get_offset(t.date());
}
/*! Subtracts a years object and a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
ptime
operator-(const ptime& t, const boost::gregorian::years& y)
{
// get_neg_offset returns a negative duration, so we add
return t + y.get_neg_offset(t.date());
}
/*! Subtracts a years object from a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
ptime
operator-=(ptime& t, const boost::gregorian::years& y)
{
// get_neg_offset returns a negative duration, so we add
return t += y.get_neg_offset(t.date());
}
}} // namespaces
#endif // DATE_DURATION_OPERATORS_HPP___
@@ -0,0 +1,170 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2014 Roshan <thisisroshansmail@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_PREV_PERMUTATION_HPP
#define BOOST_COMPUTE_ALGORITHM_PREV_PERMUTATION_HPP
#include <iterator>
#include <boost/compute/system.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/container/detail/scalar.hpp>
#include <boost/compute/algorithm/reverse.hpp>
namespace boost {
namespace compute {
namespace detail {
///
/// \brief Helper function for prev_permutation
///
/// To find rightmost element which is greater
/// than its next element
///
template<class InputIterator>
inline InputIterator prev_permutation_helper(InputIterator first,
InputIterator last,
command_queue &queue)
{
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
size_t count = detail::iterator_range_size(first, last);
if(count == 0 || count == 1){
return last;
}
count = count - 1;
const context &context = queue.get_context();
detail::meta_kernel k("prev_permutation");
size_t index_arg = k.add_arg<int *>(memory_object::global_memory, "index");
atomic_max<int_> atomic_max_int;
k << k.decl<const int_>("i") << " = get_global_id(0);\n"
<< k.decl<const value_type>("cur_value") << "="
<< first[k.var<const int_>("i")] << ";\n"
<< k.decl<const value_type>("next_value") << "="
<< first[k.expr<const int_>("i+1")] << ";\n"
<< "if(cur_value > next_value){\n"
<< " " << atomic_max_int(k.var<int_ *>("index"), k.var<int_>("i")) << ";\n"
<< "}\n";
kernel kernel = k.compile(context);
scalar<int_> index(context);
kernel.set_arg(index_arg, index.get_buffer());
index.write(static_cast<int_>(-1), queue);
queue.enqueue_1d_range_kernel(kernel, 0, count, 0);
int result = static_cast<int>(index.read(queue));
if(result == -1) return last;
else return first + result;
}
///
/// \brief Helper function for prev_permutation
///
/// To find the largest element to the right of the element found above
/// that is smaller than it
///
template<class InputIterator, class ValueType>
inline InputIterator pp_floor(InputIterator first,
InputIterator last,
ValueType value,
command_queue &queue)
{
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
size_t count = detail::iterator_range_size(first, last);
if(count == 0){
return last;
}
const context &context = queue.get_context();
detail::meta_kernel k("pp_floor");
size_t index_arg = k.add_arg<int *>(memory_object::global_memory, "index");
size_t value_arg = k.add_arg<value_type>(memory_object::private_memory, "value");
atomic_max<int_> atomic_max_int;
k << k.decl<const int_>("i") << " = get_global_id(0);\n"
<< k.decl<const value_type>("cur_value") << "="
<< first[k.var<const int_>("i")] << ";\n"
<< "if(cur_value >= " << first[k.expr<int_>("*index")]
<< " && cur_value < value){\n"
<< " " << atomic_max_int(k.var<int_ *>("index"), k.var<int_>("i")) << ";\n"
<< "}\n";
kernel kernel = k.compile(context);
scalar<int_> index(context);
kernel.set_arg(index_arg, index.get_buffer());
index.write(static_cast<int_>(0), queue);
kernel.set_arg(value_arg, value);
queue.enqueue_1d_range_kernel(kernel, 0, count, 0);
int result = static_cast<int>(index.read(queue));
return first + result;
}
} // end detail namespace
///
/// \brief Permutation generating algorithm
///
/// Transforms the range [first, last) into the previous permutation from
/// the set of all permutations arranged in lexicographic order
/// \return Boolean value signifying if the first permutation was crossed
/// and the range was reset
///
/// \param first Iterator pointing to start of range
/// \param last Iterator pointing to end of range
/// \param queue Queue on which to execute
///
template<class InputIterator>
inline bool prev_permutation(InputIterator first,
InputIterator last,
command_queue &queue = system::default_queue())
{
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
if(first == last) return false;
InputIterator first_element =
detail::prev_permutation_helper(first, last, queue);
if(first_element == last)
{
reverse(first, last, queue);
return false;
}
value_type first_value = first_element.read(queue);
InputIterator ceiling_element =
detail::pp_floor(first_element + 1, last, first_value, queue);
value_type ceiling_value = ceiling_element.read(queue);
first_element.write(ceiling_value, queue);
ceiling_element.write(first_value, queue);
reverse(first_element + 1, last, queue);
return true;
}
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_ALGORITHM_PREV_PERMUTATION_HPP
@@ -0,0 +1,47 @@
// Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/range/
//
#ifndef BOOST_RANGE_DIFFERENCE_TYPE_HPP
#define BOOST_RANGE_DIFFERENCE_TYPE_HPP
#if defined(_MSC_VER)
# pragma once
#endif
#include <boost/mpl/and.hpp>
#include <boost/range/config.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/has_range_iterator.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost
{
namespace range_detail
{
template< class T, bool B = has_type<range_iterator<T> >::value >
struct range_difference
{ };
template< class T >
struct range_difference<T, true>
: iterator_difference<
BOOST_DEDUCED_TYPENAME range_iterator<T>::type
>
{ };
}
template< class T >
struct range_difference
: range_detail::range_difference<BOOST_DEDUCED_TYPENAME remove_reference<T>::type>
{ };
}
#endif
@@ -0,0 +1,180 @@
48 128
9 4
9 9 9 9 9 8 8 8 8 8 9 9 8 8 9 9 8 8 8 8 9 9 9 8 9 9 9 9 9 9 8 8 8 9 8 9 9 9 8 9 8 8 8 9 8 8 8 9
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 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 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 17 34 51 66 81 99 111 124
2 18 35 50 67 82 100 112 125
3 19 36 52 68 82 101 111 126
2 20 36 51 69 83 102 113 127
4 19 37 53 66 84 103 114 128
5 21 38 54 70 85 92 114 0
6 22 39 55 66 85 96 110 0
7 23 32 56 71 86 103 115 0
8 20 40 55 72 86 104 116 0
9 19 41 57 73 87 105 116 0
10 24 36 56 74 88 105 117 125
10 17 33 47 75 89 106 118 128
11 21 42 51 76 87 107 119 0
1 25 40 58 74 84 107 113 0
12 22 42 49 77 90 108 118 125
13 26 43 59 68 89 104 120 124
13 22 44 57 75 91 109 113 0
12 23 37 46 78 88 107 112 0
3 27 34 60 65 87 109 118 0
6 27 45 61 79 89 98 112 0
14 28 34 62 72 92 106 112 127
8 27 42 59 71 92 110 121 126
15 20 46 57 79 93 101 115 124
9 29 45 62 74 94 108 121 0
8 30 38 63 73 95 109 111 128
16 29 47 64 69 96 109 117 126
16 23 48 63 76 94 110 116 125
7 25 39 52 70 97 106 117 124
4 26 45 63 67 83 90 119 123
15 28 39 50 76 88 103 121 123
15 26 33 58 65 97 102 122 0
14 31 47 52 77 81 93 116 0
14 24 37 61 71 82 99 122 0
4 31 40 54 80 91 106 115 122
5 32 41 58 77 98 104 117 0
9 18 49 65 79 85 104 119 128
10 30 43 60 69 84 108 115 123
1 18 43 48 73 91 98 114 127
3 21 46 64 67 86 108 113 0
5 24 48 55 75 93 107 120 126
2 32 44 62 80 95 99 114 0
16 28 41 59 80 83 100 118 0
11 33 35 53 72 96 105 111 0
11 25 44 60 78 90 100 120 122
6 31 35 56 70 95 102 121 0
12 17 50 54 68 94 105 119 0
13 29 38 53 78 97 110 123 0
7 30 49 61 64 81 101 120 127
1 14 38 0
2 4 41 0
3 19 39 0
5 29 34 0
6 35 40 0
7 20 45 0
8 28 48 0
9 22 25 0
10 24 36 0
11 12 37 0
13 43 44 0
15 18 46 0
16 17 47 0
21 32 33 0
23 30 31 0
26 27 42 0
1 12 46 0
2 36 38 0
3 5 10 0
4 9 23 0
6 13 39 0
7 15 17 0
8 18 27 0
11 33 40 0
14 28 44 0
16 29 31 0
19 20 22 0
21 30 42 0
24 26 47 0
25 37 48 0
32 34 45 0
8 35 41 0
12 31 43 0
1 19 21 0
2 43 45 0
3 4 11 0
5 18 33 0
6 25 47 0
7 28 30 0
9 14 34 0
10 35 42 0
13 15 22 0
16 37 38 0
17 41 44 0
20 24 29 0
18 23 39 0
12 26 32 0
27 38 40 0
15 36 48 0
2 30 46 0
1 4 13 0
3 28 32 0
5 43 47 0
6 34 46 0
7 9 40 0
8 11 45 0
10 17 23 0
14 31 35 0
16 22 42 0
19 37 44 0
20 33 48 0
21 24 41 0
25 27 29 0
26 39 48 0
19 31 36 0
1 5 7 0
2 29 39 0
3 16 46 0
4 26 37 0
6 28 45 0
8 22 33 0
9 21 43 0
10 25 38 0
11 14 24 0
12 17 40 0
13 27 30 0
15 32 35 0
18 44 47 0
20 23 36 0
34 41 42 0
1 32 48 0
2 3 33 0
4 29 42 0
5 14 37 0
6 7 36 0
8 9 39 0
10 13 19 0
11 18 30 0
12 16 20 0
15 29 44 0
17 34 38 0
6 21 22 0
23 32 40 0
24 27 46 0
25 41 45 0
7 26 43 0
28 31 47 0
20 35 38 0
1 33 41 0
2 42 44 0
3 23 48 0
4 31 45 0
5 8 30 0
9 16 35 36
10 11 43 46
12 21 28 34
13 14 18 40
15 24 37 39
17 19 25 26
7 22 27 47
1 3 25 43
2 18 20 21
4 14 17 39
5 6 38 41
8 23 34 37
9 10 27 32
11 26 28 35
12 15 19 42
13 29 36 46
16 40 44 48
22 24 30 45
31 33 34 44
29 30 37 47
1 16 23 28
2 11 15 27
3 22 26 40
4 21 38 48
5 12 25 36
@@ -0,0 +1,132 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2012. 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/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTERPROCESS_PERMISSIONS_HPP
#define BOOST_INTERPROCESS_PERMISSIONS_HPP
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/interprocess_fwd.hpp>
#if defined(BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/detail/win32_api.hpp>
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
//!\file
//!Describes permissions class
namespace boost {
namespace interprocess {
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#if defined(BOOST_INTERPROCESS_WINDOWS)
namespace ipcdetail {
template <int Dummy>
struct unrestricted_permissions_holder
{
static winapi::interprocess_all_access_security unrestricted;
};
template<int Dummy>
winapi::interprocess_all_access_security unrestricted_permissions_holder<Dummy>::unrestricted;
} //namespace ipcdetail {
#endif //defined BOOST_INTERPROCESS_WINDOWS
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
//!The permissions class represents permissions to be set to shared memory or
//!files, that can be constructed form usual permission representations:
//!a SECURITY_ATTRIBUTES pointer in windows or ORed rwx chmod integer in UNIX.
class permissions
{
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#if defined(BOOST_INTERPROCESS_WINDOWS)
typedef void* os_permissions_type;
#else
typedef int os_permissions_type;
#endif
os_permissions_type m_perm;
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
//!Constructs a permissions object from a user provided os-dependent
//!permissions.
permissions(os_permissions_type type)
: m_perm(type)
{}
//!Constructs a default permissions object:
//!A null security attributes pointer for windows or 0644
//!for UNIX.
permissions()
{ set_default(); }
//!Sets permissions to default values:
//!A null security attributes pointer for windows or 0644
//!for UNIX.
void set_default()
{
#if defined (BOOST_INTERPROCESS_WINDOWS)
m_perm = 0;
#else
m_perm = 0644;
#endif
}
//!Sets permissions to unrestricted access:
//!A null DACL for windows or 0666 for UNIX.
void set_unrestricted()
{
#if defined (BOOST_INTERPROCESS_WINDOWS)
m_perm = &ipcdetail::unrestricted_permissions_holder<0>::unrestricted;
#else
m_perm = 0666;
#endif
}
//!Sets permissions from a user provided os-dependent
//!permissions.
void set_permissions(os_permissions_type perm)
{ m_perm = perm; }
//!Returns stored os-dependent
//!permissions
os_permissions_type get_permissions() const
{ return m_perm; }
};
} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
#endif //BOOST_INTERPROCESS_PERMISSIONS_HPP
@@ -0,0 +1,53 @@
/*
Copyright Rene Rivera 2008-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_COMPILER_GCC_XML_H
#define BOOST_PREDEF_COMPILER_GCC_XML_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_COMP_GCCXML`]
[@http://www.gccxml.org/ GCC XML] compiler.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__GCCXML__`] [__predef_detection__]]
]
*/
#define BOOST_COMP_GCCXML BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__GCCXML__)
# define BOOST_COMP_GCCXML_DETECTION BOOST_VERSION_NUMBER_AVAILABLE
#endif
#ifdef BOOST_COMP_GCCXML_DETECTION
# if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
# define BOOST_COMP_GCCXML_EMULATED BOOST_COMP_GCCXML_DETECTION
# else
# undef BOOST_COMP_GCCXML
# define BOOST_COMP_GCCXML BOOST_COMP_GCCXML_DETECTION
# endif
# define BOOST_COMP_GCCXML_AVAILABLE
# include <boost/predef/detail/comp_detected.h>
#endif
#define BOOST_COMP_GCCXML_NAME "GCC XML"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GCCXML,BOOST_COMP_GCCXML_NAME)
#ifdef BOOST_COMP_GCCXML_EMULATED
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GCCXML_EMULATED,BOOST_COMP_GCCXML_NAME)
#endif