Initial Commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2013.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_TUPLE_POP_BACK_HPP
|
||||
# define BOOST_PREPROCESSOR_TUPLE_POP_BACK_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS
|
||||
#
|
||||
# include <boost/preprocessor/array/pop_back.hpp>
|
||||
# include <boost/preprocessor/array/to_tuple.hpp>
|
||||
# include <boost/preprocessor/comparison/greater.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/tuple/size.hpp>
|
||||
# include <boost/preprocessor/tuple/to_array.hpp>
|
||||
#
|
||||
# /* BOOST_PP_TUPLE_POP_BACK */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK(tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_BACK_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_BACK_RETURN \
|
||||
) \
|
||||
(tuple) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_EXEC(tuple) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_BACK(BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_RETURN(tuple) tuple
|
||||
#
|
||||
# /* BOOST_PP_TUPLE_POP_BACK_Z */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_Z(z, tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_BACK_Z_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_BACK_Z_RETURN \
|
||||
) \
|
||||
(z, tuple) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_Z_EXEC(z, tuple) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_BACK_Z(z, BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_Z_RETURN(z, tuple) tuple
|
||||
#
|
||||
# endif // BOOST_PP_VARIADICS
|
||||
#
|
||||
# endif // BOOST_PREPROCESSOR_TUPLE_POP_BACK_HPP
|
||||
@@ -0,0 +1,502 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>WideGraph</class>
|
||||
<widget class="QDialog" name="WideGraph">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>799</width>
|
||||
<height>337</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="CPlotter" name="widePlot">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QCheckBox" name="cbControls">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>5</x>
|
||||
<y>0</y>
|
||||
<width>77</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Controls</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="controls_widget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="8">
|
||||
<widget class="QSlider" name="gain2dSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Spectrum gain</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-50</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksAbove</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labPalette">
|
||||
<property name="text">
|
||||
<string> Palette </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="adjust_palette_push_button">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter definition for a new color palette.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Adjust...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QSlider" name="gainSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Waterfall gain</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-50</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksAbove</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="11">
|
||||
<widget class="QSpinBox" name="sbPercent2dPlot">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> %</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Spec </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbFlatten">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Flatten</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbRef">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ref Spec</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="11">
|
||||
<widget class="QSpinBox" name="smoSpinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Smoothing of Linear Average spectrum</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Smooth </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="bppSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>Compression factor for frequency scale</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Bins/Pixel </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QComboBox" name="paletteComboBox">
|
||||
<property name="toolTip">
|
||||
<string>Select waterfall palette</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QComboBox" name="spec2dComboBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Select data for spectral display</p></body></html></string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Current</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Cumulative</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Linear Avg</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Reference</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QSpinBox" name="fStartSpinBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Frequency at left edge of waterfall</p></body></html></string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> Hz</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Start </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="fSplitSpinBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Decode JT9 only above this frequency</p></body></html></string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> JT9</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>JT65 </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>3000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="waterfallAvgSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>Number of FFTs averaged (controls waterfall scrolling rate)</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>N Avg </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<widget class="QSlider" name="zeroSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Waterfall zero</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-50</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksAbove</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="10">
|
||||
<widget class="QSlider" name="zero2dSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Spectrum zero</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-50</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksAbove</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="12" rowspan="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3" rowspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5" rowspan="2">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>CPlotter</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>plotter.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,50 @@
|
||||
/* OPEN.C - Routine for opening file that might be stdin/stdout. */
|
||||
|
||||
/* Copyright (c) 1995-2012 by Radford M. Neal.
|
||||
*
|
||||
* Permission is granted for anyone to copy, use, modify, and distribute
|
||||
* these programs and accompanying documents for any purpose, provided
|
||||
* this copyright notice is retained and prominently displayed, and note
|
||||
* is made of any changes made to these programs. These programs and
|
||||
* documents are distributed without any warranty, express or implied.
|
||||
* As the programs were written for research purposes only, they have not
|
||||
* been tested to the degree that would be advisable in any important
|
||||
* application. All use of these programs is entirely at the user's own
|
||||
* risk.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "open.h"
|
||||
|
||||
|
||||
/* OPEN A FILE THAT MIGHT BE STANDARD INPUT OR OUTPUT. If the file name
|
||||
given is "-", this procedure just returns stdin or stdout, depending on
|
||||
whether the mode is for reading or writing. Otherwise, fopen is called.
|
||||
*/
|
||||
|
||||
FILE *open_file_std
|
||||
( char *fname, /* Name of file to open, or "-" for stdin/stdout */
|
||||
char *mode /* Mode for opening: eg, "r" or "w" */
|
||||
)
|
||||
{
|
||||
if (strcmp(fname,"-")==0)
|
||||
{ switch (mode[0])
|
||||
{ case 'r':
|
||||
{ return stdin;
|
||||
}
|
||||
case 'w':
|
||||
{ return stdout;
|
||||
}
|
||||
default:
|
||||
{ fprintf(stderr,"Bad mode passed to open_file_std: %s\n",mode);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ return fopen(fname,mode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/*=============================================================================
|
||||
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_;
|
||||
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_
|
||||
>
|
||||
struct list;
|
||||
}}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2002-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_type, type, true)
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// bind/mem_fn_cc.hpp - support for different calling conventions
|
||||
//
|
||||
// Do not include this header directly.
|
||||
//
|
||||
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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/bind/mem_fn.html for documentation.
|
||||
//
|
||||
|
||||
template<class R, class T> _mfi::BOOST_MEM_FN_NAME(mf0)<R, T> mem_fn(R (BOOST_MEM_FN_CC T::*f) ())
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf0)<R, T>(f);
|
||||
}
|
||||
|
||||
template<class R, class T> _mfi::BOOST_MEM_FN_NAME(cmf0)<R, T> mem_fn(R (BOOST_MEM_FN_CC T::*f) () const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf0)<R, T>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1> _mfi::BOOST_MEM_FN_NAME(mf1)<R, T, A1> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf1)<R, T, A1>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1> _mfi::BOOST_MEM_FN_NAME(cmf1)<R, T, A1> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf1)<R, T, A1>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2> _mfi::BOOST_MEM_FN_NAME(mf2)<R, T, A1, A2> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf2)<R, T, A1, A2>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2> _mfi::BOOST_MEM_FN_NAME(cmf2)<R, T, A1, A2> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf2)<R, T, A1, A2>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3> _mfi::BOOST_MEM_FN_NAME(mf3)<R, T, A1, A2, A3> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf3)<R, T, A1, A2, A3>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3> _mfi::BOOST_MEM_FN_NAME(cmf3)<R, T, A1, A2, A3> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf3)<R, T, A1, A2, A3>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4> _mfi::BOOST_MEM_FN_NAME(mf4)<R, T, A1, A2, A3, A4> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf4)<R, T, A1, A2, A3, A4>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4> _mfi::BOOST_MEM_FN_NAME(cmf4)<R, T, A1, A2, A3, A4> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf4)<R, T, A1, A2, A3, A4>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5> _mfi::BOOST_MEM_FN_NAME(mf5)<R, T, A1, A2, A3, A4, A5> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf5)<R, T, A1, A2, A3, A4, A5>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5> _mfi::BOOST_MEM_FN_NAME(cmf5)<R, T, A1, A2, A3, A4, A5> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf5)<R, T, A1, A2, A3, A4, A5>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> _mfi::BOOST_MEM_FN_NAME(mf6)<R, T, A1, A2, A3, A4, A5, A6> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf6)<R, T, A1, A2, A3, A4, A5, A6>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> _mfi::BOOST_MEM_FN_NAME(cmf6)<R, T, A1, A2, A3, A4, A5, A6> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf6)<R, T, A1, A2, A3, A4, A5, A6>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> _mfi::BOOST_MEM_FN_NAME(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> _mfi::BOOST_MEM_FN_NAME(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> _mfi::BOOST_MEM_FN_NAME(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7, A8))
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f);
|
||||
}
|
||||
|
||||
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> _mfi::BOOST_MEM_FN_NAME(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7, A8) const)
|
||||
{
|
||||
return _mfi::BOOST_MEM_FN_NAME(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
#ifndef BOOST_MPL_MAP_MAP50_HPP_INCLUDED
|
||||
#define BOOST_MPL_MAP_MAP50_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
// Copyright David Abrahams 2003-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/map/map40.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 map50.hpp
|
||||
# include <boost/mpl/map/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(41, 50, <boost/mpl/map/aux_/numbered.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
|
||||
#endif // BOOST_MPL_MAP_MAP50_HPP_INCLUDED
|
||||
@@ -0,0 +1,157 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file tags.hpp
|
||||
/// Contains the tags for all the overloadable operators in C++
|
||||
//
|
||||
// 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)
|
||||
|
||||
#ifndef BOOST_PROTO_TAGS_HPP_EAN_04_01_2005
|
||||
#define BOOST_PROTO_TAGS_HPP_EAN_04_01_2005
|
||||
|
||||
#include <boost/proto/proto_fwd.hpp>
|
||||
|
||||
namespace boost { namespace proto { namespace tagns_ { namespace tag
|
||||
{
|
||||
|
||||
/// Tag type for terminals; aka, leaves in the expression tree.
|
||||
struct terminal {};
|
||||
|
||||
/// Tag type for the unary + operator.
|
||||
struct unary_plus {};
|
||||
|
||||
/// Tag type for the unary - operator.
|
||||
struct negate {};
|
||||
|
||||
/// Tag type for the unary * operator.
|
||||
struct dereference {};
|
||||
|
||||
/// Tag type for the unary ~ operator.
|
||||
struct complement {};
|
||||
|
||||
/// Tag type for the unary & operator.
|
||||
struct address_of {};
|
||||
|
||||
/// Tag type for the unary ! operator.
|
||||
struct logical_not {};
|
||||
|
||||
/// Tag type for the unary prefix ++ operator.
|
||||
struct pre_inc {};
|
||||
|
||||
/// Tag type for the unary prefix -- operator.
|
||||
struct pre_dec {};
|
||||
|
||||
/// Tag type for the unary postfix ++ operator.
|
||||
struct post_inc {};
|
||||
|
||||
/// Tag type for the unary postfix -- operator.
|
||||
struct post_dec {};
|
||||
|
||||
/// Tag type for the binary \<\< operator.
|
||||
struct shift_left {};
|
||||
|
||||
/// Tag type for the binary \>\> operator.
|
||||
struct shift_right {};
|
||||
|
||||
/// Tag type for the binary * operator.
|
||||
struct multiplies {};
|
||||
|
||||
/// Tag type for the binary / operator.
|
||||
struct divides {};
|
||||
|
||||
/// Tag type for the binary % operator.
|
||||
struct modulus {};
|
||||
|
||||
/// Tag type for the binary + operator.
|
||||
struct plus {};
|
||||
|
||||
/// Tag type for the binary - operator.
|
||||
struct minus {};
|
||||
|
||||
/// Tag type for the binary \< operator.
|
||||
struct less {};
|
||||
|
||||
/// Tag type for the binary \> operator.
|
||||
struct greater {};
|
||||
|
||||
/// Tag type for the binary \<= operator.
|
||||
struct less_equal {};
|
||||
|
||||
/// Tag type for the binary \>= operator.
|
||||
struct greater_equal {};
|
||||
|
||||
/// Tag type for the binary == operator.
|
||||
struct equal_to {};
|
||||
|
||||
/// Tag type for the binary != operator.
|
||||
struct not_equal_to {};
|
||||
|
||||
/// Tag type for the binary || operator.
|
||||
struct logical_or {};
|
||||
|
||||
/// Tag type for the binary && operator.
|
||||
struct logical_and {};
|
||||
|
||||
/// Tag type for the binary & operator.
|
||||
struct bitwise_and {};
|
||||
|
||||
/// Tag type for the binary | operator.
|
||||
struct bitwise_or {};
|
||||
|
||||
/// Tag type for the binary ^ operator.
|
||||
struct bitwise_xor {};
|
||||
|
||||
/// Tag type for the binary , operator.
|
||||
struct comma {};
|
||||
|
||||
/// Tag type for the binary ->* operator.
|
||||
struct mem_ptr {};
|
||||
|
||||
/// Tag type for the binary = operator.
|
||||
struct assign {};
|
||||
|
||||
/// Tag type for the binary \<\<= operator.
|
||||
struct shift_left_assign {};
|
||||
|
||||
/// Tag type for the binary \>\>= operator.
|
||||
struct shift_right_assign {};
|
||||
|
||||
/// Tag type for the binary *= operator.
|
||||
struct multiplies_assign {};
|
||||
|
||||
/// Tag type for the binary /= operator.
|
||||
struct divides_assign {};
|
||||
|
||||
/// Tag type for the binary %= operator.
|
||||
struct modulus_assign {};
|
||||
|
||||
/// Tag type for the binary += operator.
|
||||
struct plus_assign {};
|
||||
|
||||
/// Tag type for the binary -= operator.
|
||||
struct minus_assign {};
|
||||
|
||||
/// Tag type for the binary &= operator.
|
||||
struct bitwise_and_assign {};
|
||||
|
||||
/// Tag type for the binary |= operator.
|
||||
struct bitwise_or_assign {};
|
||||
|
||||
/// Tag type for the binary ^= operator.
|
||||
struct bitwise_xor_assign {};
|
||||
|
||||
/// Tag type for the binary subscript operator.
|
||||
struct subscript {};
|
||||
|
||||
/// Tag type for the binary virtual data members.
|
||||
struct member {};
|
||||
|
||||
/// Tag type for the ternary ?: conditional operator.
|
||||
struct if_else_ {};
|
||||
|
||||
/// Tag type for the n-ary function call operator.
|
||||
struct function {};
|
||||
|
||||
}}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
/*=============================================================================
|
||||
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_ALGORITHM_10022005_0549)
|
||||
#define FUSION_ALGORITHM_10022005_0549
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/algorithm/iteration.hpp>
|
||||
#include <boost/fusion/algorithm/query.hpp>
|
||||
#include <boost/fusion/algorithm/transformation.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,206 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2007-2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_DETAIL_STATIC_RATIONAL_POWER_HPP
|
||||
#define BOOST_UNITS_DETAIL_STATIC_RATIONAL_POWER_HPP
|
||||
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
|
||||
#include <boost/units/detail/one.hpp>
|
||||
#include <boost/units/operators.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
template<long N,long D>
|
||||
class static_rational;
|
||||
|
||||
namespace detail {
|
||||
|
||||
namespace typeof_pow_adl_barrier {
|
||||
|
||||
using std::pow;
|
||||
|
||||
template<class Y>
|
||||
struct typeof_pow
|
||||
{
|
||||
#if defined(BOOST_UNITS_HAS_BOOST_TYPEOF)
|
||||
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, pow(typeof_::make<Y>(), 0.0))
|
||||
typedef typename nested::type type;
|
||||
#elif defined(BOOST_UNITS_HAS_MWERKS_TYPEOF)
|
||||
typedef __typeof__(pow(typeof_::make<Y>(), 0.0)) type;
|
||||
#elif defined(BOOST_UNITS_HAS_GNU_TYPEOF)
|
||||
typedef typeof(pow(typeof_::make<Y>(), 0.0)) type;
|
||||
#else
|
||||
typedef Y type;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<class R, class Y>
|
||||
struct static_rational_power_impl
|
||||
{
|
||||
typedef typename typeof_pow_adl_barrier::typeof_pow<Y>::type type;
|
||||
static type call(const Y& y)
|
||||
{
|
||||
using std::pow;
|
||||
return(pow(y, static_cast<double>(R::Numerator) / static_cast<double>(R::Denominator)));
|
||||
}
|
||||
};
|
||||
|
||||
template<class R>
|
||||
struct static_rational_power_impl<R, one>
|
||||
{
|
||||
typedef one type;
|
||||
static one call(const one&)
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
}
|
||||
};
|
||||
|
||||
template<long N>
|
||||
struct static_rational_power_impl<static_rational<N, 1>, one>
|
||||
{
|
||||
typedef one type;
|
||||
static one call(const one&)
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
}
|
||||
};
|
||||
|
||||
template<long N, bool = (N % 2 == 0)>
|
||||
struct static_int_power_impl;
|
||||
|
||||
template<long N>
|
||||
struct static_int_power_impl<N, true>
|
||||
{
|
||||
template<class Y, class R>
|
||||
struct apply
|
||||
{
|
||||
typedef typename multiply_typeof_helper<Y, Y>::type square_type;
|
||||
typedef typename static_int_power_impl<(N >> 1)>::template apply<square_type, R> next;
|
||||
typedef typename next::type type;
|
||||
static type call(const Y& y, const R& r)
|
||||
{
|
||||
const square_type square = y * y;
|
||||
return(next::call(square, r));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<long N>
|
||||
struct static_int_power_impl<N, false>
|
||||
{
|
||||
template<class Y, class R>
|
||||
struct apply
|
||||
{
|
||||
typedef typename multiply_typeof_helper<Y, Y>::type square_type;
|
||||
typedef typename multiply_typeof_helper<Y, R>::type new_r;
|
||||
typedef typename static_int_power_impl<(N >> 1)>::template apply<square_type, new_r> next;
|
||||
typedef typename next::type type;
|
||||
static type call(const Y& y, const R& r)
|
||||
{
|
||||
const Y square = y * y;
|
||||
return(next::call(square, y * r));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct static_int_power_impl<1, false>
|
||||
{
|
||||
template<class Y, class R>
|
||||
struct apply
|
||||
{
|
||||
typedef typename multiply_typeof_helper<Y, R>::type type;
|
||||
static type call(const Y& y, const R& r)
|
||||
{
|
||||
return(y * r);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct static_int_power_impl<0, true>
|
||||
{
|
||||
template<class Y, class R>
|
||||
struct apply
|
||||
{
|
||||
typedef R type;
|
||||
static R call(const Y&, const R& r)
|
||||
{
|
||||
return(r);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<int N, bool = (N < 0)>
|
||||
struct static_int_power_sign_impl;
|
||||
|
||||
template<int N>
|
||||
struct static_int_power_sign_impl<N, false>
|
||||
{
|
||||
template<class Y>
|
||||
struct apply
|
||||
{
|
||||
typedef typename static_int_power_impl<N>::template apply<Y, one> impl;
|
||||
typedef typename impl::type type;
|
||||
static type call(const Y& y)
|
||||
{
|
||||
one result;
|
||||
return(impl::call(y, result));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<int N>
|
||||
struct static_int_power_sign_impl<N, true>
|
||||
{
|
||||
template<class Y>
|
||||
struct apply
|
||||
{
|
||||
typedef typename static_int_power_impl<-N>::template apply<Y, one> impl;
|
||||
typedef typename divide_typeof_helper<one, typename impl::type>::type type;
|
||||
static type call(const Y& y)
|
||||
{
|
||||
one result;
|
||||
return(result/impl::call(y, result));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<long N, class Y>
|
||||
struct static_rational_power_impl<static_rational<N, 1>, Y>
|
||||
{
|
||||
typedef typename static_int_power_sign_impl<N>::template apply<Y> impl;
|
||||
typedef typename impl::type type;
|
||||
static type call(const Y& y)
|
||||
{
|
||||
return(impl::call(y));
|
||||
}
|
||||
};
|
||||
|
||||
template<class R, class Y>
|
||||
typename detail::static_rational_power_impl<R, Y>::type static_rational_power(const Y& y)
|
||||
{
|
||||
return(detail::static_rational_power_impl<R, Y>::call(y));
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,121 @@
|
||||
#ifndef BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
|
||||
#define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// text_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.
|
||||
|
||||
#include <ostream>
|
||||
#include <cstddef> // std::size_t
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/basic_text_oprimitive.hpp>
|
||||
#include <boost/archive/basic_text_oarchive.hpp>
|
||||
#include <boost/archive/detail/register_archive.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
|
||||
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE text_oarchive_impl :
|
||||
/* protected ? */ public basic_text_oprimitive<std::ostream>,
|
||||
public basic_text_oarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
protected:
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class basic_text_oarchive<Archive>;
|
||||
friend class save_access;
|
||||
#endif
|
||||
template<class T>
|
||||
void save(const T & t){
|
||||
this->newtoken();
|
||||
basic_text_oprimitive<std::ostream>::save(t);
|
||||
}
|
||||
void save(const version_type & t){
|
||||
save(static_cast<const unsigned int>(t));
|
||||
}
|
||||
void save(const boost::serialization::item_version_type & t){
|
||||
save(static_cast<const unsigned int>(t));
|
||||
}
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const wchar_t * t);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const std::wstring &ws);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL
|
||||
text_oarchive_impl(std::ostream & os, unsigned int flags);
|
||||
// don't import inline definitions! leave this as a reminder.
|
||||
//BOOST_ARCHIVE_DECL
|
||||
~text_oarchive_impl(){};
|
||||
public:
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save_binary(const void *address, std::size_t count);
|
||||
};
|
||||
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from text_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class BOOST_SYMBOL_VISIBLE text_oarchive :
|
||||
public text_oarchive_impl<text_oarchive>
|
||||
{
|
||||
public:
|
||||
text_oarchive(std::ostream & os_, unsigned int flags = 0) :
|
||||
// note: added _ to suppress useless gcc warning
|
||||
text_oarchive_impl<text_oarchive>(os_, flags)
|
||||
{}
|
||||
~text_oarchive(){}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// required by export
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
|
||||
@@ -0,0 +1,341 @@
|
||||
// Copyright John Maddock 2006.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_STATS_LOGNORMAL_HPP
|
||||
#define BOOST_STATS_LOGNORMAL_HPP
|
||||
|
||||
// http://www.itl.nist.gov/div898/handbook/eda/section3/eda3669.htm
|
||||
// http://mathworld.wolfram.com/LogNormalDistribution.html
|
||||
// http://en.wikipedia.org/wiki/Lognormal_distribution
|
||||
|
||||
#include <boost/math/distributions/fwd.hpp>
|
||||
#include <boost/math/distributions/normal.hpp>
|
||||
#include <boost/math/special_functions/expm1.hpp>
|
||||
#include <boost/math/distributions/detail/common_error_handling.hpp>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace boost{ namespace math
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_lognormal_x(
|
||||
const char* function,
|
||||
RealType const& x,
|
||||
RealType* result, const Policy& pol)
|
||||
{
|
||||
if((x < 0) || !(boost::math::isfinite)(x))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Random variate is %1% but must be >= 0 !", x, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
template <class RealType = double, class Policy = policies::policy<> >
|
||||
class lognormal_distribution
|
||||
{
|
||||
public:
|
||||
typedef RealType value_type;
|
||||
typedef Policy policy_type;
|
||||
|
||||
lognormal_distribution(RealType l_location = 0, RealType l_scale = 1)
|
||||
: m_location(l_location), m_scale(l_scale)
|
||||
{
|
||||
RealType result;
|
||||
detail::check_scale("boost::math::lognormal_distribution<%1%>::lognormal_distribution", l_scale, &result, Policy());
|
||||
detail::check_location("boost::math::lognormal_distribution<%1%>::lognormal_distribution", l_location, &result, Policy());
|
||||
}
|
||||
|
||||
RealType location()const
|
||||
{
|
||||
return m_location;
|
||||
}
|
||||
|
||||
RealType scale()const
|
||||
{
|
||||
return m_scale;
|
||||
}
|
||||
private:
|
||||
//
|
||||
// Data members:
|
||||
//
|
||||
RealType m_location; // distribution location.
|
||||
RealType m_scale; // distribution scale.
|
||||
};
|
||||
|
||||
typedef lognormal_distribution<double> lognormal;
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline const std::pair<RealType, RealType> range(const lognormal_distribution<RealType, Policy>& /*dist*/)
|
||||
{ // Range of permissible values for random variable x is >0 to +infinity.
|
||||
using boost::math::tools::max_value;
|
||||
return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>());
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline const std::pair<RealType, RealType> support(const lognormal_distribution<RealType, Policy>& /*dist*/)
|
||||
{ // Range of supported values for random variable x.
|
||||
// This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
|
||||
using boost::math::tools::max_value;
|
||||
return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>());
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
RealType pdf(const lognormal_distribution<RealType, Policy>& dist, const RealType& x)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
|
||||
static const char* function = "boost::math::pdf(const lognormal_distribution<%1%>&, %1%)";
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale(function, sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location(function, mu, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_lognormal_x(function, x, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(x == 0)
|
||||
return 0;
|
||||
|
||||
RealType exponent = log(x) - mu;
|
||||
exponent *= -exponent;
|
||||
exponent /= 2 * sigma * sigma;
|
||||
|
||||
result = exp(exponent);
|
||||
result /= sigma * sqrt(2 * constants::pi<RealType>()) * x;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType cdf(const lognormal_distribution<RealType, Policy>& dist, const RealType& x)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::cdf(const lognormal_distribution<%1%>&, %1%)";
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale(function, dist.scale(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location(function, dist.location(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_lognormal_x(function, x, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(x == 0)
|
||||
return 0;
|
||||
|
||||
normal_distribution<RealType, Policy> norm(dist.location(), dist.scale());
|
||||
return cdf(norm, log(x));
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType quantile(const lognormal_distribution<RealType, Policy>& dist, const RealType& p)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::quantile(const lognormal_distribution<%1%>&, %1%)";
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale(function, dist.scale(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location(function, dist.location(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_probability(function, p, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(p == 0)
|
||||
return 0;
|
||||
if(p == 1)
|
||||
return policies::raise_overflow_error<RealType>(function, 0, Policy());
|
||||
|
||||
normal_distribution<RealType, Policy> norm(dist.location(), dist.scale());
|
||||
return exp(quantile(norm, p));
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType cdf(const complemented2_type<lognormal_distribution<RealType, Policy>, RealType>& c)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::cdf(const lognormal_distribution<%1%>&, %1%)";
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale(function, c.dist.scale(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location(function, c.dist.location(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_lognormal_x(function, c.param, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(c.param == 0)
|
||||
return 1;
|
||||
|
||||
normal_distribution<RealType, Policy> norm(c.dist.location(), c.dist.scale());
|
||||
return cdf(complement(norm, log(c.param)));
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType quantile(const complemented2_type<lognormal_distribution<RealType, Policy>, RealType>& c)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::quantile(const lognormal_distribution<%1%>&, %1%)";
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale(function, c.dist.scale(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location(function, c.dist.location(), &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_probability(function, c.param, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(c.param == 1)
|
||||
return 0;
|
||||
if(c.param == 0)
|
||||
return policies::raise_overflow_error<RealType>(function, 0, Policy());
|
||||
|
||||
normal_distribution<RealType, Policy> norm(c.dist.location(), c.dist.scale());
|
||||
return exp(quantile(complement(norm, c.param)));
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType mean(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale("boost::math::mean(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location("boost::math::mean(const lognormal_distribution<%1%>&)", mu, &result, Policy()))
|
||||
return result;
|
||||
|
||||
return exp(mu + sigma * sigma / 2);
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType variance(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale("boost::math::variance(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location("boost::math::variance(const lognormal_distribution<%1%>&)", mu, &result, Policy()))
|
||||
return result;
|
||||
|
||||
return boost::math::expm1(sigma * sigma, Policy()) * exp(2 * mu + sigma * sigma);
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType mode(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale("boost::math::mode(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location("boost::math::mode(const lognormal_distribution<%1%>&)", mu, &result, Policy()))
|
||||
return result;
|
||||
|
||||
return exp(mu - sigma * sigma);
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType median(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
RealType mu = dist.location();
|
||||
return exp(mu); // e^mu
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType skewness(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
//RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
|
||||
RealType ss = sigma * sigma;
|
||||
RealType ess = exp(ss);
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale("boost::math::skewness(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location("boost::math::skewness(const lognormal_distribution<%1%>&)", dist.location(), &result, Policy()))
|
||||
return result;
|
||||
|
||||
return (ess + 2) * sqrt(boost::math::expm1(ss, Policy()));
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType kurtosis(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
//RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
RealType ss = sigma * sigma;
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale("boost::math::kurtosis(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location("boost::math::kurtosis(const lognormal_distribution<%1%>&)", dist.location(), &result, Policy()))
|
||||
return result;
|
||||
|
||||
return exp(4 * ss) + 2 * exp(3 * ss) + 3 * exp(2 * ss) - 3;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType kurtosis_excess(const lognormal_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
// RealType mu = dist.location();
|
||||
RealType sigma = dist.scale();
|
||||
RealType ss = sigma * sigma;
|
||||
|
||||
RealType result = 0;
|
||||
if(0 == detail::check_scale("boost::math::kurtosis_excess(const lognormal_distribution<%1%>&)", sigma, &result, Policy()))
|
||||
return result;
|
||||
if(0 == detail::check_location("boost::math::kurtosis_excess(const lognormal_distribution<%1%>&)", dist.location(), &result, Policy()))
|
||||
return result;
|
||||
|
||||
return exp(4 * ss) + 2 * exp(3 * ss) + 3 * exp(2 * ss) - 6;
|
||||
}
|
||||
|
||||
} // namespace math
|
||||
} // namespace boost
|
||||
|
||||
// This include must be at the end, *after* the accessors
|
||||
// for this distribution have been defined, in order to
|
||||
// keep compilers that support two-phase lookup happy.
|
||||
#include <boost/math/distributions/detail/derived_accessors.hpp>
|
||||
|
||||
#endif // BOOST_STATS_STUDENTS_T_HPP
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
#ifndef BOOST_MPL_LIST_LIST40_HPP_INCLUDED
|
||||
#define BOOST_MPL_LIST_LIST40_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/list/list30.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 list40.hpp
|
||||
# include <boost/mpl/list/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(31, 40, <boost/mpl/list/aux_/numbered.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
|
||||
#endif // BOOST_MPL_LIST_LIST40_HPP_INCLUDED
|
||||
@@ -0,0 +1,103 @@
|
||||
// boost thread_clock.cpp -----------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// See http://www.boost.org/libs/chrono for documentation.
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
#ifndef BOOST_CHRONO_DETAIL_INLINED_WIN_THREAD_CLOCK_HPP
|
||||
#define BOOST_CHRONO_DETAIL_INLINED_WIN_THREAD_CLOCK_HPP
|
||||
|
||||
#include <boost/chrono/config.hpp>
|
||||
#include <boost/chrono/thread_clock.hpp>
|
||||
#include <cassert>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/detail/winapi/get_last_error.hpp>
|
||||
#include <boost/detail/winapi/get_current_thread.hpp>
|
||||
#include <boost/detail/winapi/get_thread_times.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace chrono
|
||||
{
|
||||
|
||||
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
|
||||
thread_clock::time_point thread_clock::now( system::error_code & ec )
|
||||
{
|
||||
// note that Windows uses 100 nanosecond ticks for FILETIME
|
||||
boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
|
||||
|
||||
if ( boost::detail::winapi::GetThreadTimes(
|
||||
boost::detail::winapi::GetCurrentThread (), &creation, &exit,
|
||||
&system_time, &user_time ) )
|
||||
{
|
||||
duration user = duration(
|
||||
((static_cast<duration::rep>(user_time.dwHighDateTime) << 32)
|
||||
| user_time.dwLowDateTime) * 100 );
|
||||
|
||||
duration system = duration(
|
||||
((static_cast<duration::rep>(system_time.dwHighDateTime) << 32)
|
||||
| system_time.dwLowDateTime) * 100 );
|
||||
|
||||
if (!BOOST_CHRONO_IS_THROWS(ec))
|
||||
{
|
||||
ec.clear();
|
||||
}
|
||||
return time_point(system+user);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BOOST_CHRONO_IS_THROWS(ec))
|
||||
{
|
||||
boost::throw_exception(
|
||||
system::system_error(
|
||||
boost::detail::winapi::GetLastError(),
|
||||
BOOST_CHRONO_SYSTEM_CATEGORY,
|
||||
"chrono::thread_clock" ));
|
||||
}
|
||||
else
|
||||
{
|
||||
ec.assign( boost::detail::winapi::GetLastError(), BOOST_CHRONO_SYSTEM_CATEGORY );
|
||||
return thread_clock::time_point(duration(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
thread_clock::time_point thread_clock::now() BOOST_NOEXCEPT
|
||||
{
|
||||
|
||||
// note that Windows uses 100 nanosecond ticks for FILETIME
|
||||
boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
|
||||
|
||||
if ( boost::detail::winapi::GetThreadTimes(
|
||||
boost::detail::winapi::GetCurrentThread (), &creation, &exit,
|
||||
&system_time, &user_time ) )
|
||||
{
|
||||
duration user = duration(
|
||||
((static_cast<duration::rep>(user_time.dwHighDateTime) << 32)
|
||||
| user_time.dwLowDateTime) * 100 );
|
||||
|
||||
duration system = duration(
|
||||
((static_cast<duration::rep>(system_time.dwHighDateTime) << 32)
|
||||
| system_time.dwLowDateTime) * 100 );
|
||||
|
||||
return time_point(system+user);
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
|
||||
return time_point();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace chrono
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,179 @@
|
||||
// Copyright David Abrahams 2002.
|
||||
// Copyright Stefan Seefeld 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_python_to_python_value_hpp_
|
||||
#define boost_python_to_python_value_hpp_
|
||||
|
||||
#include <boost/python/detail/prefix.hpp>
|
||||
|
||||
#include <boost/python/refcount.hpp>
|
||||
#include <boost/python/tag.hpp>
|
||||
#include <boost/python/handle.hpp>
|
||||
|
||||
#include <boost/python/converter/registry.hpp>
|
||||
#include <boost/python/converter/registered.hpp>
|
||||
#include <boost/python/converter/builtin_converters.hpp>
|
||||
#include <boost/python/converter/object_manager.hpp>
|
||||
#include <boost/python/converter/shared_ptr_to_python.hpp>
|
||||
|
||||
#include <boost/python/detail/value_is_shared_ptr.hpp>
|
||||
#include <boost/python/detail/value_arg.hpp>
|
||||
|
||||
#include <boost/type_traits/transform_traits.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
namespace boost { namespace python {
|
||||
|
||||
namespace detail
|
||||
{
|
||||
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
|
||||
|
||||
template <bool is_const_ref>
|
||||
struct object_manager_get_pytype
|
||||
{
|
||||
template <class U>
|
||||
static PyTypeObject const* get( U& (*)() =0)
|
||||
{
|
||||
return converter::object_manager_traits<U>::get_pytype();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct object_manager_get_pytype<true>
|
||||
{
|
||||
template <class U>
|
||||
static PyTypeObject const* get( U const& (*)() =0)
|
||||
{
|
||||
return converter::object_manager_traits<U>::get_pytype();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct object_manager_to_python_value
|
||||
{
|
||||
typedef typename value_arg<T>::type argument_type;
|
||||
|
||||
PyObject* operator()(argument_type) const;
|
||||
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
|
||||
typedef boost::mpl::bool_<is_handle<T>::value> is_t_handle;
|
||||
typedef boost::detail::indirect_traits::is_reference_to_const<T> is_t_const;
|
||||
PyTypeObject const* get_pytype() const {
|
||||
return get_pytype_aux((is_t_handle*)0);
|
||||
}
|
||||
|
||||
inline static PyTypeObject const* get_pytype_aux(mpl::true_*) {return converter::object_manager_traits<T>::get_pytype();}
|
||||
|
||||
inline static PyTypeObject const* get_pytype_aux(mpl::false_* )
|
||||
{
|
||||
return object_manager_get_pytype<is_t_const::value>::get((T(*)())0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// This information helps make_getter() decide whether to try to
|
||||
// return an internal reference or not. I don't like it much,
|
||||
// but it will have to serve for now.
|
||||
BOOST_STATIC_CONSTANT(bool, uses_registry = false);
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct registry_to_python_value
|
||||
{
|
||||
typedef typename value_arg<T>::type argument_type;
|
||||
|
||||
PyObject* operator()(argument_type) const;
|
||||
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
|
||||
PyTypeObject const* get_pytype() const {return converter::registered<T>::converters.to_python_target_type();}
|
||||
#endif
|
||||
|
||||
// This information helps make_getter() decide whether to try to
|
||||
// return an internal reference or not. I don't like it much,
|
||||
// but it will have to serve for now.
|
||||
BOOST_STATIC_CONSTANT(bool, uses_registry = true);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct shared_ptr_to_python_value
|
||||
{
|
||||
typedef typename value_arg<T>::type argument_type;
|
||||
|
||||
PyObject* operator()(argument_type) const;
|
||||
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
|
||||
PyTypeObject const* get_pytype() const {return get_pytype((boost::type<argument_type>*)0);}
|
||||
#endif
|
||||
// This information helps make_getter() decide whether to try to
|
||||
// return an internal reference or not. I don't like it much,
|
||||
// but it will have to serve for now.
|
||||
BOOST_STATIC_CONSTANT(bool, uses_registry = false);
|
||||
private:
|
||||
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
|
||||
template <class U>
|
||||
PyTypeObject const* get_pytype(boost::type<shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
template <class U>
|
||||
PyTypeObject const* get_pytype(boost::type<const shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
# if __cplusplus >= 201103L
|
||||
template <class U>
|
||||
PyTypeObject const* get_pytype(boost::type<std::shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
template <class U>
|
||||
PyTypeObject const* get_pytype(boost::type<const std::shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
# endif
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
struct to_python_value
|
||||
: mpl::if_<
|
||||
detail::value_is_shared_ptr<T>
|
||||
, detail::shared_ptr_to_python_value<T>
|
||||
, typename mpl::if_<
|
||||
mpl::or_<
|
||||
converter::is_object_manager<T>
|
||||
, converter::is_reference_to_object_manager<T>
|
||||
>
|
||||
, detail::object_manager_to_python_value<T>
|
||||
, detail::registry_to_python_value<T>
|
||||
>::type
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
//
|
||||
// implementation
|
||||
//
|
||||
namespace detail
|
||||
{
|
||||
template <class T>
|
||||
inline PyObject* registry_to_python_value<T>::operator()(argument_type x) const
|
||||
{
|
||||
return converter::registered<argument_type>::converters.to_python(&x);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline PyObject* object_manager_to_python_value<T>::operator()(argument_type x) const
|
||||
{
|
||||
return python::upcast<PyObject>(
|
||||
python::xincref(
|
||||
get_managed_object(x, tag))
|
||||
);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline PyObject* shared_ptr_to_python_value<T>::operator()(argument_type x) const
|
||||
{
|
||||
return converter::shared_ptr_to_python(x);
|
||||
}
|
||||
}
|
||||
|
||||
}} // namespace boost::python
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
/*=============================================================================
|
||||
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_;
|
||||
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_>
|
||||
struct deque;
|
||||
}}
|
||||
@@ -0,0 +1,102 @@
|
||||
#ifndef UUID_AA15E74A856F11E08B8D93F24824019B
|
||||
#define UUID_AA15E74A856F11E08B8D93F24824019B
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/throw_exception.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// http://www.boost.org/libs/utility/throw_exception.html
|
||||
//
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <exception>
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
|
||||
# define BOOST_EXCEPTION_DISABLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
|
||||
# define BOOST_EXCEPTION_DISABLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
# include <boost/exception/exception.hpp>
|
||||
#if !defined(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION)
|
||||
# include <boost/current_function.hpp>
|
||||
# define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION BOOST_CURRENT_FUNCTION
|
||||
#endif
|
||||
# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_THROW_EXCEPTION_CURRENT_FUNCTION,__FILE__,__LINE__)
|
||||
#else
|
||||
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
|
||||
void throw_exception( std::exception const & e ); // user defined
|
||||
|
||||
#else
|
||||
|
||||
inline void throw_exception_assert_compatibility( std::exception const & ) { }
|
||||
|
||||
template<class E> BOOST_NORETURN inline void throw_exception( E const & e )
|
||||
{
|
||||
//All boost exceptions are required to derive from std::exception,
|
||||
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
|
||||
throw_exception_assert_compatibility(e);
|
||||
|
||||
#ifndef BOOST_EXCEPTION_DISABLE
|
||||
throw enable_current_exception(enable_error_info(e));
|
||||
#else
|
||||
throw e;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class E>
|
||||
BOOST_NORETURN
|
||||
void
|
||||
throw_exception_( E const & x, char const * current_function, char const * file, int line )
|
||||
{
|
||||
boost::throw_exception(
|
||||
set_info(
|
||||
set_info(
|
||||
set_info(
|
||||
enable_error_info(x),
|
||||
throw_function(current_function)),
|
||||
throw_file(file)),
|
||||
throw_line(line)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_TAG_OF_FWD_31122005_1445)
|
||||
#define BOOST_FUSION_TAG_OF_FWD_31122005_1445
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace traits
|
||||
{
|
||||
template<typename T, typename Active = void>
|
||||
struct tag_of;
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,301 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2015 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_IMAGE_IMAGE2D_HPP
|
||||
#define BOOST_COMPUTE_IMAGE_IMAGE2D_HPP
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <boost/compute/config.hpp>
|
||||
#include <boost/compute/context.hpp>
|
||||
#include <boost/compute/exception/opencl_error.hpp>
|
||||
#include <boost/compute/image/image_format.hpp>
|
||||
#include <boost/compute/image/image_object.hpp>
|
||||
#include <boost/compute/detail/get_object_info.hpp>
|
||||
#include <boost/compute/type_traits/type_name.hpp>
|
||||
#include <boost/compute/utility/extents.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
// forward declarations
|
||||
class command_queue;
|
||||
|
||||
/// \class image2d
|
||||
/// \brief An OpenCL 2D image object
|
||||
///
|
||||
/// For example, to create a 640x480 8-bit RGBA image:
|
||||
///
|
||||
/// \snippet test/test_image2d.cpp create_image
|
||||
///
|
||||
/// \see image_format, image3d
|
||||
class image2d : public image_object
|
||||
{
|
||||
public:
|
||||
/// Creates a null image2d object.
|
||||
image2d()
|
||||
: image_object()
|
||||
{
|
||||
}
|
||||
|
||||
/// Creates a new image2d object.
|
||||
///
|
||||
/// \see_opencl_ref{clCreateImage}
|
||||
image2d(const context &context,
|
||||
size_t image_width,
|
||||
size_t image_height,
|
||||
const image_format &format,
|
||||
cl_mem_flags flags = read_write,
|
||||
void *host_ptr = 0,
|
||||
size_t image_row_pitch = 0)
|
||||
{
|
||||
cl_int error = 0;
|
||||
|
||||
#ifdef CL_VERSION_1_2
|
||||
cl_image_desc desc;
|
||||
desc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
desc.image_width = image_width;
|
||||
desc.image_height = image_height;
|
||||
desc.image_depth = 1;
|
||||
desc.image_array_size = 0;
|
||||
desc.image_row_pitch = image_row_pitch;
|
||||
desc.image_slice_pitch = 0;
|
||||
desc.num_mip_levels = 0;
|
||||
desc.num_samples = 0;
|
||||
#ifdef CL_VERSION_2_0
|
||||
desc.mem_object = 0;
|
||||
#else
|
||||
desc.buffer = 0;
|
||||
#endif
|
||||
|
||||
m_mem = clCreateImage(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
&desc,
|
||||
host_ptr,
|
||||
&error);
|
||||
#else
|
||||
m_mem = clCreateImage2D(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
image_width,
|
||||
image_height,
|
||||
image_row_pitch,
|
||||
host_ptr,
|
||||
&error);
|
||||
#endif
|
||||
|
||||
if(!m_mem){
|
||||
BOOST_THROW_EXCEPTION(opencl_error(error));
|
||||
}
|
||||
}
|
||||
|
||||
/// \internal_ (deprecated)
|
||||
image2d(const context &context,
|
||||
cl_mem_flags flags,
|
||||
const image_format &format,
|
||||
size_t image_width,
|
||||
size_t image_height,
|
||||
size_t image_row_pitch = 0,
|
||||
void *host_ptr = 0)
|
||||
{
|
||||
cl_int error = 0;
|
||||
|
||||
#ifdef CL_VERSION_1_2
|
||||
cl_image_desc desc;
|
||||
desc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
desc.image_width = image_width;
|
||||
desc.image_height = image_height;
|
||||
desc.image_depth = 1;
|
||||
desc.image_array_size = 0;
|
||||
desc.image_row_pitch = image_row_pitch;
|
||||
desc.image_slice_pitch = 0;
|
||||
desc.num_mip_levels = 0;
|
||||
desc.num_samples = 0;
|
||||
#ifdef CL_VERSION_2_0
|
||||
desc.mem_object = 0;
|
||||
#else
|
||||
desc.buffer = 0;
|
||||
#endif
|
||||
|
||||
m_mem = clCreateImage(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
&desc,
|
||||
host_ptr,
|
||||
&error);
|
||||
#else
|
||||
m_mem = clCreateImage2D(context,
|
||||
flags,
|
||||
format.get_format_ptr(),
|
||||
image_width,
|
||||
image_height,
|
||||
image_row_pitch,
|
||||
host_ptr,
|
||||
&error);
|
||||
#endif
|
||||
|
||||
if(!m_mem){
|
||||
BOOST_THROW_EXCEPTION(opencl_error(error));
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new image2d as a copy of \p other.
|
||||
image2d(const image2d &other)
|
||||
: image_object(other)
|
||||
{
|
||||
}
|
||||
|
||||
/// Copies the image2d from \p other.
|
||||
image2d& operator=(const image2d &other)
|
||||
{
|
||||
image_object::operator=(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
|
||||
/// Move-constructs a new image object from \p other.
|
||||
image2d(image2d&& other) BOOST_NOEXCEPT
|
||||
: image_object(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
/// Move-assigns the image from \p other to \c *this.
|
||||
image2d& operator=(image2d&& other) BOOST_NOEXCEPT
|
||||
{
|
||||
image_object::operator=(std::move(other));
|
||||
|
||||
return *this;
|
||||
}
|
||||
#endif // BOOST_COMPUTE_NO_RVALUE_REFERENCES
|
||||
|
||||
/// Destroys the image2d object.
|
||||
~image2d()
|
||||
{
|
||||
}
|
||||
|
||||
/// Returns the size (width, height) of the image.
|
||||
extents<2> size() const
|
||||
{
|
||||
extents<2> size;
|
||||
size[0] = get_info<size_t>(CL_IMAGE_WIDTH);
|
||||
size[1] = get_info<size_t>(CL_IMAGE_HEIGHT);
|
||||
return size;
|
||||
}
|
||||
|
||||
/// Returns the origin of the image (\c 0, \c 0).
|
||||
extents<2> origin() const
|
||||
{
|
||||
return extents<2>();
|
||||
}
|
||||
|
||||
/// Returns information about the image.
|
||||
///
|
||||
/// \see_opencl_ref{clGetImageInfo}
|
||||
template<class T>
|
||||
T get_info(cl_image_info info) const
|
||||
{
|
||||
return detail::get_object_info<T>(clGetImageInfo, m_mem, info);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<int Enum>
|
||||
typename detail::get_object_info_type<image2d, Enum>::type
|
||||
get_info() const;
|
||||
|
||||
/// Returns the supported image formats for the context.
|
||||
///
|
||||
/// \see_opencl_ref{clGetSupportedImageFormats}
|
||||
static std::vector<image_format>
|
||||
get_supported_formats(const context &context, cl_mem_flags flags = read_write)
|
||||
{
|
||||
return image_object::get_supported_formats(context, CL_MEM_OBJECT_IMAGE2D, flags);
|
||||
}
|
||||
|
||||
/// Returns \c true if \p format is a supported 2D image format for
|
||||
/// \p context.
|
||||
static bool is_supported_format(const image_format &format,
|
||||
const context &context,
|
||||
cl_mem_flags flags = read_write)
|
||||
{
|
||||
return image_object::is_supported_format(
|
||||
format, context, CL_MEM_OBJECT_IMAGE2D, flags
|
||||
);
|
||||
}
|
||||
|
||||
/// Creates a new image with a copy of the data in \c *this. Uses \p queue
|
||||
/// to perform the copy operation.
|
||||
image2d clone(command_queue &queue) const;
|
||||
};
|
||||
|
||||
/// \internal_ define get_info() specializations for image2d
|
||||
BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(image2d,
|
||||
((cl_image_format, CL_IMAGE_FORMAT))
|
||||
((size_t, CL_IMAGE_ELEMENT_SIZE))
|
||||
((size_t, CL_IMAGE_ROW_PITCH))
|
||||
((size_t, CL_IMAGE_SLICE_PITCH))
|
||||
((size_t, CL_IMAGE_WIDTH))
|
||||
((size_t, CL_IMAGE_HEIGHT))
|
||||
((size_t, CL_IMAGE_DEPTH))
|
||||
)
|
||||
|
||||
namespace detail {
|
||||
|
||||
// set_kernel_arg() specialization for image2d
|
||||
template<>
|
||||
struct set_kernel_arg<image2d> : public set_kernel_arg<image_object> { };
|
||||
|
||||
} // end detail namespace
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
BOOST_COMPUTE_TYPE_NAME(boost::compute::image2d, image2d_t)
|
||||
|
||||
#endif // BOOST_COMPUTE_IMAGE_IMAGE2D_HPP
|
||||
@@ -0,0 +1,49 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_ADVANCE_IMPL_14122005_2015)
|
||||
#define FUSION_ADVANCE_IMPL_14122005_2015
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/mpl/negate.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct reverse_view_iterator_tag;
|
||||
|
||||
template <typename Iterator>
|
||||
struct reverse_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct advance_impl;
|
||||
|
||||
template<>
|
||||
struct advance_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template<typename Iterator, typename Dist>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename mpl::negate<Dist>::type negative_dist;
|
||||
typedef typename result_of::advance<first_type, negative_dist>::type advanced_type;
|
||||
typedef reverse_view_iterator<advanced_type> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(boost::fusion::advance<negative_dist>(i.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,88 @@
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* 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/multi_index for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_MULTI_INDEX_TAG_HPP
|
||||
#define BOOST_MULTI_INDEX_TAG_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/multi_index/detail/no_duplicate_tags.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/transform.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
|
||||
/* A wrapper of mpl::vector used to hide MPL from the user.
|
||||
* tag contains types used as tag names for indices in get() functions.
|
||||
*/
|
||||
|
||||
/* This user_definable macro limits the number of elements of a tag;
|
||||
* useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
|
||||
* has problems coping with very long symbol names.)
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_LIMIT_TAG_SIZE)
|
||||
#define BOOST_MULTI_INDEX_LIMIT_TAG_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#endif
|
||||
|
||||
#if BOOST_MULTI_INDEX_LIMIT_TAG_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#define BOOST_MULTI_INDEX_TAG_SIZE BOOST_MULTI_INDEX_LIMIT_TAG_SIZE
|
||||
#else
|
||||
#define BOOST_MULTI_INDEX_TAG_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
struct tag_marker{};
|
||||
|
||||
template<typename T>
|
||||
struct is_tag
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool,value=(is_base_and_derived<tag_marker,T>::value));
|
||||
};
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(
|
||||
BOOST_MULTI_INDEX_TAG_SIZE,
|
||||
typename T,
|
||||
=mpl::na BOOST_PP_INTERCEPT)
|
||||
>
|
||||
struct tag:private detail::tag_marker
|
||||
{
|
||||
/* The mpl::transform pass produces shorter symbols (without
|
||||
* trailing mpl::na's.)
|
||||
*/
|
||||
|
||||
typedef typename mpl::transform<
|
||||
mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_TAG_SIZE,T)>,
|
||||
mpl::identity<mpl::_1>
|
||||
>::type type;
|
||||
|
||||
BOOST_STATIC_ASSERT(detail::no_duplicate_tags<type>::value);
|
||||
};
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#undef BOOST_MULTI_INDEX_TAG_SIZE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,43 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_ALGORITHM_FIND_IF_NOT_HPP
|
||||
#define BOOST_COMPUTE_ALGORITHM_FIND_IF_NOT_HPP
|
||||
|
||||
#include <boost/compute/system.hpp>
|
||||
#include <boost/compute/functional.hpp>
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/algorithm/find_if.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// Returns an iterator pointing to the first element in the range
|
||||
/// [\p first, \p last) for which \p predicate returns \c false.
|
||||
///
|
||||
/// \see find_if()
|
||||
template<class InputIterator, class UnaryPredicate>
|
||||
inline InputIterator find_if_not(InputIterator first,
|
||||
InputIterator last,
|
||||
UnaryPredicate predicate,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
return ::boost::compute::find_if(
|
||||
first,
|
||||
last,
|
||||
not1(predicate),
|
||||
queue
|
||||
);
|
||||
}
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_ALGORITHM_FIND_IF_NOT_HPP
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
|
||||
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
#ifndef BOOST_TYPEOF_LIMIT_FUNCTION_ARITY
|
||||
#define BOOST_TYPEOF_LIMIT_FUNCTION_ARITY 10
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
FUN_ID = BOOST_TYPEOF_UNIQUE_ID(),
|
||||
FUN_PTR_ID = FUN_ID + 1 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
FUN_REF_ID = FUN_ID + 2 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
MEM_FUN_ID = FUN_ID + 3 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
CONST_MEM_FUN_ID = FUN_ID + 4 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
VOLATILE_MEM_FUN_ID = FUN_ID + 5 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
FUN_VAR_ID = FUN_ID + 7 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
FUN_VAR_PTR_ID = FUN_ID + 8 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
FUN_VAR_REF_ID = FUN_ID + 9 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
MEM_FUN_VAR_ID = FUN_ID + 10 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
CONST_MEM_FUN_VAR_ID = FUN_ID + 11 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
VOLATILE_MEM_FUN_VAR_ID = FUN_ID + 12 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
|
||||
VOLATILE_CONST_MEM_FUN_VAR_ID = FUN_ID + 13 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
|
||||
};
|
||||
|
||||
BOOST_TYPEOF_BEGIN_ENCODE_NS
|
||||
|
||||
# define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
|
||||
# define BOOST_PP_FILENAME_1 <boost/typeof/register_functions_iterate.hpp>
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
BOOST_TYPEOF_END_ENCODE_NS
|
||||
|
||||
#endif//BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
|
||||
@@ -0,0 +1,190 @@
|
||||
// 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 BUILTIN_CONVERTERS_DWA2002124_HPP
|
||||
# define BUILTIN_CONVERTERS_DWA2002124_HPP
|
||||
# include <boost/python/detail/prefix.hpp>
|
||||
# include <boost/python/detail/none.hpp>
|
||||
# include <boost/python/handle.hpp>
|
||||
# include <boost/python/ssize_t.hpp>
|
||||
# include <boost/implicit_cast.hpp>
|
||||
# include <string>
|
||||
# include <complex>
|
||||
# include <boost/limits.hpp>
|
||||
|
||||
// Since all we can use to decide how to convert an object to_python
|
||||
// is its C++ type, there can be only one such converter for each
|
||||
// type. Therefore, for built-in conversions we can bypass registry
|
||||
// lookups using explicit specializations of arg_to_python and
|
||||
// result_to_python.
|
||||
|
||||
namespace boost { namespace python {
|
||||
|
||||
namespace converter
|
||||
{
|
||||
template <class T> struct arg_to_python;
|
||||
BOOST_PYTHON_DECL PyObject* do_return_to_python(char);
|
||||
BOOST_PYTHON_DECL PyObject* do_return_to_python(char const*);
|
||||
BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject*);
|
||||
BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject*);
|
||||
}
|
||||
|
||||
// Provide specializations of to_python_value
|
||||
template <class T> struct to_python_value;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
// Since there's no registry lookup, always report the existence of
|
||||
// a converter.
|
||||
struct builtin_to_python
|
||||
{
|
||||
// This information helps make_getter() decide whether to try to
|
||||
// return an internal reference or not. I don't like it much,
|
||||
// but it will have to serve for now.
|
||||
BOOST_STATIC_CONSTANT(bool, uses_registry = false);
|
||||
};
|
||||
}
|
||||
|
||||
// Use expr to create the PyObject corresponding to x
|
||||
# define BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T, expr, pytype)\
|
||||
template <> struct to_python_value<T&> \
|
||||
: detail::builtin_to_python \
|
||||
{ \
|
||||
inline PyObject* operator()(T const& x) const \
|
||||
{ \
|
||||
return (expr); \
|
||||
} \
|
||||
inline PyTypeObject const* get_pytype() const \
|
||||
{ \
|
||||
return (pytype); \
|
||||
} \
|
||||
}; \
|
||||
template <> struct to_python_value<T const&> \
|
||||
: detail::builtin_to_python \
|
||||
{ \
|
||||
inline PyObject* operator()(T const& x) const \
|
||||
{ \
|
||||
return (expr); \
|
||||
} \
|
||||
inline PyTypeObject const* get_pytype() const \
|
||||
{ \
|
||||
return (pytype); \
|
||||
} \
|
||||
};
|
||||
|
||||
# define BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T, expr) \
|
||||
namespace converter \
|
||||
{ \
|
||||
template <> struct arg_to_python< T > \
|
||||
: handle<> \
|
||||
{ \
|
||||
arg_to_python(T const& x) \
|
||||
: python::handle<>(expr) {} \
|
||||
}; \
|
||||
}
|
||||
|
||||
// Specialize argument and return value converters for T using expr
|
||||
# define BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype) \
|
||||
BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T,expr, pytype) \
|
||||
BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr)
|
||||
|
||||
// Specialize converters for signed and unsigned T to Python Int
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
|
||||
# define BOOST_PYTHON_TO_INT(T) \
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyLong_FromLong(x), &PyLong_Type) \
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned T, ::PyLong_FromUnsignedLong(x), &PyLong_Type)
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_PYTHON_TO_INT(T) \
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyInt_FromLong(x), &PyInt_Type) \
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE( \
|
||||
unsigned T \
|
||||
, static_cast<unsigned long>(x) > static_cast<unsigned long>( \
|
||||
(std::numeric_limits<long>::max)()) \
|
||||
? ::PyLong_FromUnsignedLong(x) \
|
||||
: ::PyInt_FromLong(x), &PyInt_Type)
|
||||
#endif
|
||||
|
||||
// Bool is not signed.
|
||||
#if PY_VERSION_HEX >= 0x02030000
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyBool_FromLong(x), &PyBool_Type)
|
||||
#else
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyInt_FromLong(x), &PyInt_Type)
|
||||
#endif
|
||||
|
||||
// note: handles signed char and unsigned char, but not char (see below)
|
||||
BOOST_PYTHON_TO_INT(char)
|
||||
|
||||
BOOST_PYTHON_TO_INT(short)
|
||||
BOOST_PYTHON_TO_INT(int)
|
||||
BOOST_PYTHON_TO_INT(long)
|
||||
|
||||
# if defined(_MSC_VER) && defined(_WIN64) && PY_VERSION_HEX < 0x03000000
|
||||
/* Under 64-bit Windows std::size_t is "unsigned long long". To avoid
|
||||
getting a Python long for each std::size_t the value is checked before
|
||||
the conversion. A std::size_t is converted to a simple Python int
|
||||
if possible; a Python long appears only if the value is too small or
|
||||
too large to fit into a simple int. */
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(
|
||||
signed BOOST_PYTHON_LONG_LONG,
|
||||
( x < static_cast<signed BOOST_PYTHON_LONG_LONG>(
|
||||
(std::numeric_limits<long>::min)())
|
||||
|| x > static_cast<signed BOOST_PYTHON_LONG_LONG>(
|
||||
(std::numeric_limits<long>::max)()))
|
||||
? ::PyLong_FromLongLong(x)
|
||||
: ::PyInt_FromLong(static_cast<long>(x)), &PyInt_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(
|
||||
unsigned BOOST_PYTHON_LONG_LONG,
|
||||
x > static_cast<unsigned BOOST_PYTHON_LONG_LONG>(
|
||||
(std::numeric_limits<long>::max)())
|
||||
? ::PyLong_FromUnsignedLongLong(x)
|
||||
: ::PyInt_FromLong(static_cast<long>(x)), &PyInt_Type)
|
||||
//
|
||||
# elif defined(HAVE_LONG_LONG) // using Python's macro instead of Boost's
|
||||
// - we don't seem to get the config right
|
||||
// all the time.
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed BOOST_PYTHON_LONG_LONG, ::PyLong_FromLongLong(x), &PyLong_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned BOOST_PYTHON_LONG_LONG, ::PyLong_FromUnsignedLongLong(x), &PyLong_Type)
|
||||
# endif
|
||||
|
||||
# undef BOOST_TO_PYTHON_INT
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyUnicode_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyUnicode_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyUnicode_FromStringAndSize(x.data(),implicit_cast<ssize_t>(x.size())), &PyUnicode_Type)
|
||||
#else
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyString_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyString_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyString_FromStringAndSize(x.data(),implicit_cast<ssize_t>(x.size())), &PyString_Type)
|
||||
#endif
|
||||
|
||||
#if defined(Py_USING_UNICODE) && !defined(BOOST_NO_STD_WSTRING)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast<ssize_t>(x.size())), &PyUnicode_Type)
|
||||
# endif
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(float, ::PyFloat_FromDouble(x), &PyFloat_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(double, ::PyFloat_FromDouble(x), &PyFloat_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(long double, ::PyFloat_FromDouble(x), &PyFloat_Type)
|
||||
BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(PyObject*, converter::do_return_to_python(x), 0)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex<float>, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex<double>, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type)
|
||||
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex<long double>, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type)
|
||||
|
||||
# undef BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE
|
||||
# undef BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE
|
||||
# undef BOOST_PYTHON_TO_PYTHON_BY_VALUE
|
||||
# undef BOOST_PYTHON_TO_INT
|
||||
|
||||
namespace converter
|
||||
{
|
||||
|
||||
void initialize_builtin_converters();
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::python::converter
|
||||
|
||||
#endif // BUILTIN_CONVERTERS_DWA2002124_HPP
|
||||
@@ -0,0 +1,75 @@
|
||||
#ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
|
||||
#define BOOST_CURRENT_FUNCTION_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/current_function.hpp - BOOST_CURRENT_FUNCTION
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// http://www.boost.org/libs/assert/current_function.html
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline void current_function_helper()
|
||||
{
|
||||
|
||||
#if defined( BOOST_DISABLE_CURRENT_FUNCTION )
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION "(unknown)"
|
||||
|
||||
#elif defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
|
||||
|
||||
#elif defined(__DMC__) && (__DMC__ >= 0x810)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
|
||||
|
||||
#elif defined(__FUNCSIG__)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __FUNCSIG__
|
||||
|
||||
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __FUNCTION__
|
||||
|
||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __FUNC__
|
||||
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __func__
|
||||
|
||||
#elif defined(__cplusplus) && (__cplusplus >= 201103)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __func__
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION "(unknown)"
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
|
||||
Reference in New Issue
Block a user