Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,208 @@
// (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 second order Horners rule
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_14_HPP
#define BOOST_MATH_TOOLS_RAT_EVAL_14_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(0);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, 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]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V)
{
if(x <= 1)
{
V x2 = x * x;
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
}
else
{
V z = 1 / x;
V z2 = 1 / (x * x);
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
}
}
}}}} // namespaces
#endif // include guard
@@ -0,0 +1,78 @@
/*=============================================================================
Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com)
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef BOOST_SPIRIT_ACTOR_REF_CONST_REF_VALUE_ACTOR_HPP
#define BOOST_SPIRIT_ACTOR_REF_CONST_REF_VALUE_ACTOR_HPP
#include <boost/spirit/home/classic/namespace.hpp>
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////
// Summary:
// A semantic action policy holder. This holder stores a reference to ref
// and a const reference to value_ref.
// act methods are feed with ref, value_ref and the parse result.
//
// (This doc uses convention available in actors.hpp)
//
// Constructor:
// ...(T& ref_, ValueT const& value_ref_);
// where ref_ and value_ref_ are stored in the holder.
//
// Action calls:
// act(ref, value_ref, value);
// act(ref, value_ref, first, last);
//
// () operators: both
//
///////////////////////////////////////////////////////////////////////////
template<
typename T,
typename ValueT,
typename ActionT
>
class ref_const_ref_value_actor : public ActionT
{
private:
T& ref;
ValueT const& value_ref;
public:
ref_const_ref_value_actor(
T& ref_,
ValueT const& value_ref_
)
:
ref(ref_),
value_ref(value_ref_)
{}
template<typename T2>
void operator()(T2 const& val_) const
{
this->act(ref,value_ref,val_); // defined in ActionT
}
template<typename IteratorT>
void operator()(
IteratorT const& first_,
IteratorT const& last_
) const
{
this->act(ref,value_ref,first_,last_); // defined in ActionT
}
};
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}}
#endif
@@ -0,0 +1,24 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_BOOST_TUPLE_09242011_1744)
#define BOOST_FUSION_BOOST_TUPLE_09242011_1744
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/std_tuple/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/begin_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/end_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/size_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/convert_impl.hpp>
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
#include <boost/fusion/adapted/std_tuple/mpl/clear.hpp>
#endif
@@ -0,0 +1,4 @@
MODULE prog_args
CHARACTER(len=80) :: shm_key
CHARACTER(len=500) :: exe_dir = '.', data_dir = '.', temp_dir = '.'
END MODULE prog_args
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
/*
[auto_generated]
boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.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_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
#include <blaze/math/dense/StaticVector.h>
#include <blaze/math/dense/DynamicVector.h>
namespace boost {
namespace numeric {
namespace odeint {
template< typename T , size_t N , bool TF >
struct algebra_dispatcher< blaze::StaticVector< T , N , TF > >
{
typedef vector_space_algebra algebra_type;
};
template< typename T , bool TF >
struct algebra_dispatcher< blaze::DynamicVector< T , TF > >
{
typedef vector_space_algebra algebra_type;
};
}
}
}
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED
@@ -0,0 +1,24 @@
/*=============================================================================
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_SEQUENCE_GENERATION_10022005_0615)
#define FUSION_SEQUENCE_GENERATION_10022005_0615
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/generation/make_deque.hpp>
#include <boost/fusion/container/generation/deque_tie.hpp>
#include <boost/fusion/container/generation/cons_tie.hpp>
#include <boost/fusion/container/generation/ignore.hpp>
#include <boost/fusion/container/generation/list_tie.hpp>
#include <boost/fusion/container/generation/make_cons.hpp>
#include <boost/fusion/container/generation/make_list.hpp>
#include <boost/fusion/container/generation/make_map.hpp>
#include <boost/fusion/container/generation/map_tie.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/container/generation/vector_tie.hpp>
#include <boost/fusion/container/generation/make_set.hpp>
#endif
@@ -0,0 +1,328 @@
// Copyright Peter Dimov 2001
// Copyright Aleksey Gurtovoy 2001-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)
//
// Preprocessed version of "boost/mpl/aux_/basic_bind.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
namespace aux {
template< bool >
struct resolve_arg_impl
{
template<
typename T, typename U1, typename U2, typename U3
, typename U4, typename U5
>
struct result_
{
typedef T type;
};
};
template<>
struct resolve_arg_impl<true>
{
template<
typename T, typename U1, typename U2, typename U3
, typename U4, typename U5
>
struct result_
{
typedef typename apply_wrap5<
T
, U1, U2, U3, U4, U5
>::type type;
};
};
template< typename T > struct is_bind_template;
template<
typename T, typename U1, typename U2, typename U3, typename U4
, typename U5
>
struct resolve_bind_arg
: resolve_arg_impl< is_bind_template<T>::value >
::template result_< T,U1,U2,U3,U4,U5 >
{
};
template< int arity_ > struct bind_chooser;
aux::no_tag is_bind_helper(...);
template< typename T > aux::no_tag is_bind_helper(protect<T>*);
template< int N >
aux::yes_tag is_bind_helper(arg<N>*);
template< bool is_ref_ = true >
struct is_bind_template_impl
{
template< typename T > struct result_
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
};
template<>
struct is_bind_template_impl<false>
{
template< typename T > struct result_
{
BOOST_STATIC_CONSTANT(bool, value =
sizeof(aux::is_bind_helper(static_cast<T*>(0)))
== sizeof(aux::yes_tag)
);
};
};
template< typename T > struct is_bind_template
: is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
::template result_<T>
{
};
} // namespace aux
template<
typename F
>
struct bind0
{
template<
typename U1 = na, typename U2 = na, typename U3 = na
, typename U4 = na, typename U5 = na
>
struct apply
{
private:
typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
public:
typedef typename apply_wrap0<
f_
>::type type;
};
};
namespace aux {
template<
typename F
>
aux::yes_tag
is_bind_helper(bind0<F>*);
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
template<
typename F, typename T1
>
struct bind1
{
template<
typename U1 = na, typename U2 = na, typename U3 = na
, typename U4 = na, typename U5 = na
>
struct apply
{
private:
typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
public:
typedef typename apply_wrap1<
f_
, typename t1::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1
>
aux::yes_tag
is_bind_helper(bind1< F,T1 >*);
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
template<
typename F, typename T1, typename T2
>
struct bind2
{
template<
typename U1 = na, typename U2 = na, typename U3 = na
, typename U4 = na, typename U5 = na
>
struct apply
{
private:
typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
public:
typedef typename apply_wrap2<
f_
, typename t1::type, typename t2::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2
>
aux::yes_tag
is_bind_helper(bind2< F,T1,T2 >*);
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
template<
typename F, typename T1, typename T2, typename T3
>
struct bind3
{
template<
typename U1 = na, typename U2 = na, typename U3 = na
, typename U4 = na, typename U5 = na
>
struct apply
{
private:
typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
public:
typedef typename apply_wrap3<
f_
, typename t1::type, typename t2::type, typename t3::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename T3
>
aux::yes_tag
is_bind_helper(bind3< F,T1,T2,T3 >*);
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
template<
typename F, typename T1, typename T2, typename T3, typename T4
>
struct bind4
{
template<
typename U1 = na, typename U2 = na, typename U3 = na
, typename U4 = na, typename U5 = na
>
struct apply
{
private:
typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
public:
typedef typename apply_wrap4<
f_
, typename t1::type, typename t2::type, typename t3::type
, typename t4::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename T3, typename T4
>
aux::yes_tag
is_bind_helper(bind4< F,T1,T2,T3,T4 >*);
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct bind5
{
template<
typename U1 = na, typename U2 = na, typename U3 = na
, typename U4 = na, typename U5 = na
>
struct apply
{
private:
typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;
public:
typedef typename apply_wrap5<
f_
, typename t1::type, typename t2::type, typename t3::type
, typename t4::type, typename t5::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
>
aux::yes_tag
is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
}}
@@ -0,0 +1,10 @@
Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat
Upstream-Name: @CMAKE_PROJECT_NAME@
Upstream-Maintainer: @PROJECT_CONTACT@
Upstream-Source: @PROJECT_HOMEPAGE@
Files: *
Copyright: @PROJECT_COPYRIGHT@.
License: GPL v3
The full text of the GPL is distributed in
/usr/share/common-licenses/GPL-3 on Debian systems.
@@ -0,0 +1,163 @@
// Status=review
=== Standard Exchange
By longstanding tradition, a minimally valid QSO requires the exchange
of callsigns, a signal report or some other information, and
acknowledgments. _WSJT-X_ is designed to facilitate making such
minimal QSOs using short, structured messages. The process works best
if you use these formats and follow standard operating practices. The
recommended basic QSO goes something like this:
CQ K1ABC FN42 #K1ABC calls CQ
K1ABC G0XYZ IO91 #G0XYZ answers
G0XYZ K1ABC 19 #K1ABC sends report
K1ABC G0XYZ R-22 #G0XYZ sends R+report
G0XYZ K1ABC RRR #K1ABC sends RRR
K1ABC G0XYZ 73 #G0XYZ sends 73
*Standard messages* consist of two callsigns (or CQ, QRZ, or DE and
one callsign) followed by the transmitting stations grid locator, a
signal report, R plus a signal report, or the final acknowledgements
RRR or 73. These messages are compressed and encoded in a highly
efficient and reliable way. In uncompressed form (as displayed
on-screen) they may contain as many as 22 characters.
*Signal reports* are specified as signal-to-noise ratio (S/N) in dB,
using a standard reference noise bandwidth of 2500 Hz. Thus, in the
example message above, K1ABC is telling G0XYZ that his
signal is 19 dB below the noise power in bandwidth 2500 Hz. In the
message at 0004, G0XYZ acknowledges receipt of that report and
responds with a 22 dB signal report. JT65 reports are constrained to
lie in the range 30 to 1 dB, and values are significantly compressed
above about -10 dB. JT9 supports the extended range 50 to +49 dB and
assigns more reliable numbers to relatively strong signals.
NOTE: Signals become visible on the waterfall around S/N = 26 dB
and audible (to someone with very good hearing) around 15
dB. Thresholds for decodability are around -23 dB for JT4, 24 dB for
JT65, 26 dB for JT9.
=== Free-Text Messages
Users often add some friendly chit-chat at the end of a QSO.
Free-format messages such as "`TNX ROBERT 73`" or "`5W VERT 73 GL`"
are supported, up to a maximum of 13 characters, including spaces. In
general you should avoid the character / in free-text messages, as the
program may then try to interpret your construction as part of a
compound callsign. It should be obvious that the JT4, JT9, and JT65
protocols are not designed or well suited for extensive conversations
or rag-chewing.
[[COMP-CALL]]
=== Compound Callsigns
Compound callsigns such as xx/K1ABC or K1ABC/x are handled in
one of two possible ways:
.Messages containing Type 1 compound callsigns
A list of about 350 of the most common prefixes and suffixes can be
displayed from the *Help* menu. A single compound callsign involving
one item from this list can be used in place of the standard third
word of a message (normally a locator, signal report, RRR, or 73).
The following examples are all acceptable messages containing *Type 1*
compound callsigns:
CQ ZA/K1ABC
CQ K1ABC/4
ZA/K1ABC G0XYZ
G0XYZ K1ABC/4
The following messages are _not_ valid, because a third word is not
permitted in any message containing a *Type 1* compound callsign:
ZA/K1ABC G0XYZ -22 #These messages are invalid; each would
G0XYZ K1ABC/4 73 # be sent without its third "word"
A QSO between two stations using *Type 1* compound-callsign messages
might look like this:
CQ ZA/K1ABC
ZA/K1ABC G0XYZ
G0XYZ K1ABC 19
K1ABC G0XYZ R22
G0XYZ K1ABC RRR
K1ABC G0XYZ 73
Notice that the full compound callsign is sent and received in the
first two transmissions. After that, the operators omit the add-on
prefix or suffix and use the standard structured messages.
.Type 2 Compound-Callsign Messages
Prefixes and suffixes _not_ found in the displayable short list are
handled by using *Type 2* compound callsigns. In this case the
compound callsign must be the second word in a two- or three-word
message, and the first word must be CQ, DE, or QRZ. Prefixes can be 1
to 4 characters, suffixes 1 to 3 characters. A third word conveying a
locator, report, RRR, or 73 is permitted. The following are valid
messages containing *Type 2* compound callsigns:
CQ W4/G0XYZ FM07
QRZ K1ABC/VE6 DO33
DE W4/G0XYZ FM18
DE W4/G0XYZ -22
DE W4/G0XYZ R-22
DE W4/G0XYZ RRR
DE W4/G0XYZ 73
In each case, the compound callsign is treated as *Type 2* because the
add-on prefix or suffix is _not_ one of those in the fixed list. Note
that a second callsign is never permissible in these messages.
TIP: During a transmission your outgoing message is displayed in the
first label on the *Status Bar* and shown exactly as another station
will receive it. You can check to see that you are actually
transmitting the message you wish to send.
QSOs involving *Type 2* compound callsigns might look like either
of the following sequences:
CQ K1ABC/VE1 FN75
K1ABC G0XYZ IO91
G0XYZ K1ABC 19
K1ABC G0XYZ R22
G0XYZ K1ABC RRR
K1ABC/VE1 73
CQ K1ABC FN42
DE G0XYZ/W4 FM18
G0XYZ K1ABC 19
K1ABC G0XYZ R22
G0XYZ K1ABC RRR
DE G0XYZ/W4 73
Operators with a compound callsign use its full form when calling CQ
and possibly also in a 73 transmission, as may be required by
licensing authorities. Other transmissions during a QSO may use the
standard structured messages without callsign prefix or suffix.
TIP: If you are using a compound callsign, you may want to
experiment with the option *Message generation for type 2 compound
callsign holders* on the *Settings | General* tab, so that messages
will be generated that best suit your needs.
=== Pre-QSO Checklist
Before attempting your first QSO with one of the WSJT modes, be sure
to go through the <<TUTORIAL,Basic Operating Tutorial>> above as well
as the following checklist:
- Your callsign and grid locator set to correct values
- PTT and CAT control (if used) properly configured and tested
- Computer clock properly synchronized to UTC within ±1 s
- Radio set to *USB* (upper sideband) mode
- Radio filters centered and set to widest available passband (up to 5 kHz).
TIP: Remember that in many circumstances JT4, JT9, JT65, and WSPR do
not require high power. Under most HF propagation conditions, QRP is
the norm.
@@ -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
//! Lexicographic comparison manipulator implementation
// ***************************************************************************
#ifndef BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER
#define BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_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 ************** //
// ************************************************************************** //
//! Lexicographic comparison manipulator, for containers
struct lexicographic {};
//____________________________________________________________________________//
inline int
operator<<( unit_test::lazy_ostream const&, lexicographic ) { 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, lexicographic )
{
typedef typename OP::elem_op elem_op;
return assertion::op::lexicographic_compare<elem_op>( ae.m_e.lhs().value(), ae.m_e.rhs() );
}
//____________________________________________________________________________//
inline check_type
operator<<( assertion_type const&, lexicographic )
{
return CHECK_BUILT_ASSERTION;
}
//____________________________________________________________________________//
} // namespace tt_detail
} // namespace test_tools
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER
@@ -0,0 +1,97 @@
// (C) Copyright Yuriy Krasnoschek 2009.
// (C) Copyright John Maddock 2001 - 2003.
// (C) Copyright Jens Maurer 2001 - 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 for most recent version.
// symbian specific config options:
#define BOOST_PLATFORM "Symbian"
#define BOOST_SYMBIAN 1
#if defined(__S60_3X__)
// Open C / C++ plugin was introdused in this SDK, earlier versions don't have CRT / STL
# define BOOST_S60_3rd_EDITION_FP2_OR_LATER_SDK
// make sure we have __GLIBC_PREREQ if available at all
#ifdef __cplusplus
#include <cstdlib>
#else
#include <stdlib.h>
#endif// boilerplate code:
# define BOOST_HAS_UNISTD_H
# include <boost/config/posix_features.hpp>
// S60 SDK defines _POSIX_VERSION as POSIX.1
# ifndef BOOST_HAS_STDINT_H
# define BOOST_HAS_STDINT_H
# endif
# ifndef BOOST_HAS_GETTIMEOFDAY
# define BOOST_HAS_GETTIMEOFDAY
# endif
# ifndef BOOST_HAS_DIRENT_H
# define BOOST_HAS_DIRENT_H
# endif
# ifndef BOOST_HAS_SIGACTION
# define BOOST_HAS_SIGACTION
# endif
# ifndef BOOST_HAS_PTHREADS
# define BOOST_HAS_PTHREADS
# endif
# ifndef BOOST_HAS_NANOSLEEP
# define BOOST_HAS_NANOSLEEP
# endif
# ifndef BOOST_HAS_SCHED_YIELD
# define BOOST_HAS_SCHED_YIELD
# endif
# ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
# endif
# ifndef BOOST_HAS_LOG1P
# define BOOST_HAS_LOG1P
# endif
# ifndef BOOST_HAS_EXPM1
# define BOOST_HAS_EXPM1
# endif
# ifndef BOOST_POSIX_API
# define BOOST_POSIX_API
# endif
// endianess support
# include <sys/endian.h>
// Symbian SDK provides _BYTE_ORDER instead of __BYTE_ORDER
# ifndef __LITTLE_ENDIAN
# ifdef _LITTLE_ENDIAN
# define __LITTLE_ENDIAN _LITTLE_ENDIAN
# else
# define __LITTLE_ENDIAN 1234
# endif
# endif
# ifndef __BIG_ENDIAN
# ifdef _BIG_ENDIAN
# define __BIG_ENDIAN _BIG_ENDIAN
# else
# define __BIG_ENDIAN 4321
# endif
# endif
# ifndef __BYTE_ORDER
# define __BYTE_ORDER __LITTLE_ENDIAN // Symbian is LE
# endif
// Known limitations
# define BOOST_ASIO_DISABLE_SERIAL_PORT
# define BOOST_DATE_TIME_NO_LOCALE
# define BOOST_NO_STD_WSTRING
# define BOOST_EXCEPTION_DISABLE
# define BOOST_NO_EXCEPTIONS
#else // TODO: More platform support e.g. UIQ
# error "Unsuppoted Symbian SDK"
#endif
#if defined(__WINSCW__) && !defined(BOOST_DISABLE_WIN32)
# define BOOST_DISABLE_WIN32 // winscw defines WIN32 macro
#endif
@@ -0,0 +1,12 @@
// Boost.Function library
// Copyright Douglas Gregor 2002-2003. 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
#define BOOST_FUNCTION_NUM_ARGS 3
#include <boost/function/detail/maybe_include.hpp>
#undef BOOST_FUNCTION_NUM_ARGS
@@ -0,0 +1,43 @@
#ifndef DATE_TIME_TIME_PRECISION_LIMITS_HPP
#define DATE_TIME_TIME_PRECISION_LIMITS_HPP
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
* $Date$
*/
/*! \file time_defs.hpp
This file contains nice definitions for handling the resoluion of various time
reprsentations.
*/
namespace boost {
namespace date_time {
//!Defines some nice types for handling time level resolutions
enum time_resolutions {
sec,
tenth,
hundreth, // deprecated misspelled version of hundredth
hundredth = hundreth,
milli,
ten_thousandth,
micro,
nano,
NumResolutions
};
//! Flags for daylight savings or summer time
enum dst_flags {not_dst, is_dst, calculate};
} } //namespace date_time
#endif
@@ -0,0 +1,33 @@
#ifndef DATE_TIME_GREG_YMD_HPP__
#define DATE_TIME_GREG_YMD_HPP__
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
* $Date$
*/
#include "boost/date_time/year_month_day.hpp"
#include "boost/date_time/special_defs.hpp"
#include "boost/date_time/gregorian/greg_day.hpp"
#include "boost/date_time/gregorian/greg_year.hpp"
#include "boost/date_time/gregorian/greg_month.hpp"
namespace boost {
namespace gregorian {
typedef date_time::year_month_day_base<greg_year,
greg_month,
greg_day> greg_year_month_day;
} } //namespace gregorian
#endif
@@ -0,0 +1,70 @@
/*
[auto_generated]
boost/numeric/odeint/integrate/detail/functors.hpp
[begin_description]
some functors for the iterator based integrate routines
[end_description]
Copyright 2009-2013 Karsten Ahnert
Copyright 2009-2013 Mario Mulansky
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED
#include <utility>
namespace boost {
namespace numeric {
namespace odeint {
namespace detail {
template< class Observer >
struct obs_caller {
size_t &m_n;
Observer m_obs;
obs_caller( size_t &m , Observer &obs ) : m_n(m) , m_obs( obs ) {}
template< class State , class Time >
void operator()( std::pair< const State & , const Time & > x )
{
typedef typename odeint::unwrap_reference< Observer >::type observer_type;
observer_type &obs = m_obs;
obs( x.first , x.second );
m_n++;
}
};
template< class Observer , class Time >
struct obs_caller_time {
Time &m_t;
Observer m_obs;
obs_caller_time( Time &t , Observer &obs ) : m_t(t) , m_obs( obs ) {}
template< class State >
void operator()( std::pair< const State & , const Time & > x )
{
typedef typename odeint::unwrap_reference< Observer >::type observer_type;
observer_type &obs = m_obs;
obs( x.first , x.second );
m_t = x.second;
}
};
} // namespace detail
} // namespace odeint
} // namespace numeric
} // namespace boost
#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED
@@ -0,0 +1,114 @@
:doctype: manpage
:man source: AsciiDoc
:man version: {VERSION}
:man manual: WSJT-X Manual
= jt65code(1)
== NAME
jt65code, jt9code, jt4code - Weak signal communications encoding support utility.
== SYNOPSIS
*jt65code* "'MESSAGE'"
*jt65code* ['OPTIONS']
*jt9code* "'MESSAGE'"
*jt9code* ['OPTIONS']
*jt4code* "'MESSAGE'"
*jt4code* ['OPTIONS']
== OPTIONS
*-t*::
Prints a selection of messages alongside their corresponding
decoded form and types.
== DESCRIPTION
*jt65code*, *jt9code* and *jt4code* are utility programs that let you
explore the conversion of user-level messages into channel symbols or
“tone numbers.” These programs can be useful to someone designing a
beacon generator for JT9 or JT65, or for studying behavior of the
error-control codes for each of the protocols.
Channel-symbol values for JT9 run from 0 to 8, with 0 representing the
sync tone. The total number of symbols in a transmitted message is
85. To run jt9code, enter the program name followed by a JT9 message
enclosed in quotes. In Windows the command and program output might
look like this:
.....
$ jt9code "G0XYZ K1ABC FN42"
Message: G0XYZ K1ABC FN42
Channel symbols:
0 0 7 3 0 3 2 5 4 0 1 7 7 7 8 0 4 8 8 2 2 1 0 1 1 3 5 4 5 6
8 7 0 6 0 1 8 3 3 7 8 1 1 2 4 5 8 1 5 2 0 0 8 6 0 5 8 5 1 0
5 8 7 7 2 0 4 6 6 6 7 6 0 1 8 8 5 7 2 5 1 5 0 4 0
Decoded message: G0XYZ K1ABC FN42
.....
For the corresponding program jt65code only the information-carrying
channel symbols are shown, and the symbol values range from 0 to
63. Sync synbols lie two tone intervals below data tone 0, and the
sequential locations of sync symbols are described in the JT65
Protocol section of this Guide.
A typical execution of jt65code is shown below. The program displays
the packed message of 72 bits, shown here as 12 six-bit symbol values,
followed by the channel symbols:
.....
$ jt65code "G0XYZ K1ABC FN42"
Message: G0XYZ K1ABC FN42
Packed message, 6-bit symbols: 61 36 45 30 3 55 3 2 14 5 33 40
Information-carrying channel symbols:
56 40 8 40 51 47 50 34 44 53 22 53 28 31 13 60 46 2 14 58 43
41 58 35 8 35 3 24 1 21 41 43 0 25 54 9 41 54 7 25 21 9
62 59 7 43 31 21 57 13 59 41 17 49 19 54 21 39 33 42 18 2 60
Decoded message: G0XYZ K1ABC FN42
.....
For an illustration of the power of the strong error-control coding in
JT9, JT65 and JT4, try looking at the channel symbols after changing a
single character in the message. For example, change the grid locater
from FN42 to FN43 in the JT65 message:
.....
$ jt65code "G0XYZ K1ABC FN43"
Message: G0XYZ K1ABC FN43
Packed message, 6-bit symbols: 61 36 45 30 3 55 3 2 14 5 33 41
Information-carrying channel symbols:
25 35 47 8 13 9 61 40 44 9 51 6 8 40 38 34 8 2 21 23 30
51 32 56 39 35 3 50 48 30 8 5 40 18 54 9 24 30 26 61 23 11
3 59 7 7 39 1 25 24 4 50 17 49 52 19 34 7 4 34 61 2 61
Decoded message: G0XYZ K1ABC FN43
.....
You will discover that every possible JT65 message differs from every
other possible JT65 message in at least 52 of the 63
information-carrying channel symbols.
WSJT-X home page:: http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html
WSJT-X User's Guide::
http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main-{VERSION}.html
== AUTHOR
Joe Taylor, K1JT.
== COPYING
*jt65code*, *jt9code* and *jt4code* are Copyright (C) 2001 - 2015 by
Joseph H. Taylor, Jr., K1JT, with contributions from additional
authors. WSJT-X is Open Source software, licensed under the GNU
General Public License (GPLv3).
These programs are distributed in the hope that they will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
@@ -0,0 +1,12 @@
// Boost.Function library
// Copyright Douglas Gregor 2002-2003. 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
#define BOOST_FUNCTION_NUM_ARGS 1
#include <boost/function/detail/maybe_include.hpp>
#undef BOOST_FUNCTION_NUM_ARGS
@@ -0,0 +1,31 @@
#ifndef DATE_TIME_LOCALE_CONFIG_HPP___
#define DATE_TIME_LOCALE_CONFIG_HPP___
/* Copyright (c) 2002-2006 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
* $Date$
*/
// This file configures whether the library will support locales and hence
// iostream based i/o. Even if a compiler has some support for locales,
// any failure to be compatible gets the compiler on the exclusion list.
//
// At the moment this is defined for MSVC 6 and any compiler that
// defines BOOST_NO_STD_LOCALE (gcc 2.95.x)
#include "boost/config.hpp" //sets BOOST_NO_STD_LOCALE
#include "boost/detail/workaround.hpp"
//This file basically becomes a noop if locales are not properly supported
#if (defined(BOOST_NO_STD_LOCALE) \
|| (BOOST_WORKAROUND( BOOST_MSVC, < 1300)) \
|| (BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x581 )) ) )
#define BOOST_DATE_TIME_NO_LOCALE
#endif
#endif
@@ -0,0 +1,235 @@
// This is a comment line, anything with // is ignored at process time.
= _WSJT-X_ User Guide
Joseph H Taylor, Jr, K1JT
:revnumber: {VERSION}
// For web-pages, adding :badges: is ok, but is a security issue for
// package building .deb, .rpm, etc as it exposes the IP address and the images
// are non-free, so can't be included as part of the Debian package.
// :badges:
:docinfo1:
:imagesdir: {docdir}/images
:icons: font
:numbered:
:keywords: amateur radio weak signal communication K1JT WSJT JT65 JT9
:description: Software for Amateur Radio Weak-Signal Communication
:prog: WSJT-X
// use global link file
include::../../common/links.adoc[]
// These [[xxxx]] labels are HTML anchors, and can be used to
// navigate though the document easily: <<INTRO,See Introduction>> will
// place a hyper-link in your text to take you too the anchored section.
// All major sections or points of interest should have one.
// == is level (2), section 1.0, === would mean section 1.1, === would
// be section 1.1.1. This method is used throughout the document.
[[INTRO]]
== Introduction
include::introduction.adoc[]
[[NEW_FEATURES]]
include::new_features.adoc[]
[[SYSREQ]]
== System Requirements
include::system-requirements.adoc[]
[[INSTALL]]
== Installation
Installation packages for released versions on Windows, Linux, and OS
X are found on the {homepage}. Click on the _WSJT-X_ link at the
left margin and select the appropriate package for your operating
system.
[[INSTALL_WIN]]
=== Windows
include::install-windows.adoc[]
[[INSTALL_LINUX]]
=== Linux
include::install-linux.adoc[]
[[INSTALL_OSX]]
=== OS X and macOS
include::install-mac.adoc[]
////
[[SRC_CODE]]
=== Source Code
include::install-from-source.adoc[]
////
[[CONFIG]]
== Settings
Select *Settings* from the *File* menu or by typing *F2*. (On
Macintosh select *Preferences* from the _WSJT-X_ menu, or use the
keyboard shortcut *Cmd+,*). The following sections describe setup
options available on each of eight tabs selectable near the top of the
window.
[[GENERAL]]
=== General
include::settings-general.adoc[]
[[RADIO]]
=== Radio
include::settings-radio.adoc[]
[[AUDIO]]
=== Audio
include::settings-audio.adoc[]
[[TXMACROS]]
=== Tx Macros
include::settings-txmacros.adoc[]
[[REPORTING]]
=== Reporting
include::settings-reporting.adoc[]
[[BAND_SETTINGS]]
=== Frequencies
include::settings-frequencies.adoc[]
[[COLORS]]
=== Colors
include::settings-colors.adoc[]
[[ADVANCED]]
=== Advanced
include::settings-advanced.adoc[]
[[TRANSCEIVER]]
== Transceiver Setup
include::transceiver-setup.adoc[]
[[TUTORIAL]]
== Basic Operating Tutorial
This section introduces the basic user controls and program behavior
of _WSJT-X_, with particular emphasis on the JT9, JT65, and FT8 modes.
We suggest that new users should go through the full HF-oriented
tutorial, preferably while at your radio. Subsequent sections cover
additional details on <<MAKE_QSOS,Making QSOs>>, <<WSPR,WSPR mode>>
and <<VHF_AND_UP,VHF+ Features>>.
[[TUT_MAIN]]
=== Main Window Settings
include::tutorial-main-window.adoc[]
[[TUT_WIDE_GRAPH]]
=== Wide Graph Settings
include::tutorial-wide-graph-settings.adoc[]
[[TUT_EX1]]
=== JT9
include::tutorial-example1.adoc[]
[[TUT_EX2]]
=== JT9+JT65
include::tutorial-example2.adoc[]
[[TUT_EX3]]
=== FT8
include::tutorial-example3.adoc[]
[[MAKE_QSOS]]
== Making QSOs
include::make-qso.adoc[]
[[VHF_AND_UP]]
== VHF+ Features
include::vhf-features.adoc[]
[[WSPR]]
== WSPR Mode
include::wspr.adoc[]
[[COMMAND_REF]]
== On-Screen Controls
[[MENUS]]
=== Menus
include::controls-functions-menus.adoc[]
[[CONTROLS_MAIN]]
=== Button Row
include::controls-functions-main-window.adoc[]
[[CONTROLS_LEFT]]
=== Left
include::controls-functions-left.adoc[]
[[CONTROLS_CENTER]]
=== Center
include::controls-functions-center.adoc[]
[[CONTROLS_MSGS]]
=== Tx Messages
include::controls-functions-messages.adoc[]
[[STATUS_BAR]]
=== Status Bar
include::controls-functions-status-bar.adoc[]
[[CONTROLS_WIDE]]
=== Wide Graph
include::controls-functions-wide-graph.adoc[]
[[LOGGING]]
== Logging
include::logging.adoc[]
[[DECODER_NOTES]]
== Decoder Notes
include::decoder_notes.adoc[]
[[MEASUREMENT_TOOLS]]
== Measurement Tools
include::measurement_tools.adoc[]
[[COOP_PGMS]]
== Cooperating Programs
include::cooperating-programs.adoc[]
[[PLATFORM]]
== Platform Dependencies
include::platform-dependencies.adoc[]
[[FAQ]]
== Frequently Asked Questions
include::faq.adoc[]
[[PROTOCOLS]]
== Protocol Specifications
include::protocols.adoc[]
[[ASTRODATA]]
== Astronomical Data
include::astro_data.adoc[]
[[UTIL]]
== Utility Programs
include::utilities.adoc[]
[[SUPPORT]]
== Support
include::support.adoc[]
[[ACK]]
== Acknowledgements
include::acknowledgements.adoc[]
[[LICENSE]]
== License
include::../../common/license.adoc[]
ifeval::["{backend}" != "html5"]
[index]
== Index
endif::[]
@@ -0,0 +1,88 @@
#ifndef MODES_HPP__
#define MODES_HPP__
#include <QAbstractListModel>
#include "qt_helpers.hpp"
class QString;
class QVariant;
class QModelIndex;
//
// Class Modes - Qt model that implements a list of data modes
//
//
// Responsibilities
//
// Provides a single column list model that contains the human
// readable string version of the data mode in the display role. Also
// provided is a translatable column header string and tool tip
// string.
//
//
// Collaborations
//
// Implements a concrete sub-class of the QAbstractListModel class.
//
class Modes final
: public QAbstractListModel
{
Q_OBJECT
Q_ENUMS (Mode)
public:
//
// This enumeration contains the supported modes, to complement this
// an array of human readable strings in the implementation
// (Modes.cpp) must be maintained in parallel.
//
enum Mode
{
ALL, // matches with all modes
JT65,
JT9,
JT4,
WSPR,
Echo,
ISCAT,
MSK144,
QRA64,
FreqCal,
FT8,
MODES_END_SENTINAL_AND_COUNT // this must be last
};
Q_ENUM (Mode)
explicit Modes (QObject * parent = nullptr);
// translate between enumeration and human readable strings
static char const * name (Mode);
static Mode value (QString const&);
// Implement the QAbstractListModel interface
int rowCount (QModelIndex const& parent = QModelIndex {}) const override
{
return parent.isValid () ? 0 : MODES_END_SENTINAL_AND_COUNT; // Number of modes in Mode enumeration class
}
QVariant data (QModelIndex const&, int role = Qt::DisplayRole) const override;
QVariant headerData (int section, Qt::Orientation, int = Qt::DisplayRole) const override;
};
// Qt boilerplate to make the Modes::Mode enumeration a type that can
// be streamed and queued as a signal argument as well as showing the
// human readable string when output to debug streams.
#if QT_VERSION < 0x050500
// Qt 5.6 introduces the Q_ENUM macro which automatically registers
// the meta-type
Q_DECLARE_METATYPE (Modes::Mode);
#endif
#if !defined (QT_NO_DEBUG_STREAM)
ENUM_QDEBUG_OPS_DECL (Modes, Mode);
#endif
ENUM_QDATASTREAM_OPS_DECL (Modes, Mode);
ENUM_CONVERSION_OPS_DECL (Modes, Mode);
#endif
@@ -0,0 +1,28 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP
#define BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP
#include <boost/units/derived_dimension.hpp>
#include <boost/units/physical_dimensions/length.hpp>
namespace boost {
namespace units {
/// derived dimension for volume : l^3
typedef derived_dimension<length_base_dimension,3>::type volume_dimension;
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP
@@ -0,0 +1,151 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_VACPP_PPC_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_VACPP_PPC_HPP_INCLUDED
//
// detail/sp_counted_base_vacpp_ppc.hpp - xlC(vacpp) on POWER
// based on: detail/sp_counted_base_w32.hpp
//
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
// Copyright 2004-2005 Peter Dimov
// Copyright 2006 Michael van der Westhuizen
// Copyright 2012 IBM Corp.
//
// 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)
//
//
// Lock-free algorithm by Alexander Terekhov
//
// Thanks to Ben Hitchings for the #weak + (#shared != 0)
// formulation
//
#include <boost/detail/sp_typeinfo.hpp>
extern "builtin" void __lwsync(void);
extern "builtin" void __isync(void);
extern "builtin" int __fetch_and_add(volatile int* addr, int val);
extern "builtin" int __compare_and_swap(volatile int*, int*, int);
namespace boost
{
namespace detail
{
inline void atomic_increment( int *pw )
{
// ++*pw;
__lwsync();
__fetch_and_add(pw, 1);
__isync();
}
inline int atomic_decrement( int *pw )
{
// return --*pw;
__lwsync();
int originalValue = __fetch_and_add(pw, -1);
__isync();
return (originalValue - 1);
}
inline int atomic_conditional_increment( int *pw )
{
// if( *pw != 0 ) ++*pw;
// return *pw;
__lwsync();
int v = *const_cast<volatile int*>(pw);
for (;;)
// loop until state is known
{
if (v == 0) return 0;
if (__compare_and_swap(pw, &v, v + 1))
{
__isync(); return (v + 1);
}
}
}
class sp_counted_base
{
private:
sp_counted_base( sp_counted_base const & );
sp_counted_base & operator= ( sp_counted_base const & );
int use_count_; // #shared
int weak_count_; // #weak + (#shared != 0)
char pad[64] __attribute__((__aligned__(64)));
// pad to prevent false sharing
public:
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
{
}
virtual ~sp_counted_base() // nothrow
{
}
// dispose() is called when use_count_ drops to zero, to release
// the resources managed by *this.
virtual void dispose() = 0; // nothrow
// destroy() is called when weak_count_ drops to zero.
virtual void destroy() // nothrow
{
delete this;
}
virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
virtual void * get_untyped_deleter() = 0;
void add_ref_copy()
{
atomic_increment( &use_count_ );
}
bool add_ref_lock() // true on success
{
return atomic_conditional_increment( &use_count_ ) != 0;
}
void release() // nothrow
{
if( atomic_decrement( &use_count_ ) == 0 )
{
dispose();
weak_release();
}
}
void weak_add_ref() // nothrow
{
atomic_increment( &weak_count_ );
}
void weak_release() // nothrow
{
if( atomic_decrement( &weak_count_ ) == 0 )
{
destroy();
}
}
long use_count() const // nothrow
{
return *const_cast<volatile int*>(&use_count_);
}
};
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_VACPP_PPC_HPP_INCLUDED
@@ -0,0 +1,487 @@
///////////////////////////////////////////////////////////////////////////////
/// \file generate_by_value.hpp
/// Contains definition of by_value_generator_\<\> class template.
//
// Copyright 2008 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
template<typename Tag , typename Arg0 >
struct by_value_generator_<
proto::expr<Tag, list1<Arg0>, 1>
>
{
typedef
list1<Arg0>
src_args;
typedef
list1<
typename uncvref<Arg0 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 1> src_type;
typedef proto::expr<Tag, dst_args, 1> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0
};
return that;
}
};
template<typename Tag , typename Arg0 >
struct by_value_generator_<
proto::basic_expr<Tag, list1<Arg0>, 1>
>
{
typedef
list1<Arg0>
src_args;
typedef
list1<
typename uncvref<Arg0 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 1> src_type;
typedef proto::basic_expr<Tag, dst_args, 1> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 >
struct by_value_generator_<
proto::expr<Tag, list2<Arg0 , Arg1>, 2>
>
{
typedef
list2<Arg0 , Arg1>
src_args;
typedef
list2<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 2> src_type;
typedef proto::expr<Tag, dst_args, 2> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 >
struct by_value_generator_<
proto::basic_expr<Tag, list2<Arg0 , Arg1>, 2>
>
{
typedef
list2<Arg0 , Arg1>
src_args;
typedef
list2<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 2> src_type;
typedef proto::basic_expr<Tag, dst_args, 2> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 >
struct by_value_generator_<
proto::expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3>
>
{
typedef
list3<Arg0 , Arg1 , Arg2>
src_args;
typedef
list3<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 3> src_type;
typedef proto::expr<Tag, dst_args, 3> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 >
struct by_value_generator_<
proto::basic_expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3>
>
{
typedef
list3<Arg0 , Arg1 , Arg2>
src_args;
typedef
list3<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 3> src_type;
typedef proto::basic_expr<Tag, dst_args, 3> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
struct by_value_generator_<
proto::expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4>
>
{
typedef
list4<Arg0 , Arg1 , Arg2 , Arg3>
src_args;
typedef
list4<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 4> src_type;
typedef proto::expr<Tag, dst_args, 4> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
struct by_value_generator_<
proto::basic_expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4>
>
{
typedef
list4<Arg0 , Arg1 , Arg2 , Arg3>
src_args;
typedef
list4<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 4> src_type;
typedef proto::basic_expr<Tag, dst_args, 4> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
struct by_value_generator_<
proto::expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5>
>
{
typedef
list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>
src_args;
typedef
list5<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 5> src_type;
typedef proto::expr<Tag, dst_args, 5> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
struct by_value_generator_<
proto::basic_expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5>
>
{
typedef
list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>
src_args;
typedef
list5<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 5> src_type;
typedef proto::basic_expr<Tag, dst_args, 5> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 >
struct by_value_generator_<
proto::expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6>
>
{
typedef
list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>
src_args;
typedef
list6<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 6> src_type;
typedef proto::expr<Tag, dst_args, 6> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 >
struct by_value_generator_<
proto::basic_expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6>
>
{
typedef
list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>
src_args;
typedef
list6<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 6> src_type;
typedef proto::basic_expr<Tag, dst_args, 6> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 >
struct by_value_generator_<
proto::expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7>
>
{
typedef
list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>
src_args;
typedef
list7<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 7> src_type;
typedef proto::expr<Tag, dst_args, 7> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 >
struct by_value_generator_<
proto::basic_expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7>
>
{
typedef
list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>
src_args;
typedef
list7<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 7> src_type;
typedef proto::basic_expr<Tag, dst_args, 7> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 >
struct by_value_generator_<
proto::expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8>
>
{
typedef
list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>
src_args;
typedef
list8<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 8> src_type;
typedef proto::expr<Tag, dst_args, 8> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 >
struct by_value_generator_<
proto::basic_expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8>
>
{
typedef
list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>
src_args;
typedef
list8<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 8> src_type;
typedef proto::basic_expr<Tag, dst_args, 8> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 >
struct by_value_generator_<
proto::expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9>
>
{
typedef
list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>
src_args;
typedef
list9<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 9> src_type;
typedef proto::expr<Tag, dst_args, 9> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 >
struct by_value_generator_<
proto::basic_expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9>
>
{
typedef
list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>
src_args;
typedef
list9<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 9> src_type;
typedef proto::basic_expr<Tag, dst_args, 9> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 >
struct by_value_generator_<
proto::expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10>
>
{
typedef
list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>
src_args;
typedef
list10<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type , typename uncvref<Arg9 >::type
>
dst_args;
typedef proto::expr<Tag, src_args, 10> src_type;
typedef proto::expr<Tag, dst_args, 10> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 , e.child9
};
return that;
}
};
template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 >
struct by_value_generator_<
proto::basic_expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10>
>
{
typedef
list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>
src_args;
typedef
list10<
typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type , typename uncvref<Arg9 >::type
>
dst_args;
typedef proto::basic_expr<Tag, src_args, 10> src_type;
typedef proto::basic_expr<Tag, dst_args, 10> type;
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 , e.child9
};
return that;
}
};
@@ -0,0 +1,141 @@
// (C) Copyright Ion Gaztanaga 2014.
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
#define BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
#include <boost/config.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/noncopyable.hpp>
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_NO_CXX11_DECLTYPE) \
&& !defined(BOOST_INTEL_CXX_VERSION) && \
!(defined(BOOST_MSVC) && _MSC_VER == 1800)
#define BOOST_TT_CXX11_IS_COPY_ASSIGNABLE
#include <boost/type_traits/declval.hpp>
#else
//For compilers without decltype
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost {
namespace detail{
template <bool DerivedFromNoncopyable, class T>
struct is_copy_assignable_impl2 {
// Intel compiler has problems with SFINAE for copy constructors and deleted functions:
//
// error: function *function_name* cannot be referenced -- it is a deleted function
// static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
// ^
//
// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See:
// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken
#if defined(BOOST_TT_CXX11_IS_COPY_ASSIGNABLE)
typedef boost::type_traits::yes_type yes_type;
typedef boost::type_traits::no_type no_type;
template <class U>
static decltype(::boost::declval<U&>() = ::boost::declval<const U&>(), yes_type() ) test(int);
template <class>
static no_type test(...);
static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
#else
static BOOST_DEDUCED_TYPENAME boost::add_reference<T>::type produce();
template <class T1>
static boost::type_traits::no_type test(T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0);
static boost::type_traits::yes_type test(...);
// If you see errors like this:
//
// `'T::operator=(const T&)' is private`
// `boost/type_traits/is_copy_assignable.hpp:NN:M: error: within this context`
//
// then you are trying to call that macro for a structure defined like that:
//
// struct T {
// ...
// private:
// T & operator=(const T &);
// ...
// };
//
// To fix that you must modify your structure:
//
// // C++03 and C++11 version
// struct T: private boost::noncopyable {
// ...
// private:
// T & operator=(const T &);
// ...
// };
//
// // C++11 version
// struct T {
// ...
// private:
// T& operator=(const T &) = delete;
// ...
// };
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(test(produce())) == sizeof(boost::type_traits::yes_type)
));
#endif
};
template <class T>
struct is_copy_assignable_impl2<true, T> {
BOOST_STATIC_CONSTANT(bool, value = false);
};
template <class T>
struct is_copy_assignable_impl {
#if !defined(BOOST_TT_CXX11_IS_COPY_ASSIGNABLE)
//For compilers without decltype, at least return false on const types, arrays
//types derived from boost::noncopyable and types defined as BOOST_MOVEABLE_BUT_NOT_COPYABLE
typedef BOOST_DEDUCED_TYPENAME boost::remove_reference<T>::type unreferenced_t;
BOOST_STATIC_CONSTANT(bool, value = (
boost::detail::is_copy_assignable_impl2<
boost::is_base_and_derived<boost::noncopyable, T>::value
|| boost::is_const<unreferenced_t>::value || boost::is_array<unreferenced_t>::value
,T
>::value
));
#else
BOOST_STATIC_CONSTANT(bool, value = (
boost::detail::is_copy_assignable_impl2<
boost::is_base_and_derived<boost::noncopyable, T>::value,T
>::value
));
#endif
};
} // namespace detail
template <class T> struct is_copy_assignable : public integral_constant<bool, ::boost::detail::is_copy_assignable_impl<T>::value>{};
template <> struct is_copy_assignable<void> : public false_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template <> struct is_copy_assignable<void const> : public false_type{};
template <> struct is_copy_assignable<void const volatile> : public false_type{};
template <> struct is_copy_assignable<void volatile> : public false_type{};
#endif
} // namespace boost
#endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,358 @@
// (C) Copyright Gennadiy Rozental 2001.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile$
//
// Version : $Revision: 74248 $
//
// Description : implementation details for old toolbox
// ***************************************************************************
#ifndef BOOST_TEST_TOOLS_OLD_IMPL_HPP_012705GER
#define BOOST_TEST_TOOLS_OLD_IMPL_HPP_012705GER
// Boost.Test
#include <boost/test/unit_test_log.hpp>
#include <boost/test/tools/assertion_result.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/test/tools/detail/fwd.hpp>
#include <boost/test/tools/detail/print_helper.hpp>
// Boost
#include <boost/limits.hpp>
#include <boost/numeric/conversion/conversion_traits.hpp> // for numeric::conversion_traits
#include <boost/type_traits/is_array.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
// STL
#include <cstddef> // for std::size_t
#include <climits> // for CHAR_BIT
#include <boost/test/detail/suppress_warnings.hpp>
//____________________________________________________________________________//
namespace boost {
namespace test_tools {
namespace tt_detail {
// ************************************************************************** //
// ************** old TOOLBOX Implementation ************** //
// ************************************************************************** //
// This function adds level of indirection, but it makes sure we evaluate predicate
// arguments only once
#ifndef BOOST_TEST_PROD
#define TEMPL_PARAMS( z, m, dummy ) , typename BOOST_JOIN( Arg, m )
#define FUNC_PARAMS( z, m, dummy ) \
, BOOST_JOIN( Arg, m ) const& BOOST_JOIN( arg, m ) \
, char const* BOOST_JOIN( BOOST_JOIN( arg, m ), _descr ) \
/**/
#define PRED_PARAMS( z, m, dummy ) BOOST_PP_COMMA_IF( m ) BOOST_JOIN( arg, m )
#define ARG_INFO( z, m, dummy ) \
, BOOST_JOIN( BOOST_JOIN( arg, m ), _descr ) \
, &static_cast<const unit_test::lazy_ostream&>(unit_test::lazy_ostream::instance() \
<< ::boost::test_tools::tt_detail::print_helper( BOOST_JOIN( arg, m ) )) \
/**/
#define IMPL_FRWD( z, n, dummy ) \
template<typename Pred \
BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), TEMPL_PARAMS, _ )> \
inline bool \
check_frwd( Pred P, unit_test::lazy_ostream const& assertion_descr, \
const_string file_name, std::size_t line_num, \
tool_level tl, check_type ct \
BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), FUNC_PARAMS, _ ) \
) \
{ \
return \
report_assertion( P( BOOST_PP_REPEAT_ ## z(BOOST_PP_ADD(n, 1), PRED_PARAMS,_) ),\
assertion_descr, file_name, line_num, tl, ct, \
BOOST_PP_ADD( n, 1 ) \
BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), ARG_INFO, _ ) \
); \
} \
/**/
#ifndef BOOST_TEST_MAX_PREDICATE_ARITY
#define BOOST_TEST_MAX_PREDICATE_ARITY 5
#endif
BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
#undef TEMPL_PARAMS
#undef FUNC_PARAMS
#undef PRED_INFO
#undef ARG_INFO
#undef IMPL_FRWD
#endif
//____________________________________________________________________________//
template <class Left, class Right>
inline assertion_result equal_impl( Left const& left, Right const& right )
{
return left == right;
}
//____________________________________________________________________________//
inline assertion_result equal_impl( char* left, char const* right ) { return equal_impl( static_cast<char const*>(left), static_cast<char const*>(right) ); }
inline assertion_result equal_impl( char const* left, char* right ) { return equal_impl( static_cast<char const*>(left), static_cast<char const*>(right) ); }
inline assertion_result equal_impl( char* left, char* right ) { return equal_impl( static_cast<char const*>(left), static_cast<char const*>(right) ); }
#if !defined( BOOST_NO_CWCHAR )
assertion_result BOOST_TEST_DECL equal_impl( wchar_t const* left, wchar_t const* right );
inline assertion_result equal_impl( wchar_t* left, wchar_t const* right ) { return equal_impl( static_cast<wchar_t const*>(left), static_cast<wchar_t const*>(right) ); }
inline assertion_result equal_impl( wchar_t const* left, wchar_t* right ) { return equal_impl( static_cast<wchar_t const*>(left), static_cast<wchar_t const*>(right) ); }
inline assertion_result equal_impl( wchar_t* left, wchar_t* right ) { return equal_impl( static_cast<wchar_t const*>(left), static_cast<wchar_t const*>(right) ); }
#endif
//____________________________________________________________________________//
struct equal_impl_frwd {
template <typename Left, typename Right>
inline assertion_result
call_impl( Left const& left, Right const& right, mpl::false_ ) const
{
return equal_impl( left, right );
}
template <typename Left, typename Right>
inline assertion_result
call_impl( Left const& left, Right const& right, mpl::true_ ) const
{
return (*this)( right, &left[0] );
}
template <typename Left, typename Right>
inline assertion_result
operator()( Left const& left, Right const& right ) const
{
typedef typename is_array<Left>::type left_is_array;
return call_impl( left, right, left_is_array() );
}
};
//____________________________________________________________________________//
struct ne_impl {
template <class Left, class Right>
assertion_result operator()( Left const& left, Right const& right )
{
return !equal_impl_frwd()( left, right );
}
};
//____________________________________________________________________________//
struct lt_impl {
template <class Left, class Right>
assertion_result operator()( Left const& left, Right const& right )
{
return left < right;
}
};
//____________________________________________________________________________//
struct le_impl {
template <class Left, class Right>
assertion_result operator()( Left const& left, Right const& right )
{
return left <= right;
}
};
//____________________________________________________________________________//
struct gt_impl {
template <class Left, class Right>
assertion_result operator()( Left const& left, Right const& right )
{
return left > right;
}
};
//____________________________________________________________________________//
struct ge_impl {
template <class Left, class Right>
assertion_result operator()( Left const& left, Right const& right )
{
return left >= right;
}
};
//____________________________________________________________________________//
struct equal_coll_impl {
template <typename Left, typename Right>
assertion_result operator()( Left left_begin, Left left_end, Right right_begin, Right right_end )
{
assertion_result pr( true );
std::size_t pos = 0;
for( ; left_begin != left_end && right_begin != right_end; ++left_begin, ++right_begin, ++pos ) {
if( *left_begin != *right_begin ) {
pr = false;
pr.message() << "\nMismatch at position " << pos << ": "
<< ::boost::test_tools::tt_detail::print_helper(*left_begin)
<< " != "
<< ::boost::test_tools::tt_detail::print_helper(*right_begin);
}
}
if( left_begin != left_end ) {
std::size_t r_size = pos;
while( left_begin != left_end ) {
++pos;
++left_begin;
}
pr = false;
pr.message() << "\nCollections size mismatch: " << pos << " != " << r_size;
}
if( right_begin != right_end ) {
std::size_t l_size = pos;
while( right_begin != right_end ) {
++pos;
++right_begin;
}
pr = false;
pr.message() << "\nCollections size mismatch: " << l_size << " != " << pos;
}
return pr;
}
};
//____________________________________________________________________________//
struct bitwise_equal_impl {
template <class Left, class Right>
assertion_result operator()( Left const& left, Right const& right )
{
assertion_result pr( true );
std::size_t left_bit_size = sizeof(Left)*CHAR_BIT;
std::size_t right_bit_size = sizeof(Right)*CHAR_BIT;
static Left const leftOne( 1 );
static Right const rightOne( 1 );
std::size_t total_bits = left_bit_size < right_bit_size ? left_bit_size : right_bit_size;
for( std::size_t counter = 0; counter < total_bits; ++counter ) {
if( ( left & ( leftOne << counter ) ) != ( right & ( rightOne << counter ) ) ) {
pr = false;
pr.message() << "\nMismatch at position " << counter;
}
}
if( left_bit_size != right_bit_size ) {
pr = false;
pr.message() << "\nOperands bit sizes mismatch: " << left_bit_size << " != " << right_bit_size;
}
return pr;
}
};
//____________________________________________________________________________//
template<typename FPT1, typename FPT2>
struct comp_supertype {
// deduce "better" type from types of arguments being compared
// if one type is floating and the second integral we use floating type and
// value of integral type is promoted to the floating. The same for float and double
// But we don't want to compare two values of integral types using this tool.
typedef typename numeric::conversion_traits<FPT1,FPT2>::supertype type;
BOOST_STATIC_ASSERT_MSG( !is_integral<type>::value, "Only floating-point types can be compared!");
};
} // namespace tt_detail
namespace fpc = math::fpc;
// ************************************************************************** //
// ************** check_is_close ************** //
// ************************************************************************** //
struct BOOST_TEST_DECL check_is_close_t {
// Public typedefs
typedef assertion_result result_type;
template<typename FPT1, typename FPT2, typename ToleranceType>
assertion_result
operator()( FPT1 left, FPT2 right, ToleranceType tolerance ) const
{
fpc::close_at_tolerance<typename tt_detail::comp_supertype<FPT1,FPT2>::type> pred( tolerance, fpc::FPC_STRONG );
assertion_result ar( pred( left, right ) );
if( !ar )
ar.message() << pred.tested_rel_diff();
return ar;
}
};
//____________________________________________________________________________//
template<typename FPT1, typename FPT2, typename ToleranceType>
inline assertion_result
check_is_close( FPT1 left, FPT2 right, ToleranceType tolerance )
{
return check_is_close_t()( left, right, tolerance );
}
//____________________________________________________________________________//
// ************************************************************************** //
// ************** check_is_small ************** //
// ************************************************************************** //
struct BOOST_TEST_DECL check_is_small_t {
// Public typedefs
typedef bool result_type;
template<typename FPT>
bool
operator()( FPT fpv, FPT tolerance ) const
{
return fpc::is_small( fpv, tolerance );
}
};
//____________________________________________________________________________//
template<typename FPT>
inline bool
check_is_small( FPT fpv, FPT tolerance )
{
return fpc::is_small( fpv, tolerance );
}
//____________________________________________________________________________//
} // namespace test_tools
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_TOOLS_OLD_IMPL_HPP_012705GER
@@ -0,0 +1,5 @@
// Copyright David Abrahams 2006. 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)
# undef BOOST_concept_typename
# undef BOOST_concept
@@ -0,0 +1,517 @@
#include "widegraph.h"
#include <algorithm>
#include <QApplication>
#include <QSettings>
#include "ui_widegraph.h"
#include "commons.h"
#include "Configuration.hpp"
#include "MessageBox.hpp"
#include "SettingsGroup.hpp"
#include "moc_widegraph.cpp"
namespace
{
auto user_defined = QObject::tr ("User Defined");
float swide[MAX_SCREENSIZE];
}
WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
QDialog(parent),
ui(new Ui::WideGraph),
m_settings (settings),
m_palettes_path {":/Palettes"},
m_ntr0 {0},
m_lockTxFreq {false},
m_bHaveTransmitted {false},
m_n {0}
{
ui->setupUi(this);
setWindowTitle (QApplication::applicationName () + " - " + tr ("Wide Graph"));
setWindowFlags (Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
setMaximumWidth (MAX_SCREENSIZE);
setMaximumHeight (880);
ui->widePlot->setCursor(Qt::CrossCursor);
ui->widePlot->setMaximumHeight(800);
ui->widePlot->setCurrent(false);
connect(ui->widePlot, SIGNAL(freezeDecode1(int)),this,
SLOT(wideFreezeDecode(int)));
connect(ui->widePlot, SIGNAL(setFreq1(int,int)),this,
SLOT(setFreq2(int,int)));
{
//Restore user's settings
SettingsGroup g {m_settings, "WideGraph"};
restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ());
ui->widePlot->setPlotZero(m_settings->value("PlotZero", 0).toInt());
ui->widePlot->setPlotGain(m_settings->value("PlotGain", 0).toInt());
ui->widePlot->setPlot2dGain(m_settings->value("Plot2dGain", 0).toInt());
ui->widePlot->setPlot2dZero(m_settings->value("Plot2dZero", 0).toInt());
ui->zeroSlider->setValue(ui->widePlot->plotZero());
ui->gainSlider->setValue(ui->widePlot->plotGain());
ui->gain2dSlider->setValue(ui->widePlot->plot2dGain());
ui->zero2dSlider->setValue(ui->widePlot->plot2dZero());
int n = m_settings->value("BinsPerPixel",2).toInt();
m_bFlatten=m_settings->value("Flatten",true).toBool();
m_bRef=m_settings->value("UseRef",false).toBool();
ui->cbFlatten->setChecked(m_bFlatten);
ui->widePlot->setFlatten(m_bFlatten,m_bRef);
ui->cbRef->setChecked(m_bRef);
ui->widePlot->setBreadth(m_settings->value("PlotWidth",1000).toInt());
ui->bppSpinBox->setValue(n);
m_nsmo=m_settings->value("SmoothYellow",1).toInt();
ui->smoSpinBox->setValue(m_nsmo);
m_Percent2DScreen=m_settings->value("Percent2D",30).toInt();
ui->sbPercent2dPlot->setValue(m_Percent2DScreen);
m_waterfallAvg = m_settings->value("WaterfallAvg",5).toInt();
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
ui->widePlot->setWaterfallAvg(m_waterfallAvg);
ui->widePlot->setCurrent(m_settings->value("Current",false).toBool());
ui->widePlot->setCumulative(m_settings->value("Cumulative",true).toBool());
ui->widePlot->setLinearAvg(m_settings->value("LinearAvg",false).toBool());
ui->widePlot->setReference(m_settings->value("Reference",false).toBool());
if(ui->widePlot->current()) ui->spec2dComboBox->setCurrentIndex(0);
if(ui->widePlot->cumulative()) ui->spec2dComboBox->setCurrentIndex(1);
if(ui->widePlot->linearAvg()) ui->spec2dComboBox->setCurrentIndex(2);
if(ui->widePlot->Reference()) ui->spec2dComboBox->setCurrentIndex(3);
int nbpp=m_settings->value("BinsPerPixel",2).toInt();
ui->widePlot->setBinsPerPixel(nbpp);
ui->widePlot->setStartFreq(m_settings->value("StartFreq",0).toInt());
ui->fStartSpinBox->setValue(ui->widePlot->startFreq());
m_waterfallPalette=m_settings->value("WaterfallPalette","Default").toString();
m_userPalette = WFPalette {m_settings->value("UserPalette").value<WFPalette::Colours> ()};
int m_fMin = m_settings->value ("Fmin", 2500).toInt ();
ui->fSplitSpinBox->setValue (m_fMin);
setRxRange ();
ui->controls_widget->setVisible(!m_settings->value("HideControls", false).toBool ());
}
saveSettings (); // update config with defaults
int index=0;
for (QString const& file:
m_palettes_path.entryList(QDir::NoDotAndDotDot |
QDir::System | QDir::Hidden |
QDir::AllDirs | QDir::Files,
QDir::DirsFirst)) {
QString t=file.mid(0,file.length()-4);
ui->paletteComboBox->addItem(t);
if(t==m_waterfallPalette) ui->paletteComboBox->setCurrentIndex(index);
index++;
}
ui->paletteComboBox->addItem (user_defined);
if (user_defined == m_waterfallPalette) ui->paletteComboBox->setCurrentIndex(index);
readPalette ();
}
WideGraph::~WideGraph ()
{
}
void WideGraph::closeEvent (QCloseEvent * e)
{
saveSettings ();
QDialog::closeEvent (e);
}
void WideGraph::saveSettings() //saveSettings
{
SettingsGroup g {m_settings, "WideGraph"};
m_settings->setValue ("geometry", saveGeometry ());
m_settings->setValue ("PlotZero", ui->widePlot->plotZero());
m_settings->setValue ("PlotGain", ui->widePlot->plotGain());
m_settings->setValue ("Plot2dGain", ui->widePlot->plot2dGain());
m_settings->setValue ("Plot2dZero", ui->widePlot->plot2dZero());
m_settings->setValue ("PlotWidth", ui->widePlot->plotWidth ());
m_settings->setValue ("BinsPerPixel", ui->bppSpinBox->value ());
m_settings->setValue ("SmoothYellow", ui->smoSpinBox->value ());
m_settings->setValue ("Percent2D",m_Percent2DScreen);
m_settings->setValue ("WaterfallAvg", ui->waterfallAvgSpinBox->value ());
m_settings->setValue ("Current", ui->widePlot->current());
m_settings->setValue ("Cumulative", ui->widePlot->cumulative());
m_settings->setValue ("LinearAvg", ui->widePlot->linearAvg());
m_settings->setValue ("Reference", ui->widePlot->Reference());
m_settings->setValue ("BinsPerPixel", ui->widePlot->binsPerPixel ());
m_settings->setValue ("StartFreq", ui->widePlot->startFreq ());
m_settings->setValue ("WaterfallPalette", m_waterfallPalette);
m_settings->setValue ("UserPalette", QVariant::fromValue (m_userPalette.colours ()));
m_settings->setValue("Flatten",m_bFlatten);
m_settings->setValue("UseRef",m_bRef);
m_settings->setValue ("HideControls", ui->controls_widget->isHidden ());
}
void WideGraph::drawRed(int ia, int ib)
{
ui->widePlot->drawRed(ia,ib,swide);
}
void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata) //dataSink2
{
static float splot[NSMAX];
int nbpp = ui->widePlot->binsPerPixel();
//Average spectra over specified number, m_waterfallAvg
if (m_n==0) {
for (int i=0; i<NSMAX; i++)
splot[i]=s[i];
} else {
for (int i=0; i<NSMAX; i++)
splot[i] += s[i];
}
m_n++;
if (m_n>=m_waterfallAvg) {
for (int i=0; i<NSMAX; i++)
splot[i] /= m_n; //Normalize the average
m_n=0;
int i=int(ui->widePlot->startFreq()/df3 + 0.5);
int jz=5000.0/(nbpp*df3);
if(jz>MAX_SCREENSIZE) jz=MAX_SCREENSIZE;
for (int j=0; j<jz; j++) {
float ss=0;
for (int k=0; k<nbpp; k++) {
if(splot[i]>ss) ss=splot[i];
i++;
}
swide[j]=nbpp*ss;
}
// Time according to this computer
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
int ntr = (ms/1000) % m_TRperiod;
if((ndiskdata && ihsym <= m_waterfallAvg) || (!ndiskdata && ntr<m_ntr0)) {
float flagValue=1.0e30;
if(m_bHaveTransmitted) flagValue=2.0e30;
for (int i=0; i<2048; i++) {
swide[i] = flagValue;
}
m_bHaveTransmitted=false;
}
m_ntr0=ntr;
ui->widePlot->draw(swide,true,false);
}
}
void WideGraph::on_bppSpinBox_valueChanged(int n) //bpp
{
ui->widePlot->setBinsPerPixel(n);
}
void WideGraph::on_waterfallAvgSpinBox_valueChanged(int n) //Navg
{
m_waterfallAvg = n;
ui->widePlot->setWaterfallAvg(n);
}
void WideGraph::keyPressEvent(QKeyEvent *e) //F11, F12
{
switch(e->key())
{
int n;
case Qt::Key_F11:
n=11;
if(e->modifiers() & Qt::ControlModifier) n+=100;
emit f11f12(n);
break;
case Qt::Key_F12:
n=12;
if(e->modifiers() & Qt::ControlModifier) n+=100;
emit f11f12(n);
break;
case Qt::Key_M:
if(e->modifiers() & Qt::ControlModifier) {
ui->controls_widget->setVisible(!ui->controls_widget->isVisible());
}
break;
default:
QDialog::keyPressEvent (e);
}
}
void WideGraph::setRxFreq(int n) //setRxFreq
{
ui->widePlot->setRxFreq(n);
ui->widePlot->draw(swide,false,false);
if(m_lockTxFreq) setTxFreq(n);
}
int WideGraph::rxFreq() //rxFreq
{
return ui->widePlot->rxFreq();
}
int WideGraph::nStartFreq() //nStartFreq
{
return ui->widePlot->startFreq();
}
void WideGraph::wideFreezeDecode(int n) //wideFreezeDecode
{
emit freezeDecode2(n);
}
void WideGraph::setRxRange ()
{
ui->widePlot->setRxRange (Fmin ());
ui->widePlot->DrawOverlay();
ui->widePlot->update();
}
int WideGraph::Fmin() //Fmin
{
return "60m" == m_rxBand ? 0 : m_fMin;
}
int WideGraph::Fmax() //Fmax
{
return std::max (5000, ui->widePlot->Fmax());
}
int WideGraph::fSpan()
{
return ui->widePlot->fSpan ();
}
void WideGraph::setPeriod(int ntrperiod, int nsps) //SetPeriod
{
m_TRperiod=ntrperiod;
m_nsps=nsps;
ui->widePlot->setNsps(ntrperiod, nsps);
}
void WideGraph::setTxFreq(int n) //setTxFreq
{
emit setXIT2(n);
ui->widePlot->setTxFreq(n);
}
void WideGraph::setMode(QString mode) //setMode
{
m_mode=mode;
ui->fSplitSpinBox->setEnabled(m_mode=="JT9+JT65");
ui->widePlot->setMode(mode);
ui->widePlot->DrawOverlay();
ui->widePlot->update();
}
void WideGraph::setSubMode(int n) //setSubMode
{
m_nSubMode=n;
ui->widePlot->setSubMode(n);
ui->widePlot->DrawOverlay();
ui->widePlot->update();
}
void WideGraph::setModeTx(QString modeTx) //setModeTx
{
m_modeTx=modeTx;
ui->widePlot->setModeTx(modeTx);
ui->widePlot->DrawOverlay();
ui->widePlot->update();
}
//Current-Cumulative-Yellow
void WideGraph::on_spec2dComboBox_currentIndexChanged(const QString &arg1)
{
ui->widePlot->setCurrent(false);
ui->widePlot->setCumulative(false);
ui->widePlot->setLinearAvg(false);
ui->widePlot->setReference(false);
ui->smoSpinBox->setEnabled(false);
if(arg1=="Current") ui->widePlot->setCurrent(true);
if(arg1=="Cumulative") ui->widePlot->setCumulative(true);
if(arg1=="Linear Avg") {
ui->widePlot->setLinearAvg(true);
ui->smoSpinBox->setEnabled(true);
}
if(arg1=="Reference") {
ui->widePlot->setReference(true);
}
if(ui->widePlot->m_bScaleOK) ui->widePlot->draw(swide,false,false);
}
void WideGraph::on_fSplitSpinBox_valueChanged(int n) //fSplit
{
if (m_rxBand != "60m") m_fMin=n;
setRxRange ();
}
void WideGraph::setLockTxFreq(bool b) //LockTxFreq
{
m_lockTxFreq=b;
ui->widePlot->setLockTxFreq(b);
}
void WideGraph::setFreq2(int rxFreq, int txFreq) //setFreq2
{
emit setFreq3(rxFreq,txFreq);
}
void WideGraph::setDialFreq(double d) //setDialFreq
{
ui->widePlot->setDialFreq(d);
}
void WideGraph::setRxBand (QString const& band)
{
m_rxBand = band;
if ("60m" == m_rxBand)
{
ui->fSplitSpinBox->setEnabled (false);
ui->fSplitSpinBox->setValue (0);
}
else
{
ui->fSplitSpinBox->setValue (m_fMin);
ui->fSplitSpinBox->setEnabled (true);
}
ui->widePlot->setRxBand(band);
setRxRange ();
}
void WideGraph::on_fStartSpinBox_valueChanged(int n) //fStart
{
ui->widePlot->setStartFreq(n);
}
void WideGraph::readPalette () //readPalette
{
try
{
if (user_defined == m_waterfallPalette)
{
ui->widePlot->setColours (WFPalette {m_userPalette}.interpolate ());
}
else
{
ui->widePlot->setColours (WFPalette {m_palettes_path.absoluteFilePath (m_waterfallPalette + ".pal")}.interpolate());
}
}
catch (std::exception const& e)
{
MessageBox::warning_message (this, tr ("Read Palette"), e.what ());
}
}
void WideGraph::on_paletteComboBox_activated (QString const& palette) //palette selector
{
m_waterfallPalette = palette;
readPalette();
}
void WideGraph::on_cbFlatten_toggled(bool b) //Flatten On/Off
{
m_bFlatten=b;
if(m_bRef and m_bFlatten) {
m_bRef=false;
ui->cbRef->setChecked(false);
}
ui->widePlot->setFlatten(m_bFlatten,m_bRef);
}
void WideGraph::on_cbRef_toggled(bool b)
{
m_bRef=b;
if(m_bRef and m_bFlatten) {
m_bFlatten=false;
ui->cbFlatten->setChecked(false);
}
ui->widePlot->setFlatten(m_bFlatten,m_bRef);
}
void WideGraph::on_adjust_palette_push_button_clicked (bool) //Adjust Palette
{
try
{
if (m_userPalette.design ())
{
m_waterfallPalette = user_defined;
ui->paletteComboBox->setCurrentText (m_waterfallPalette);
readPalette ();
}
}
catch (std::exception const& e)
{
MessageBox::warning_message (this, tr ("Read Palette"), e.what ());
}
}
bool WideGraph::flatten() //Flatten
{
return m_bFlatten;
}
bool WideGraph::useRef() //Flatten
{
return m_bRef;
}
void WideGraph::on_gainSlider_valueChanged(int value) //Gain
{
ui->widePlot->setPlotGain(value);
}
void WideGraph::on_zeroSlider_valueChanged(int value) //Zero
{
ui->widePlot->setPlotZero(value);
}
void WideGraph::on_gain2dSlider_valueChanged(int value) //Gain2
{
ui->widePlot->setPlot2dGain(value);
if(ui->widePlot->m_bScaleOK) {
ui->widePlot->draw(swide,false,false);
if(m_mode=="QRA64") ui->widePlot->draw(swide,false,true);
}
}
void WideGraph::on_zero2dSlider_valueChanged(int value) //Zero2
{
ui->widePlot->setPlot2dZero(value);
if(ui->widePlot->m_bScaleOK) {
ui->widePlot->draw(swide,false,false);
if(m_mode=="QRA64") ui->widePlot->draw(swide,false,true);
}
}
void WideGraph::setTol(int n) //setTol
{
ui->widePlot->setTol(n);
ui->widePlot->DrawOverlay();
ui->widePlot->update();
}
void WideGraph::on_smoSpinBox_valueChanged(int n)
{
m_nsmo=n;
}
int WideGraph::smoothYellow()
{
return m_nsmo;
}
void WideGraph::setWSPRtransmitted()
{
m_bHaveTransmitted=true;
}
void WideGraph::setVHF(bool bVHF)
{
ui->widePlot->setVHF(bVHF);
}
void WideGraph::on_sbPercent2dPlot_valueChanged(int n)
{
m_Percent2DScreen=n;
ui->widePlot->SetPercent2DScreen(n);
}
void WideGraph::setRedFile(QString fRed)
{
ui->widePlot->setRedFile(fRed);
}
@@ -0,0 +1,76 @@
// Copyright David Abrahams 2002.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef DECORATED_TYPE_ID_DWA2002517_HPP
# define DECORATED_TYPE_ID_DWA2002517_HPP
# include <boost/python/type_id.hpp>
# include <boost/python/detail/indirect_traits.hpp>
# include <boost/type_traits/cv_traits.hpp>
namespace boost { namespace python { namespace detail {
struct decorated_type_info : totally_ordered<decorated_type_info>
{
enum decoration { const_ = 0x1, volatile_ = 0x2, reference = 0x4 };
decorated_type_info(type_info, decoration = decoration());
inline bool operator<(decorated_type_info const& rhs) const;
inline bool operator==(decorated_type_info const& rhs) const;
friend BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&);
operator type_info const&() const;
private: // type
typedef type_info base_id_t;
private: // data members
decoration m_decoration;
base_id_t m_base_type;
};
template <class T>
inline decorated_type_info decorated_type_id(boost::type<T>* = 0)
{
return decorated_type_info(
type_id<T>()
, decorated_type_info::decoration(
(is_const<T>::value || indirect_traits::is_reference_to_const<T>::value
? decorated_type_info::const_ : 0)
| (is_volatile<T>::value || indirect_traits::is_reference_to_volatile<T>::value
? decorated_type_info::volatile_ : 0)
| (is_reference<T>::value ? decorated_type_info::reference : 0)
)
);
}
inline decorated_type_info::decorated_type_info(type_info base_t, decoration decoration)
: m_decoration(decoration)
, m_base_type(base_t)
{
}
inline bool decorated_type_info::operator<(decorated_type_info const& rhs) const
{
return m_decoration < rhs.m_decoration
|| (m_decoration == rhs.m_decoration
&& m_base_type < rhs.m_base_type);
}
inline bool decorated_type_info::operator==(decorated_type_info const& rhs) const
{
return m_decoration == rhs.m_decoration && m_base_type == rhs.m_base_type;
}
inline decorated_type_info::operator type_info const&() const
{
return m_base_type;
}
BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&);
}}} // namespace boost::python::detail
#endif // DECORATED_TYPE_ID_DWA2002517_HPP
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,43 @@
#ifndef BOOST_MPL_AUX_BACK_IMPL_HPP_INCLUDED
#define BOOST_MPL_AUX_BACK_IMPL_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/begin_end.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/aux_/traits_lambda_spec.hpp>
namespace boost { namespace mpl {
// default implementation, requires at least bi-directional iterators;
// conrete sequences might override it by specializing either the
// 'back_impl' or the primary 'back' template
template< typename Tag >
struct back_impl
{
template< typename Sequence > struct apply
{
typedef typename end<Sequence>::type end_;
typedef typename prior<end_>::type last_;
typedef typename deref<last_>::type type;
};
};
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1, back_impl)
}}
#endif // BOOST_MPL_AUX_BACK_IMPL_HPP_INCLUDED
@@ -0,0 +1,13 @@
// Status=review
- *Bins/Pixel* = 4
- *Start* = 200 Hz
- *N Avg* = 5
- *Palette* = Digipan
- *Flatten* = checked
- Select *Cumulative* for data display
- *Gain* and *Zero* sliders for waterfall and spectrum set near midscale
- *Spec* = 25%
- Use the mouse to grab the left or right edge of the *Wide Graph*, and
adjust its width so that the upper frequency limit is about 2400 Hz.
@@ -0,0 +1,48 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTERPROCESS_DETAIL_PTIME_TO_TIMESPEC_HPP
#define BOOST_INTERPROCESS_DETAIL_PTIME_TO_TIMESPEC_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
namespace boost {
namespace interprocess {
namespace ipcdetail {
inline timespec ptime_to_timespec (const boost::posix_time::ptime &tm)
{
const boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
//Avoid negative absolute times
boost::posix_time::time_duration duration = (tm <= epoch) ? boost::posix_time::time_duration(epoch - epoch)
: boost::posix_time::time_duration(tm - epoch);
timespec ts;
ts.tv_sec = duration.total_seconds();
ts.tv_nsec = duration.total_nanoseconds() % 1000000000;
return ts;
}
} //namespace ipcdetail {
} //namespace interprocess {
} //namespace boost {
#endif //ifndef BOOST_INTERPROCESS_DETAIL_PTIME_TO_TIMESPEC_HPP
@@ -0,0 +1,264 @@
#ifndef BOOST_NEW_ITERATOR_TESTS_HPP
# define BOOST_NEW_ITERATOR_TESTS_HPP
//
// Copyright (c) David Abrahams 2001.
// Copyright (c) Jeremy Siek 2001-2003.
// Copyright (c) Thomas Witt 2002.
//
// 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)
//
// This is meant to be the beginnings of a comprehensive, generic
// test suite for STL concepts such as iterators and containers.
//
// Revision History:
// 28 Oct 2002 Started update for new iterator categories
// (Jeremy Siek)
// 28 Apr 2002 Fixed input iterator requirements.
// For a == b a++ == b++ is no longer required.
// See 24.1.1/3 for details.
// (Thomas Witt)
// 08 Feb 2001 Fixed bidirectional iterator test so that
// --i is no longer a precondition.
// (Jeremy Siek)
// 04 Feb 2001 Added lvalue test, corrected preconditions
// (David Abrahams)
# include <iterator>
# include <boost/type_traits.hpp>
# include <boost/static_assert.hpp>
# include <boost/concept_archetype.hpp> // for detail::dummy_constructor
# include <boost/detail/iterator.hpp>
# include <boost/pending/iterator_tests.hpp>
# include <boost/iterator/is_readable_iterator.hpp>
# include <boost/iterator/is_lvalue_iterator.hpp>
# include <boost/iterator/detail/config_def.hpp>
# include <boost/detail/is_incrementable.hpp>
# include <boost/detail/lightweight_test.hpp>
namespace boost {
// Do separate tests for *i++ so we can treat, e.g., smart pointers,
// as readable and/or writable iterators.
template <class Iterator, class T>
void readable_iterator_traversal_test(Iterator i1, T v, mpl::true_)
{
T v2(*i1++);
BOOST_TEST(v == v2);
}
template <class Iterator, class T>
void readable_iterator_traversal_test(const Iterator i1, T v, mpl::false_)
{}
template <class Iterator, class T>
void writable_iterator_traversal_test(Iterator i1, T v, mpl::true_)
{
++i1; // we just wrote into that position
*i1++ = v;
Iterator x(i1++);
(void)x;
}
template <class Iterator, class T>
void writable_iterator_traversal_test(const Iterator i1, T v, mpl::false_)
{}
// Preconditions: *i == v
template <class Iterator, class T>
void readable_iterator_test(const Iterator i1, T v)
{
Iterator i2(i1); // Copy Constructible
typedef typename detail::iterator_traits<Iterator>::reference ref_t;
ref_t r1 = *i1;
ref_t r2 = *i2;
T v1 = r1;
T v2 = r2;
BOOST_TEST(v1 == v);
BOOST_TEST(v2 == v);
# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
readable_iterator_traversal_test(i1, v, detail::is_postfix_incrementable<Iterator>());
// I think we don't really need this as it checks the same things as
// the above code.
BOOST_STATIC_ASSERT(is_readable_iterator<Iterator>::value);
# endif
}
template <class Iterator, class T>
void writable_iterator_test(Iterator i, T v, T v2)
{
Iterator i2(i); // Copy Constructible
*i2 = v;
# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
writable_iterator_traversal_test(
i, v2, mpl::and_<
detail::is_incrementable<Iterator>
, detail::is_postfix_incrementable<Iterator>
>());
# endif
}
template <class Iterator>
void swappable_iterator_test(Iterator i, Iterator j)
{
Iterator i2(i), j2(j);
typename detail::iterator_traits<Iterator>::value_type bi = *i, bj = *j;
iter_swap(i2, j2);
typename detail::iterator_traits<Iterator>::value_type ai = *i, aj = *j;
BOOST_TEST(bi == aj && bj == ai);
}
template <class Iterator, class T>
void constant_lvalue_iterator_test(Iterator i, T v1)
{
Iterator i2(i);
typedef typename detail::iterator_traits<Iterator>::value_type value_type;
typedef typename detail::iterator_traits<Iterator>::reference reference;
BOOST_STATIC_ASSERT((is_same<const value_type&, reference>::value));
const T& v2 = *i2;
BOOST_TEST(v1 == v2);
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
BOOST_STATIC_ASSERT(is_lvalue_iterator<Iterator>::value);
BOOST_STATIC_ASSERT(!is_non_const_lvalue_iterator<Iterator>::value);
# endif
}
template <class Iterator, class T>
void non_const_lvalue_iterator_test(Iterator i, T v1, T v2)
{
Iterator i2(i);
typedef typename detail::iterator_traits<Iterator>::value_type value_type;
typedef typename detail::iterator_traits<Iterator>::reference reference;
BOOST_STATIC_ASSERT((is_same<value_type&, reference>::value));
T& v3 = *i2;
BOOST_TEST(v1 == v3);
// A non-const lvalue iterator is not neccessarily writable, but we
// are assuming the value_type is assignable here
*i = v2;
T& v4 = *i2;
BOOST_TEST(v2 == v4);
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
BOOST_STATIC_ASSERT(is_lvalue_iterator<Iterator>::value);
BOOST_STATIC_ASSERT(is_non_const_lvalue_iterator<Iterator>::value);
# endif
}
template <class Iterator, class T>
void forward_readable_iterator_test(Iterator i, Iterator j, T val1, T val2)
{
Iterator i2;
Iterator i3(i);
i2 = i;
BOOST_TEST(i2 == i3);
BOOST_TEST(i != j);
BOOST_TEST(i2 != j);
readable_iterator_test(i, val1);
readable_iterator_test(i2, val1);
readable_iterator_test(i3, val1);
BOOST_TEST(i == i2++);
BOOST_TEST(i != ++i3);
readable_iterator_test(i2, val2);
readable_iterator_test(i3, val2);
readable_iterator_test(i, val1);
}
template <class Iterator, class T>
void forward_swappable_iterator_test(Iterator i, Iterator j, T val1, T val2)
{
forward_readable_iterator_test(i, j, val1, val2);
Iterator i2 = i;
++i2;
swappable_iterator_test(i, i2);
}
// bidirectional
// Preconditions: *i == v1, *++i == v2
template <class Iterator, class T>
void bidirectional_readable_iterator_test(Iterator i, T v1, T v2)
{
Iterator j(i);
++j;
forward_readable_iterator_test(i, j, v1, v2);
++i;
Iterator i1 = i, i2 = i;
BOOST_TEST(i == i1--);
BOOST_TEST(i != --i2);
readable_iterator_test(i, v2);
readable_iterator_test(i1, v1);
readable_iterator_test(i2, v1);
--i;
BOOST_TEST(i == i1);
BOOST_TEST(i == i2);
++i1;
++i2;
readable_iterator_test(i, v1);
readable_iterator_test(i1, v2);
readable_iterator_test(i2, v2);
}
// random access
// Preconditions: [i,i+N) is a valid range
template <class Iterator, class TrueVals>
void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals)
{
bidirectional_readable_iterator_test(i, vals[0], vals[1]);
const Iterator j = i;
int c;
for (c = 0; c < N-1; ++c)
{
BOOST_TEST(i == j + c);
BOOST_TEST(*i == vals[c]);
typename detail::iterator_traits<Iterator>::value_type x = j[c];
BOOST_TEST(*i == x);
BOOST_TEST(*i == *(j + c));
BOOST_TEST(*i == *(c + j));
++i;
BOOST_TEST(i > j);
BOOST_TEST(i >= j);
BOOST_TEST(j <= i);
BOOST_TEST(j < i);
}
Iterator k = j + N - 1;
for (c = 0; c < N-1; ++c)
{
BOOST_TEST(i == k - c);
BOOST_TEST(*i == vals[N - 1 - c]);
typename detail::iterator_traits<Iterator>::value_type x = j[N - 1 - c];
BOOST_TEST(*i == x);
Iterator q = k - c;
BOOST_TEST(*i == *q);
BOOST_TEST(i > j);
BOOST_TEST(i >= j);
BOOST_TEST(j <= i);
BOOST_TEST(j < i);
--i;
}
}
} // namespace boost
# include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_NEW_ITERATOR_TESTS_HPP
@@ -0,0 +1,180 @@
// Copyright John Maddock 2012.
// 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_MATH_HANKEL_HPP
#define BOOST_MATH_HANKEL_HPP
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/bessel.hpp>
namespace boost{ namespace math{
namespace detail{
template <class T, class Policy>
std::complex<T> hankel_imp(T v, T x, const bessel_no_int_tag&, const Policy& pol, int sign)
{
BOOST_MATH_STD_USING
static const char* function = "boost::math::cyl_hankel_1<%1%>(%1%,%1%)";
if(x < 0)
{
bool isint_v = floor(v) == v;
T j, y;
bessel_jy(v, -x, &j, &y, need_j | need_y, pol);
std::complex<T> cx(x), cv(v);
std::complex<T> j_result, y_result;
if(isint_v)
{
int s = (iround(v) & 1) ? -1 : 1;
j_result = j * s;
y_result = T(s) * (y - (2 / constants::pi<T>()) * (log(-x) - log(cx)) * j);
}
else
{
j_result = pow(cx, v) * pow(-cx, -v) * j;
T p1 = pow(-x, v);
std::complex<T> p2 = pow(cx, v);
y_result = p1 * y / p2
+ (p2 / p1 - p1 / p2) * j / tan(constants::pi<T>() * v);
}
// multiply y_result by i:
y_result = std::complex<T>(-sign * y_result.imag(), sign * y_result.real());
return j_result + y_result;
}
if(x == 0)
{
if(v == 0)
{
// J is 1, Y is -INF
return std::complex<T>(1, sign * -policies::raise_overflow_error<T>(function, 0, pol));
}
else
{
// At least one of J and Y is complex infinity:
return std::complex<T>(policies::raise_overflow_error<T>(function, 0, pol), sign * policies::raise_overflow_error<T>(function, 0, pol));
}
}
T j, y;
bessel_jy(v, x, &j, &y, need_j | need_y, pol);
return std::complex<T>(j, sign * y);
}
template <class T, class Policy>
std::complex<T> hankel_imp(int v, T x, const bessel_int_tag&, const Policy& pol, int sign);
template <class T, class Policy>
inline std::complex<T> hankel_imp(T v, T x, const bessel_maybe_int_tag&, const Policy& pol, int sign)
{
BOOST_MATH_STD_USING // ADL of std names.
int ival = detail::iconv(v, pol);
if(0 == v - ival)
{
return hankel_imp(ival, x, bessel_int_tag(), pol, sign);
}
return hankel_imp(v, x, bessel_no_int_tag(), pol, sign);
}
template <class T, class Policy>
inline std::complex<T> hankel_imp(int v, T x, const bessel_int_tag&, const Policy& pol, int sign)
{
BOOST_MATH_STD_USING
if((std::abs(v) < 200) && (x > 0))
return std::complex<T>(bessel_jn(v, x, pol), sign * bessel_yn(v, x, pol));
return hankel_imp(static_cast<T>(v), x, bessel_no_int_tag(), pol, sign);
}
template <class T, class Policy>
inline std::complex<T> sph_hankel_imp(T v, T x, const Policy& pol, int sign)
{
BOOST_MATH_STD_USING
return constants::root_half_pi<T>() * hankel_imp(v + 0.5f, x, bessel_no_int_tag(), pol, sign) / sqrt(std::complex<T>(x));
}
} // namespace detail
template <class T1, class T2, class Policy>
inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol)
{
BOOST_FPU_EXCEPTION_GUARD
typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
typedef typename detail::bessel_traits<T1, T2, Policy>::optimisation_tag tag_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::hankel_imp<value_type>(v, static_cast<value_type>(x), tag_type(), pol, 1), "boost::math::cyl_hankel_1<%1%>(%1%,%1%)");
}
template <class T1, class T2>
inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x)
{
return cyl_hankel_1(v, x, policies::policy<>());
}
template <class T1, class T2, class Policy>
inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol)
{
BOOST_FPU_EXCEPTION_GUARD
typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
typedef typename detail::bessel_traits<T1, T2, Policy>::optimisation_tag tag_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::hankel_imp<value_type>(v, static_cast<value_type>(x), tag_type(), pol, -1), "boost::math::cyl_hankel_1<%1%>(%1%,%1%)");
}
template <class T1, class T2>
inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x)
{
return cyl_hankel_2(v, x, policies::policy<>());
}
template <class T1, class T2, class Policy>
inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy&)
{
BOOST_FPU_EXCEPTION_GUARD
typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::sph_hankel_imp<value_type>(static_cast<value_type>(v), static_cast<value_type>(x), forwarding_policy(), 1), "boost::math::sph_hankel_1<%1%>(%1%,%1%)");
}
template <class T1, class T2>
inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x)
{
return sph_hankel_1(v, x, policies::policy<>());
}
template <class T1, class T2, class Policy>
inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy&)
{
BOOST_FPU_EXCEPTION_GUARD
typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
typedef typename policies::evaluation<result_type, Policy>::type value_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::sph_hankel_imp<value_type>(static_cast<value_type>(v), static_cast<value_type>(x), forwarding_policy(), -1), "boost::math::sph_hankel_1<%1%>(%1%,%1%)");
}
template <class T1, class T2>
inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x)
{
return sph_hankel_2(v, x, policies::policy<>());
}
}} // namespaces
#endif // BOOST_MATH_HANKEL_HPP
@@ -0,0 +1,53 @@
// 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)
// (C) Copyright 2012 Vicente J. Botet Escriba
#ifndef BOOST_THREAD_SHARED_LOCK_GUARD_HPP
#define BOOST_THREAD_SHARED_LOCK_GUARD_HPP
#include <boost/thread/detail/config.hpp>
//#include <boost/thread/locks.hpp>
#include <boost/thread/lock_options.hpp>
#include <boost/thread/detail/delete.hpp>
namespace boost
{
template<typename SharedMutex>
class shared_lock_guard
{
private:
SharedMutex& m;
public:
typedef SharedMutex mutex_type;
BOOST_THREAD_NO_COPYABLE(shared_lock_guard)
explicit shared_lock_guard(SharedMutex& m_):
m(m_)
{
m.lock_shared();
}
shared_lock_guard(SharedMutex& m_,adopt_lock_t):
m(m_)
{}
~shared_lock_guard()
{
m.unlock_shared();
}
};
#ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
template<typename T>
struct is_mutex_type<shared_lock_guard<T> >
{
BOOST_STATIC_CONSTANT(bool, value = true);
};
#endif
}
#endif // header
@@ -0,0 +1,19 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_SEQ_PUSH_BACK_HPP
# define BOOST_PREPROCESSOR_SEQ_PUSH_BACK_HPP
#
# /* BOOST_PP_SEQ_PUSH_BACK */
#
# define BOOST_PP_SEQ_PUSH_BACK(seq, elem) seq(elem)
#
# endif
@@ -0,0 +1,329 @@
// Copyright John Maddock 2006, 2007.
// Copyright Paul A. Bristow 2006, 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)
#ifndef BOOST_STATS_NORMAL_HPP
#define BOOST_STATS_NORMAL_HPP
// http://en.wikipedia.org/wiki/Normal_distribution
// http://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm
// Also:
// Weisstein, Eric W. "Normal Distribution."
// From MathWorld--A Wolfram Web Resource.
// http://mathworld.wolfram.com/NormalDistribution.html
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/special_functions/erf.hpp> // for erf/erfc.
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <utility>
namespace boost{ namespace math{
template <class RealType = double, class Policy = policies::policy<> >
class normal_distribution
{
public:
typedef RealType value_type;
typedef Policy policy_type;
normal_distribution(RealType l_mean = 0, RealType sd = 1)
: m_mean(l_mean), m_sd(sd)
{ // Default is a 'standard' normal distribution N01.
static const char* function = "boost::math::normal_distribution<%1%>::normal_distribution";
RealType result;
detail::check_scale(function, sd, &result, Policy());
detail::check_location(function, l_mean, &result, Policy());
}
RealType mean()const
{ // alias for location.
return m_mean;
}
RealType standard_deviation()const
{ // alias for scale.
return m_sd;
}
// Synonyms, provided to allow generic use of find_location and find_scale.
RealType location()const
{ // location.
return m_mean;
}
RealType scale()const
{ // scale.
return m_sd;
}
private:
//
// Data members:
//
RealType m_mean; // distribution mean or location.
RealType m_sd; // distribution standard deviation or scale.
}; // class normal_distribution
typedef normal_distribution<double> normal;
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4127)
#endif
template <class RealType, class Policy>
inline const std::pair<RealType, RealType> range(const normal_distribution<RealType, Policy>& /*dist*/)
{ // Range of permissible values for random variable x.
if (std::numeric_limits<RealType>::has_infinity)
{
return std::pair<RealType, RealType>(-std::numeric_limits<RealType>::infinity(), std::numeric_limits<RealType>::infinity()); // - to + infinity.
}
else
{ // Can only use max_value.
using boost::math::tools::max_value;
return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>()); // - to + max value.
}
}
template <class RealType, class Policy>
inline const std::pair<RealType, RealType> support(const normal_distribution<RealType, Policy>& /*dist*/)
{ // This is range values for random variable x where cdf rises from 0 to 1, and outside it, the pdf is zero.
if (std::numeric_limits<RealType>::has_infinity)
{
return std::pair<RealType, RealType>(-std::numeric_limits<RealType>::infinity(), std::numeric_limits<RealType>::infinity()); // - to + infinity.
}
else
{ // Can only use max_value.
using boost::math::tools::max_value;
return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>()); // - to + max value.
}
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
template <class RealType, class Policy>
inline RealType pdf(const normal_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
RealType sd = dist.standard_deviation();
RealType mean = dist.mean();
static const char* function = "boost::math::pdf(const normal_distribution<%1%>&, %1%)";
RealType result = 0;
if(false == detail::check_scale(function, sd, &result, Policy()))
{
return result;
}
if(false == detail::check_location(function, mean, &result, Policy()))
{
return result;
}
if((boost::math::isinf)(x))
{
return 0; // pdf + and - infinity is zero.
}
// Below produces MSVC 4127 warnings, so the above used instead.
//if(std::numeric_limits<RealType>::has_infinity && abs(x) == std::numeric_limits<RealType>::infinity())
//{ // pdf + and - infinity is zero.
// return 0;
//}
if(false == detail::check_x(function, x, &result, Policy()))
{
return result;
}
RealType exponent = x - mean;
exponent *= -exponent;
exponent /= 2 * sd * sd;
result = exp(exponent);
result /= sd * sqrt(2 * constants::pi<RealType>());
return result;
} // pdf
template <class RealType, class Policy>
inline RealType cdf(const normal_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
RealType sd = dist.standard_deviation();
RealType mean = dist.mean();
static const char* function = "boost::math::cdf(const normal_distribution<%1%>&, %1%)";
RealType result = 0;
if(false == detail::check_scale(function, sd, &result, Policy()))
{
return result;
}
if(false == detail::check_location(function, mean, &result, Policy()))
{
return result;
}
if((boost::math::isinf)(x))
{
if(x < 0) return 0; // -infinity
return 1; // + infinity
}
// These produce MSVC 4127 warnings, so the above used instead.
//if(std::numeric_limits<RealType>::has_infinity && x == std::numeric_limits<RealType>::infinity())
//{ // cdf +infinity is unity.
// return 1;
//}
//if(std::numeric_limits<RealType>::has_infinity && x == -std::numeric_limits<RealType>::infinity())
//{ // cdf -infinity is zero.
// return 0;
//}
if(false == detail::check_x(function, x, &result, Policy()))
{
return result;
}
RealType diff = (x - mean) / (sd * constants::root_two<RealType>());
result = boost::math::erfc(-diff, Policy()) / 2;
return result;
} // cdf
template <class RealType, class Policy>
inline RealType quantile(const normal_distribution<RealType, Policy>& dist, const RealType& p)
{
BOOST_MATH_STD_USING // for ADL of std functions
RealType sd = dist.standard_deviation();
RealType mean = dist.mean();
static const char* function = "boost::math::quantile(const normal_distribution<%1%>&, %1%)";
RealType result = 0;
if(false == detail::check_scale(function, sd, &result, Policy()))
return result;
if(false == detail::check_location(function, mean, &result, Policy()))
return result;
if(false == detail::check_probability(function, p, &result, Policy()))
return result;
result= boost::math::erfc_inv(2 * p, Policy());
result = -result;
result *= sd * constants::root_two<RealType>();
result += mean;
return result;
} // quantile
template <class RealType, class Policy>
inline RealType cdf(const complemented2_type<normal_distribution<RealType, Policy>, RealType>& c)
{
BOOST_MATH_STD_USING // for ADL of std functions
RealType sd = c.dist.standard_deviation();
RealType mean = c.dist.mean();
RealType x = c.param;
static const char* function = "boost::math::cdf(const complement(normal_distribution<%1%>&), %1%)";
RealType result = 0;
if(false == detail::check_scale(function, sd, &result, Policy()))
return result;
if(false == detail::check_location(function, mean, &result, Policy()))
return result;
if((boost::math::isinf)(x))
{
if(x < 0) return 1; // cdf complement -infinity is unity.
return 0; // cdf complement +infinity is zero
}
// These produce MSVC 4127 warnings, so the above used instead.
//if(std::numeric_limits<RealType>::has_infinity && x == std::numeric_limits<RealType>::infinity())
//{ // cdf complement +infinity is zero.
// return 0;
//}
//if(std::numeric_limits<RealType>::has_infinity && x == -std::numeric_limits<RealType>::infinity())
//{ // cdf complement -infinity is unity.
// return 1;
//}
if(false == detail::check_x(function, x, &result, Policy()))
return result;
RealType diff = (x - mean) / (sd * constants::root_two<RealType>());
result = boost::math::erfc(diff, Policy()) / 2;
return result;
} // cdf complement
template <class RealType, class Policy>
inline RealType quantile(const complemented2_type<normal_distribution<RealType, Policy>, RealType>& c)
{
BOOST_MATH_STD_USING // for ADL of std functions
RealType sd = c.dist.standard_deviation();
RealType mean = c.dist.mean();
static const char* function = "boost::math::quantile(const complement(normal_distribution<%1%>&), %1%)";
RealType result = 0;
if(false == detail::check_scale(function, sd, &result, Policy()))
return result;
if(false == detail::check_location(function, mean, &result, Policy()))
return result;
RealType q = c.param;
if(false == detail::check_probability(function, q, &result, Policy()))
return result;
result = boost::math::erfc_inv(2 * q, Policy());
result *= sd * constants::root_two<RealType>();
result += mean;
return result;
} // quantile
template <class RealType, class Policy>
inline RealType mean(const normal_distribution<RealType, Policy>& dist)
{
return dist.mean();
}
template <class RealType, class Policy>
inline RealType standard_deviation(const normal_distribution<RealType, Policy>& dist)
{
return dist.standard_deviation();
}
template <class RealType, class Policy>
inline RealType mode(const normal_distribution<RealType, Policy>& dist)
{
return dist.mean();
}
template <class RealType, class Policy>
inline RealType median(const normal_distribution<RealType, Policy>& dist)
{
return dist.mean();
}
template <class RealType, class Policy>
inline RealType skewness(const normal_distribution<RealType, Policy>& /*dist*/)
{
return 0;
}
template <class RealType, class Policy>
inline RealType kurtosis(const normal_distribution<RealType, Policy>& /*dist*/)
{
return 3;
}
template <class RealType, class Policy>
inline RealType kurtosis_excess(const normal_distribution<RealType, Policy>& /*dist*/)
{
return 0;
}
} // 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_NORMAL_HPP