Initial Commit
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/algebra/multi_array_algebra.hpp
|
||||
|
||||
[begin_description]
|
||||
tba.
|
||||
[end_description]
|
||||
|
||||
Copyright 2009-2012 Karsten Ahnert
|
||||
Copyright 2009-2012 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_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED
|
||||
#define BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED
|
||||
|
||||
|
||||
#include <boost/numeric/odeint/algebra/detail/for_each.hpp>
|
||||
#include <boost/numeric/odeint/algebra/detail/norm_inf.hpp>
|
||||
#include <boost/numeric/odeint/algebra/norm_result_type.hpp>
|
||||
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
// not ready
|
||||
struct multi_array_algebra
|
||||
{
|
||||
template< class S1 , class Op >
|
||||
static void for_each1( S1 &s1 , Op op )
|
||||
{
|
||||
detail::for_each1( s1.data() , s1.data() + s1.num_elements() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class Op >
|
||||
static void for_each2( S1 &s1 , S2 &s2 , Op op )
|
||||
{
|
||||
detail::for_each2( s1.data() , s1.data() + s1.num_elements() , s2.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class Op >
|
||||
static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
|
||||
{
|
||||
detail::for_each3( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class Op >
|
||||
static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op )
|
||||
{
|
||||
detail::for_each4( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
|
||||
static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op )
|
||||
{
|
||||
detail::for_each5( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
|
||||
static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op )
|
||||
{
|
||||
detail::for_each6( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op >
|
||||
static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op )
|
||||
{
|
||||
detail::for_each7( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op >
|
||||
static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op )
|
||||
{
|
||||
detail::for_each8( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class Op >
|
||||
static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op )
|
||||
{
|
||||
detail::for_each9( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class Op >
|
||||
static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op )
|
||||
{
|
||||
detail::for_each10( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class Op >
|
||||
static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op )
|
||||
{
|
||||
detail::for_each11( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op >
|
||||
static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op )
|
||||
{
|
||||
detail::for_each12( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op >
|
||||
static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op )
|
||||
{
|
||||
detail::for_each13( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , s13.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op >
|
||||
static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op )
|
||||
{
|
||||
detail::for_each14( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , s13.data() , s14.data() , op );
|
||||
}
|
||||
|
||||
template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op >
|
||||
static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op )
|
||||
{
|
||||
detail::for_each15( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , s13.data() , s14.data() , s15.data() , op );
|
||||
}
|
||||
|
||||
template< typename S >
|
||||
static typename norm_result_type<S>::type norm_inf( const S &s )
|
||||
{
|
||||
return detail::norm_inf( s.data() , s.data() + s.num_elements() , static_cast< typename norm_result_type<S>::type >( 0 ) );
|
||||
}
|
||||
};
|
||||
|
||||
// template< class T , size_t N >
|
||||
// struct algebra_dispatcher< boost::array< T , N > >
|
||||
// {
|
||||
// typedef array_algebra algebra_type;
|
||||
// };
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2005
|
||||
* John Maddock
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_workarounds.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares Misc workarounds.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_WORKAROUND_HPP
|
||||
#define BOOST_REGEX_WORKAROUND_HPP
|
||||
|
||||
|
||||
#include <new>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <climits>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include <iosfwd>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/mpl/bool_fwd.hpp>
|
||||
#include <boost/regex/config.hpp>
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
# include <locale>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::sprintf; using ::strcpy; using ::strcat; using ::strlen;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
#ifdef BOOST_NO_STD_DISTANCE
|
||||
template <class T>
|
||||
std::ptrdiff_t distance(const T& x, const T& y)
|
||||
{ return y - x; }
|
||||
#else
|
||||
using std::distance;
|
||||
#endif
|
||||
}}
|
||||
|
||||
|
||||
#ifdef BOOST_REGEX_NO_BOOL
|
||||
# define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>((x) ? true : false)
|
||||
#else
|
||||
# define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>(x)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Fix broken namespace support:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
|
||||
|
||||
namespace std{
|
||||
using ::ptrdiff_t;
|
||||
using ::size_t;
|
||||
using ::abs;
|
||||
using ::memset;
|
||||
using ::memcpy;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* helper functions pointer_construct/pointer_destroy:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4100)
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline void pointer_destroy(T* p)
|
||||
{ p->~T(); (void)p; }
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline void pointer_construct(T* p, const T& t)
|
||||
{ new (p) T(t); }
|
||||
|
||||
}} // namespaces
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* helper function copy:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
||||
//
|
||||
// MSVC 8 will either emit warnings or else refuse to compile
|
||||
// code that makes perfectly legitimate use of std::copy, when
|
||||
// the OutputIterator type is a user-defined class (apparently all user
|
||||
// defined iterators are "unsafe"). This code works around that:
|
||||
//
|
||||
template<class InputIterator, class OutputIterator>
|
||||
inline OutputIterator copy(
|
||||
InputIterator first,
|
||||
InputIterator last,
|
||||
OutputIterator dest
|
||||
)
|
||||
{
|
||||
return stdext::unchecked_copy(first, last, dest);
|
||||
}
|
||||
template<class InputIterator1, class InputIterator2>
|
||||
inline bool equal(
|
||||
InputIterator1 first,
|
||||
InputIterator1 last,
|
||||
InputIterator2 with
|
||||
)
|
||||
{
|
||||
return stdext::unchecked_equal(first, last, with);
|
||||
}
|
||||
#elif BOOST_WORKAROUND(BOOST_MSVC, > 1500)
|
||||
//
|
||||
// MSVC 10 will either emit warnings or else refuse to compile
|
||||
// code that makes perfectly legitimate use of std::copy, when
|
||||
// the OutputIterator type is a user-defined class (apparently all user
|
||||
// defined iterators are "unsafe"). What's more Microsoft have removed their
|
||||
// non-standard "unchecked" versions, even though their still in the MS
|
||||
// documentation!! Work around this as best we can:
|
||||
//
|
||||
template<class InputIterator, class OutputIterator>
|
||||
inline OutputIterator copy(
|
||||
InputIterator first,
|
||||
InputIterator last,
|
||||
OutputIterator dest
|
||||
)
|
||||
{
|
||||
while(first != last)
|
||||
*dest++ = *first++;
|
||||
return dest;
|
||||
}
|
||||
template<class InputIterator1, class InputIterator2>
|
||||
inline bool equal(
|
||||
InputIterator1 first,
|
||||
InputIterator1 last,
|
||||
InputIterator2 with
|
||||
)
|
||||
{
|
||||
while(first != last)
|
||||
if(*first++ != *with++) return false;
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
using std::copy;
|
||||
using std::equal;
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__
|
||||
|
||||
// use safe versions of strcpy etc:
|
||||
using ::strcpy_s;
|
||||
using ::strcat_s;
|
||||
#else
|
||||
inline std::size_t strcpy_s(
|
||||
char *strDestination,
|
||||
std::size_t sizeInBytes,
|
||||
const char *strSource
|
||||
)
|
||||
{
|
||||
if(std::strlen(strSource)+1 > sizeInBytes)
|
||||
return 1;
|
||||
std::strcpy(strDestination, strSource);
|
||||
return 0;
|
||||
}
|
||||
inline std::size_t strcat_s(
|
||||
char *strDestination,
|
||||
std::size_t sizeInBytes,
|
||||
const char *strSource
|
||||
)
|
||||
{
|
||||
if(std::strlen(strSource) + std::strlen(strDestination) + 1 > sizeInBytes)
|
||||
return 1;
|
||||
std::strcat(strDestination, strSource);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline void overflow_error_if_not_zero(std::size_t i)
|
||||
{
|
||||
if(i)
|
||||
{
|
||||
std::overflow_error e("String buffer too small");
|
||||
boost::throw_exception(e);
|
||||
}
|
||||
}
|
||||
|
||||
}} // namespaces
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
#ifndef BOOST_MPL_MAP_AUX_EMPTY_IMPL_HPP_INCLUDED
|
||||
#define BOOST_MPL_MAP_AUX_EMPTY_IMPL_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/empty_fwd.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/mpl/map/aux_/tag.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct empty_impl< aux::map_tag >
|
||||
{
|
||||
template< typename Map > struct apply
|
||||
: not_< typename Map::size >
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_MAP_AUX_EMPTY_IMPL_HPP_INCLUDED
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2011-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_PREDEF_OS_VMS_H
|
||||
#define BOOST_PREDEF_OS_VMS_H
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_OS_VMS`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/Vms VMS] operating system.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`VMS`] [__predef_detection__]]
|
||||
[[`__VMS`] [__predef_detection__]]
|
||||
|
||||
[[`__VMS_VER`] [V.R.P]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_OS_VMS BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
|
||||
defined(VMS) || defined(__VMS) \
|
||||
)
|
||||
# undef BOOST_OS_VMS
|
||||
# if defined(__VMS_VER)
|
||||
# define BOOST_OS_VMS BOOST_PREDEF_MAKE_10_VVRR00PP00(__VMS_VER)
|
||||
# else
|
||||
# define BOOST_OS_VMS BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BOOST_OS_VMS
|
||||
# define BOOST_OS_VMS_AVAILABLE
|
||||
# include <boost/predef/detail/os_detected.h>
|
||||
#endif
|
||||
|
||||
#define BOOST_OS_VMS_NAME "VMS"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_VMS,BOOST_OS_VMS_NAME)
|
||||
@@ -0,0 +1,135 @@
|
||||
#include "BeaconsModel.hpp"
|
||||
|
||||
#include <QStandardItem>
|
||||
#include <QFont>
|
||||
|
||||
namespace
|
||||
{
|
||||
char const * const headings[] = {
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Client"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Time"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Snr"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "DT"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Frequency"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Drift"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Grid"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Power"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Live"),
|
||||
QT_TRANSLATE_NOOP ("BeaconsModel", "Callsign"),
|
||||
};
|
||||
|
||||
QString live_string (bool off_air)
|
||||
{
|
||||
return off_air ? QT_TRANSLATE_NOOP ("BeaconsModel", "no") : QT_TRANSLATE_NOOP ("BeaconsModel", "yes");
|
||||
}
|
||||
|
||||
QFont text_font {"Courier", 10};
|
||||
|
||||
QList<QStandardItem *> make_row (QString const& client_id, QTime time, qint32 snr, float delta_time
|
||||
, Frequency frequency, qint32 drift, QString const& callsign
|
||||
, QString const& grid, qint32 power, bool off_air)
|
||||
{
|
||||
auto time_item = new QStandardItem {time.toString ("hh:mm")};
|
||||
time_item->setData (time);
|
||||
time_item->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto snr_item = new QStandardItem {QString::number (snr)};
|
||||
snr_item->setData (snr);
|
||||
snr_item->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto dt = new QStandardItem {QString::number (delta_time)};
|
||||
dt->setData (delta_time);
|
||||
dt->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto freq = new QStandardItem {Radio::pretty_frequency_MHz_string (frequency)};
|
||||
freq->setData (frequency);
|
||||
freq->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto dri = new QStandardItem {QString::number (drift)};
|
||||
dri->setData (drift);
|
||||
dri->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto gd = new QStandardItem {grid};
|
||||
gd->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto pwr = new QStandardItem {QString::number (power)};
|
||||
pwr->setData (power);
|
||||
pwr->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto live = new QStandardItem {live_string (off_air)};
|
||||
live->setTextAlignment (Qt::AlignHCenter);
|
||||
|
||||
QList<QStandardItem *> row {
|
||||
new QStandardItem {client_id}, time_item, snr_item, dt, freq, dri, gd, pwr, live, new QStandardItem {callsign}};
|
||||
Q_FOREACH (auto& item, row)
|
||||
{
|
||||
item->setEditable (false);
|
||||
item->setFont (text_font);
|
||||
item->setTextAlignment (item->textAlignment () | Qt::AlignVCenter);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
BeaconsModel::BeaconsModel (QObject * parent)
|
||||
: QStandardItemModel {0, sizeof (headings) / sizeof (headings[0]), parent}
|
||||
{
|
||||
int column {0};
|
||||
for (auto const& heading : headings)
|
||||
{
|
||||
setHeaderData (column++, Qt::Horizontal, tr (heading));
|
||||
}
|
||||
}
|
||||
|
||||
void BeaconsModel::add_beacon_spot (bool is_new, QString const& client_id, QTime time, qint32 snr, float delta_time
|
||||
, Frequency frequency, qint32 drift, QString const& callsign
|
||||
, QString const& grid, qint32 power, bool off_air)
|
||||
{
|
||||
if (!is_new)
|
||||
{
|
||||
int target_row {-1};
|
||||
for (auto row = 0; row < rowCount (); ++row)
|
||||
{
|
||||
if (data (index (row, 0)).toString () == client_id)
|
||||
{
|
||||
auto row_time = item (row, 1)->data ().toTime ();
|
||||
if (row_time == time
|
||||
&& item (row, 2)->data ().toInt () == snr
|
||||
&& item (row, 3)->data ().toFloat () == delta_time
|
||||
&& item (row, 4)->data ().value<Frequency> () == frequency
|
||||
&& data (index (row, 5)).toInt () == drift
|
||||
&& data (index (row, 7)).toString () == grid
|
||||
&& data (index (row, 8)).toInt () == power
|
||||
&& data (index (row, 6)).toString () == live_string (off_air)
|
||||
&& data (index (row, 9)).toString () == callsign)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (time <= row_time)
|
||||
{
|
||||
target_row = row; // last row with same time
|
||||
}
|
||||
}
|
||||
}
|
||||
if (target_row >= 0)
|
||||
{
|
||||
insertRow (target_row + 1, make_row (client_id, time, snr, delta_time, frequency, drift, callsign, grid, power, off_air));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
appendRow (make_row (client_id, time, snr, delta_time, frequency, drift, callsign, grid, power, off_air));
|
||||
}
|
||||
|
||||
void BeaconsModel::clear_decodes (QString const& client_id)
|
||||
{
|
||||
for (auto row = rowCount () - 1; row >= 0; --row)
|
||||
{
|
||||
if (data (index (row, 0)).toString () == client_id)
|
||||
{
|
||||
removeRow (row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_BeaconsModel.cpp"
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
#ifndef BOOST_MPL_INSERT_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_INSERT_FWD_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template< typename Tag > struct insert_impl;
|
||||
template< typename Sequence, typename Pos_or_T, typename T > struct insert;
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_INSERT_FWD_HPP_INCLUDED
|
||||
@@ -0,0 +1,83 @@
|
||||
#ifndef BANDS_HPP__
|
||||
#define BANDS_HPP__
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
#include "Radio.hpp"
|
||||
|
||||
//
|
||||
// Class Bands
|
||||
//
|
||||
// Encapsulates information about amateur radio bands as defined by
|
||||
// the ADIF specification. The model is immutable. The rows are
|
||||
// stored in asscending order of frequency.
|
||||
//
|
||||
// Responsibilities
|
||||
//
|
||||
// Provides a well known band name mapped to lower and upper
|
||||
// frequency limits. Also provides a convenience operation to
|
||||
// determine the band name for any given frequency, the result of
|
||||
// which may be null if the given frequency doesn't lie within a
|
||||
// recognised band.
|
||||
//
|
||||
// Collaborations
|
||||
//
|
||||
// Implements the QAbstractTableModel interface as an immutable table
|
||||
// where rows are bands and columns are band name, lower frequency
|
||||
// limit and, upper ferquency limit respectively.
|
||||
//
|
||||
class Bands final
|
||||
: public QAbstractTableModel
|
||||
{
|
||||
public:
|
||||
using Frequency = Radio::Frequency;
|
||||
|
||||
// an iterator that meets the requirements of the C++ for range statement
|
||||
class const_iterator
|
||||
{
|
||||
public:
|
||||
const_iterator (int row)
|
||||
: row_ {row}
|
||||
{
|
||||
}
|
||||
|
||||
QString operator * ();
|
||||
bool operator != (const_iterator const&) const;
|
||||
const_iterator& operator ++ ();
|
||||
|
||||
private:
|
||||
int row_;
|
||||
};
|
||||
|
||||
explicit Bands (QObject * parent = nullptr);
|
||||
|
||||
//
|
||||
// Model API
|
||||
//
|
||||
QString find (Frequency) const; // find band Frequency is in
|
||||
int find (QString const&) const; // find row of band (-1 if not valid)
|
||||
static QString const& oob ();
|
||||
|
||||
// Iterators
|
||||
const_iterator begin () const;
|
||||
const_iterator end () const;
|
||||
|
||||
// Custom role for sorting.
|
||||
static int constexpr SortRole = Qt::UserRole;
|
||||
|
||||
// Implement the QAbstractTableModel interface
|
||||
int rowCount (QModelIndex const& parent = QModelIndex {}) const override;
|
||||
int columnCount (QModelIndex const& parent = QModelIndex {}) const override;
|
||||
Qt::ItemFlags flags (QModelIndex const& = QModelIndex {}) const override;
|
||||
QVariant headerData (int section, Qt::Orientation, int = Qt::DisplayRole) const override;
|
||||
|
||||
// The value return for the Qt::DisplayRole role for the root of the
|
||||
// model (invalid index) is a special string representing out of
|
||||
// band.
|
||||
//
|
||||
// All columns return a number for the custom role SortRole, this
|
||||
// number defines a strict frequency order for the rows.
|
||||
QVariant data (QModelIndex const&, int role = Qt::DisplayRole) const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,90 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
// 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_SEARCH_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_SEARCH_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 search
|
||||
///
|
||||
/// range-based version of the search std algorithm
|
||||
///
|
||||
/// \pre ForwardRange1 is a model of the ForwardRangeConcept
|
||||
/// \pre ForwardRange2 is a model of the ForwardRangeConcept
|
||||
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
|
||||
template< class ForwardRange1, class ForwardRange2 >
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange1>::type
|
||||
search(ForwardRange1& rng1, const ForwardRange2& rng2)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return std::search(boost::begin(rng1),boost::end(rng1),
|
||||
boost::begin(rng2),boost::end(rng2));
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< class ForwardRange1, class ForwardRange2 >
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange1>::type
|
||||
search(const ForwardRange1& rng1, const ForwardRange2& rng2)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return std::search(boost::begin(rng1), boost::end(rng1),
|
||||
boost::begin(rng2), boost::end(rng2));
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< class ForwardRange1, class ForwardRange2, class BinaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange1>::type
|
||||
search(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return std::search(boost::begin(rng1),boost::end(rng1),
|
||||
boost::begin(rng2),boost::end(rng2),pred);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< class ForwardRange1, class ForwardRange2, class BinaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange1>::type
|
||||
search(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return std::search(boost::begin(rng1), boost::end(rng1),
|
||||
boost::begin(rng2), boost::end(rng2), pred);
|
||||
}
|
||||
|
||||
// range_return overloads
|
||||
|
||||
/// \overload
|
||||
template< range_return_value re, class ForwardRange1, class ForwardRange2 >
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange1,re>::type
|
||||
search(ForwardRange1& rng1, const ForwardRange2& rng2)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return range_return<ForwardRange1,re>::
|
||||
pack(std::search(boost::begin(rng1),boost::end(rng1),
|
||||
boost::begin(rng2),boost::end(rng2)),
|
||||
rng1);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< range_return_value re, class ForwardRange1, class ForwardRange2 >
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange1,re>::type
|
||||
search(const ForwardRange1& rng1, const ForwardRange2& rng2)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return range_return<const ForwardRange1,re>::
|
||||
pack(std::search(boost::begin(rng1),boost::end(rng1),
|
||||
boost::begin(rng2),boost::end(rng2)),
|
||||
rng1);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< range_return_value re, class ForwardRange1, class ForwardRange2,
|
||||
class BinaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange1,re>::type
|
||||
search(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return range_return<ForwardRange1,re>::
|
||||
pack(std::search(boost::begin(rng1),boost::end(rng1),
|
||||
boost::begin(rng2),boost::end(rng2),pred),
|
||||
rng1);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< range_return_value re, class ForwardRange1, class ForwardRange2,
|
||||
class BinaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange1,re>::type
|
||||
search(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
|
||||
return range_return<const ForwardRange1,re>::
|
||||
pack(std::search(boost::begin(rng1),boost::end(rng1),
|
||||
boost::begin(rng2),boost::end(rng2),pred),
|
||||
rng1);
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::search;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,45 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2007 Tobias Schwinger
|
||||
|
||||
Use modification and distribution are subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt).
|
||||
==============================================================================*/
|
||||
|
||||
// No include guard - this file is included multiple times intentionally.
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
|
||||
#if !defined(BOOST_FUSION_CLASS_TPL_NAME)
|
||||
# error "BOOST_FUSION_CLASS_TPL_NAME undefined"
|
||||
#endif
|
||||
|
||||
#define BOOST_FUSION_FUNC_NAME BOOST_PP_CAT(make_,BOOST_FUSION_CLASS_TPL_NAME)
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename F>
|
||||
struct BOOST_FUSION_FUNC_NAME
|
||||
{
|
||||
typedef fusion::BOOST_FUSION_CLASS_TPL_NAME<
|
||||
typename fusion::detail::as_fusion_element<F>::type > type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::BOOST_FUSION_FUNC_NAME<F>::type
|
||||
BOOST_FUSION_FUNC_NAME(F const & f)
|
||||
{
|
||||
return typename result_of::BOOST_FUSION_FUNC_NAME<F>::type(f);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#undef BOOST_FUSION_CLASS_TPL_NAME
|
||||
#undef BOOST_FUSION_FUNC_NAME
|
||||
|
||||
@@ -0,0 +1,677 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp
|
||||
|
||||
[begin_description]
|
||||
Base class for all explicit first-same-as-last Runge Kutta steppers.
|
||||
[end_description]
|
||||
|
||||
Copyright 2010-2013 Karsten Ahnert
|
||||
Copyright 2010-2012 Mario Mulansky
|
||||
Copyright 2012 Christoph Koke
|
||||
|
||||
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_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
|
||||
#include <boost/numeric/odeint/util/bind.hpp>
|
||||
#include <boost/numeric/odeint/util/unwrap_reference.hpp>
|
||||
#include <boost/numeric/odeint/util/state_wrapper.hpp>
|
||||
#include <boost/numeric/odeint/util/is_resizeable.hpp>
|
||||
#include <boost/numeric/odeint/util/resizer.hpp>
|
||||
#include <boost/numeric/odeint/util/copy.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
/*
|
||||
* base class for explicit stepper and error steppers with the fsal property
|
||||
* models the stepper AND the error stepper fsal concept
|
||||
*
|
||||
* this class provides the following do_step overloads
|
||||
* do_step( sys , x , t , dt )
|
||||
* do_step( sys , x , dxdt , t , dt )
|
||||
* do_step( sys , in , t , out , dt )
|
||||
* do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )
|
||||
* do_step( sys , x , t , dt , xerr )
|
||||
* do_step( sys , x , dxdt , t , dt , xerr )
|
||||
* do_step( sys , in , t , out , dt , xerr )
|
||||
* do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )
|
||||
*/
|
||||
template<
|
||||
class Stepper ,
|
||||
unsigned short Order ,
|
||||
unsigned short StepperOrder ,
|
||||
unsigned short ErrorOrder ,
|
||||
class State ,
|
||||
class Value ,
|
||||
class Deriv ,
|
||||
class Time ,
|
||||
class Algebra ,
|
||||
class Operations ,
|
||||
class Resizer
|
||||
>
|
||||
class explicit_error_stepper_fsal_base : public algebra_stepper_base< Algebra , Operations >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
|
||||
typedef typename algebra_stepper_base_type::algebra_type algebra_type;
|
||||
|
||||
typedef State state_type;
|
||||
typedef Value value_type;
|
||||
typedef Deriv deriv_type;
|
||||
typedef Time time_type;
|
||||
typedef Resizer resizer_type;
|
||||
typedef Stepper stepper_type;
|
||||
typedef explicit_error_stepper_fsal_tag stepper_category;
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
typedef state_wrapper< state_type > wrapped_state_type;
|
||||
typedef state_wrapper< deriv_type > wrapped_deriv_type;
|
||||
typedef explicit_error_stepper_fsal_base< Stepper , Order , StepperOrder , ErrorOrder ,
|
||||
State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
|
||||
#endif
|
||||
|
||||
|
||||
typedef unsigned short order_type;
|
||||
static const order_type order_value = Order;
|
||||
static const order_type stepper_order_value = StepperOrder;
|
||||
static const order_type error_order_value = ErrorOrder;
|
||||
|
||||
explicit_error_stepper_fsal_base( const algebra_type &algebra = algebra_type() )
|
||||
: algebra_stepper_base_type( algebra ) , m_first_call( true )
|
||||
{ }
|
||||
|
||||
order_type order( void ) const
|
||||
{
|
||||
return order_value;
|
||||
}
|
||||
|
||||
order_type stepper_order( void ) const
|
||||
{
|
||||
return stepper_order_value;
|
||||
}
|
||||
|
||||
order_type error_order( void ) const
|
||||
{
|
||||
return error_order_value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* version 1 : do_step( sys , x , t , dt )
|
||||
*
|
||||
* the two overloads are needed in order to solve the forwarding problem
|
||||
*/
|
||||
template< class System , class StateInOut >
|
||||
void do_step( System system , StateInOut &x , time_type t , time_type dt )
|
||||
{
|
||||
do_step_v1( system , x , t , dt );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut.
|
||||
*/
|
||||
template< class System , class StateInOut >
|
||||
void do_step( System system , const StateInOut &x , time_type t , time_type dt )
|
||||
{
|
||||
do_step_v1( system , x , t , dt );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* version 2 : do_step( sys , x , dxdt , t , dt )
|
||||
*
|
||||
* this version does not solve the forwarding problem, boost.range can not be used
|
||||
*
|
||||
* the disable is needed to avoid ambiguous overloads if state_type = time_type
|
||||
*/
|
||||
template< class System , class StateInOut , class DerivInOut >
|
||||
typename boost::disable_if< boost::is_same< StateInOut , time_type > , void >::type
|
||||
do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt )
|
||||
{
|
||||
m_first_call = true;
|
||||
this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* named Version 2: do_step_dxdt_impl( sys , in , dxdt , t , dt )
|
||||
*
|
||||
* this version is needed when this stepper is used for initializing
|
||||
* multistep stepper like adams-bashforth. Hence we provide an explicitely
|
||||
* named version that is not disabled. Meant for internal use only.
|
||||
*/
|
||||
template< class System , class StateInOut , class DerivInOut >
|
||||
void do_step_dxdt_impl( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt )
|
||||
{
|
||||
m_first_call = true;
|
||||
this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt );
|
||||
}
|
||||
|
||||
/*
|
||||
* version 3 : do_step( sys , in , t , out , dt )
|
||||
*
|
||||
* this version does not solve the forwarding problem, boost.range can not
|
||||
* be used.
|
||||
*
|
||||
* the disable is needed to avoid ambiguous overloads if
|
||||
* state_type = time_type
|
||||
*/
|
||||
template< class System , class StateIn , class StateOut >
|
||||
typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type
|
||||
do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
|
||||
{
|
||||
if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
||||
{
|
||||
initialize( system , in , t );
|
||||
}
|
||||
this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , m_dxdt.m_v , dt );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* version 4 : do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )
|
||||
*
|
||||
* this version does not solve the forwarding problem, boost.range can not be used
|
||||
*/
|
||||
template< class System, class StateIn, class DerivIn, class StateOut,
|
||||
class DerivOut >
|
||||
void do_step( System system, const StateIn &in, const DerivIn &dxdt_in,
|
||||
time_type t, StateOut &out, DerivOut &dxdt_out, time_type dt )
|
||||
{
|
||||
m_first_call = true;
|
||||
this->stepper().do_step_impl( system, in, dxdt_in, t, out, dxdt_out,
|
||||
dt );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* version 5 : do_step( sys , x , t , dt , xerr )
|
||||
*
|
||||
* the two overloads are needed in order to solve the forwarding problem
|
||||
*/
|
||||
template< class System , class StateInOut , class Err >
|
||||
void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
|
||||
{
|
||||
do_step_v5( system , x , t , dt , xerr );
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut.
|
||||
*/
|
||||
template< class System , class StateInOut , class Err >
|
||||
void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr )
|
||||
{
|
||||
do_step_v5( system , x , t , dt , xerr );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* version 6 : do_step( sys , x , dxdt , t , dt , xerr )
|
||||
*
|
||||
* this version does not solve the forwarding problem, boost.range can not be used
|
||||
*
|
||||
* the disable is needed to avoid ambiguous overloads if state_type = time_type
|
||||
*/
|
||||
template< class System , class StateInOut , class DerivInOut , class Err >
|
||||
typename boost::disable_if< boost::is_same< StateInOut , time_type > , void >::type
|
||||
do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt , Err &xerr )
|
||||
{
|
||||
m_first_call = true;
|
||||
this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt , xerr );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* version 7 : do_step( sys , in , t , out , dt , xerr )
|
||||
*
|
||||
* this version does not solve the forwarding problem, boost.range can not be used
|
||||
*/
|
||||
template< class System , class StateIn , class StateOut , class Err >
|
||||
void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr )
|
||||
{
|
||||
if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
||||
{
|
||||
initialize( system , in , t );
|
||||
}
|
||||
this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , m_dxdt.m_v , dt , xerr );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* version 8 : do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )
|
||||
*
|
||||
* this version does not solve the forwarding problem, boost.range can not be used
|
||||
*/
|
||||
template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut , class Err >
|
||||
void do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t ,
|
||||
StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr )
|
||||
{
|
||||
m_first_call = true;
|
||||
this->stepper().do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt , xerr );
|
||||
}
|
||||
|
||||
template< class StateIn >
|
||||
void adjust_size( const StateIn &x )
|
||||
{
|
||||
resize_impl( x );
|
||||
}
|
||||
|
||||
void reset( void )
|
||||
{
|
||||
m_first_call = true;
|
||||
}
|
||||
|
||||
template< class DerivIn >
|
||||
void initialize( const DerivIn &deriv )
|
||||
{
|
||||
boost::numeric::odeint::copy( deriv , m_dxdt.m_v );
|
||||
m_first_call = false;
|
||||
}
|
||||
|
||||
template< class System , class StateIn >
|
||||
void initialize( System system , const StateIn &x , time_type t )
|
||||
{
|
||||
typename odeint::unwrap_reference< System >::type &sys = system;
|
||||
sys( x , m_dxdt.m_v , t );
|
||||
m_first_call = false;
|
||||
}
|
||||
|
||||
bool is_initialized( void ) const
|
||||
{
|
||||
return ! m_first_call;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
template< class System , class StateInOut >
|
||||
void do_step_v1( System system , StateInOut &x , time_type t , time_type dt )
|
||||
{
|
||||
if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
||||
{
|
||||
initialize( system , x , t );
|
||||
}
|
||||
this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , m_dxdt.m_v , dt );
|
||||
}
|
||||
|
||||
template< class System , class StateInOut , class Err >
|
||||
void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
|
||||
{
|
||||
if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
||||
{
|
||||
initialize( system , x , t );
|
||||
}
|
||||
this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , m_dxdt.m_v , dt , xerr );
|
||||
}
|
||||
|
||||
template< class StateIn >
|
||||
bool resize_impl( const StateIn &x )
|
||||
{
|
||||
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
|
||||
}
|
||||
|
||||
|
||||
stepper_type& stepper( void )
|
||||
{
|
||||
return *static_cast< stepper_type* >( this );
|
||||
}
|
||||
|
||||
const stepper_type& stepper( void ) const
|
||||
{
|
||||
return *static_cast< const stepper_type* >( this );
|
||||
}
|
||||
|
||||
|
||||
resizer_type m_resizer;
|
||||
bool m_first_call;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
wrapped_deriv_type m_dxdt;
|
||||
};
|
||||
|
||||
|
||||
/******* DOXYGEN *******/
|
||||
|
||||
/**
|
||||
* \class explicit_error_stepper_fsal_base
|
||||
* \brief Base class for explicit steppers with error estimation and stepper fulfilling the FSAL (first-same-as-last)
|
||||
* property. This class can be used with controlled steppers for step size control.
|
||||
*
|
||||
* This class serves as the base class for all explicit steppers with algebra and operations and which fulfill the FSAL
|
||||
* property. In contrast to explicit_stepper_base it also estimates the error and can be used in a controlled stepper
|
||||
* to provide step size control.
|
||||
*
|
||||
* The FSAL property means that the derivative of the system at t+dt is already used in the current step going from
|
||||
* t to t +dt. Therefore, some more do_steps method can be introduced and the controlled steppers can explicitly make use
|
||||
* of this property.
|
||||
*
|
||||
* \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders,
|
||||
* one for the order of a step if the error is not estimated. The other two orders are the orders of the step and
|
||||
* the error step if the error estimation is performed.
|
||||
*
|
||||
* explicit_error_stepper_fsal_base is used as the interface in a CRTP (currently recurring template
|
||||
* pattern). In order to work correctly the parent class needs to have a method
|
||||
* `do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt , xerr )`.
|
||||
* explicit_error_stepper_fsal_base derives from algebra_stepper_base.
|
||||
*
|
||||
* This class can have an intrinsic state depending on the explicit usage of the `do_step` method. This means that some
|
||||
* `do_step` methods are expected to be called in order. For example the `do_step( sys , x , t , dt , xerr )` will keep track
|
||||
* of the derivative of `x` which is the internal state. The first call of this method is recognized such that one
|
||||
* does not explicitly initialize the internal state, so it is safe to use this method like
|
||||
*
|
||||
* \code
|
||||
* stepper_type stepper;
|
||||
* stepper.do_step( sys , x , t , dt , xerr );
|
||||
* stepper.do_step( sys , x , t , dt , xerr );
|
||||
* stepper.do_step( sys , x , t , dt , xerr );
|
||||
* \endcode
|
||||
*
|
||||
* But it is unsafe to call this method with different system functions after each other. Do do so, one must initialize the
|
||||
* internal state with the `initialize` method or reset the internal state with the `reset` method.
|
||||
*
|
||||
* explicit_error_stepper_fsal_base provides several overloaded `do_step` methods, see the list below. Only two of them are needed
|
||||
* to fulfill the Error Stepper concept. The other ones are for convenience and for better performance. Some of them
|
||||
* simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the stepper.
|
||||
*
|
||||
* - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fulfill the Error Stepper concept. The
|
||||
* state is updated in-place. A type modelling a Boost.Range can be used for x.
|
||||
* - `do_step( sys , x , dxdt , t , dt )` - This method updates the state x and the derivative dxdt in-place. It is expected
|
||||
* that dxdt has the value of the derivative of x at time t.
|
||||
* - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step
|
||||
* is stored in `out`.
|
||||
* - `do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )` - This method updates the state and the derivative
|
||||
* out-of-place. It expects that the derivative at the point `t` is explicitly passed in `dxdt_in`.
|
||||
* - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fulfill the Error Stepper concept. The
|
||||
* state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x.
|
||||
* - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state and the derivative in-place. It is assumed
|
||||
* that the dxdt has the value of the derivative of x at time t. An error estimate is calculated.
|
||||
* - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error
|
||||
* during the step.
|
||||
* - `do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )` - This methods updates the state and the derivative
|
||||
* out-of-place and estimates the error during the step. It is assumed the dxdt_in is derivative of in at time t.
|
||||
*
|
||||
* \note The system is always passed as value, which might result in poor performance if it contains data. In this
|
||||
* case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );`
|
||||
*
|
||||
* \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate`
|
||||
* routines or `iterator`s.
|
||||
*
|
||||
* \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base
|
||||
* provides the interface for the Stepper.
|
||||
* \tparam Order The order of a stepper if the stepper is used without error estimation.
|
||||
* \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have
|
||||
* the same value.
|
||||
* \tparam ErrorOrder The order of the error step if the stepper is used with error estimation.
|
||||
* \tparam State The state type for the stepper.
|
||||
* \tparam Value The value type for the stepper. This should be a floating point type, like float,
|
||||
* double, or a multiprecision type. It must not necessary be the value_type of the State. For example
|
||||
* the State can be a `vector< complex< double > >` in this case the Value must be double.
|
||||
* The default value is double.
|
||||
* \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the
|
||||
* state type, only if used with Boost.Units both types differ.
|
||||
* \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is
|
||||
* used, this type has usually a unit.
|
||||
* \tparam Algebra The algebra type which must fulfill the Algebra Concept.
|
||||
* \tparam Operations The type for the operations which must fulfill the Operations Concept.
|
||||
* \tparam Resizer The resizer policy class.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::explicit_error_stepper_fsal_base( const algebra_type &algebra )
|
||||
* \brief Constructs a explicit_stepper_fsal_base class. This constructor can be used as a default
|
||||
* constructor if the algebra has a default constructor.
|
||||
* \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::order( void ) const
|
||||
* \return Returns the order of the stepper if it used without error estimation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::stepper_order( void ) const
|
||||
* \return Returns the order of a step if the stepper is used without error estimation.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::error_order( void ) const
|
||||
* \return Returns the order of an error step if the stepper is used without error estimation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , time_type t , time_type dt )
|
||||
* \brief This method performs one step. It transforms the result in-place.
|
||||
*
|
||||
* \note This method uses the internal state of the stepper.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param dt The step size.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt )
|
||||
* \brief The method performs one step with the stepper passed by Stepper. Additionally to the other methods
|
||||
* the derivative of x is also passed to this method. Therefore, dxdt must be evaluated initially:
|
||||
*
|
||||
* \code
|
||||
* ode( x , dxdt , t );
|
||||
* for( ... )
|
||||
* {
|
||||
* stepper.do_step( ode , x , dxdt , t , dt );
|
||||
* t += dt;
|
||||
* }
|
||||
* \endcode
|
||||
*
|
||||
* \note This method does NOT use the initial state, since the first derivative is explicitly passed to this method.
|
||||
*
|
||||
* The result is updated in place in x as well as the derivative dxdt. This method is disabled if
|
||||
* Time and StateInOut are of the same type. In this case the method could not be distinguished from other `do_step`
|
||||
* versions.
|
||||
*
|
||||
* \note This method does not solve the forwarding problem.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
|
||||
* \param dxdt The derivative of x at t. After calling `do_step` dxdt is updated to the new value.
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param dt The step size.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
|
||||
* \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
|
||||
* This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from
|
||||
* other `do_step` variants.
|
||||
*
|
||||
* \note This method uses the internal state of the stepper.
|
||||
*
|
||||
* \note This method does not solve the forwarding problem.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param in The state of the ODE which should be solved. in is not modified in this method
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param out The result of the step is written in out.
|
||||
* \param dt The step size.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , StateOut &out , DerivOut &dxdt_out , time_type dt )
|
||||
* \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
|
||||
* Furthermore, the derivative of x at t is passed to the stepper and updated by the stepper to its new value at
|
||||
* t+dt.
|
||||
*
|
||||
* \note This method does not solve the forwarding problem.
|
||||
*
|
||||
* \note This method does NOT use the internal state of the stepper.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param in The state of the ODE which should be solved. in is not modified in this method
|
||||
* \param dxdt_in The derivative of x at t.
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param out The result of the step is written in out.
|
||||
* \param dxdt_out The updated derivative of `out` at `t+dt`.
|
||||
* \param dt The step size.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
|
||||
* \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE
|
||||
* is updated in-place.
|
||||
*
|
||||
*
|
||||
* \note This method uses the internal state of the stepper.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param x The state of the ODE which should be solved. x is updated by this method.
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param dt The step size.
|
||||
* \param xerr The estimation of the error is stored in xerr.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt , Err &xerr )
|
||||
* \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
|
||||
* the derivative of x is also passed to this method and updated by this method.
|
||||
*
|
||||
* \note This method does NOT use the internal state of the stepper.
|
||||
*
|
||||
* The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this
|
||||
* case the method could not be distinguished from other `do_step` versions. This method is disabled if StateInOut and
|
||||
* Time are of the same type.
|
||||
*
|
||||
* \note This method does NOT use the internal state of the stepper.
|
||||
*
|
||||
* \note This method does not solve the forwarding problem.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
|
||||
* \param dxdt The derivative of x at t. After calling `do_step` this value is updated to the new value at `t+dt`.
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param dt The step size.
|
||||
* \param xerr The error estimate is stored in xerr.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr )
|
||||
* \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
|
||||
* Furthermore, the error is estimated.
|
||||
*
|
||||
* \note This method uses the internal state of the stepper.
|
||||
*
|
||||
* \note This method does not solve the forwarding problem.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param in The state of the ODE which should be solved. in is not modified in this method
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param out The result of the step is written in out.
|
||||
* \param dt The step size.
|
||||
* \param xerr The error estimate.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr )
|
||||
* \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
|
||||
* Furthermore, the derivative of x at t is passed to the stepper and the error is estimated.
|
||||
*
|
||||
* \note This method does NOT use the internal state of the stepper.
|
||||
*
|
||||
* \note This method does not solve the forwarding problem.
|
||||
*
|
||||
* \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
|
||||
* Simple System concept.
|
||||
* \param in The state of the ODE which should be solved. in is not modified in this method
|
||||
* \param dxdt_in The derivative of x at t.
|
||||
* \param t The value of the time, at which the step should be performed.
|
||||
* \param out The result of the step is written in out.
|
||||
* \param dxdt_out The new derivative at `t+dt` is written into this variable.
|
||||
* \param dt The step size.
|
||||
* \param xerr The error estimate.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::adjust_size( const StateIn &x )
|
||||
* \brief Adjust the size of all temporaries in the stepper manually.
|
||||
* \param x A state from which the size of the temporaries to be resized is deduced.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::reset( void )
|
||||
* \brief Resets the internal state of this stepper. After calling this method it is safe to use all
|
||||
* `do_step` method without explicitly initializing the stepper.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::initialize( const DerivIn &deriv )
|
||||
* \brief Initializes the internal state of the stepper.
|
||||
* \param deriv The derivative of x. The next call of `do_step` expects that the derivative of `x` passed to `do_step`
|
||||
* has the value of `deriv`.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::initialize( System system , const StateIn &x , time_type t )
|
||||
* \brief Initializes the internal state of the stepper.
|
||||
*
|
||||
* This method is equivalent to
|
||||
* \code
|
||||
* Deriv dxdt;
|
||||
* system( x , dxdt , t );
|
||||
* stepper.initialize( dxdt );
|
||||
* \endcode
|
||||
*
|
||||
* \param system The system function for the next calls of `do_step`.
|
||||
* \param x The current state of the ODE.
|
||||
* \param t The current time of the ODE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn explicit_error_stepper_fsal_base::is_initialized( void ) const
|
||||
* \brief Returns if the stepper is already initialized. If the stepper is not initialized, the first
|
||||
* call of `do_step` will initialize the state of the stepper. If the stepper is already initialized
|
||||
* the system function can not be safely exchanged between consecutive `do_step` calls.
|
||||
*/
|
||||
|
||||
} // odeint
|
||||
} // numeric
|
||||
} // boost
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED
|
||||
@@ -0,0 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
struct map_tag;
|
||||
struct map_iterator_tag;
|
||||
template <
|
||||
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_
|
||||
>
|
||||
struct map;
|
||||
}}
|
||||
@@ -0,0 +1,69 @@
|
||||
// (C) Copyright Gennadiy Rozental 2001.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/test for the library home page.
|
||||
//
|
||||
//! @file
|
||||
//! Per element comparison manipulator implementation
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER
|
||||
#define BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER
|
||||
|
||||
// Boost Test
|
||||
#include <boost/test/tools/detail/fwd.hpp>
|
||||
#include <boost/test/tools/detail/indirections.hpp>
|
||||
|
||||
#include <boost/test/tools/assertion.hpp>
|
||||
#include <boost/test/tools/collection_comparison_op.hpp>
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace test_tools {
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** per element comparison manipulator ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
//! Per element comparison manipulator, for containers
|
||||
struct per_element {};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
inline int
|
||||
operator<<( unit_test::lazy_ostream const&, per_element ) { return 0; }
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace tt_detail {
|
||||
|
||||
template<typename T1, typename T2, typename OP>
|
||||
inline assertion_result
|
||||
operator<<(assertion_evaluate_t<assertion::binary_expr<T1,T2,OP> > const& ae, per_element )
|
||||
{
|
||||
typedef typename OP::elem_op elem_op;
|
||||
return assertion::op::element_compare<elem_op>( ae.m_e.lhs().value(), ae.m_e.rhs() );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
inline check_type
|
||||
operator<<( assertion_type const&, per_element )
|
||||
{
|
||||
return CHECK_BUILT_ASSERTION;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
} // namespace tt_detail
|
||||
} // namespace test_tools
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_PREDEF_COMPILER_SGI_MIPSPRO_H
|
||||
#define BOOST_PREDEF_COMPILER_SGI_MIPSPRO_H
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_COMP_SGI`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/MIPSpro SGI MIPSpro] compiler.
|
||||
Version number available as major, minor, and patch.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`__sgi`] [__predef_detection__]]
|
||||
[[`sgi`] [__predef_detection__]]
|
||||
|
||||
[[`_SGI_COMPILER_VERSION`] [V.R.P]]
|
||||
[[`_COMPILER_VERSION`] [V.R.P]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_COMP_SGI BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if defined(__sgi) || defined(sgi)
|
||||
# if !defined(BOOST_COMP_SGI_DETECTION) && defined(_SGI_COMPILER_VERSION)
|
||||
# define BOOST_COMP_SGI_DETECTION BOOST_PREDEF_MAKE_10_VRP(_SGI_COMPILER_VERSION)
|
||||
# endif
|
||||
# if !defined(BOOST_COMP_SGI_DETECTION) && defined(_COMPILER_VERSION)
|
||||
# define BOOST_COMP_SGI_DETECTION BOOST_PREDEF_MAKE_10_VRP(_COMPILER_VERSION)
|
||||
# endif
|
||||
# if !defined(BOOST_COMP_SGI_DETECTION)
|
||||
# define BOOST_COMP_SGI_DETECTION BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_COMP_SGI_DETECTION
|
||||
# if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
|
||||
# define BOOST_COMP_SGI_EMULATED BOOST_COMP_SGI_DETECTION
|
||||
# else
|
||||
# undef BOOST_COMP_SGI
|
||||
# define BOOST_COMP_SGI BOOST_COMP_SGI_DETECTION
|
||||
# endif
|
||||
# define BOOST_COMP_SGI_AVAILABLE
|
||||
# include <boost/predef/detail/comp_detected.h>
|
||||
#endif
|
||||
|
||||
#define BOOST_COMP_SGI_NAME "SGI MIPSpro"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SGI,BOOST_COMP_SGI_NAME)
|
||||
|
||||
#ifdef BOOST_COMP_SGI_EMULATED
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SGI_EMULATED,BOOST_COMP_SGI_NAME)
|
||||
#endif
|
||||
@@ -0,0 +1,115 @@
|
||||
// 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_MIN_ELEMENT_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_MIN_ELEMENT_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 min_element
|
||||
///
|
||||
/// range-based version of the min_element std algorithm
|
||||
///
|
||||
/// \pre ForwardRange is a model of the ForwardRangeConcept
|
||||
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
|
||||
template<class ForwardRange>
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
|
||||
min_element(ForwardRange& rng)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
|
||||
return std::min_element(boost::begin(rng), boost::end(rng));
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class ForwardRange>
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
|
||||
min_element(const ForwardRange& rng)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
|
||||
return std::min_element(boost::begin(rng), boost::end(rng));
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class ForwardRange, class BinaryPredicate>
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
|
||||
min_element(ForwardRange& rng, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
|
||||
return std::min_element(boost::begin(rng), boost::end(rng), pred);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class ForwardRange, class BinaryPredicate>
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
|
||||
min_element(const ForwardRange& rng, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
|
||||
return std::min_element(boost::begin(rng), boost::end(rng), pred);
|
||||
}
|
||||
|
||||
// range_return overloads
|
||||
|
||||
/// \overload
|
||||
template<range_return_value re, class ForwardRange>
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
|
||||
min_element(ForwardRange& rng)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
|
||||
return range_return<ForwardRange,re>::pack(
|
||||
std::min_element(boost::begin(rng), boost::end(rng)),
|
||||
rng);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<range_return_value re, class ForwardRange>
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
|
||||
min_element(const ForwardRange& rng)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
|
||||
return range_return<const ForwardRange,re>::pack(
|
||||
std::min_element(boost::begin(rng), boost::end(rng)),
|
||||
rng);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<range_return_value re, class ForwardRange, class BinaryPredicate>
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
|
||||
min_element(ForwardRange& rng, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
|
||||
return range_return<ForwardRange,re>::pack(
|
||||
std::min_element(boost::begin(rng), boost::end(rng), pred),
|
||||
rng);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<range_return_value re, class ForwardRange, class BinaryPredicate>
|
||||
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
|
||||
min_element(const ForwardRange& rng, BinaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
|
||||
return range_return<const ForwardRange,re>::pack(
|
||||
std::min_element(boost::begin(rng), boost::end(rng), pred),
|
||||
rng);
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::min_element;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,88 @@
|
||||
subroutine downsam9(id2,npts8,nsps8,newdat,nspsd,fpk,c2)
|
||||
|
||||
!Downsample from id2() into c2() so as to yield nspsd samples per symbol,
|
||||
!mixing from fpk down to zero frequency. The downsample factor is 432.
|
||||
|
||||
use, intrinsic :: iso_c_binding
|
||||
use FFTW3
|
||||
use timer_module, only: timer
|
||||
|
||||
include 'constants.f90'
|
||||
integer(C_SIZE_T) NMAX1
|
||||
parameter (NMAX1=653184)
|
||||
parameter (NFFT1=653184,NFFT2=1512)
|
||||
type(C_PTR) :: plan !Pointers plan for big FFT
|
||||
integer*2 id2(0:8*npts8-1)
|
||||
logical, intent(inout) :: newdat
|
||||
real*4, pointer :: x1(:)
|
||||
complex c1(0:NFFT1/2)
|
||||
complex c2(0:NFFT2-1)
|
||||
real s(5000)
|
||||
logical first
|
||||
common/patience/npatience,nthreads
|
||||
data first/.true./
|
||||
save plan,first,c1,s,x1
|
||||
|
||||
df1=12000.0/NFFT1
|
||||
npts=8*npts8
|
||||
if(npts.gt.NFFT1) npts=NFFT1 !### Fix! ###
|
||||
|
||||
if(first) then
|
||||
nflags=FFTW_ESTIMATE
|
||||
if(npatience.eq.1) nflags=FFTW_ESTIMATE_PATIENT
|
||||
if(npatience.eq.2) nflags=FFTW_MEASURE
|
||||
if(npatience.eq.3) nflags=FFTW_PATIENT
|
||||
if(npatience.eq.4) nflags=FFTW_EXHAUSTIVE
|
||||
! Plan the FFTs just once
|
||||
|
||||
!$omp critical(fftw) ! serialize non thread-safe FFTW3 calls
|
||||
plan=fftwf_alloc_real(NMAX1)
|
||||
call c_f_pointer(plan,x1,[NMAX1])
|
||||
x1(0:NMAX1-1) => x1 !remap bounds
|
||||
call fftwf_plan_with_nthreads(nthreads)
|
||||
plan=fftwf_plan_dft_r2c_1d(NFFT1,x1,c1,nflags)
|
||||
call fftwf_plan_with_nthreads(1)
|
||||
!$omp end critical(fftw)
|
||||
|
||||
first=.false.
|
||||
endif
|
||||
|
||||
if(newdat) then
|
||||
x1(0:npts-1)=id2(0:npts-1)
|
||||
x1(npts:NFFT1-1)=0. !Zero the rest of x1
|
||||
call timer('FFTbig9 ',0)
|
||||
call fftwf_execute_dft_r2c(plan,x1,c1)
|
||||
call timer('FFTbig9 ',1)
|
||||
|
||||
nadd=int(1.0/df1)
|
||||
s=0.
|
||||
do i=1,5000
|
||||
j=int((i-1)/df1)
|
||||
do n=1,nadd
|
||||
j=j+1
|
||||
s(i)=s(i)+real(c1(j))**2 + aimag(c1(j))**2
|
||||
enddo
|
||||
enddo
|
||||
newdat=.false.
|
||||
endif
|
||||
|
||||
ndown=8*nsps8/nspsd !Downsample factor = 432
|
||||
nh2=NFFT2/2
|
||||
nf=nint(fpk)
|
||||
i0=int(fpk/df1)
|
||||
|
||||
nw=100
|
||||
ia=max(1,nf-nw)
|
||||
ib=min(5000,nf+nw)
|
||||
call pctile(s(ia),ib-ia+1,40,avenoise)
|
||||
|
||||
fac=sqrt(1.0/avenoise)
|
||||
do i=0,NFFT2-1
|
||||
j=i0+i
|
||||
if(i.gt.nh2) j=j-NFFT2
|
||||
c2(i)=fac*c1(j)
|
||||
enddo
|
||||
call four2a(c2,NFFT2,1,1,1) !FFT back to time domain
|
||||
|
||||
return
|
||||
end subroutine downsam9
|
||||
@@ -0,0 +1,151 @@
|
||||
#include "logqso.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
#include "logbook/adif.h"
|
||||
#include "MessageBox.hpp"
|
||||
#include "Configuration.hpp"
|
||||
#include "Bands.hpp"
|
||||
|
||||
#include "ui_logqso.h"
|
||||
#include "moc_logqso.cpp"
|
||||
|
||||
LogQSO::LogQSO(QString const& programTitle, QSettings * settings
|
||||
, Configuration const * config, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::LogQSO)
|
||||
, m_settings (settings)
|
||||
, m_config {config}
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle(programTitle + " - Log QSO");
|
||||
loadSettings ();
|
||||
}
|
||||
|
||||
LogQSO::~LogQSO ()
|
||||
{
|
||||
}
|
||||
|
||||
void LogQSO::loadSettings ()
|
||||
{
|
||||
m_settings->beginGroup ("LogQSO");
|
||||
restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ());
|
||||
ui->cbTxPower->setChecked (m_settings->value ("SaveTxPower", false).toBool ());
|
||||
ui->cbComments->setChecked (m_settings->value ("SaveComments", false).toBool ());
|
||||
m_txPower = m_settings->value ("TxPower", "").toString ();
|
||||
m_comments = m_settings->value ("LogComments", "").toString();
|
||||
m_settings->endGroup ();
|
||||
}
|
||||
|
||||
void LogQSO::storeSettings () const
|
||||
{
|
||||
m_settings->beginGroup ("LogQSO");
|
||||
m_settings->setValue ("geometry", saveGeometry ());
|
||||
m_settings->setValue ("SaveTxPower", ui->cbTxPower->isChecked ());
|
||||
m_settings->setValue ("SaveComments", ui->cbComments->isChecked ());
|
||||
m_settings->setValue ("TxPower", m_txPower);
|
||||
m_settings->setValue ("LogComments", m_comments);
|
||||
m_settings->endGroup ();
|
||||
}
|
||||
|
||||
void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString mode,
|
||||
QString const& rptSent, QString const& rptRcvd,
|
||||
QDateTime const& dateTimeOn, QDateTime const& dateTimeOff,
|
||||
Radio::Frequency dialFreq, QString const& myCall, QString const& myGrid,
|
||||
bool noSuffix, bool toRTTY, bool dBtoComments)
|
||||
{
|
||||
if(!isHidden()) return;
|
||||
ui->call->setText(hisCall);
|
||||
ui->grid->setText(hisGrid);
|
||||
ui->name->setText("");
|
||||
ui->txPower->setText("");
|
||||
ui->comments->setText("");
|
||||
if (ui->cbTxPower->isChecked ()) ui->txPower->setText(m_txPower);
|
||||
if (ui->cbComments->isChecked ()) ui->comments->setText(m_comments);
|
||||
if(dBtoComments) {
|
||||
QString t=mode;
|
||||
if(rptSent!="") t+=" Sent: " + rptSent;
|
||||
if(rptRcvd!="") t+=" Rcvd: " + rptRcvd;
|
||||
ui->comments->setText(t);
|
||||
}
|
||||
if(noSuffix and mode.mid(0,3)=="JT9") mode="JT9";
|
||||
if(toRTTY and mode.mid(0,3)=="JT9") mode="RTTY";
|
||||
ui->mode->setText(mode);
|
||||
ui->sent->setText(rptSent);
|
||||
ui->rcvd->setText(rptRcvd);
|
||||
ui->start_date_time->setDateTime (dateTimeOn);
|
||||
ui->end_date_time->setDateTime (dateTimeOff);
|
||||
m_dialFreq=dialFreq;
|
||||
m_myCall=myCall;
|
||||
m_myGrid=myGrid;
|
||||
ui->band->setText (m_config->bands ()->find (dialFreq));
|
||||
|
||||
show ();
|
||||
}
|
||||
|
||||
void LogQSO::accept()
|
||||
{
|
||||
QString hisCall,hisGrid,mode,rptSent,rptRcvd,dateOn,dateOff,timeOn,timeOff,band;
|
||||
QString comments,name;
|
||||
|
||||
hisCall=ui->call->text();
|
||||
hisGrid=ui->grid->text();
|
||||
mode=ui->mode->text();
|
||||
rptSent=ui->sent->text();
|
||||
rptRcvd=ui->rcvd->text();
|
||||
m_dateTimeOn = ui->start_date_time->dateTime ();
|
||||
m_dateTimeOff = ui->end_date_time->dateTime ();
|
||||
band=ui->band->text();
|
||||
name=ui->name->text();
|
||||
m_txPower=ui->txPower->text();
|
||||
comments=ui->comments->text();
|
||||
m_comments=comments;
|
||||
QString strDialFreq(QString::number(m_dialFreq / 1.e6,'f',6));
|
||||
|
||||
//Log this QSO to ADIF file "wsjtx_log.adi"
|
||||
QString filename = "wsjtx_log.adi"; // TODO allow user to set
|
||||
ADIF adifile;
|
||||
auto adifilePath = QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx_log.adi");
|
||||
adifile.init(adifilePath);
|
||||
if (!adifile.addQSOToFile(hisCall,hisGrid,mode,rptSent,rptRcvd,m_dateTimeOn,m_dateTimeOff,band,comments,name,strDialFreq,m_myCall,m_myGrid,m_txPower))
|
||||
{
|
||||
MessageBox::warning_message (this, tr ("Log file error"),
|
||||
tr ("Cannot open \"%1\"").arg (adifilePath));
|
||||
}
|
||||
|
||||
//Log this QSO to file "wsjtx.log"
|
||||
static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")};
|
||||
if(!f.open(QIODevice::Text | QIODevice::Append)) {
|
||||
MessageBox::warning_message (this, tr ("Log file error"),
|
||||
tr ("Cannot open \"%1\" for append").arg (f.fileName ()),
|
||||
tr ("Error: %1").arg (f.errorString ()));
|
||||
} else {
|
||||
QString logEntry=m_dateTimeOn.date().toString("yyyy-MM-dd,") +
|
||||
m_dateTimeOn.time().toString("hh:mm:ss,") +
|
||||
m_dateTimeOff.date().toString("yyyy-MM-dd,") +
|
||||
m_dateTimeOff.time().toString("hh:mm:ss,") + hisCall + "," +
|
||||
hisGrid + "," + strDialFreq + "," + mode +
|
||||
"," + rptSent + "," + rptRcvd + "," + m_txPower +
|
||||
"," + comments + "," + name;
|
||||
QTextStream out(&f);
|
||||
out << logEntry << endl;
|
||||
f.close();
|
||||
}
|
||||
|
||||
//Clean up and finish logging
|
||||
Q_EMIT acceptQSO (m_dateTimeOff, hisCall, hisGrid, m_dialFreq, mode, rptSent, rptRcvd, m_txPower, comments, name,m_dateTimeOn);
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
// closeEvent is only called from the system menu close widget for a
|
||||
// modeless dialog so we use the hideEvent override to store the
|
||||
// window settings
|
||||
void LogQSO::hideEvent (QHideEvent * e)
|
||||
{
|
||||
storeSettings ();
|
||||
QDialog::hideEvent (e);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2003
|
||||
* John Maddock
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE syntax_type.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares regular expression synatx type enumerator.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
#define BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
|
||||
namespace boost{
|
||||
namespace regex_constants{
|
||||
|
||||
typedef unsigned char syntax_type;
|
||||
|
||||
//
|
||||
// values chosen are binary compatible with previous version:
|
||||
//
|
||||
static const syntax_type syntax_char = 0;
|
||||
static const syntax_type syntax_open_mark = 1;
|
||||
static const syntax_type syntax_close_mark = 2;
|
||||
static const syntax_type syntax_dollar = 3;
|
||||
static const syntax_type syntax_caret = 4;
|
||||
static const syntax_type syntax_dot = 5;
|
||||
static const syntax_type syntax_star = 6;
|
||||
static const syntax_type syntax_plus = 7;
|
||||
static const syntax_type syntax_question = 8;
|
||||
static const syntax_type syntax_open_set = 9;
|
||||
static const syntax_type syntax_close_set = 10;
|
||||
static const syntax_type syntax_or = 11;
|
||||
static const syntax_type syntax_escape = 12;
|
||||
static const syntax_type syntax_dash = 14;
|
||||
static const syntax_type syntax_open_brace = 15;
|
||||
static const syntax_type syntax_close_brace = 16;
|
||||
static const syntax_type syntax_digit = 17;
|
||||
static const syntax_type syntax_comma = 27;
|
||||
static const syntax_type syntax_equal = 37;
|
||||
static const syntax_type syntax_colon = 36;
|
||||
static const syntax_type syntax_not = 53;
|
||||
|
||||
// extensions:
|
||||
|
||||
static const syntax_type syntax_hash = 13;
|
||||
static const syntax_type syntax_newline = 26;
|
||||
|
||||
// escapes:
|
||||
|
||||
typedef syntax_type escape_syntax_type;
|
||||
|
||||
static const escape_syntax_type escape_type_word_assert = 18;
|
||||
static const escape_syntax_type escape_type_not_word_assert = 19;
|
||||
static const escape_syntax_type escape_type_control_f = 29;
|
||||
static const escape_syntax_type escape_type_control_n = 30;
|
||||
static const escape_syntax_type escape_type_control_r = 31;
|
||||
static const escape_syntax_type escape_type_control_t = 32;
|
||||
static const escape_syntax_type escape_type_control_v = 33;
|
||||
static const escape_syntax_type escape_type_ascii_control = 35;
|
||||
static const escape_syntax_type escape_type_hex = 34;
|
||||
static const escape_syntax_type escape_type_unicode = 0; // not used
|
||||
static const escape_syntax_type escape_type_identity = 0; // not used
|
||||
static const escape_syntax_type escape_type_backref = syntax_digit;
|
||||
static const escape_syntax_type escape_type_decimal = syntax_digit; // not used
|
||||
static const escape_syntax_type escape_type_class = 22;
|
||||
static const escape_syntax_type escape_type_not_class = 23;
|
||||
|
||||
// extensions:
|
||||
|
||||
static const escape_syntax_type escape_type_left_word = 20;
|
||||
static const escape_syntax_type escape_type_right_word = 21;
|
||||
static const escape_syntax_type escape_type_start_buffer = 24; // for \`
|
||||
static const escape_syntax_type escape_type_end_buffer = 25; // for \'
|
||||
static const escape_syntax_type escape_type_control_a = 28; // for \a
|
||||
static const escape_syntax_type escape_type_e = 38; // for \e
|
||||
static const escape_syntax_type escape_type_E = 47; // for \Q\E
|
||||
static const escape_syntax_type escape_type_Q = 48; // for \Q\E
|
||||
static const escape_syntax_type escape_type_X = 49; // for \X
|
||||
static const escape_syntax_type escape_type_C = 50; // for \C
|
||||
static const escape_syntax_type escape_type_Z = 51; // for \Z
|
||||
static const escape_syntax_type escape_type_G = 52; // for \G
|
||||
|
||||
static const escape_syntax_type escape_type_property = 54; // for \p
|
||||
static const escape_syntax_type escape_type_not_property = 55; // for \P
|
||||
static const escape_syntax_type escape_type_named_char = 56; // for \N
|
||||
static const escape_syntax_type escape_type_extended_backref = 57; // for \g
|
||||
static const escape_syntax_type escape_type_reset_start_mark = 58; // for \K
|
||||
static const escape_syntax_type escape_type_line_ending = 59; // for \R
|
||||
|
||||
static const escape_syntax_type syntax_max = 60;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2006. 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_DETAIL_AS_LITERAL_HPP
|
||||
#define BOOST_RANGE_DETAIL_AS_LITERAL_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/range/detail/detail_str.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template< class Range >
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<Range>::type>
|
||||
as_literal( Range& r )
|
||||
{
|
||||
return ::boost::make_iterator_range( ::boost::range_detail::str_begin(r),
|
||||
::boost::range_detail::str_end(r) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
program stats
|
||||
|
||||
character*8 arg
|
||||
character*40 infile
|
||||
character decoded*22
|
||||
|
||||
nargs=iargc()
|
||||
if(nargs.lt.1) then
|
||||
print*,'Usage: stats file1 ...'
|
||||
go to 999
|
||||
endif
|
||||
|
||||
ttol=0.1
|
||||
nftol=1
|
||||
write(*,1000)
|
||||
1000 format(' SNR Files Sync BM FT Hint Total False BadSync'/ &
|
||||
56('-'))
|
||||
|
||||
do ifile=1,nargs
|
||||
call getarg(ifile,infile)
|
||||
open(10,file=infile,status='old')
|
||||
i1=index(infile,".")+1
|
||||
i2=40
|
||||
if(index(infile,"_").gt.1) i2=index(infile,"_") - 1
|
||||
snrgen=0.
|
||||
read(infile(i1:i2),*,err=1) snrgen
|
||||
1 snrgen=-snrgen
|
||||
nsynced=0
|
||||
nbm=0
|
||||
nftok=0
|
||||
nhint=0
|
||||
ngood=0
|
||||
nbad=0
|
||||
nbadsync=0
|
||||
|
||||
do iline=1,999999
|
||||
read(10,1010,end=100) nutc,sync,nsnr,dt,nfreq,ncandidates,nhard, &
|
||||
ntotal,rtt,ntry,nft,nqual,decoded
|
||||
1010 format(i4.4,f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22)
|
||||
|
||||
ndfreq=abs(nfreq-1500)
|
||||
if(sync.ge.1.0 .and. abs(dt).le.ttol .and. ndfreq.le.nftol) then
|
||||
nsynced=nsynced+1
|
||||
else
|
||||
nbadsync=nbadsync+1
|
||||
endif
|
||||
|
||||
if(decoded.eq.' ') cycle
|
||||
if(nft.eq.2 .or. (ntotal.le.81 .and. rtt.le.0.87)) then !nag=0
|
||||
if(decoded(1:11).eq.'K1ABC W9XYZ') then
|
||||
ngood=ngood+1
|
||||
if(nft.eq.1 .and. ncandidates.eq.0) nbm=nbm+1
|
||||
if(nft.eq.1) nftok=nftok+1
|
||||
if(nft.ge.2) nhint=nhint+1
|
||||
else
|
||||
nbad=nbad+1
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
|
||||
100 write(*,1100) snrgen,nutc,nsynced,nbm,nftok,nhint,ngood,nbad, &
|
||||
nbadsync
|
||||
1100 format(f5.1,8i6)
|
||||
enddo
|
||||
|
||||
999 end program stats
|
||||
@@ -0,0 +1,309 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2008
|
||||
//
|
||||
// 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 the main "vector_c.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<
|
||||
typename T, long C0 = LONG_MAX, long C1 = LONG_MAX, long C2 = LONG_MAX
|
||||
, long C3 = LONG_MAX, long C4 = LONG_MAX, long C5 = LONG_MAX
|
||||
, long C6 = LONG_MAX, long C7 = LONG_MAX, long C8 = LONG_MAX
|
||||
, long C9 = LONG_MAX, long C10 = LONG_MAX, long C11 = LONG_MAX
|
||||
, long C12 = LONG_MAX, long C13 = LONG_MAX, long C14 = LONG_MAX
|
||||
, long C15 = LONG_MAX, long C16 = LONG_MAX, long C17 = LONG_MAX
|
||||
, long C18 = LONG_MAX, long C19 = LONG_MAX
|
||||
>
|
||||
struct vector_c;
|
||||
|
||||
template<
|
||||
typename T
|
||||
>
|
||||
struct vector_c<
|
||||
T, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector0_c<T>
|
||||
{
|
||||
typedef typename vector0_c<T>::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector1_c< T, T(C0) >
|
||||
{
|
||||
typedef typename vector1_c< T, T(C0) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector2_c< T, T(C0), T(C1) >
|
||||
{
|
||||
typedef typename vector2_c< T, T(C0), T(C1) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector3_c< T, T(C0), T(C1), T(C2) >
|
||||
{
|
||||
typedef typename vector3_c< T, T(C0), T(C1), T(C2) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector4_c< T, T(C0), T(C1), T(C2), T(C3) >
|
||||
{
|
||||
typedef typename vector4_c< T, T(C0), T(C1), T(C2), T(C3) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector5_c< T, T(C0), T(C1), T(C2), T(C3), T(C4) >
|
||||
{
|
||||
typedef typename vector5_c< T, T(C0), T(C1), T(C2), T(C3), T(C4) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector6_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5) >
|
||||
{
|
||||
typedef typename vector6_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector7_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6) >
|
||||
{
|
||||
typedef typename vector7_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector8_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7) >
|
||||
{
|
||||
typedef typename vector8_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX
|
||||
>
|
||||
: vector9_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8) >
|
||||
{
|
||||
typedef typename vector9_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX
|
||||
>
|
||||
: vector10_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9) >
|
||||
{
|
||||
typedef typename vector10_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector11_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10) >
|
||||
{
|
||||
typedef typename vector11_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector12_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11) >
|
||||
{
|
||||
typedef typename vector12_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector13_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12) >
|
||||
{
|
||||
typedef typename vector13_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector14_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13) >
|
||||
{
|
||||
typedef typename vector14_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13, long C14
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector15_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14) >
|
||||
{
|
||||
typedef typename vector15_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13, long C14, long C15
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector16_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15) >
|
||||
{
|
||||
typedef typename vector16_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13, long C14, long C15, long C16
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector17_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16) >
|
||||
{
|
||||
typedef typename vector17_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13, long C14, long C15, long C16, long C17
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector18_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17) >
|
||||
{
|
||||
typedef typename vector18_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13, long C14, long C15, long C16, long C17, long C18
|
||||
>
|
||||
struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17, C18, LONG_MAX
|
||||
>
|
||||
: vector19_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18) >
|
||||
{
|
||||
typedef typename vector19_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18) >::type type;
|
||||
};
|
||||
|
||||
/// primary template (not a specialization!)
|
||||
|
||||
template<
|
||||
typename T, long C0, long C1, long C2, long C3, long C4, long C5
|
||||
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
|
||||
, long C13, long C14, long C15, long C16, long C17, long C18, long C19
|
||||
>
|
||||
struct vector_c
|
||||
: vector20_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18), T(C19) >
|
||||
{
|
||||
typedef typename vector20_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18), T(C19) >::type type;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Eric Niebler
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SINGLE_VIEW_END_IMPL_05052005_0332)
|
||||
#define BOOST_FUSION_SINGLE_VIEW_END_IMPL_05052005_0332
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct single_view_tag;
|
||||
|
||||
template <typename SingleView, typename Pos>
|
||||
struct single_view_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<single_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef single_view_iterator<Sequence, mpl::int_<1> > type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return type(seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
#ifndef BOOST_MPL_VECTOR_AUX_PUSH_BACK_HPP_INCLUDED
|
||||
#define BOOST_MPL_VECTOR_AUX_PUSH_BACK_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/push_back_fwd.hpp>
|
||||
#include <boost/mpl/aux_/config/typeof.hpp>
|
||||
|
||||
#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
|
||||
|
||||
# include <boost/mpl/vector/aux_/item.hpp>
|
||||
# include <boost/mpl/vector/aux_/tag.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct push_back_impl< aux::vector_tag >
|
||||
{
|
||||
template< typename Vector, typename T > struct apply
|
||||
{
|
||||
typedef v_item<T,Vector,0> type;
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_VECTOR_AUX_PUSH_BACK_HPP_INCLUDED
|
||||
@@ -0,0 +1,99 @@
|
||||
#include "IARURegions.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
#include <QModelIndex>
|
||||
|
||||
#include "moc_IARURegions.cpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
// human readable strings for each Region enumeration value
|
||||
char const * const region_names[] =
|
||||
{
|
||||
"All",
|
||||
"Region 1",
|
||||
"Region 2",
|
||||
"Region 3",
|
||||
};
|
||||
std::size_t constexpr region_names_size = sizeof (region_names) / sizeof (region_names[0]);
|
||||
}
|
||||
|
||||
IARURegions::IARURegions (QObject * parent)
|
||||
: QAbstractListModel {parent}
|
||||
{
|
||||
static_assert (region_names_size == REGIONS_END_SENTINAL_AND_COUNT,
|
||||
"region_names array must match Region enumeration");
|
||||
}
|
||||
|
||||
char const * IARURegions::name (Region r)
|
||||
{
|
||||
return region_names[static_cast<int> (r)];
|
||||
}
|
||||
|
||||
auto IARURegions::value (QString const& s) -> Region
|
||||
{
|
||||
auto end = region_names + region_names_size;
|
||||
auto p = std::find_if (region_names, end
|
||||
, [&s] (char const * const name) {
|
||||
return name == s;
|
||||
});
|
||||
return p != end ? static_cast<Region> (p - region_names) : ALL;
|
||||
}
|
||||
|
||||
QVariant IARURegions::data (QModelIndex const& index, int role) const
|
||||
{
|
||||
QVariant item;
|
||||
|
||||
if (index.isValid ())
|
||||
{
|
||||
auto const& row = index.row ();
|
||||
switch (role)
|
||||
{
|
||||
case Qt::ToolTipRole:
|
||||
case Qt::AccessibleDescriptionRole:
|
||||
item = tr ("IARU Region");
|
||||
break;
|
||||
|
||||
case Qt::EditRole:
|
||||
item = static_cast<Region> (row);
|
||||
break;
|
||||
|
||||
case Qt::DisplayRole:
|
||||
case Qt::AccessibleTextRole:
|
||||
item = region_names[row];
|
||||
break;
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
item = Qt::AlignHCenter + Qt::AlignVCenter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
QVariant IARURegions::headerData (int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
QVariant result;
|
||||
|
||||
if (Qt::DisplayRole == role && Qt::Horizontal == orientation)
|
||||
{
|
||||
result = tr ("IARU Region");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = QAbstractListModel::headerData (section, orientation, role);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#if !defined (QT_NO_DEBUG_STREAM)
|
||||
ENUM_QDEBUG_OPS_IMPL (IARURegions, Region);
|
||||
#endif
|
||||
|
||||
ENUM_QDATASTREAM_OPS_IMPL (IARURegions, Region);
|
||||
ENUM_CONVERSION_OPS_IMPL (IARURegions, Region);
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_CONFIG_DMC_AMBIGUOUS_CTPS_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_CONFIG_DMC_AMBIGUOUS_CTPS_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
|
||||
|
||||
# define BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_CONFIG_DMC_AMBIGUOUS_CTPS_HPP_INCLUDED
|
||||
@@ -0,0 +1,395 @@
|
||||
// Copyright John Maddock 2006.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_STATS_WEIBULL_HPP
|
||||
#define BOOST_STATS_WEIBULL_HPP
|
||||
|
||||
// http://www.itl.nist.gov/div898/handbook/eda/section3/eda3668.htm
|
||||
// http://mathworld.wolfram.com/WeibullDistribution.html
|
||||
|
||||
#include <boost/math/distributions/fwd.hpp>
|
||||
#include <boost/math/special_functions/gamma.hpp>
|
||||
#include <boost/math/special_functions/log1p.hpp>
|
||||
#include <boost/math/special_functions/expm1.hpp>
|
||||
#include <boost/math/distributions/detail/common_error_handling.hpp>
|
||||
#include <boost/math/distributions/complement.hpp>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace boost{ namespace math
|
||||
{
|
||||
namespace detail{
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_weibull_shape(
|
||||
const char* function,
|
||||
RealType shape,
|
||||
RealType* result, const Policy& pol)
|
||||
{
|
||||
if((shape <= 0) || !(boost::math::isfinite)(shape))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Shape parameter is %1%, but must be > 0 !", shape, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_weibull_x(
|
||||
const char* function,
|
||||
RealType const& x,
|
||||
RealType* result, const Policy& pol)
|
||||
{
|
||||
if((x < 0) || !(boost::math::isfinite)(x))
|
||||
{
|
||||
*result = policies::raise_domain_error<RealType>(
|
||||
function,
|
||||
"Random variate is %1% but must be >= 0 !", x, pol);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline bool check_weibull(
|
||||
const char* function,
|
||||
RealType scale,
|
||||
RealType shape,
|
||||
RealType* result, const Policy& pol)
|
||||
{
|
||||
return check_scale(function, scale, result, pol) && check_weibull_shape(function, shape, result, pol);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class RealType = double, class Policy = policies::policy<> >
|
||||
class weibull_distribution
|
||||
{
|
||||
public:
|
||||
typedef RealType value_type;
|
||||
typedef Policy policy_type;
|
||||
|
||||
weibull_distribution(RealType l_shape, RealType l_scale = 1)
|
||||
: m_shape(l_shape), m_scale(l_scale)
|
||||
{
|
||||
RealType result;
|
||||
detail::check_weibull("boost::math::weibull_distribution<%1%>::weibull_distribution", l_scale, l_shape, &result, Policy());
|
||||
}
|
||||
|
||||
RealType shape()const
|
||||
{
|
||||
return m_shape;
|
||||
}
|
||||
|
||||
RealType scale()const
|
||||
{
|
||||
return m_scale;
|
||||
}
|
||||
private:
|
||||
//
|
||||
// Data members:
|
||||
//
|
||||
RealType m_shape; // distribution shape
|
||||
RealType m_scale; // distribution scale
|
||||
};
|
||||
|
||||
typedef weibull_distribution<double> weibull;
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline const std::pair<RealType, RealType> range(const weibull_distribution<RealType, Policy>& /*dist*/)
|
||||
{ // Range of permissible values for random variable x.
|
||||
using boost::math::tools::max_value;
|
||||
return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>());
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline const std::pair<RealType, RealType> support(const weibull_distribution<RealType, Policy>& /*dist*/)
|
||||
{ // Range of supported values for random variable x.
|
||||
// This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
|
||||
using boost::math::tools::max_value;
|
||||
using boost::math::tools::min_value;
|
||||
return std::pair<RealType, RealType>(min_value<RealType>(), max_value<RealType>());
|
||||
// A discontinuity at x == 0, so only support down to min_value.
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType pdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::pdf(const weibull_distribution<%1%>, %1%)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
if(false == detail::check_weibull_x(function, x, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(x == 0)
|
||||
{
|
||||
if(shape == 1)
|
||||
{
|
||||
return 1 / scale;
|
||||
}
|
||||
if(shape > 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return policies::raise_overflow_error<RealType>(function, 0, Policy());
|
||||
}
|
||||
result = exp(-pow(x / scale, shape));
|
||||
result *= pow(x / scale, shape - 1) * shape / scale;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType cdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::cdf(const weibull_distribution<%1%>, %1%)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
if(false == detail::check_weibull_x(function, x, &result, Policy()))
|
||||
return result;
|
||||
|
||||
result = -boost::math::expm1(-pow(x / scale, shape), Policy());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType quantile(const weibull_distribution<RealType, Policy>& dist, const RealType& p)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::quantile(const weibull_distribution<%1%>, %1%)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
if(false == detail::check_probability(function, p, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(p == 1)
|
||||
return policies::raise_overflow_error<RealType>(function, 0, Policy());
|
||||
|
||||
result = scale * pow(-boost::math::log1p(-p, Policy()), 1 / shape);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType cdf(const complemented2_type<weibull_distribution<RealType, Policy>, RealType>& c)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::cdf(const weibull_distribution<%1%>, %1%)";
|
||||
|
||||
RealType shape = c.dist.shape();
|
||||
RealType scale = c.dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
if(false == detail::check_weibull_x(function, c.param, &result, Policy()))
|
||||
return result;
|
||||
|
||||
result = exp(-pow(c.param / scale, shape));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType quantile(const complemented2_type<weibull_distribution<RealType, Policy>, RealType>& c)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::quantile(const weibull_distribution<%1%>, %1%)";
|
||||
|
||||
RealType shape = c.dist.shape();
|
||||
RealType scale = c.dist.scale();
|
||||
RealType q = c.param;
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
if(false == detail::check_probability(function, q, &result, Policy()))
|
||||
return result;
|
||||
|
||||
if(q == 0)
|
||||
return policies::raise_overflow_error<RealType>(function, 0, Policy());
|
||||
|
||||
result = scale * pow(-log(q), 1 / shape);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType mean(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::mean(const weibull_distribution<%1%>)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
|
||||
result = scale * boost::math::tgamma(1 + 1 / shape, Policy());
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType variance(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
static const char* function = "boost::math::variance(const weibull_distribution<%1%>)";
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
result = boost::math::tgamma(1 + 1 / shape, Policy());
|
||||
result *= -result;
|
||||
result += boost::math::tgamma(1 + 2 / shape, Policy());
|
||||
result *= scale * scale;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType mode(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std function pow.
|
||||
|
||||
static const char* function = "boost::math::mode(const weibull_distribution<%1%>)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
if(shape <= 1)
|
||||
return 0;
|
||||
result = scale * pow((shape - 1) / shape, 1 / shape);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType median(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std function pow.
|
||||
|
||||
static const char* function = "boost::math::median(const weibull_distribution<%1%>)";
|
||||
|
||||
RealType shape = dist.shape(); // Wikipedia k
|
||||
RealType scale = dist.scale(); // Wikipedia lambda
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
using boost::math::constants::ln_two;
|
||||
result = scale * pow(ln_two<RealType>(), 1 / shape);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType skewness(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::skewness(const weibull_distribution<%1%>)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
RealType g1, g2, g3, d;
|
||||
|
||||
g1 = boost::math::tgamma(1 + 1 / shape, Policy());
|
||||
g2 = boost::math::tgamma(1 + 2 / shape, Policy());
|
||||
g3 = boost::math::tgamma(1 + 3 / shape, Policy());
|
||||
d = pow(g2 - g1 * g1, RealType(1.5));
|
||||
|
||||
result = (2 * g1 * g1 * g1 - 3 * g1 * g2 + g3) / d;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType kurtosis_excess(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
BOOST_MATH_STD_USING // for ADL of std functions
|
||||
|
||||
static const char* function = "boost::math::kurtosis_excess(const weibull_distribution<%1%>)";
|
||||
|
||||
RealType shape = dist.shape();
|
||||
RealType scale = dist.scale();
|
||||
|
||||
RealType result = 0;
|
||||
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
|
||||
return result;
|
||||
|
||||
RealType g1, g2, g3, g4, d, g1_2, g1_4;
|
||||
|
||||
g1 = boost::math::tgamma(1 + 1 / shape, Policy());
|
||||
g2 = boost::math::tgamma(1 + 2 / shape, Policy());
|
||||
g3 = boost::math::tgamma(1 + 3 / shape, Policy());
|
||||
g4 = boost::math::tgamma(1 + 4 / shape, Policy());
|
||||
g1_2 = g1 * g1;
|
||||
g1_4 = g1_2 * g1_2;
|
||||
d = g2 - g1_2;
|
||||
d *= d;
|
||||
|
||||
result = -6 * g1_4 + 12 * g1_2 * g2 - 3 * g2 * g2 - 4 * g1 * g3 + g4;
|
||||
result /= d;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class RealType, class Policy>
|
||||
inline RealType kurtosis(const weibull_distribution<RealType, Policy>& dist)
|
||||
{
|
||||
return kurtosis_excess(dist) + 3;
|
||||
}
|
||||
|
||||
} // namespace math
|
||||
} // namespace boost
|
||||
|
||||
// This include must be at the end, *after* the accessors
|
||||
// for this distribution have been defined, in order to
|
||||
// keep compilers that support two-phase lookup happy.
|
||||
#include <boost/math/distributions/detail/derived_accessors.hpp>
|
||||
|
||||
#endif // BOOST_STATS_WEIBULL_HPP
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/*=============================================================================
|
||||
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_NEXT_IMPL_06052005_0900)
|
||||
#define FUSION_NEXT_IMPL_06052005_0900
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/algorithm/query/detail/find_if.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
#include <boost/mpl/quote.hpp>
|
||||
#include <boost/mpl/bind.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl;
|
||||
|
||||
template <>
|
||||
struct next_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::last_type last_type;
|
||||
typedef typename Iterator::pred_type pred_type;
|
||||
typedef typename Iterator::category category;
|
||||
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
result_of::equal_to<first_type, last_type>
|
||||
, mpl::identity<last_type>
|
||||
, result_of::next<first_type>
|
||||
>::type
|
||||
next_type;
|
||||
|
||||
typedef typename
|
||||
detail::static_find_if<
|
||||
next_type
|
||||
, last_type
|
||||
, mpl::bind1<
|
||||
typename mpl::lambda<pred_type>::type
|
||||
, mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
|
||||
>
|
||||
>
|
||||
filter;
|
||||
|
||||
typedef filter_iterator<
|
||||
category, typename filter::type, last_type, pred_type>
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(filter::iter_call(i.first));
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,684 @@
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// group.hpp : encapsulates a group of manipulators along with an argument
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Copyright Samuel Krempp 2003. 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/format for library home page
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// group_head : cut the last element of a group out.
|
||||
// (is overloaded below on each type of group)
|
||||
|
||||
// group_last : returns the last element of a group
|
||||
// (is overloaded below on each type of group)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef BOOST_FORMAT_GROUP_HPP
|
||||
#define BOOST_FORMAT_GROUP_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace io {
|
||||
|
||||
|
||||
namespace detail {
|
||||
|
||||
|
||||
// empty group, but useful even though.
|
||||
struct group0
|
||||
{
|
||||
group0() {}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << ( BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group0& )
|
||||
{
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1>
|
||||
struct group1
|
||||
{
|
||||
T1 a1_;
|
||||
group1(T1 a1)
|
||||
: a1_(a1)
|
||||
{}
|
||||
private:
|
||||
group1& operator=(const group1&);
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group1<T1>& x)
|
||||
{
|
||||
os << x.a1_;
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2>
|
||||
struct group2
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
group2(T1 a1,T2 a2)
|
||||
: a1_(a1),a2_(a2)
|
||||
{}
|
||||
private:
|
||||
group2& operator=(const group2&);
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group2<T1,T2>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3>
|
||||
struct group3
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
group3(T1 a1,T2 a2,T3 a3)
|
||||
: a1_(a1),a2_(a2),a3_(a3)
|
||||
{}
|
||||
private:
|
||||
group3& operator=(const group3&);
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group3<T1,T2,T3>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4>
|
||||
struct group4
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
group4(T1 a1,T2 a2,T3 a3,T4 a4)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4)
|
||||
{}
|
||||
private:
|
||||
group4& operator=(const group4&);
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group4<T1,T2,T3,T4>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5>
|
||||
struct group5
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
T5 a5_;
|
||||
group5(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group5<T1,T2,T3,T4,T5>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6>
|
||||
struct group6
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
T5 a5_;
|
||||
T6 a6_;
|
||||
group6(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group6<T1,T2,T3,T4,T5,T6>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
|
||||
struct group7
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
T5 a5_;
|
||||
T6 a6_;
|
||||
T7 a7_;
|
||||
group7(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group7<T1,T2,T3,T4,T5,T6,T7>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
|
||||
struct group8
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
T5 a5_;
|
||||
T6 a6_;
|
||||
T7 a7_;
|
||||
T8 a8_;
|
||||
group8(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group8<T1,T2,T3,T4,T5,T6,T7,T8>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
|
||||
struct group9
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
T5 a5_;
|
||||
T6 a6_;
|
||||
T7 a7_;
|
||||
T8 a8_;
|
||||
T9 a9_;
|
||||
group9(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8),a9_(a9)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group9<T1,T2,T3,T4,T5,T6,T7,T8,T9>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_<< x.a9_;
|
||||
return os;
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
|
||||
struct group10
|
||||
{
|
||||
T1 a1_;
|
||||
T2 a2_;
|
||||
T3 a3_;
|
||||
T4 a4_;
|
||||
T5 a5_;
|
||||
T6 a6_;
|
||||
T7 a7_;
|
||||
T8 a8_;
|
||||
T9 a9_;
|
||||
T10 a10_;
|
||||
group10(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9,T10 a10)
|
||||
: a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8),a9_(a9),a10_(a10)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
|
||||
inline
|
||||
BOOST_IO_STD basic_ostream<Ch, Tr>&
|
||||
operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
|
||||
const group10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>& x)
|
||||
{
|
||||
os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_<< x.a9_<< x.a10_;
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2>
|
||||
inline
|
||||
group1<T1>
|
||||
group_head( group2<T1,T2> const& x)
|
||||
{
|
||||
return group1<T1> (x.a1_);
|
||||
}
|
||||
|
||||
template <class T1,class T2>
|
||||
inline
|
||||
group1<T2>
|
||||
group_last( group2<T1,T2> const& x)
|
||||
{
|
||||
return group1<T2> (x.a2_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3>
|
||||
inline
|
||||
group2<T1,T2>
|
||||
group_head( group3<T1,T2,T3> const& x)
|
||||
{
|
||||
return group2<T1,T2> (x.a1_,x.a2_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3>
|
||||
inline
|
||||
group1<T3>
|
||||
group_last( group3<T1,T2,T3> const& x)
|
||||
{
|
||||
return group1<T3> (x.a3_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4>
|
||||
inline
|
||||
group3<T1,T2,T3>
|
||||
group_head( group4<T1,T2,T3,T4> const& x)
|
||||
{
|
||||
return group3<T1,T2,T3> (x.a1_,x.a2_,x.a3_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4>
|
||||
inline
|
||||
group1<T4>
|
||||
group_last( group4<T1,T2,T3,T4> const& x)
|
||||
{
|
||||
return group1<T4> (x.a4_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5>
|
||||
inline
|
||||
group4<T1,T2,T3,T4>
|
||||
group_head( group5<T1,T2,T3,T4,T5> const& x)
|
||||
{
|
||||
return group4<T1,T2,T3,T4> (x.a1_,x.a2_,x.a3_,x.a4_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5>
|
||||
inline
|
||||
group1<T5>
|
||||
group_last( group5<T1,T2,T3,T4,T5> const& x)
|
||||
{
|
||||
return group1<T5> (x.a5_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6>
|
||||
inline
|
||||
group5<T1,T2,T3,T4,T5>
|
||||
group_head( group6<T1,T2,T3,T4,T5,T6> const& x)
|
||||
{
|
||||
return group5<T1,T2,T3,T4,T5> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6>
|
||||
inline
|
||||
group1<T6>
|
||||
group_last( group6<T1,T2,T3,T4,T5,T6> const& x)
|
||||
{
|
||||
return group1<T6> (x.a6_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
|
||||
inline
|
||||
group6<T1,T2,T3,T4,T5,T6>
|
||||
group_head( group7<T1,T2,T3,T4,T5,T6,T7> const& x)
|
||||
{
|
||||
return group6<T1,T2,T3,T4,T5,T6> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
|
||||
inline
|
||||
group1<T7>
|
||||
group_last( group7<T1,T2,T3,T4,T5,T6,T7> const& x)
|
||||
{
|
||||
return group1<T7> (x.a7_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
|
||||
inline
|
||||
group7<T1,T2,T3,T4,T5,T6,T7>
|
||||
group_head( group8<T1,T2,T3,T4,T5,T6,T7,T8> const& x)
|
||||
{
|
||||
return group7<T1,T2,T3,T4,T5,T6,T7> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
|
||||
inline
|
||||
group1<T8>
|
||||
group_last( group8<T1,T2,T3,T4,T5,T6,T7,T8> const& x)
|
||||
{
|
||||
return group1<T8> (x.a8_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
|
||||
inline
|
||||
group8<T1,T2,T3,T4,T5,T6,T7,T8>
|
||||
group_head( group9<T1,T2,T3,T4,T5,T6,T7,T8,T9> const& x)
|
||||
{
|
||||
return group8<T1,T2,T3,T4,T5,T6,T7,T8> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_,x.a8_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
|
||||
inline
|
||||
group1<T9>
|
||||
group_last( group9<T1,T2,T3,T4,T5,T6,T7,T8,T9> const& x)
|
||||
{
|
||||
return group1<T9> (x.a9_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
|
||||
inline
|
||||
group9<T1,T2,T3,T4,T5,T6,T7,T8,T9>
|
||||
group_head( group10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> const& x)
|
||||
{
|
||||
return group9<T1,T2,T3,T4,T5,T6,T7,T8,T9> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_,x.a8_,x.a9_);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
|
||||
inline
|
||||
group1<T10>
|
||||
group_last( group10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> const& x)
|
||||
{
|
||||
return group1<T10> (x.a10_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
|
||||
// helper functions
|
||||
|
||||
|
||||
inline detail::group1< detail::group0 >
|
||||
group() { return detail::group1< detail::group0 > ( detail::group0() ); }
|
||||
|
||||
template <class T1, class Var>
|
||||
inline
|
||||
detail::group1< detail::group2<T1, Var const&> >
|
||||
group(T1 a1, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group2<T1, Var const&> >
|
||||
( detail::group2<T1, Var const&>
|
||||
(a1, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2, class Var>
|
||||
inline
|
||||
detail::group1< detail::group3<T1,T2, Var const&> >
|
||||
group(T1 a1,T2 a2, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group3<T1,T2, Var const&> >
|
||||
( detail::group3<T1,T2, Var const&>
|
||||
(a1,a2, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3, class Var>
|
||||
inline
|
||||
detail::group1< detail::group4<T1,T2,T3, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group4<T1,T2,T3, Var const&> >
|
||||
( detail::group4<T1,T2,T3, Var const&>
|
||||
(a1,a2,a3, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4, class Var>
|
||||
inline
|
||||
detail::group1< detail::group5<T1,T2,T3,T4, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group5<T1,T2,T3,T4, Var const&> >
|
||||
( detail::group5<T1,T2,T3,T4, Var const&>
|
||||
(a1,a2,a3,a4, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5, class Var>
|
||||
inline
|
||||
detail::group1< detail::group6<T1,T2,T3,T4,T5, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group6<T1,T2,T3,T4,T5, Var const&> >
|
||||
( detail::group6<T1,T2,T3,T4,T5, Var const&>
|
||||
(a1,a2,a3,a4,a5, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6, class Var>
|
||||
inline
|
||||
detail::group1< detail::group7<T1,T2,T3,T4,T5,T6, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group7<T1,T2,T3,T4,T5,T6, Var const&> >
|
||||
( detail::group7<T1,T2,T3,T4,T5,T6, Var const&>
|
||||
(a1,a2,a3,a4,a5,a6, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7, class Var>
|
||||
inline
|
||||
detail::group1< detail::group8<T1,T2,T3,T4,T5,T6,T7, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group8<T1,T2,T3,T4,T5,T6,T7, Var const&> >
|
||||
( detail::group8<T1,T2,T3,T4,T5,T6,T7, Var const&>
|
||||
(a1,a2,a3,a4,a5,a6,a7, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8, class Var>
|
||||
inline
|
||||
detail::group1< detail::group9<T1,T2,T3,T4,T5,T6,T7,T8, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group9<T1,T2,T3,T4,T5,T6,T7,T8, Var const&> >
|
||||
( detail::group9<T1,T2,T3,T4,T5,T6,T7,T8, Var const&>
|
||||
(a1,a2,a3,a4,a5,a6,a7,a8, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9, class Var>
|
||||
inline
|
||||
detail::group1< detail::group10<T1,T2,T3,T4,T5,T6,T7,T8,T9, Var const&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9, Var const& var)
|
||||
{
|
||||
return detail::group1< detail::group10<T1,T2,T3,T4,T5,T6,T7,T8,T9, Var const&> >
|
||||
( detail::group10<T1,T2,T3,T4,T5,T6,T7,T8,T9, Var const&>
|
||||
(a1,a2,a3,a4,a5,a6,a7,a8,a9, var)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
|
||||
|
||||
template <class T1, class Var>
|
||||
inline
|
||||
detail::group1< detail::group2<T1, Var&> >
|
||||
group(T1 a1, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group2<T1, Var&> >
|
||||
( detail::group2<T1, Var&>
|
||||
(a1, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2, class Var>
|
||||
inline
|
||||
detail::group1< detail::group3<T1,T2, Var&> >
|
||||
group(T1 a1,T2 a2, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group3<T1,T2, Var&> >
|
||||
( detail::group3<T1,T2, Var&>
|
||||
(a1,a2, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3, class Var>
|
||||
inline
|
||||
detail::group1< detail::group4<T1,T2,T3, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group4<T1,T2,T3, Var&> >
|
||||
( detail::group4<T1,T2,T3, Var&>
|
||||
(a1,a2,a3, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4, class Var>
|
||||
inline
|
||||
detail::group1< detail::group5<T1,T2,T3,T4, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group5<T1,T2,T3,T4, Var&> >
|
||||
( detail::group5<T1,T2,T3,T4, Var&>
|
||||
(a1,a2,a3,a4, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5, class Var>
|
||||
inline
|
||||
detail::group1< detail::group6<T1,T2,T3,T4,T5, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group6<T1,T2,T3,T4,T5, Var&> >
|
||||
( detail::group6<T1,T2,T3,T4,T5, Var&>
|
||||
(a1,a2,a3,a4,a5, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6, class Var>
|
||||
inline
|
||||
detail::group1< detail::group7<T1,T2,T3,T4,T5,T6, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group7<T1,T2,T3,T4,T5,T6, Var&> >
|
||||
( detail::group7<T1,T2,T3,T4,T5,T6, Var&>
|
||||
(a1,a2,a3,a4,a5,a6, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7, class Var>
|
||||
inline
|
||||
detail::group1< detail::group8<T1,T2,T3,T4,T5,T6,T7, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group8<T1,T2,T3,T4,T5,T6,T7, Var&> >
|
||||
( detail::group8<T1,T2,T3,T4,T5,T6,T7, Var&>
|
||||
(a1,a2,a3,a4,a5,a6,a7, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8, class Var>
|
||||
inline
|
||||
detail::group1< detail::group9<T1,T2,T3,T4,T5,T6,T7,T8, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group9<T1,T2,T3,T4,T5,T6,T7,T8, Var&> >
|
||||
( detail::group9<T1,T2,T3,T4,T5,T6,T7,T8, Var&>
|
||||
(a1,a2,a3,a4,a5,a6,a7,a8, var)
|
||||
);
|
||||
}
|
||||
|
||||
template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9, class Var>
|
||||
inline
|
||||
detail::group1< detail::group10<T1,T2,T3,T4,T5,T6,T7,T8,T9, Var&> >
|
||||
group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9, Var& var)
|
||||
{
|
||||
return detail::group1< detail::group10<T1,T2,T3,T4,T5,T6,T7,T8,T9, Var&> >
|
||||
( detail::group10<T1,T2,T3,T4,T5,T6,T7,T8,T9, Var&>
|
||||
(a1,a2,a3,a4,a5,a6,a7,a8,a9, var)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#endif // - BOOST_NO_OVERLOAD_FOR_NON_CONST
|
||||
|
||||
|
||||
} // namespace io
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_FORMAT_GROUP_HPP
|
||||
@@ -0,0 +1,45 @@
|
||||
/*=============================================================================
|
||||
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_PRIOR_IMPL_05042005_1145)
|
||||
#define FUSION_PRIOR_IMPL_05042005_1145
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/vector/vector_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct vector_iterator_tag;
|
||||
template <typename Vector, int N>
|
||||
struct vector_iterator;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct prior_impl;
|
||||
|
||||
template <>
|
||||
struct prior_impl<vector_iterator_tag>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Iterator::vector vector;
|
||||
typedef typename Iterator::index index;
|
||||
typedef vector_iterator<vector, index::value-1> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.vec);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user