Initial Commit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
// Status=review
|
||||
.Main Window:
|
||||
- Select *FT8* on the *Mode* menu.
|
||||
- Set Tx and Rx frequencies to 1200 Hz.
|
||||
- Double-click on *Erase* to clear both text windows.
|
||||
|
||||
.Wide Graph Settings:
|
||||
|
||||
- *Bins/Pixel* = 4, *Start* = 200 Hz, *N Avg* = 2
|
||||
- Adjust the width of the Wide Graph window so that the upper
|
||||
frequency limit is approximately 2600 Hz.
|
||||
|
||||
.Open a Wave File:
|
||||
|
||||
- Select *File | Open* and navigate to
|
||||
+...\save\samples\FT8\170709_135615.wav+. The waterfall and decoded
|
||||
text window should look something like the following screen shots:
|
||||
|
||||
[[X15]]
|
||||
image::170709_135615.wav.png[align="left",alt="Wide Graph Decode 170709_135615"]
|
||||
|
||||
image::ft8_decodes.png[align="left"]
|
||||
|
||||
- Click with the mouse anywhere on the waterfall display. The green Rx
|
||||
frequency marker will jump to your selected frequency, and the Rx
|
||||
frequency control on the main window will be updated accordingly.
|
||||
|
||||
- Do the same thing with the Shift key held down. Now the red Tx
|
||||
frequency marker and its associated control on the main window will
|
||||
follow your frequency selections.
|
||||
|
||||
- Do the same thing with the Ctrl key held down. Now the both colored
|
||||
markers and both spinner controls will follow your selections.
|
||||
|
||||
- Double-clicking at any frequency on the waterfall does all the
|
||||
things just described and also invokes the decoder in a small range
|
||||
around that frequency. To decode a particular signal, double-click
|
||||
near the left edge of its waterfall trace.
|
||||
|
||||
- Now double-click on any of the the lines of decoded text in the main
|
||||
window. Unless you have *My Call* set to K1JT or KY7M on the
|
||||
*Settings -> General* tab, all three lines will show the same
|
||||
behavior, setting both RxFreq and TxFreq to the frequency of the
|
||||
selected message. However, if MyCall is set to K1JT then clicking on
|
||||
a message directed to K1JT will move only the Rx frequency setting.
|
||||
This behavior is desirable so that you will not inadvertently change
|
||||
your Tx frequency to that of a tail-ender who called you somewhere
|
||||
else in the FT8 subband.
|
||||
|
||||
NOTE: The FT8 decoder can often copy several overlapping signals at
|
||||
nearly the same frequency. However, in crowded band conditions you
|
||||
will often find it advantageous to move off the frequency of the
|
||||
station you are calling. Keyboard shortcuts *Shift+F11* and
|
||||
*Shift+F12* provide an easy way to move your Tx frequency in 60 Hz
|
||||
steps.
|
||||
|
||||
IMPORTANT: When finished with this Tutorial, don't forget to re-enter
|
||||
your own callsign as *My Call* on the *Settings | General* tab.
|
||||
@@ -0,0 +1,46 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
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_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template <>
|
||||
struct at_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Seq::begin_type begin_type;
|
||||
typedef typename result_of::advance<begin_type,N>::type pos;
|
||||
typedef typename result_of::deref<pos>::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Seq& s)
|
||||
{
|
||||
return * fusion::advance<N>(s.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/integrate/integrate_times.hpp
|
||||
|
||||
[begin_description]
|
||||
Integration of ODEs with observation at user defined points
|
||||
[end_description]
|
||||
|
||||
Copyright 2011-2013 Karsten Ahnert
|
||||
Copyright 2011-2015 Mario Mulansky
|
||||
|
||||
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_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
|
||||
#include <boost/numeric/odeint/integrate/null_observer.hpp>
|
||||
#include <boost/numeric/odeint/integrate/check_adapter.hpp>
|
||||
#include <boost/numeric/odeint/integrate/detail/integrate_times.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
|
||||
/*
|
||||
* \brief Integrates while calling the observer at the time points given by sequence [times_start, time_end)
|
||||
* the two overloads are needed in order to solve the forwarding problem
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer , class StepOverflowChecker >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , State &start_state ,
|
||||
TimeIterator times_start , TimeIterator times_end , Time dt ,
|
||||
Observer observer , StepOverflowChecker checker )
|
||||
{
|
||||
// unwrap references
|
||||
typedef typename odeint::unwrap_reference< Stepper >::type stepper_type;
|
||||
typedef typename odeint::unwrap_reference< Observer >::type observer_type;
|
||||
typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type;
|
||||
typedef typename stepper_type::stepper_category stepper_category;
|
||||
|
||||
// pass on checked stepper and observer
|
||||
// checked_stepper/observer use references internally, so passing by value is fine
|
||||
return detail::integrate_times(
|
||||
checked_stepper<stepper_type, checker_type>(stepper, checker) ,
|
||||
system , start_state ,
|
||||
times_start , times_end , dt ,
|
||||
checked_observer<observer_type, checker_type>(observer, checker),
|
||||
stepper_category() );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer , class StepOverflowChecker >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , const State &start_state ,
|
||||
TimeIterator times_start , TimeIterator times_end , Time dt ,
|
||||
Observer observer , StepOverflowChecker checker )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< Stepper >::type stepper_type;
|
||||
typedef typename odeint::unwrap_reference< Observer >::type observer_type;
|
||||
typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type;
|
||||
typedef typename stepper_type::stepper_category stepper_category;
|
||||
|
||||
stepper_type &st = stepper;
|
||||
observer_type &obs = observer;
|
||||
checker_type &chk = checker;
|
||||
|
||||
return detail::integrate_times(
|
||||
checked_stepper<stepper_type, checker_type>(stepper, checker) ,
|
||||
system , start_state ,
|
||||
times_start , times_end , dt ,
|
||||
checked_observer<observer_type, checker_type>(observer, checker),
|
||||
stepper_category() );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief The same function as above, but with the observation times given as range.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeRange , class Time , class Observer , class StepOverflowChecker >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , State &start_state ,
|
||||
const TimeRange × , Time dt ,
|
||||
Observer observer , StepOverflowChecker checker )
|
||||
{
|
||||
return integrate_times(
|
||||
stepper , system , start_state ,
|
||||
boost::begin( times ) , boost::end( times ) , dt , observer , checker );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeRange , class Time , class Observer , class StepOverflowChecker >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , const State &start_state ,
|
||||
const TimeRange × , Time dt ,
|
||||
Observer observer , StepOverflowChecker checker )
|
||||
{
|
||||
return integrate_times(
|
||||
stepper , system , start_state ,
|
||||
boost::begin( times ) , boost::end( times ) , dt , observer , checker );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The same functions as above, but without a StepOverflowChecker
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , State &start_state ,
|
||||
TimeIterator times_start , TimeIterator times_end , Time dt ,
|
||||
Observer observer )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
|
||||
// simply don't use checked_* adapters
|
||||
return detail::integrate_times(
|
||||
stepper , system , start_state ,
|
||||
times_start , times_end , dt ,
|
||||
observer , stepper_category() );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , const State &start_state ,
|
||||
TimeIterator times_start , TimeIterator times_end , Time dt ,
|
||||
Observer observer )
|
||||
{
|
||||
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
|
||||
return detail::integrate_times(
|
||||
stepper , system , start_state ,
|
||||
times_start , times_end , dt ,
|
||||
observer , stepper_category() );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief The same function as above, but with the observation times given as range.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , State &start_state ,
|
||||
const TimeRange × , Time dt ,
|
||||
Observer observer )
|
||||
{
|
||||
return integrate_times(
|
||||
stepper , system , start_state ,
|
||||
boost::begin( times ) , boost::end( times ) , dt , observer );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
|
||||
*/
|
||||
template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
|
||||
size_t integrate_times(
|
||||
Stepper stepper , System system , const State &start_state ,
|
||||
const TimeRange × , Time dt ,
|
||||
Observer observer )
|
||||
{
|
||||
return integrate_times(
|
||||
stepper , system , start_state ,
|
||||
boost::begin( times ) , boost::end( times ) , dt , observer);
|
||||
}
|
||||
|
||||
|
||||
/********* DOXYGEN ***********/
|
||||
|
||||
/**
|
||||
* \fn size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator times_start , TimeIterator times_end , Time dt , Observer observer )
|
||||
* \brief Integrates the ODE with observer calls at given time points.
|
||||
*
|
||||
* Integrates the ODE given by system using the given stepper. This function
|
||||
* does observer calls at the subsequent time points given by the range
|
||||
* times_start, times_end. If the stepper has not step size control, the
|
||||
* step size might be reduced occasionally to ensure observer calls exactly
|
||||
* at the time points from the given sequence. If the stepper is a
|
||||
* ControlledStepper, the step size is adjusted to meet the error bounds,
|
||||
* but also might be reduced occasionally to ensure correct observer calls.
|
||||
* If a DenseOutputStepper is provided, the dense output functionality is
|
||||
* used to call the observer at the given times. The end time of the
|
||||
* integration is always *(end_time-1).
|
||||
* If a max_step_checker is provided as StepOverflowChecker, a
|
||||
* no_progress_error is thrown if too many steps (default: 500) are
|
||||
* performed without progress, i.e. in between observer calls. If no
|
||||
* checker is provided, no such overflow check is performed.
|
||||
*
|
||||
* \param stepper The stepper to be used for numerical integration.
|
||||
* \param system Function/Functor defining the rhs of the ODE.
|
||||
* \param start_state The initial condition x0.
|
||||
* \param times_start Iterator to the start time
|
||||
* \param times_end Iterator to the end time
|
||||
* \param dt The time step between observer calls, _not_ necessarily the
|
||||
* time step of the integration.
|
||||
* \param observer Function/Functor called at equidistant time intervals.
|
||||
* \param checker [optional] Functor to check for step count overflows, if no
|
||||
* checker is provided, no exception is thrown.
|
||||
* \return The number of steps performed.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
|
||||
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* -*- c++ -*-
|
||||
*
|
||||
* \file const_iterator_type.hpp
|
||||
*
|
||||
* \brief Const iterator to a given container type.
|
||||
*
|
||||
* Copyright (c) 2009, Marco Guazzone
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
* \author Marco Guazzone, marco.guazzone@gmail.com
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP
|
||||
#define BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP
|
||||
|
||||
|
||||
#include <boost/numeric/ublas/fwd.hpp>
|
||||
#include <boost/numeric/ublas/tags.hpp>
|
||||
#include <boost/numeric/ublas/traits.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
namespace detail {
|
||||
|
||||
/**
|
||||
* \brief Auxiliary class for retrieving the const iterator to the given
|
||||
* matrix expression according its orientation and to the given dimension tag.
|
||||
* \tparam MatrixT A model of MatrixExpression.
|
||||
* \tparam TagT A dimension tag type (e.g., tag::major).
|
||||
* \tparam OrientationT An orientation category type (e.g., row_major_tag).
|
||||
*/
|
||||
template <typename MatrixT, typename TagT, typename OrientationT>
|
||||
struct const_iterator_type_impl;
|
||||
|
||||
|
||||
/// \brief Specialization of \c const_iterator_type_impl for row-major oriented
|
||||
/// matrices and over the major dimension.
|
||||
template <typename MatrixT>
|
||||
struct const_iterator_type_impl<MatrixT,tag::major,row_major_tag>
|
||||
{
|
||||
typedef typename matrix_view_traits<MatrixT>::const_iterator1 type;
|
||||
};
|
||||
|
||||
|
||||
/// \brief Specialization of \c const_iterator_type_impl for column-major
|
||||
/// oriented matrices and over the major dimension.
|
||||
template <typename MatrixT>
|
||||
struct const_iterator_type_impl<MatrixT,tag::major,column_major_tag>
|
||||
{
|
||||
typedef typename matrix_view_traits<MatrixT>::const_iterator2 type;
|
||||
};
|
||||
|
||||
|
||||
/// \brief Specialization of \c const_iterator_type_impl for row-major oriented
|
||||
/// matrices and over the minor dimension.
|
||||
template <typename MatrixT>
|
||||
struct const_iterator_type_impl<MatrixT,tag::minor,row_major_tag>
|
||||
{
|
||||
typedef typename matrix_view_traits<MatrixT>::const_iterator2 type;
|
||||
};
|
||||
|
||||
|
||||
/// \brief Specialization of \c const_iterator_type_impl for column-major
|
||||
/// oriented matrices and over the minor dimension.
|
||||
template <typename MatrixT>
|
||||
struct const_iterator_type_impl<MatrixT,tag::minor,column_major_tag>
|
||||
{
|
||||
typedef typename matrix_view_traits<MatrixT>::const_iterator1 type;
|
||||
};
|
||||
|
||||
} // Namespace detail
|
||||
|
||||
|
||||
/**
|
||||
* \brief A const iterator for the given container type over the given
|
||||
* dimension.
|
||||
* \tparam ContainerT A container expression type.
|
||||
* \tparam TagT A dimension tag type (e.g., tag::major).
|
||||
*/
|
||||
template <typename ContainerT, typename TagT=void>
|
||||
struct const_iterator_type;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Specialization of \c const_iterator_type for vector expressions.
|
||||
* \tparam VectorT A model of VectorExpression type.
|
||||
*/
|
||||
template <typename VectorT>
|
||||
struct const_iterator_type<VectorT, void>
|
||||
{
|
||||
typedef typename vector_view_traits<VectorT>::const_iterator type;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Specialization of \c const_iterator_type for matrix expressions and
|
||||
* over the major dimension.
|
||||
* \tparam MatrixT A model of MatrixExpression type.
|
||||
*/
|
||||
template <typename MatrixT>
|
||||
struct const_iterator_type<MatrixT,tag::major>
|
||||
{
|
||||
typedef typename detail::const_iterator_type_impl<MatrixT,tag::minor,typename matrix_view_traits<MatrixT>::orientation_category>::type type;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Specialization of \c const_iterator_type for matrix expressions and
|
||||
* over the minor dimension.
|
||||
* \tparam MatrixT A model of MatrixExpression type.
|
||||
*/
|
||||
template <typename MatrixT>
|
||||
struct const_iterator_type<MatrixT,tag::minor>
|
||||
{
|
||||
typedef typename detail::const_iterator_type_impl<MatrixT,tag::minor,typename matrix_view_traits<MatrixT>::orientation_category>::type type;
|
||||
};
|
||||
|
||||
}}} // Namespace boost::numeric::ublas
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP
|
||||
@@ -0,0 +1,18 @@
|
||||
// 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 FORCE_INSTANTIATE_DWA200265_HPP
|
||||
# define FORCE_INSTANTIATE_DWA200265_HPP
|
||||
|
||||
namespace boost { namespace python { namespace detail {
|
||||
|
||||
// Allows us to force the argument to be instantiated without
|
||||
// incurring unused variable warnings
|
||||
|
||||
template <class T>
|
||||
inline void force_instantiate(T const&) {}
|
||||
|
||||
}}} // namespace boost::python::detail
|
||||
|
||||
#endif // FORCE_INSTANTIATE_DWA200265_HPP
|
||||
@@ -0,0 +1,81 @@
|
||||
// Copyright Neil Groves 2009. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
#ifndef BOOST_RANGE_ALGORITHM_FIND_IF_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_FIND_IF_HPP_INCLUDED
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/detail/range_return.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
{
|
||||
|
||||
/// \brief template function find_if
|
||||
///
|
||||
/// range-based version of the find_if std algorithm
|
||||
///
|
||||
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
|
||||
/// \pre UnaryPredicate is a model of the UnaryPredicateConcept
|
||||
template< class SinglePassRange, class UnaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME disable_if<
|
||||
is_const<SinglePassRange>,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type
|
||||
>::type
|
||||
find_if( SinglePassRange& rng, UnaryPredicate pred )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
|
||||
return std::find_if(boost::begin(rng), boost::end(rng), pred);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< class SinglePassRange, class UnaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type
|
||||
find_if( const SinglePassRange& rng, UnaryPredicate pred )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||
return std::find_if(boost::begin(rng), boost::end(rng), pred);
|
||||
}
|
||||
|
||||
// range_return overloads
|
||||
|
||||
/// \overload
|
||||
template< range_return_value re, class SinglePassRange, class UnaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME disable_if<
|
||||
is_const<SinglePassRange>,
|
||||
BOOST_DEDUCED_TYPENAME range_return<SinglePassRange,re>::type
|
||||
>::type
|
||||
find_if( SinglePassRange& rng, UnaryPredicate pred )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
|
||||
return range_return<SinglePassRange,re>::
|
||||
pack(std::find_if(boost::begin(rng), boost::end(rng), pred),
|
||||
rng);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< range_return_value re, class SinglePassRange, class UnaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<const SinglePassRange,re>::type
|
||||
find_if( const SinglePassRange& rng, UnaryPredicate pred )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||
return range_return<const SinglePassRange,re>::
|
||||
pack(std::find_if(boost::begin(rng), boost::end(rng), pred),
|
||||
rng);
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::find_if;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/intrusive for documentation.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
//This functor compares a stored value
|
||||
//and the one passed as an argument
|
||||
template<class ConstReference>
|
||||
class equal_to_value
|
||||
{
|
||||
ConstReference t_;
|
||||
|
||||
public:
|
||||
equal_to_value(ConstReference t)
|
||||
: t_(t)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(ConstReference t)const
|
||||
{ return t_ == t; }
|
||||
};
|
||||
|
||||
} //namespace detail{
|
||||
} //namespace intrusive{
|
||||
} //namespace boost{
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
|
||||
@@ -0,0 +1,57 @@
|
||||
/* Include file to configure the RS codec for character symbols
|
||||
*
|
||||
* Copyright 2002, Phil Karn, KA9Q
|
||||
* May be used under the terms of the GNU General Public License (GPL)
|
||||
*/
|
||||
#define DTYPE unsigned char
|
||||
|
||||
/* Reed-Solomon codec control block */
|
||||
struct rs {
|
||||
int mm; /* Bits per symbol */
|
||||
int nn; /* Symbols per block (= (1<<mm)-1) */
|
||||
DTYPE *alpha_to; /* log lookup table */
|
||||
DTYPE *index_of; /* Antilog lookup table */
|
||||
DTYPE *genpoly; /* Generator polynomial */
|
||||
int nroots; /* Number of generator roots = number of parity symbols */
|
||||
int fcr; /* First consecutive root, index form */
|
||||
int prim; /* Primitive element, index form */
|
||||
int iprim; /* prim-th root of 1, index form */
|
||||
int pad; /* Padding bytes in shortened block */
|
||||
};
|
||||
|
||||
static inline int modnn(struct rs *rs,int x){
|
||||
while (x >= rs->nn) {
|
||||
x -= rs->nn;
|
||||
x = (x >> rs->mm) + (x & rs->nn);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
#define MODNN(x) modnn(rs,x)
|
||||
|
||||
#define MM (rs->mm)
|
||||
#define NN (rs->nn)
|
||||
#define ALPHA_TO (rs->alpha_to)
|
||||
#define INDEX_OF (rs->index_of)
|
||||
#define GENPOLY (rs->genpoly)
|
||||
#define NROOTS (rs->nroots)
|
||||
#define FCR (rs->fcr)
|
||||
#define PRIM (rs->prim)
|
||||
#define IPRIM (rs->iprim)
|
||||
#define PAD (rs->pad)
|
||||
#define A0 (NN)
|
||||
|
||||
#define ENCODE_RS encode_rs_char
|
||||
#define DECODE_RS decode_rs_char
|
||||
#define INIT_RS init_rs_char
|
||||
#define FREE_RS free_rs_char
|
||||
|
||||
void ENCODE_RS(void *p,DTYPE *data,DTYPE *parity);
|
||||
int DECODE_RS(void *p,DTYPE *data,int *eras_pos,int no_eras);
|
||||
void *INIT_RS(int symsize,int gfpoly,int fcr,
|
||||
int prim,int nroots,int pad);
|
||||
void FREE_RS(void *p);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_greater_equal
|
||||
#define BOOST_TT_TRAIT_OP >=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
( \
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,331 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// 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_CONTAINER_BASIC_STRING_HPP
|
||||
#define BOOST_COMPUTE_CONTAINER_BASIC_STRING_HPP
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#include <boost/compute/cl.hpp>
|
||||
#include <boost/compute/algorithm/find.hpp>
|
||||
#include <boost/compute/algorithm/search.hpp>
|
||||
#include <boost/compute/container/vector.hpp>
|
||||
#include <boost/compute/system.hpp>
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// \class basic_string
|
||||
/// \brief A template for a dynamically-sized character sequence.
|
||||
///
|
||||
/// The \c basic_string class provides a generic template for a dynamically-
|
||||
/// sized character sequence. This is most commonly used through the \c string
|
||||
/// typedef (for \c basic_string<char>).
|
||||
///
|
||||
/// For example, to create a string on the device with its contents copied
|
||||
/// from a C-string on the host:
|
||||
/// \code
|
||||
/// boost::compute::string str("hello, world!");
|
||||
/// \endcode
|
||||
///
|
||||
/// \see \ref vector "vector<T>"
|
||||
template<class CharT, class Traits = std::char_traits<CharT> >
|
||||
class basic_string
|
||||
{
|
||||
public:
|
||||
typedef Traits traits_type;
|
||||
typedef typename Traits::char_type value_type;
|
||||
typedef size_t size_type;
|
||||
static const size_type npos = size_type(-1);
|
||||
typedef typename ::boost::compute::vector<CharT>::reference reference;
|
||||
typedef typename ::boost::compute::vector<CharT>::const_reference const_reference;
|
||||
typedef typename ::boost::compute::vector<CharT>::iterator iterator;
|
||||
typedef typename ::boost::compute::vector<CharT>::const_iterator const_iterator;
|
||||
typedef typename ::boost::compute::vector<CharT>::reverse_iterator reverse_iterator;
|
||||
typedef typename ::boost::compute::vector<CharT>::const_reverse_iterator const_reverse_iterator;
|
||||
|
||||
basic_string()
|
||||
{
|
||||
}
|
||||
|
||||
basic_string(size_type count, CharT ch)
|
||||
: m_data(count)
|
||||
{
|
||||
std::fill(m_data.begin(), m_data.end(), ch);
|
||||
}
|
||||
|
||||
basic_string(const basic_string &other,
|
||||
size_type pos,
|
||||
size_type count = npos)
|
||||
: m_data(other.begin() + pos,
|
||||
other.begin() + (std::min)(other.size(), count))
|
||||
{
|
||||
}
|
||||
|
||||
basic_string(const char *s, size_type count)
|
||||
: m_data(s, s + count)
|
||||
{
|
||||
}
|
||||
|
||||
basic_string(const char *s)
|
||||
: m_data(s, s + std::strlen(s))
|
||||
{
|
||||
}
|
||||
|
||||
template<class InputIterator>
|
||||
basic_string(InputIterator first, InputIterator last)
|
||||
: m_data(first, last)
|
||||
{
|
||||
}
|
||||
|
||||
basic_string(const basic_string<CharT, Traits> &other)
|
||||
: m_data(other.m_data)
|
||||
{
|
||||
}
|
||||
|
||||
basic_string<CharT, Traits>& operator=(const basic_string<CharT, Traits> &other)
|
||||
{
|
||||
if(this != &other){
|
||||
m_data = other.m_data;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
~basic_string()
|
||||
{
|
||||
}
|
||||
|
||||
reference at(size_type pos)
|
||||
{
|
||||
return m_data.at(pos);
|
||||
}
|
||||
|
||||
const_reference at(size_type pos) const
|
||||
{
|
||||
return m_data.at(pos);
|
||||
}
|
||||
|
||||
reference operator[](size_type pos)
|
||||
{
|
||||
return m_data[pos];
|
||||
}
|
||||
|
||||
const_reference operator[](size_type pos) const
|
||||
{
|
||||
return m_data[pos];
|
||||
}
|
||||
|
||||
reference front()
|
||||
{
|
||||
return m_data.front();
|
||||
}
|
||||
|
||||
const_reference front() const
|
||||
{
|
||||
return m_data.front();
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return m_data.back();
|
||||
}
|
||||
|
||||
const_reference back() const
|
||||
{
|
||||
return m_data.back();
|
||||
}
|
||||
|
||||
iterator begin()
|
||||
{
|
||||
return m_data.begin();
|
||||
}
|
||||
|
||||
const_iterator begin() const
|
||||
{
|
||||
return m_data.begin();
|
||||
}
|
||||
|
||||
const_iterator cbegin() const
|
||||
{
|
||||
return m_data.cbegin();
|
||||
}
|
||||
|
||||
iterator end()
|
||||
{
|
||||
return m_data.end();
|
||||
}
|
||||
|
||||
const_iterator end() const
|
||||
{
|
||||
return m_data.end();
|
||||
}
|
||||
|
||||
const_iterator cend() const
|
||||
{
|
||||
return m_data.cend();
|
||||
}
|
||||
|
||||
reverse_iterator rbegin()
|
||||
{
|
||||
return m_data.rbegin();
|
||||
}
|
||||
|
||||
const_reverse_iterator rbegin() const
|
||||
{
|
||||
return m_data.rbegin();
|
||||
}
|
||||
|
||||
const_reverse_iterator crbegin() const
|
||||
{
|
||||
return m_data.crbegin();
|
||||
}
|
||||
|
||||
reverse_iterator rend()
|
||||
{
|
||||
return m_data.rend();
|
||||
}
|
||||
|
||||
const_reverse_iterator rend() const
|
||||
{
|
||||
return m_data.rend();
|
||||
}
|
||||
|
||||
const_reverse_iterator crend() const
|
||||
{
|
||||
return m_data.crend();
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return m_data.empty();
|
||||
}
|
||||
|
||||
size_type size() const
|
||||
{
|
||||
return m_data.size();
|
||||
}
|
||||
|
||||
size_type length() const
|
||||
{
|
||||
return m_data.size();
|
||||
}
|
||||
|
||||
size_type max_size() const
|
||||
{
|
||||
return m_data.max_size();
|
||||
}
|
||||
|
||||
void reserve(size_type size)
|
||||
{
|
||||
m_data.reserve(size);
|
||||
}
|
||||
|
||||
size_type capacity() const
|
||||
{
|
||||
return m_data.capacity();
|
||||
}
|
||||
|
||||
void shrink_to_fit()
|
||||
{
|
||||
m_data.shrink_to_fit();
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_data.clear();
|
||||
}
|
||||
|
||||
void swap(basic_string<CharT, Traits> &other)
|
||||
{
|
||||
if(this != &other)
|
||||
{
|
||||
::boost::compute::vector<CharT> temp_data(other.m_data);
|
||||
other.m_data = m_data;
|
||||
m_data = temp_data;
|
||||
}
|
||||
}
|
||||
|
||||
basic_string<CharT, Traits> substr(size_type pos = 0,
|
||||
size_type count = npos) const
|
||||
{
|
||||
return basic_string<CharT, Traits>(*this, pos, count);
|
||||
}
|
||||
|
||||
/// Finds the first character \p ch
|
||||
size_type find(CharT ch, size_type pos = 0) const
|
||||
{
|
||||
const_iterator iter = ::boost::compute::find(begin() + pos, end(), ch);
|
||||
if(iter == end()){
|
||||
return npos;
|
||||
}
|
||||
else {
|
||||
return static_cast<size_type>(std::distance(begin(), iter));
|
||||
}
|
||||
}
|
||||
|
||||
/// Finds the first substring equal to \p str
|
||||
size_type find(basic_string& str, size_type pos = 0) const
|
||||
{
|
||||
const_iterator iter = ::boost::compute::search(begin() + pos, end(),
|
||||
str.begin(), str.end());
|
||||
if(iter == end()){
|
||||
return npos;
|
||||
}
|
||||
else {
|
||||
return static_cast<size_type>(std::distance(begin(), iter));
|
||||
}
|
||||
}
|
||||
|
||||
/// Finds the first substring equal to the character string
|
||||
/// pointed to by \p s.
|
||||
/// The length of the string is determined by the first null character.
|
||||
///
|
||||
/// For example, the following code
|
||||
/// \snippet test/test_string.cpp string_find
|
||||
///
|
||||
/// will return 5 as position.
|
||||
size_type find(const char* s, size_type pos = 0) const
|
||||
{
|
||||
basic_string str(s);
|
||||
const_iterator iter = ::boost::compute::search(begin() + pos, end(),
|
||||
str.begin(), str.end());
|
||||
if(iter == end()){
|
||||
return npos;
|
||||
}
|
||||
else {
|
||||
return static_cast<size_type>(std::distance(begin(), iter));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
::boost::compute::vector<CharT> m_data;
|
||||
};
|
||||
|
||||
template<class CharT, class Traits>
|
||||
std::ostream&
|
||||
operator<<(std::ostream& stream,
|
||||
boost::compute::basic_string<CharT, Traits>const& outStr)
|
||||
{
|
||||
command_queue queue = ::boost::compute::system::default_queue();
|
||||
boost::compute::copy(outStr.begin(),
|
||||
outStr.end(),
|
||||
std::ostream_iterator<CharT>(stream),
|
||||
queue);
|
||||
return stream;
|
||||
}
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_CONTAINER_BASIC_STRING_HPP
|
||||
@@ -0,0 +1,43 @@
|
||||
/* DEC.H - Interface to decoding procedures. */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
|
||||
/* DECODING METHOD, ITS PARAMETERS, AND OTHER VARIABLES. The global variables
|
||||
declared here are located in dec.c. */
|
||||
|
||||
typedef enum
|
||||
{ Enum_block, Enum_bit, Prprp
|
||||
} decoding_method;
|
||||
|
||||
extern decoding_method dec_method; /* Decoding method to use */
|
||||
|
||||
extern int ldpc_table; /* Trace option, 2 for a table of decoding details */
|
||||
extern int block_no; /* Number of current block, from zero */
|
||||
|
||||
extern int max_iter; /* Maximum number of iteratons of decoding to do */
|
||||
extern char *gen_file; /* Generator file for Enum_block and Enum_bit */
|
||||
|
||||
|
||||
/* PROCEDURES RELATING TO DECODING METHODS. */
|
||||
|
||||
void enum_decode_setup (void);
|
||||
unsigned enum_decode (double *, char *, double *, int);
|
||||
|
||||
void prprp_decode_setup (void);
|
||||
unsigned prprp_decode
|
||||
(mod2sparse *, double *, char *, char *, double *);
|
||||
|
||||
void initprp (mod2sparse *, double *, char *, double *);
|
||||
void iterprp (mod2sparse *, double *, char *, double *);
|
||||
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=Message Aggregator
|
||||
Comment=Amateur Radio Weak Signal Operating
|
||||
Exec=message_aggregator
|
||||
Icon=wsjtx_icon
|
||||
Terminal=false
|
||||
X-MultipleArgs=false
|
||||
Type=Application
|
||||
Categories=AudioVideo;Audio;HamRadio;
|
||||
StartupNotify=true
|
||||
@@ -0,0 +1,59 @@
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
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(BOOST_FUSION_VECTOR50_FWD_HPP_INCLUDED)
|
||||
#define BOOST_FUSION_VECTOR50_FWD_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/vector/detail/cpp03/preprocessed/vector50_fwd.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/vector50_fwd.hpp")
|
||||
#endif
|
||||
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
// expand vector41 to vector50
|
||||
#define BOOST_PP_FILENAME_1 <boost/fusion/container/vector/detail/cpp03/vector50_fwd.hpp>
|
||||
#define BOOST_PP_ITERATION_LIMITS (41, 50)
|
||||
#include BOOST_PP_ITERATE()
|
||||
}}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename T)>
|
||||
struct BOOST_PP_CAT(vector, BOOST_PP_ITERATION());
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
|
||||
// (C) Copyright Tobias Schwinger
|
||||
//
|
||||
// Use modification and distribution are subject to the boost Software License,
|
||||
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_FT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
||||
#define BOOST_FT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace function_types
|
||||
{
|
||||
template< typename T, typename Tag = null_tag >
|
||||
struct is_member_function_pointer
|
||||
: function_types::represents
|
||||
< function_types::components<T>
|
||||
, function_types::tag<Tag ,detail::member_function_pointer_tag> >
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_member_function_pointer,(T,Tag))
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
0; 0; 0
|
||||
0; 0; 0
|
||||
0; 0; 0
|
||||
0; 0; 0
|
||||
0;255; 0
|
||||
255;255; 0
|
||||
255;255; 0
|
||||
255;255; 0
|
||||
255; 0; 0
|
||||
@@ -0,0 +1,29 @@
|
||||
subroutine wspr5_downsample(iwave,c)
|
||||
|
||||
! Input: i*2 data in iwave() at sample rate 12000 Hz
|
||||
! Output: Complex data in c(), sampled at 400 Hz
|
||||
|
||||
include 'wsprlf_params.f90'
|
||||
parameter (NMAX=300*12000,NFFT2=NMAX/30)
|
||||
integer*2 iwave(NMAX)
|
||||
complex c(0:NZ-1)
|
||||
complex c1(0:NFFT2-1)
|
||||
complex cx(0:NMAX/2)
|
||||
real x(NMAX)
|
||||
equivalence (x,cx)
|
||||
|
||||
df=12000.0/NMAX
|
||||
x=iwave
|
||||
call four2a(x,NMAX,1,-1,0) !r2c FFT to freq domain
|
||||
i0=nint(1500.0/df)
|
||||
c1(0)=cx(i0)
|
||||
do i=1,NFFT2/2
|
||||
c1(i)=cx(i0+i)
|
||||
c1(NFFT2-i)=cx(i0-i)
|
||||
enddo
|
||||
c1=c1/NFFT2
|
||||
call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain
|
||||
c=c1(0:NZ-1)
|
||||
|
||||
return
|
||||
end subroutine wspr5_downsample
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED
|
||||
#define BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <cstddef> // size_t
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct remove_all_extents{ typedef T type; };
|
||||
|
||||
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
||||
template <class T, std::size_t N> struct remove_all_extents<T[N]> : public remove_all_extents<T>{};
|
||||
template <class T, std::size_t N> struct remove_all_extents<T const[N]> : public remove_all_extents<T const>{};
|
||||
template <class T, std::size_t N> struct remove_all_extents<T volatile[N]> : public remove_all_extents<T volatile>{};
|
||||
template <class T, std::size_t N> struct remove_all_extents<T const volatile[N]> : public remove_all_extents<T const volatile>{};
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
|
||||
template <class T> struct remove_all_extents<T[]> : public remove_all_extents<T>{};
|
||||
template <class T> struct remove_all_extents<T const[]> : public remove_all_extents<T const>{};
|
||||
template <class T> struct remove_all_extents<T volatile[]> : public remove_all_extents<T volatile>{};
|
||||
template <class T> struct remove_all_extents<T const volatile[]> : public remove_all_extents<T const volatile>{};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
|
||||
@@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
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_END_IMPL_05062005_1226)
|
||||
#define FUSION_END_IMPL_05062005_1226
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct iterator_range_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<iterator_range_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::end_type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
return s.last;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2015 Jakub Szuppe <j.szuppe@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_ALGORITHM_DETAIL_REDUCE_BY_KEY_HPP
|
||||
#define BOOST_COMPUTE_ALGORITHM_DETAIL_REDUCE_BY_KEY_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/functional.hpp>
|
||||
#include <boost/compute/container/vector.hpp>
|
||||
#include <boost/compute/detail/iterator_range_size.hpp>
|
||||
#include <boost/compute/algorithm/detail/serial_reduce_by_key.hpp>
|
||||
#include <boost/compute/algorithm/detail/reduce_by_key_with_scan.hpp>
|
||||
#include <boost/compute/type_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
namespace detail {
|
||||
|
||||
template<class InputKeyIterator, class InputValueIterator,
|
||||
class OutputKeyIterator, class OutputValueIterator,
|
||||
class BinaryFunction, class BinaryPredicate>
|
||||
size_t reduce_by_key_on_gpu(InputKeyIterator keys_first,
|
||||
InputKeyIterator keys_last,
|
||||
InputValueIterator values_first,
|
||||
OutputKeyIterator keys_result,
|
||||
OutputValueIterator values_result,
|
||||
BinaryFunction function,
|
||||
BinaryPredicate predicate,
|
||||
command_queue &queue)
|
||||
{
|
||||
return detail::reduce_by_key_with_scan(keys_first, keys_last, values_first,
|
||||
keys_result, values_result, function,
|
||||
predicate, queue);
|
||||
}
|
||||
|
||||
template<class InputKeyIterator, class InputValueIterator,
|
||||
class OutputKeyIterator, class OutputValueIterator>
|
||||
bool reduce_by_key_on_gpu_requirements_met(InputKeyIterator keys_first,
|
||||
InputValueIterator values_first,
|
||||
OutputKeyIterator keys_result,
|
||||
OutputValueIterator values_result,
|
||||
const size_t count,
|
||||
command_queue &queue)
|
||||
{
|
||||
const device &device = queue.get_device();
|
||||
return (count > 256)
|
||||
&& !(device.type() & device::cpu)
|
||||
&& reduce_by_key_with_scan_requirements_met(keys_first, values_first,
|
||||
keys_result,values_result,
|
||||
count, queue);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class InputKeyIterator, class InputValueIterator,
|
||||
class OutputKeyIterator, class OutputValueIterator,
|
||||
class BinaryFunction, class BinaryPredicate>
|
||||
inline std::pair<OutputKeyIterator, OutputValueIterator>
|
||||
dispatch_reduce_by_key(InputKeyIterator keys_first,
|
||||
InputKeyIterator keys_last,
|
||||
InputValueIterator values_first,
|
||||
OutputKeyIterator keys_result,
|
||||
OutputValueIterator values_result,
|
||||
BinaryFunction function,
|
||||
BinaryPredicate predicate,
|
||||
command_queue &queue)
|
||||
{
|
||||
typedef typename
|
||||
std::iterator_traits<OutputKeyIterator>::difference_type key_difference_type;
|
||||
typedef typename
|
||||
std::iterator_traits<OutputValueIterator>::difference_type value_difference_type;
|
||||
|
||||
const size_t count = detail::iterator_range_size(keys_first, keys_last);
|
||||
if (count < 2) {
|
||||
boost::compute::copy_n(keys_first, count, keys_result, queue);
|
||||
boost::compute::copy_n(values_first, count, values_result, queue);
|
||||
return
|
||||
std::make_pair<OutputKeyIterator, OutputValueIterator>(
|
||||
keys_result + static_cast<key_difference_type>(count),
|
||||
values_result + static_cast<value_difference_type>(count)
|
||||
);
|
||||
}
|
||||
|
||||
size_t result_size = 0;
|
||||
if(reduce_by_key_on_gpu_requirements_met(keys_first, values_first, keys_result,
|
||||
values_result, count, queue)){
|
||||
result_size =
|
||||
detail::reduce_by_key_on_gpu(keys_first, keys_last, values_first,
|
||||
keys_result, values_result, function,
|
||||
predicate, queue);
|
||||
}
|
||||
else {
|
||||
result_size =
|
||||
detail::serial_reduce_by_key(keys_first, keys_last, values_first,
|
||||
keys_result, values_result, function,
|
||||
predicate, queue);
|
||||
}
|
||||
|
||||
return
|
||||
std::make_pair<OutputKeyIterator, OutputValueIterator>(
|
||||
keys_result + static_cast<key_difference_type>(result_size),
|
||||
values_result + static_cast<value_difference_type>(result_size)
|
||||
);
|
||||
}
|
||||
|
||||
} // end detail namespace
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_ALGORITHM_DETAIL_REDUCE_BY_KEY_HPP
|
||||
@@ -0,0 +1,39 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_FUNCTIONAL_RELATIONAL_HPP
|
||||
#define BOOST_COMPUTE_FUNCTIONAL_RELATIONAL_HPP
|
||||
|
||||
#include <boost/compute/functional/detail/macros.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isequal, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isnotequal, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isgreater, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isgreaterequal, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isless, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(islessequal, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(islessgreater, int (T, T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isfinite, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isinf, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isnan, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isnormal, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isordered, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(isunordered, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(signbit, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(any, int (T), class T)
|
||||
BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(all, int (T), class T)
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_FUNCTIONAL_RELATIONAL_HPP
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -0,0 +1,157 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
// Copyright Jaap Suter 2003
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/bitxor.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<
|
||||
typename Tag1
|
||||
, typename Tag2
|
||||
>
|
||||
struct bitxor_impl
|
||||
: if_c<
|
||||
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
|
||||
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
|
||||
)
|
||||
|
||||
, aux::cast2nd_impl< bitxor_impl< Tag1,Tag1 >,Tag1, Tag2 >
|
||||
, aux::cast1st_impl< bitxor_impl< Tag2,Tag2 >,Tag1, Tag2 >
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
/// for Digital Mars C++/compilers with no CTPS/TTP support
|
||||
template<> struct bitxor_impl< na,na >
|
||||
{
|
||||
template< typename U1, typename U2 > struct apply
|
||||
{
|
||||
typedef apply type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename Tag > struct bitxor_impl< na,Tag >
|
||||
{
|
||||
template< typename U1, typename U2 > struct apply
|
||||
{
|
||||
typedef apply type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename Tag > struct bitxor_impl< Tag,na >
|
||||
{
|
||||
template< typename U1, typename U2 > struct apply
|
||||
{
|
||||
typedef apply type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
};
|
||||
|
||||
template< typename T > struct bitxor_tag
|
||||
{
|
||||
typedef typename T::tag type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename BOOST_MPL_AUX_NA_PARAM(N1)
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
, typename N3 = na, typename N4 = na, typename N5 = na
|
||||
>
|
||||
struct bitxor_
|
||||
: bitxor_< bitxor_< bitxor_< bitxor_< N1,N2 >, N3>, N4>, N5>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(
|
||||
5
|
||||
, bitxor_
|
||||
, ( N1, N2, N3, N4, N5 )
|
||||
)
|
||||
};
|
||||
|
||||
template<
|
||||
typename N1, typename N2, typename N3, typename N4
|
||||
>
|
||||
struct bitxor_< N1,N2,N3,N4,na >
|
||||
|
||||
: bitxor_< bitxor_< bitxor_< N1,N2 >, N3>, N4>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
|
||||
5
|
||||
, bitxor_
|
||||
, ( N1, N2, N3, N4, na )
|
||||
)
|
||||
};
|
||||
|
||||
template<
|
||||
typename N1, typename N2, typename N3
|
||||
>
|
||||
struct bitxor_< N1,N2,N3,na,na >
|
||||
|
||||
: bitxor_< bitxor_< N1,N2 >, N3>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
|
||||
5
|
||||
, bitxor_
|
||||
, ( N1, N2, N3, na, na )
|
||||
)
|
||||
};
|
||||
|
||||
template<
|
||||
typename N1, typename N2
|
||||
>
|
||||
struct bitxor_< N1,N2,na,na,na >
|
||||
: bitxor_impl<
|
||||
typename bitxor_tag<N1>::type
|
||||
, typename bitxor_tag<N2>::type
|
||||
>::template apply< N1,N2 >::type
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
|
||||
5
|
||||
, bitxor_
|
||||
, ( N1, N2, na, na, na )
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_NA_SPEC2(2, 5, bitxor_)
|
||||
|
||||
}}
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
namespace aux {
|
||||
template< typename T, T n1, T n2 >
|
||||
struct bitxor_wknd
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(T, value = (n1 ^ n2));
|
||||
typedef integral_c< T,value > type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct bitxor_impl< integral_c_tag,integral_c_tag >
|
||||
{
|
||||
template< typename N1, typename N2 > struct apply
|
||||
: aux::bitxor_wknd<
|
||||
typename aux::largest_int<
|
||||
typename N1::value_type
|
||||
, typename N2::value_type
|
||||
>::type
|
||||
, N1::value
|
||||
, N2::value
|
||||
>::type
|
||||
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
@@ -0,0 +1,466 @@
|
||||
/* boost random/piecewise_constant_distribution.hpp header file
|
||||
*
|
||||
* Copyright Steven Watanabe 2011
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org for most recent version including documentation.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_HPP_INCLUDED
|
||||
#define BOOST_RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_HPP_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/random/uniform_real.hpp>
|
||||
#include <boost/random/discrete_distribution.hpp>
|
||||
#include <boost/random/detail/config.hpp>
|
||||
#include <boost/random/detail/operators.hpp>
|
||||
#include <boost/random/detail/vector_io.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace random {
|
||||
|
||||
/**
|
||||
* The class @c piecewise_constant_distribution models a \random_distribution.
|
||||
*/
|
||||
template<class RealType = double, class WeightType = double>
|
||||
class piecewise_constant_distribution {
|
||||
public:
|
||||
typedef std::size_t input_type;
|
||||
typedef RealType result_type;
|
||||
|
||||
class param_type {
|
||||
public:
|
||||
|
||||
typedef piecewise_constant_distribution distribution_type;
|
||||
|
||||
/**
|
||||
* Constructs a @c param_type object, representing a distribution
|
||||
* that produces values uniformly distributed in the range [0, 1).
|
||||
*/
|
||||
param_type()
|
||||
{
|
||||
_weights.push_back(WeightType(1));
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
}
|
||||
/**
|
||||
* Constructs a @c param_type object from two iterator ranges
|
||||
* containing the interval boundaries and the interval weights.
|
||||
* If there are less than two boundaries, then this is equivalent to
|
||||
* the default constructor and creates a single interval, [0, 1).
|
||||
*
|
||||
* The values of the interval boundaries must be strictly
|
||||
* increasing, and the number of weights must be one less than
|
||||
* the number of interval boundaries. If there are extra
|
||||
* weights, they are ignored.
|
||||
*/
|
||||
template<class IntervalIter, class WeightIter>
|
||||
param_type(IntervalIter intervals_first, IntervalIter intervals_last,
|
||||
WeightIter weight_first)
|
||||
: _intervals(intervals_first, intervals_last)
|
||||
{
|
||||
if(_intervals.size() < 2) {
|
||||
_intervals.clear();
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
_weights.push_back(WeightType(1));
|
||||
} else {
|
||||
_weights.reserve(_intervals.size() - 1);
|
||||
for(std::size_t i = 0; i < _intervals.size() - 1; ++i) {
|
||||
_weights.push_back(*weight_first++);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
/**
|
||||
* Constructs a @c param_type object from an
|
||||
* initializer_list containing the interval boundaries
|
||||
* and a unary function specifying the weights. Each
|
||||
* weight is determined by calling the function at the
|
||||
* midpoint of the corresponding interval.
|
||||
*
|
||||
* If the initializer_list contains less than two elements,
|
||||
* this is equivalent to the default constructor and the
|
||||
* distribution will produce values uniformly distributed
|
||||
* in the range [0, 1).
|
||||
*/
|
||||
template<class T, class F>
|
||||
param_type(const std::initializer_list<T>& il, F f)
|
||||
: _intervals(il.begin(), il.end())
|
||||
{
|
||||
if(_intervals.size() < 2) {
|
||||
_intervals.clear();
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
_weights.push_back(WeightType(1));
|
||||
} else {
|
||||
_weights.reserve(_intervals.size() - 1);
|
||||
for(std::size_t i = 0; i < _intervals.size() - 1; ++i) {
|
||||
RealType midpoint = (_intervals[i] + _intervals[i + 1]) / 2;
|
||||
_weights.push_back(f(midpoint));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* Constructs a @c param_type object from Boost.Range
|
||||
* ranges holding the interval boundaries and the weights. If
|
||||
* there are less than two interval boundaries, this is equivalent
|
||||
* to the default constructor and the distribution will produce
|
||||
* values uniformly distributed in the range [0, 1). The
|
||||
* number of weights must be one less than the number of
|
||||
* interval boundaries.
|
||||
*/
|
||||
template<class IntervalRange, class WeightRange>
|
||||
param_type(const IntervalRange& intervals_arg,
|
||||
const WeightRange& weights_arg)
|
||||
: _intervals(boost::begin(intervals_arg), boost::end(intervals_arg)),
|
||||
_weights(boost::begin(weights_arg), boost::end(weights_arg))
|
||||
{
|
||||
if(_intervals.size() < 2) {
|
||||
_intervals.clear();
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
_weights.push_back(WeightType(1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the parameters for a distribution that approximates a
|
||||
* function. The range of the distribution is [xmin, xmax). This
|
||||
* range is divided into nw equally sized intervals and the weights
|
||||
* are found by calling the unary function f on the midpoints of the
|
||||
* intervals.
|
||||
*/
|
||||
template<class F>
|
||||
param_type(std::size_t nw, RealType xmin, RealType xmax, F f)
|
||||
{
|
||||
std::size_t n = (nw == 0) ? 1 : nw;
|
||||
double delta = (xmax - xmin) / n;
|
||||
BOOST_ASSERT(delta > 0);
|
||||
for(std::size_t k = 0; k < n; ++k) {
|
||||
_weights.push_back(f(xmin + k*delta + delta/2));
|
||||
_intervals.push_back(xmin + k*delta);
|
||||
}
|
||||
_intervals.push_back(xmax);
|
||||
}
|
||||
|
||||
/** Returns a vector containing the interval boundaries. */
|
||||
std::vector<RealType> intervals() const { return _intervals; }
|
||||
|
||||
/**
|
||||
* Returns a vector containing the probability densities
|
||||
* over all the intervals of the distribution.
|
||||
*/
|
||||
std::vector<RealType> densities() const
|
||||
{
|
||||
RealType sum = std::accumulate(_weights.begin(), _weights.end(),
|
||||
static_cast<RealType>(0));
|
||||
std::vector<RealType> result;
|
||||
result.reserve(_weights.size());
|
||||
for(std::size_t i = 0; i < _weights.size(); ++i) {
|
||||
RealType width = _intervals[i + 1] - _intervals[i];
|
||||
result.push_back(_weights[i] / (sum * width));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Writes the parameters to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm)
|
||||
{
|
||||
detail::print_vector(os, parm._intervals);
|
||||
detail::print_vector(os, parm._weights);
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads the parameters from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm)
|
||||
{
|
||||
std::vector<RealType> new_intervals;
|
||||
std::vector<WeightType> new_weights;
|
||||
detail::read_vector(is, new_intervals);
|
||||
detail::read_vector(is, new_weights);
|
||||
if(is) {
|
||||
parm._intervals.swap(new_intervals);
|
||||
parm._weights.swap(new_weights);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
/** Returns true if the two sets of parameters are the same. */
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs)
|
||||
{
|
||||
return lhs._intervals == rhs._intervals
|
||||
&& lhs._weights == rhs._weights;
|
||||
}
|
||||
/** Returns true if the two sets of parameters are different. */
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type)
|
||||
|
||||
private:
|
||||
|
||||
friend class piecewise_constant_distribution;
|
||||
|
||||
std::vector<RealType> _intervals;
|
||||
std::vector<WeightType> _weights;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new @c piecewise_constant_distribution with
|
||||
* a single interval, [0, 1).
|
||||
*/
|
||||
piecewise_constant_distribution()
|
||||
{
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
}
|
||||
/**
|
||||
* Constructs a piecewise_constant_distribution from two iterator ranges
|
||||
* containing the interval boundaries and the interval weights.
|
||||
* If there are less than two boundaries, then this is equivalent to
|
||||
* the default constructor and creates a single interval, [0, 1).
|
||||
*
|
||||
* The values of the interval boundaries must be strictly
|
||||
* increasing, and the number of weights must be one less than
|
||||
* the number of interval boundaries. If there are extra
|
||||
* weights, they are ignored.
|
||||
*
|
||||
* For example,
|
||||
*
|
||||
* @code
|
||||
* double intervals[] = { 0.0, 1.0, 4.0 };
|
||||
* double weights[] = { 1.0, 1.0 };
|
||||
* piecewise_constant_distribution<> dist(
|
||||
* &intervals[0], &intervals[0] + 3, &weights[0]);
|
||||
* @endcode
|
||||
*
|
||||
* The distribution has a 50% chance of producing a
|
||||
* value between 0 and 1 and a 50% chance of producing
|
||||
* a value between 1 and 4.
|
||||
*/
|
||||
template<class IntervalIter, class WeightIter>
|
||||
piecewise_constant_distribution(IntervalIter first_interval,
|
||||
IntervalIter last_interval,
|
||||
WeightIter first_weight)
|
||||
: _intervals(first_interval, last_interval)
|
||||
{
|
||||
if(_intervals.size() < 2) {
|
||||
_intervals.clear();
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
} else {
|
||||
std::vector<WeightType> actual_weights;
|
||||
actual_weights.reserve(_intervals.size() - 1);
|
||||
for(std::size_t i = 0; i < _intervals.size() - 1; ++i) {
|
||||
actual_weights.push_back(*first_weight++);
|
||||
}
|
||||
typedef discrete_distribution<std::size_t, WeightType> bins_type;
|
||||
typename bins_type::param_type bins_param(actual_weights);
|
||||
_bins.param(bins_param);
|
||||
}
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
/**
|
||||
* Constructs a piecewise_constant_distribution from an
|
||||
* initializer_list containing the interval boundaries
|
||||
* and a unary function specifying the weights. Each
|
||||
* weight is determined by calling the function at the
|
||||
* midpoint of the corresponding interval.
|
||||
*
|
||||
* If the initializer_list contains less than two elements,
|
||||
* this is equivalent to the default constructor and the
|
||||
* distribution will produce values uniformly distributed
|
||||
* in the range [0, 1).
|
||||
*/
|
||||
template<class T, class F>
|
||||
piecewise_constant_distribution(std::initializer_list<T> il, F f)
|
||||
: _intervals(il.begin(), il.end())
|
||||
{
|
||||
if(_intervals.size() < 2) {
|
||||
_intervals.clear();
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
} else {
|
||||
std::vector<WeightType> actual_weights;
|
||||
actual_weights.reserve(_intervals.size() - 1);
|
||||
for(std::size_t i = 0; i < _intervals.size() - 1; ++i) {
|
||||
RealType midpoint = (_intervals[i] + _intervals[i + 1]) / 2;
|
||||
actual_weights.push_back(f(midpoint));
|
||||
}
|
||||
typedef discrete_distribution<std::size_t, WeightType> bins_type;
|
||||
typename bins_type::param_type bins_param(actual_weights);
|
||||
_bins.param(bins_param);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* Constructs a piecewise_constant_distribution from Boost.Range
|
||||
* ranges holding the interval boundaries and the weights. If
|
||||
* there are less than two interval boundaries, this is equivalent
|
||||
* to the default constructor and the distribution will produce
|
||||
* values uniformly distributed in the range [0, 1). The
|
||||
* number of weights must be one less than the number of
|
||||
* interval boundaries.
|
||||
*/
|
||||
template<class IntervalsRange, class WeightsRange>
|
||||
piecewise_constant_distribution(const IntervalsRange& intervals_arg,
|
||||
const WeightsRange& weights_arg)
|
||||
: _bins(weights_arg),
|
||||
_intervals(boost::begin(intervals_arg), boost::end(intervals_arg))
|
||||
{
|
||||
if(_intervals.size() < 2) {
|
||||
_intervals.clear();
|
||||
_intervals.push_back(RealType(0));
|
||||
_intervals.push_back(RealType(1));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Constructs a piecewise_constant_distribution that approximates a
|
||||
* function. The range of the distribution is [xmin, xmax). This
|
||||
* range is divided into nw equally sized intervals and the weights
|
||||
* are found by calling the unary function f on the midpoints of the
|
||||
* intervals.
|
||||
*/
|
||||
template<class F>
|
||||
piecewise_constant_distribution(std::size_t nw,
|
||||
RealType xmin,
|
||||
RealType xmax,
|
||||
F f)
|
||||
: _bins(nw, xmin, xmax, f)
|
||||
{
|
||||
if(nw == 0) { nw = 1; }
|
||||
RealType delta = (xmax - xmin) / nw;
|
||||
_intervals.reserve(nw + 1);
|
||||
for(std::size_t i = 0; i < nw; ++i) {
|
||||
_intervals.push_back(xmin + i * delta);
|
||||
}
|
||||
_intervals.push_back(xmax);
|
||||
}
|
||||
/**
|
||||
* Constructs a piecewise_constant_distribution from its parameters.
|
||||
*/
|
||||
explicit piecewise_constant_distribution(const param_type& parm)
|
||||
: _bins(parm._weights),
|
||||
_intervals(parm._intervals)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a value distributed according to the parameters of the
|
||||
* piecewist_constant_distribution.
|
||||
*/
|
||||
template<class URNG>
|
||||
RealType operator()(URNG& urng) const
|
||||
{
|
||||
std::size_t i = _bins(urng);
|
||||
return uniform_real<RealType>(_intervals[i], _intervals[i+1])(urng);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a value distributed according to the parameters
|
||||
* specified by param.
|
||||
*/
|
||||
template<class URNG>
|
||||
RealType operator()(URNG& urng, const param_type& parm) const
|
||||
{
|
||||
return piecewise_constant_distribution(parm)(urng);
|
||||
}
|
||||
|
||||
/** Returns the smallest value that the distribution can produce. */
|
||||
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{ return _intervals.front(); }
|
||||
/** Returns the largest value that the distribution can produce. */
|
||||
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{ return _intervals.back(); }
|
||||
|
||||
/**
|
||||
* Returns a vector containing the probability density
|
||||
* over each interval.
|
||||
*/
|
||||
std::vector<RealType> densities() const
|
||||
{
|
||||
std::vector<RealType> result(_bins.probabilities());
|
||||
for(std::size_t i = 0; i < result.size(); ++i) {
|
||||
result[i] /= (_intervals[i+1] - _intervals[i]);
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
/** Returns a vector containing the interval boundaries. */
|
||||
std::vector<RealType> intervals() const { return _intervals; }
|
||||
|
||||
/** Returns the parameters of the distribution. */
|
||||
param_type param() const
|
||||
{
|
||||
return param_type(_intervals, _bins.probabilities());
|
||||
}
|
||||
/** Sets the parameters of the distribution. */
|
||||
void param(const param_type& parm)
|
||||
{
|
||||
std::vector<RealType> new_intervals(parm._intervals);
|
||||
typedef discrete_distribution<std::size_t, WeightType> bins_type;
|
||||
typename bins_type::param_type bins_param(parm._weights);
|
||||
_bins.param(bins_param);
|
||||
_intervals.swap(new_intervals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Effects: Subsequent uses of the distribution do not depend
|
||||
* on values produced by any engine prior to invoking reset.
|
||||
*/
|
||||
void reset() { _bins.reset(); }
|
||||
|
||||
/** Writes a distribution to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(
|
||||
os, piecewise_constant_distribution, pcd)
|
||||
{
|
||||
os << pcd.param();
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads a distribution from a @c std::istream */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(
|
||||
is, piecewise_constant_distribution, pcd)
|
||||
{
|
||||
param_type parm;
|
||||
if(is >> parm) {
|
||||
pcd.param(parm);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the two distributions will return the
|
||||
* same sequence of values, when passed equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(
|
||||
piecewise_constant_distribution, lhs, rhs)
|
||||
{
|
||||
return lhs._bins == rhs._bins && lhs._intervals == rhs._intervals;
|
||||
}
|
||||
/**
|
||||
* Returns true if the two distributions may return different
|
||||
* sequences of values, when passed equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(piecewise_constant_distribution)
|
||||
|
||||
private:
|
||||
discrete_distribution<std::size_t, WeightType> _bins;
|
||||
std::vector<RealType> _intervals;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,506 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2005-2013.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/container for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP
|
||||
#define BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/container/detail/config_begin.hpp>
|
||||
#include <boost/container/detail/workaround.hpp>
|
||||
|
||||
#include <boost/container/detail/mpl.hpp>
|
||||
#include <boost/container/detail/type_traits.hpp>
|
||||
#include <boost/container/detail/mpl.hpp>
|
||||
#include <boost/container/detail/std_fwd.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
# include <boost/container/detail/variadic_templates_tools.hpp>
|
||||
#endif
|
||||
#include <boost/move/adl_move_swap.hpp> //swap
|
||||
|
||||
#include <boost/intrusive/detail/minimal_pair_header.hpp> //pair
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include<boost/move/detail/fwd_macros.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace tuples {
|
||||
|
||||
struct null_type;
|
||||
|
||||
} //namespace tuples {
|
||||
} //namespace boost {
|
||||
|
||||
#if defined(BOOST_MSVC) && (_CPPLIB_VER == 520)
|
||||
//MSVC 2010 tuple marker
|
||||
namespace std { namespace tr1 { struct _Nil; }}
|
||||
#elif defined(BOOST_MSVC) && (_CPPLIB_VER == 540)
|
||||
//MSVC 2012 tuple marker
|
||||
namespace std { struct _Nil; }
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace container {
|
||||
|
||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
|
||||
template <int Dummy = 0>
|
||||
struct std_piecewise_construct_holder
|
||||
{
|
||||
static ::std::piecewise_construct_t *dummy;
|
||||
};
|
||||
|
||||
template <int Dummy>
|
||||
::std::piecewise_construct_t *std_piecewise_construct_holder<Dummy>::dummy =
|
||||
reinterpret_cast< ::std::piecewise_construct_t *>(0x01234); //Avoid sanitizer errors on references to null pointers
|
||||
|
||||
typedef const std::piecewise_construct_t & piecewise_construct_t;
|
||||
|
||||
struct try_emplace_t{};
|
||||
|
||||
#else
|
||||
|
||||
//! The piecewise_construct_t struct is an empty structure type used as a unique type to
|
||||
//! disambiguate used to disambiguate between different functions that take two tuple arguments.
|
||||
typedef unspecified piecewise_construct_t;
|
||||
|
||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
|
||||
//! A instance of type
|
||||
//! piecewise_construct_t
|
||||
static piecewise_construct_t piecewise_construct = BOOST_CONTAINER_DOC1ST(unspecified, *std_piecewise_construct_holder<>::dummy);
|
||||
|
||||
///@cond
|
||||
|
||||
namespace container_detail {
|
||||
|
||||
struct piecewise_construct_use
|
||||
{
|
||||
//Avoid warnings of unused "piecewise_construct"
|
||||
piecewise_construct_use()
|
||||
{ (void)&::boost::container::piecewise_construct; }
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct pair;
|
||||
|
||||
template <class T>
|
||||
struct is_pair
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_pair< pair<T1, T2> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_pair< std::pair<T1, T2> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_not_pair
|
||||
{
|
||||
static const bool value = !is_pair<T>::value;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_std_pair
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_std_pair< std::pair<T1, T2> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
struct pair_nat;
|
||||
|
||||
template<typename T, typename U, typename V>
|
||||
void get(T); //to enable ADL
|
||||
|
||||
///@endcond
|
||||
|
||||
template <class T1, class T2>
|
||||
struct pair
|
||||
{
|
||||
private:
|
||||
BOOST_COPYABLE_AND_MOVABLE(pair)
|
||||
|
||||
public:
|
||||
typedef T1 first_type;
|
||||
typedef T2 second_type;
|
||||
|
||||
T1 first;
|
||||
T2 second;
|
||||
|
||||
//Default constructor
|
||||
pair()
|
||||
: first(), second()
|
||||
{}
|
||||
|
||||
//pair copy assignment
|
||||
pair(const pair& x)
|
||||
: first(x.first), second(x.second)
|
||||
{}
|
||||
|
||||
//pair move constructor
|
||||
pair(BOOST_RV_REF(pair) p)
|
||||
: first(::boost::move(p.first)), second(::boost::move(p.second))
|
||||
{}
|
||||
|
||||
template <class D, class S>
|
||||
pair(const pair<D, S> &p)
|
||||
: first(p.first), second(p.second)
|
||||
{}
|
||||
|
||||
template <class D, class S>
|
||||
pair(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
|
||||
: first(::boost::move(p.first)), second(::boost::move(p.second))
|
||||
{}
|
||||
|
||||
//pair from two values
|
||||
pair(const T1 &t1, const T2 &t2)
|
||||
: first(t1)
|
||||
, second(t2)
|
||||
{}
|
||||
|
||||
template<class U, class V>
|
||||
pair(BOOST_FWD_REF(U) u, BOOST_FWD_REF(V) v)
|
||||
: first(::boost::forward<U>(u))
|
||||
, second(::boost::forward<V>(v))
|
||||
{}
|
||||
|
||||
//And now compatibility with std::pair
|
||||
pair(const std::pair<T1, T2>& x)
|
||||
: first(x.first), second(x.second)
|
||||
{}
|
||||
|
||||
template <class D, class S>
|
||||
pair(const std::pair<D, S>& p)
|
||||
: first(p.first), second(p.second)
|
||||
{}
|
||||
|
||||
pair(BOOST_RV_REF_BEG std::pair<T1, T2> BOOST_RV_REF_END p)
|
||||
: first(::boost::move(p.first)), second(::boost::move(p.second))
|
||||
{}
|
||||
|
||||
template <class D, class S>
|
||||
pair(BOOST_RV_REF_BEG std::pair<D, S> BOOST_RV_REF_END p)
|
||||
: first(::boost::move(p.first)), second(::boost::move(p.second))
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template< class KeyType, class ...Args>
|
||||
pair(try_emplace_t, BOOST_FWD_REF(KeyType) k, Args && ...args)
|
||||
: first(boost::forward<KeyType>(k)), second(::boost::forward<Args>(args)...)\
|
||||
{}
|
||||
#else
|
||||
|
||||
//piecewise construction from boost::tuple
|
||||
#define BOOST_PAIR_TRY_EMPLACE_CONSTRUCT_CODE(N)\
|
||||
template< class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N > \
|
||||
pair( try_emplace_t, BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N )\
|
||||
: first(boost::forward<KeyType>(k)), second(BOOST_MOVE_FWD##N)\
|
||||
{}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_PAIR_TRY_EMPLACE_CONSTRUCT_CODE)
|
||||
#undef BOOST_PAIR_TRY_EMPLACE_CONSTRUCT_CODE
|
||||
|
||||
#endif //BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
|
||||
//piecewise construction from boost::tuple
|
||||
#define BOOST_PAIR_PIECEWISE_CONSTRUCT_BOOST_TUPLE_CODE(N,M)\
|
||||
template< template<class, class, class, class, class, class, class, class, class, class> class BoostTuple \
|
||||
BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
|
||||
pair( piecewise_construct_t\
|
||||
, BoostTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::boost::tuples::null_type)> p\
|
||||
, BoostTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::boost::tuples::null_type)> q)\
|
||||
: first(BOOST_MOVE_TMPL_GET##N), second(BOOST_MOVE_TMPL_GETQ##M)\
|
||||
{ (void)p; (void)q; }\
|
||||
//
|
||||
BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_PAIR_PIECEWISE_CONSTRUCT_BOOST_TUPLE_CODE)
|
||||
#undef BOOST_PAIR_PIECEWISE_CONSTRUCT_BOOST_TUPLE_CODE
|
||||
|
||||
//piecewise construction from variadic tuple (with delegating constructors)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
# if !defined(BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS)
|
||||
private:
|
||||
template<template<class ...> class Tuple, class... Args1, class... Args2, size_t... Indexes1, size_t... Indexes2>
|
||||
pair(Tuple<Args1...>& t1, Tuple<Args2...>& t2, index_tuple<Indexes1...>, index_tuple<Indexes2...>)
|
||||
: first (::boost::forward<Args1>(get<Indexes1>(t1))...)
|
||||
, second(::boost::forward<Args2>(get<Indexes2>(t2))...)
|
||||
{ (void) t1; (void)t2; }
|
||||
|
||||
public:
|
||||
template<template<class ...> class Tuple, class... Args1, class... Args2>
|
||||
pair(piecewise_construct_t, Tuple<Args1...> t1, Tuple<Args2...> t2)
|
||||
: pair(t1, t2, typename build_number_seq<sizeof...(Args1)>::type(), typename build_number_seq<sizeof...(Args2)>::type())
|
||||
{}
|
||||
# else
|
||||
//piecewise construction from variadic tuple (suboptimal, without delegating constructors)
|
||||
private:
|
||||
template<typename T, template<class ...> class Tuple, typename... Args>
|
||||
static T build_from_args(Tuple<Args...>&& t)
|
||||
{ return do_build_from_args<T>(::boost::move(t), typename build_number_seq<sizeof...(Args)>::type()); }
|
||||
|
||||
template<typename T, template<class ...> class Tuple, typename... Args, std::size_t... Indexes>
|
||||
static T do_build_from_args(Tuple<Args...> && t, const index_tuple<Indexes...>&)
|
||||
{ (void)t; return T(::boost::forward<Args>(get<Indexes>(t))...); }
|
||||
|
||||
public:
|
||||
template<template<class ...> class Tuple, class... Args1, class... Args2>
|
||||
pair(piecewise_construct_t, Tuple<Args1...> t1, Tuple<Args2...> t2)
|
||||
: first (build_from_args<first_type> (::boost::move(t1)))
|
||||
, second (build_from_args<second_type>(::boost::move(t2)))
|
||||
{}
|
||||
# endif //BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#elif defined(BOOST_MSVC) && (_CPPLIB_VER == 520)
|
||||
//MSVC 2010 tuple implementation
|
||||
#define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE(N,M)\
|
||||
template< template<class, class, class, class, class, class, class, class, class, class> class StdTuple \
|
||||
BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
|
||||
pair( piecewise_construct_t\
|
||||
, StdTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::std::tr1::_Nil)> p\
|
||||
, StdTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::std::tr1::_Nil)> q)\
|
||||
: first(BOOST_MOVE_GET_IDX##N), second(BOOST_MOVE_GET_IDXQ##M)\
|
||||
{ (void)p; (void)q; }\
|
||||
//
|
||||
BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE)
|
||||
#undef BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE
|
||||
#elif defined(BOOST_MSVC) && (_CPPLIB_VER == 540)
|
||||
#if _VARIADIC_MAX >= 9
|
||||
#define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT 9
|
||||
#else
|
||||
#define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT BOOST_MOVE_ADD(_VARIADIC_MAX, 1)
|
||||
#endif
|
||||
|
||||
//MSVC 2012 tuple implementation
|
||||
#define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_CODE(N,M)\
|
||||
template< template<BOOST_MOVE_REPEAT(_VARIADIC_MAX, class), class, class, class> class StdTuple \
|
||||
BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
|
||||
pair( piecewise_construct_t\
|
||||
, StdTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(BOOST_MOVE_ADD(_VARIADIC_MAX, 3),N),::std::_Nil) > p\
|
||||
, StdTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(BOOST_MOVE_ADD(_VARIADIC_MAX, 3),M),::std::_Nil) > q)\
|
||||
: first(BOOST_MOVE_GET_IDX##N), second(BOOST_MOVE_GET_IDXQ##M)\
|
||||
{ (void)p; (void)q; }\
|
||||
//
|
||||
BOOST_MOVE_ITER2D_0TOMAX(BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT, BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_CODE)
|
||||
#undef BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE
|
||||
#undef BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT
|
||||
#endif
|
||||
|
||||
//pair copy assignment
|
||||
pair& operator=(BOOST_COPY_ASSIGN_REF(pair) p)
|
||||
{
|
||||
first = p.first;
|
||||
second = p.second;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//pair move assignment
|
||||
pair& operator=(BOOST_RV_REF(pair) p)
|
||||
{
|
||||
first = ::boost::move(p.first);
|
||||
second = ::boost::move(p.second);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class D, class S>
|
||||
typename ::boost::container::container_detail::disable_if_or
|
||||
< pair &
|
||||
, ::boost::container::container_detail::is_same<T1, D>
|
||||
, ::boost::container::container_detail::is_same<T2, S>
|
||||
>::type
|
||||
operator=(const pair<D, S>&p)
|
||||
{
|
||||
first = p.first;
|
||||
second = p.second;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class D, class S>
|
||||
typename ::boost::container::container_detail::disable_if_or
|
||||
< pair &
|
||||
, ::boost::container::container_detail::is_same<T1, D>
|
||||
, ::boost::container::container_detail::is_same<T2, S>
|
||||
>::type
|
||||
operator=(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
|
||||
{
|
||||
first = ::boost::move(p.first);
|
||||
second = ::boost::move(p.second);
|
||||
return *this;
|
||||
}
|
||||
//std::pair copy assignment
|
||||
pair& operator=(const std::pair<T1, T2> &p)
|
||||
{
|
||||
first = p.first;
|
||||
second = p.second;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class D, class S>
|
||||
pair& operator=(const std::pair<D, S> &p)
|
||||
{
|
||||
first = ::boost::move(p.first);
|
||||
second = ::boost::move(p.second);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//std::pair move assignment
|
||||
pair& operator=(BOOST_RV_REF_BEG std::pair<T1, T2> BOOST_RV_REF_END p)
|
||||
{
|
||||
first = ::boost::move(p.first);
|
||||
second = ::boost::move(p.second);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class D, class S>
|
||||
pair& operator=(BOOST_RV_REF_BEG std::pair<D, S> BOOST_RV_REF_END p)
|
||||
{
|
||||
first = ::boost::move(p.first);
|
||||
second = ::boost::move(p.second);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//swap
|
||||
void swap(pair& p)
|
||||
{
|
||||
::boost::adl_move_swap(this->first, p.first);
|
||||
::boost::adl_move_swap(this->second, p.second);
|
||||
}
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
inline bool operator==(const pair<T1,T2>& x, const pair<T1,T2>& y)
|
||||
{ return static_cast<bool>(x.first == y.first && x.second == y.second); }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline bool operator< (const pair<T1,T2>& x, const pair<T1,T2>& y)
|
||||
{ return static_cast<bool>(x.first < y.first ||
|
||||
(!(y.first < x.first) && x.second < y.second)); }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline bool operator!=(const pair<T1,T2>& x, const pair<T1,T2>& y)
|
||||
{ return static_cast<bool>(!(x == y)); }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline bool operator> (const pair<T1,T2>& x, const pair<T1,T2>& y)
|
||||
{ return y < x; }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline bool operator>=(const pair<T1,T2>& x, const pair<T1,T2>& y)
|
||||
{ return static_cast<bool>(!(x < y)); }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline bool operator<=(const pair<T1,T2>& x, const pair<T1,T2>& y)
|
||||
{ return static_cast<bool>(!(y < x)); }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline pair<T1, T2> make_pair(T1 x, T2 y)
|
||||
{ return pair<T1, T2>(x, y); }
|
||||
|
||||
template <class T1, class T2>
|
||||
inline void swap(pair<T1, T2>& x, pair<T1, T2>& y)
|
||||
{ x.swap(y); }
|
||||
|
||||
} //namespace container_detail {
|
||||
} //namespace container {
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
template<class T1, class T2>
|
||||
struct has_move_emulation_enabled< ::boost::container::container_detail::pair<T1, T2> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
namespace move_detail{
|
||||
|
||||
template<class T>
|
||||
struct is_class_or_union;
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_class_or_union< ::boost::container::container_detail::pair<T1, T2> >
|
||||
//This specialization is needed to avoid instantiation of pair in
|
||||
//is_class, and allow recursive maps.
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_class_or_union< std::pair<T1, T2> >
|
||||
//This specialization is needed to avoid instantiation of pair in
|
||||
//is_class, and allow recursive maps.
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct is_union;
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_union< ::boost::container::container_detail::pair<T1, T2> >
|
||||
//This specialization is needed to avoid instantiation of pair in
|
||||
//is_class, and allow recursive maps.
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_union< std::pair<T1, T2> >
|
||||
//This specialization is needed to avoid instantiation of pair in
|
||||
//is_class, and allow recursive maps.
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct is_class;
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_class< ::boost::container::container_detail::pair<T1, T2> >
|
||||
//This specialization is needed to avoid instantiation of pair in
|
||||
//is_class, and allow recursive maps.
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <class T1, class T2>
|
||||
struct is_class< std::pair<T1, T2> >
|
||||
//This specialization is needed to avoid instantiation of pair in
|
||||
//is_class, and allow recursive maps.
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
} //namespace move_detail{
|
||||
|
||||
} //namespace boost {
|
||||
|
||||
#include <boost/container/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_CONTAINER_DETAIL_PAIR_HPP
|
||||
@@ -0,0 +1,70 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2014-2015 Kohei Takahashi
|
||||
|
||||
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 FUSION_AS_VECTOR_11052014_1801
|
||||
#define FUSION_AS_VECTOR_11052014_1801
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/vector/detail/config.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Without variadics, we will use the PP version
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# include <boost/fusion/container/vector/detail/cpp03/as_vector.hpp>
|
||||
#else
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/fusion/support/detail/index_sequence.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
BOOST_FUSION_BARRIER_BEGIN
|
||||
|
||||
template <typename Indices>
|
||||
struct as_vector_impl;
|
||||
|
||||
template <std::size_t ...Indices>
|
||||
struct as_vector_impl<index_sequence<Indices...> >
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef vector<
|
||||
typename result_of::value_of<
|
||||
typename result_of::advance_c<Iterator, Indices>::type
|
||||
>::type...
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static typename apply<Iterator>::type
|
||||
call(Iterator i)
|
||||
{
|
||||
typedef typename apply<Iterator>::type result;
|
||||
return result(*advance_c<Indices>(i)...);
|
||||
}
|
||||
};
|
||||
|
||||
template <int size>
|
||||
struct as_vector
|
||||
: as_vector_impl<typename make_index_sequence<size>::type> {};
|
||||
|
||||
BOOST_FUSION_BARRIER_END
|
||||
}}}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Eric Niebler
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
Copyright (c) 2014 John Fletcher
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PHOENIX_CORE_ASSIGN_HPP
|
||||
#define BOOST_PHOENIX_CORE_ASSIGN_HPP
|
||||
|
||||
#define BOOST_PHOENIX_ACTOR_ASSIGN_CHILD(N) \
|
||||
assign( \
|
||||
proto::_child_c<N> \
|
||||
, proto::call< \
|
||||
proto::_child_c<N>(proto::_state) \
|
||||
> \
|
||||
) \
|
||||
/**/
|
||||
#define BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD(Z, N, D) \
|
||||
proto::and_< \
|
||||
BOOST_PHOENIX_ACTOR_ASSIGN_CHILD(N) \
|
||||
/**/
|
||||
#define BOOST_PHOENIX_ACTOR_END_ASSIGN(Z, N, D) \
|
||||
> \
|
||||
/**/
|
||||
#define BOOST_PHOENIX_ACTOR_ASSIGN_CALL(N) \
|
||||
proto::when< \
|
||||
proto::nary_expr<proto::_ , \
|
||||
BOOST_PP_ENUM_PARAMS(N, proto::_ BOOST_PP_INTERCEPT) \
|
||||
> \
|
||||
, BOOST_PP_ENUM( \
|
||||
N \
|
||||
, BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD \
|
||||
, _ \
|
||||
) \
|
||||
BOOST_PP_REPEAT( \
|
||||
N \
|
||||
, BOOST_PHOENIX_ACTOR_END_ASSIGN \
|
||||
, _ \
|
||||
) \
|
||||
> \
|
||||
/**/
|
||||
#define BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL(Z, N, D) \
|
||||
proto::or_< \
|
||||
BOOST_PHOENIX_ACTOR_ASSIGN_CALL(N) \
|
||||
/**/
|
||||
|
||||
#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/phoenix/core/detail/cpp03/preprocessed/assign.hpp>
|
||||
#else
|
||||
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/assign_" BOOST_PHOENIX_LIMIT_STR ".hpp")
|
||||
#endif
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010-2011 Thomas Heller
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
struct assign
|
||||
: BOOST_PP_ENUM_SHIFTED(
|
||||
BOOST_PHOENIX_LIMIT
|
||||
, BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL
|
||||
, _
|
||||
)
|
||||
, proto::when<
|
||||
proto::terminal<proto::_>
|
||||
, do_assign(proto::_, proto::_state)
|
||||
>
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_PP_DEC(BOOST_PHOENIX_LIMIT)
|
||||
, BOOST_PHOENIX_ACTOR_END_ASSIGN
|
||||
, _
|
||||
)
|
||||
{};
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#undef BOOST_PHOENIX_ACTOR_ASSIGN_CALL
|
||||
#undef BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL
|
||||
#undef BOOST_PHOENIX_ACTOR_END_ASSIGN_CALL
|
||||
#undef BOOST_PHOENIX_ACTOR_ASSIGN_CHILD
|
||||
#undef BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD
|
||||
#undef BOOST_PHOENIX_ACTOR_END_ASSIGN_CHILD
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_FUNCTIONAL_FIELD_HPP
|
||||
#define BOOST_COMPUTE_FUNCTIONAL_FIELD_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
namespace detail {
|
||||
|
||||
template<class T, class Arg>
|
||||
struct invoked_field
|
||||
{
|
||||
typedef T result_type;
|
||||
|
||||
invoked_field(const Arg &arg, const std::string &field)
|
||||
: m_arg(arg),
|
||||
m_field(field)
|
||||
{
|
||||
}
|
||||
|
||||
Arg m_arg;
|
||||
std::string m_field;
|
||||
};
|
||||
|
||||
} // end detail namespace
|
||||
|
||||
/// Returns the named field from a value.
|
||||
///
|
||||
/// The template-type \c T specifies the field's value type. Note
|
||||
/// that the value type must match the actual type of the field
|
||||
/// otherwise runtime compilation or logic errors may occur.
|
||||
///
|
||||
/// For example, to access the \c second field in a
|
||||
/// \c std::pair<int, float> object:
|
||||
/// \code
|
||||
/// field<float>("second");
|
||||
/// \endcode
|
||||
///
|
||||
/// This can also be used with vector types to access individual
|
||||
/// components as well as perform swizzle operations.
|
||||
///
|
||||
/// For example, to access the first and third components of an
|
||||
/// \c int vector type (e.g. \c int4):
|
||||
/// \code
|
||||
/// field<int2_>("xz");
|
||||
/// \endcode
|
||||
///
|
||||
/// \see \ref get "get<N>"
|
||||
template<class T>
|
||||
class field
|
||||
{
|
||||
public:
|
||||
/// Result type.
|
||||
typedef T result_type;
|
||||
|
||||
/// Creates a new field functor with \p field.
|
||||
field(const std::string &field)
|
||||
: m_field(field)
|
||||
{
|
||||
}
|
||||
|
||||
/// \internal_
|
||||
template<class Arg>
|
||||
detail::invoked_field<T, Arg> operator()(const Arg &arg) const
|
||||
{
|
||||
return detail::invoked_field<T, Arg>(arg, m_field);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_field;
|
||||
};
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_FUNCTIONAL_FIELD_HPP
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/derived_dimension.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
#include <boost/units/physical_dimensions/current.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// derived dimension for reluctance : L^-2 M^-1 T^2 I^2
|
||||
typedef derived_dimension<length_base_dimension,-2,
|
||||
mass_base_dimension,-1,
|
||||
time_base_dimension,2,
|
||||
current_base_dimension,2>::type reluctance_dimension;
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP
|
||||
@@ -0,0 +1,35 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_LENGTH_HPP
|
||||
#define BOOST_UNITS_SI_LENGTH_HPP
|
||||
|
||||
#include <boost/units/systems/si/base.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
typedef unit<length_dimension,si::system> length;
|
||||
|
||||
BOOST_UNITS_STATIC_CONSTANT(meter,length);
|
||||
BOOST_UNITS_STATIC_CONSTANT(meters,length);
|
||||
BOOST_UNITS_STATIC_CONSTANT(metre,length);
|
||||
BOOST_UNITS_STATIC_CONSTANT(metres,length);
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_SI_LENGTH_HPP
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright David Abrahams 2001.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef MODULE_DWA2001128_HPP
|
||||
# define MODULE_DWA2001128_HPP
|
||||
|
||||
# include <boost/python/detail/prefix.hpp>
|
||||
|
||||
# include <boost/python/module_init.hpp>
|
||||
# define BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE_INIT
|
||||
|
||||
#endif // MODULE_DWA20011221_HPP
|
||||
@@ -0,0 +1,81 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2003 Joel de Guzman
|
||||
Copyright (c) 2002-2003 Hartmut Kaiser
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_MINIMAL_DEBUG_HPP)
|
||||
#define BOOST_SPIRIT_MINIMAL_DEBUG_HPP
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP)
|
||||
#error "You must include boost/spirit/debug.hpp, not boost/spirit/debug/minimal.hpp"
|
||||
#endif
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Minimum debugging tools support
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_OUT)
|
||||
#define BOOST_SPIRIT_DEBUG_OUT std::cout
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BOOST_SPIRIT_DEBUG_FLAGS controls the level of diagnostics printed
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_NONE)
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_NONE 0x0000 // no diagnostics at all
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_MAX)
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_MAX 0xFFFF // print maximal diagnostics
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS)
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS BOOST_SPIRIT_DEBUG_FLAGS_MAX
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_PRINT_SOME)
|
||||
#define BOOST_SPIRIT_DEBUG_PRINT_SOME 20
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_RULE)
|
||||
#define BOOST_SPIRIT_DEBUG_RULE(r)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_RULE)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_NODE)
|
||||
#define BOOST_SPIRIT_DEBUG_NODE(r)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_NODE)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_GRAMMAR)
|
||||
#define BOOST_SPIRIT_DEBUG_GRAMMAR(r)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_GRAMMAR)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE)
|
||||
#define BOOST_SPIRIT_DEBUG_TRACE_RULE(r, t)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE)
|
||||
#define BOOST_SPIRIT_DEBUG_TRACE_NODE(r, t)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR)
|
||||
#define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR(r, t)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME)
|
||||
#define BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME(r, n, t)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME)
|
||||
#define BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME(r, n, t)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME)
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME)
|
||||
#define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(r, n, t)
|
||||
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME)
|
||||
|
||||
#endif // !defined(BOOST_SPIRIT_MINIMAL_DEBUG_HPP)
|
||||
Reference in New Issue
Block a user