Initial Commit
This commit is contained in:
@@ -0,0 +1,184 @@
|
||||
/* boost random/beta_distribution.hpp header file
|
||||
*
|
||||
* Copyright Steven Watanabe 2014
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org for most recent version including documentation.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RANDOM_BETA_DISTRIBUTION_HPP
|
||||
#define BOOST_RANDOM_BETA_DISTRIBUTION_HPP
|
||||
|
||||
#include <cassert>
|
||||
#include <istream>
|
||||
#include <iosfwd>
|
||||
#include <boost/random/detail/operators.hpp>
|
||||
#include <boost/random/gamma_distribution.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace random {
|
||||
|
||||
/**
|
||||
* The beta distribution is a real-valued distribution which produces
|
||||
* values in the range [0, 1]. It has two parameters, alpha and beta.
|
||||
*
|
||||
* It has \f$\displaystyle p(x) = \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha, \beta)}\f$.
|
||||
*/
|
||||
template<class RealType = double>
|
||||
class beta_distribution {
|
||||
public:
|
||||
typedef RealType result_type;
|
||||
typedef RealType input_type;
|
||||
|
||||
class param_type {
|
||||
public:
|
||||
typedef beta_distribution distribution_type;
|
||||
|
||||
/**
|
||||
* Constructs a @c param_type from the "alpha" and "beta" parameters
|
||||
* of the distribution.
|
||||
*
|
||||
* Requires: alpha > 0, beta > 0
|
||||
*/
|
||||
explicit param_type(RealType alpha_arg = RealType(1.0),
|
||||
RealType beta_arg = RealType(1.0))
|
||||
: _alpha(alpha_arg), _beta(beta_arg)
|
||||
{
|
||||
assert(alpha_arg > 0);
|
||||
assert(beta_arg > 0);
|
||||
}
|
||||
|
||||
/** Returns the "alpha" parameter of the distribtuion. */
|
||||
RealType alpha() const { return _alpha; }
|
||||
/** Returns the "beta" parameter of the distribution. */
|
||||
RealType beta() const { return _beta; }
|
||||
|
||||
/** Writes a @c param_type to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm)
|
||||
{ os << parm._alpha << ' ' << parm._beta; return os; }
|
||||
|
||||
/** Reads a @c param_type from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm)
|
||||
{ is >> parm._alpha >> std::ws >> parm._beta; return is; }
|
||||
|
||||
/** Returns true if the two sets of parameters are the same. */
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs)
|
||||
{ return lhs._alpha == rhs._alpha && lhs._beta == rhs._beta; }
|
||||
|
||||
/** Returns true if the two sets of parameters are the different. */
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type)
|
||||
|
||||
private:
|
||||
RealType _alpha;
|
||||
RealType _beta;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs an @c beta_distribution from its "alpha" and "beta" parameters.
|
||||
*
|
||||
* Requires: alpha > 0, beta > 0
|
||||
*/
|
||||
explicit beta_distribution(RealType alpha_arg = RealType(1.0),
|
||||
RealType beta_arg = RealType(1.0))
|
||||
: _alpha(alpha_arg), _beta(beta_arg)
|
||||
{
|
||||
assert(alpha_arg > 0);
|
||||
assert(beta_arg > 0);
|
||||
}
|
||||
/** Constructs an @c beta_distribution from its parameters. */
|
||||
explicit beta_distribution(const param_type& parm)
|
||||
: _alpha(parm.alpha()), _beta(parm.beta())
|
||||
{}
|
||||
|
||||
/**
|
||||
* Returns a random variate distributed according to the
|
||||
* beta distribution.
|
||||
*/
|
||||
template<class URNG>
|
||||
RealType operator()(URNG& urng) const
|
||||
{
|
||||
RealType a = gamma_distribution<RealType>(_alpha, RealType(1.0))(urng);
|
||||
RealType b = gamma_distribution<RealType>(_beta, RealType(1.0))(urng);
|
||||
return a / (a + b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random variate distributed accordint to the beta
|
||||
* distribution with parameters specified by @c param.
|
||||
*/
|
||||
template<class URNG>
|
||||
RealType operator()(URNG& urng, const param_type& parm) const
|
||||
{
|
||||
return beta_distribution(parm)(urng);
|
||||
}
|
||||
|
||||
/** Returns the "alpha" parameter of the distribution. */
|
||||
RealType alpha() const { return _alpha; }
|
||||
/** Returns the "beta" parameter of the distribution. */
|
||||
RealType beta() const { return _beta; }
|
||||
|
||||
/** Returns the smallest value that the distribution can produce. */
|
||||
RealType min BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{ return RealType(0.0); }
|
||||
/** Returns the largest value that the distribution can produce. */
|
||||
RealType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
{ return RealType(1.0); }
|
||||
|
||||
/** Returns the parameters of the distribution. */
|
||||
param_type param() const { return param_type(_alpha, _beta); }
|
||||
/** Sets the parameters of the distribution. */
|
||||
void param(const param_type& parm)
|
||||
{
|
||||
_alpha = parm.alpha();
|
||||
_beta = parm.beta();
|
||||
}
|
||||
|
||||
/**
|
||||
* Effects: Subsequent uses of the distribution do not depend
|
||||
* on values produced by any engine prior to invoking reset.
|
||||
*/
|
||||
void reset() { }
|
||||
|
||||
/** Writes an @c beta_distribution to a @c std::ostream. */
|
||||
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, beta_distribution, wd)
|
||||
{
|
||||
os << wd.param();
|
||||
return os;
|
||||
}
|
||||
|
||||
/** Reads an @c beta_distribution from a @c std::istream. */
|
||||
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, beta_distribution, wd)
|
||||
{
|
||||
param_type parm;
|
||||
if(is >> parm) {
|
||||
wd.param(parm);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the two instances of @c beta_distribution will
|
||||
* return identical sequences of values given equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(beta_distribution, lhs, rhs)
|
||||
{ return lhs._alpha == rhs._alpha && lhs._beta == rhs._beta; }
|
||||
|
||||
/**
|
||||
* Returns true if the two instances of @c beta_distribution will
|
||||
* return different sequences of values given equal generators.
|
||||
*/
|
||||
BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(beta_distribution)
|
||||
|
||||
private:
|
||||
RealType _alpha;
|
||||
RealType _beta;
|
||||
};
|
||||
|
||||
} // namespace random
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_RANDOM_BETA_DISTRIBUTION_HPP
|
||||
@@ -0,0 +1,32 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/derived_dimension.hpp>
|
||||
#include <boost/units/physical_dimensions/length.hpp>
|
||||
#include <boost/units/physical_dimensions/mass.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// derived dimension for power : L^2 M T^-3
|
||||
typedef derived_dimension<length_base_dimension,2,
|
||||
mass_base_dimension,1,
|
||||
time_base_dimension,-3>::type power_dimension;
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP
|
||||
@@ -0,0 +1,49 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (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_CAT_HPP
|
||||
# define BOOST_PREPROCESSOR_SEQ_CAT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/seq/fold_left.hpp>
|
||||
# include <boost/preprocessor/seq/seq.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/tuple/eat.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SEQ_CAT */
|
||||
#
|
||||
# define BOOST_PP_SEQ_CAT(seq) \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
|
||||
BOOST_PP_SEQ_CAT_I, \
|
||||
BOOST_PP_SEQ_HEAD \
|
||||
)(seq) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_CAT_I(seq) BOOST_PP_SEQ_FOLD_LEFT(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
|
||||
#
|
||||
# define BOOST_PP_SEQ_CAT_O(s, st, elem) BOOST_PP_SEQ_CAT_O_I(st, elem)
|
||||
# define BOOST_PP_SEQ_CAT_O_I(a, b) a ## b
|
||||
#
|
||||
# /* BOOST_PP_SEQ_CAT_S */
|
||||
#
|
||||
# define BOOST_PP_SEQ_CAT_S(s, seq) \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
|
||||
BOOST_PP_SEQ_CAT_S_I_A, \
|
||||
BOOST_PP_SEQ_CAT_S_I_B \
|
||||
)(s, seq) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_CAT_S_I_A(s, seq) BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
|
||||
# define BOOST_PP_SEQ_CAT_S_I_B(s, seq) BOOST_PP_SEQ_HEAD(seq)
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,52 @@
|
||||
// (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: -1 $
|
||||
//
|
||||
// Description : defines test_tree_visitor
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_TREE_VISITOR_HPP_100211GER
|
||||
#define BOOST_TEST_TREE_VISITOR_HPP_100211GER
|
||||
|
||||
// Boost.Test
|
||||
#include <boost/test/detail/config.hpp>
|
||||
|
||||
#include <boost/test/tree/test_unit.hpp>
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace unit_test {
|
||||
|
||||
// ************************************************************************** //
|
||||
// ************** test_tree_visitor ************** //
|
||||
// ************************************************************************** //
|
||||
|
||||
class BOOST_TEST_DECL test_tree_visitor {
|
||||
public:
|
||||
// test tree visitor interface
|
||||
virtual bool visit( test_unit const& ) { return true; }
|
||||
virtual void visit( test_case const& tc ) { visit( (test_unit const&)tc ); }
|
||||
virtual bool test_suite_start( test_suite const& ts ){ return visit( (test_unit const&)ts ); }
|
||||
virtual void test_suite_finish( test_suite const& ) {}
|
||||
|
||||
protected:
|
||||
BOOST_TEST_PROTECTED_VIRTUAL ~test_tree_visitor() {}
|
||||
};
|
||||
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_TREE_VISITOR_HPP_100211GER
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
// Copyright (C) 2006 The Trustees of Indiana University.
|
||||
|
||||
// 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)
|
||||
|
||||
// Authors: Douglas Gregor
|
||||
// Andrew Lumsdaine
|
||||
|
||||
// This file contains the "unsafe_serialize" routine, which transforms
|
||||
// types they may not be serializable (such as void*) into
|
||||
// serializable equivalents.
|
||||
#ifndef BOOST_PROPERTY_MAP_UNSAFE_SERIALIZE_HPP
|
||||
#define BOOST_PROPERTY_MAP_UNSAFE_SERIALIZE_HPP
|
||||
|
||||
#include <boost/mpi/datatype.hpp>
|
||||
#include <boost/serialization/is_bitwise_serializable.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <utility>
|
||||
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(void*)
|
||||
namespace boost { namespace mpi {
|
||||
template<> struct is_mpi_datatype<void*> : mpl::true_ { };
|
||||
} } // end namespace boost::mpi
|
||||
|
||||
namespace boost {
|
||||
typedef mpl::if_c<(sizeof(int) == sizeof(void*)),
|
||||
int,
|
||||
mpl::if_c<(sizeof(long) == sizeof(void*)),
|
||||
long,
|
||||
mpl::if_c<(sizeof(void*) <= sizeof(boost::intmax_t)),
|
||||
boost::intmax_t,
|
||||
void>::type
|
||||
>::type
|
||||
>::type ptr_serialize_type;
|
||||
|
||||
BOOST_STATIC_ASSERT ((!boost::is_void<ptr_serialize_type>::value));
|
||||
|
||||
template<typename T> inline T& unsafe_serialize(T& x) { return x; }
|
||||
|
||||
inline ptr_serialize_type& unsafe_serialize(void*& x)
|
||||
{ return reinterpret_cast<ptr_serialize_type&>(x); }
|
||||
|
||||
// Force Boost.MPI to serialize a void* like a ptr_serialize_type
|
||||
namespace mpi {
|
||||
template<> inline MPI_Datatype get_mpi_datatype<void*>(void* const& x)
|
||||
{
|
||||
return get_mpi_datatype<ptr_serialize_type>();
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
struct unsafe_pair
|
||||
{
|
||||
unsafe_pair() { }
|
||||
unsafe_pair(const T& t, const U& u) : first(t), second(u) { }
|
||||
unsafe_pair(const std::pair<T, U>& p) : first(p.first), second(p.second) { }
|
||||
T first;
|
||||
U second;
|
||||
|
||||
template<typename Archiver>
|
||||
void serialize(Archiver& ar, const unsigned /*version*/)
|
||||
{
|
||||
ar & unsafe_serialize(first) & unsafe_serialize(second);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
bool operator<(unsafe_pair<T,U> const& x, unsafe_pair<T,U> const& y)
|
||||
{
|
||||
return std::make_pair(x.first, x.second) <
|
||||
std::make_pair(y.first, y.second);
|
||||
}
|
||||
|
||||
} // end namespace boost
|
||||
|
||||
#endif // BOOST_PROPERTY_MAP_UNSAFE_SERIALIZE_HPP
|
||||
@@ -0,0 +1,374 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/stepper/runge_kutta_fehlberg87.hpp
|
||||
|
||||
[begin_description]
|
||||
Implementation of the Runge-Kutta-Fehlberg stepper with the generic stepper.
|
||||
[end_description]
|
||||
|
||||
Copyright 2011-2013 Mario Mulansky
|
||||
Copyright 2012-2013 Karsten Ahnert
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
|
||||
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
|
||||
#include <boost/numeric/odeint/algebra/default_operations.hpp>
|
||||
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
|
||||
#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
|
||||
|
||||
#include <boost/array.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/util/state_wrapper.hpp>
|
||||
#include <boost/numeric/odeint/util/is_resizeable.hpp>
|
||||
#include <boost/numeric/odeint/util/resizer.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a1 : boost::array< Value , 1 >
|
||||
{
|
||||
rk78_coefficients_a1( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 2 )/static_cast< Value >( 27 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a2 : boost::array< Value , 2 >
|
||||
{
|
||||
rk78_coefficients_a2( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 36 );
|
||||
(*this)[1] = static_cast< Value >( 1 )/static_cast< Value >( 12 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a3 : boost::array< Value , 3 >
|
||||
{
|
||||
rk78_coefficients_a3( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 24 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 1 )/static_cast< Value >( 8 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a4 : boost::array< Value , 4 >
|
||||
{
|
||||
rk78_coefficients_a4( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 5 )/static_cast< Value >( 12 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( -25 )/static_cast< Value >( 16 );
|
||||
(*this)[3] = static_cast< Value >( 25 )/static_cast< Value >( 16 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a5 : boost::array< Value , 5 >
|
||||
{
|
||||
rk78_coefficients_a5( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 20 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 1 )/static_cast< Value >( 4 );
|
||||
(*this)[4] = static_cast< Value >( 1 )/static_cast< Value >( 5 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a6 : boost::array< Value , 6 >
|
||||
{
|
||||
rk78_coefficients_a6( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( -25 )/static_cast< Value >( 108 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 125 )/static_cast< Value >( 108 );
|
||||
(*this)[4] = static_cast< Value >( -65 )/static_cast< Value >( 27 );
|
||||
(*this)[5] = static_cast< Value >( 125 )/static_cast< Value >( 54 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a7 : boost::array< Value , 7 >
|
||||
{
|
||||
rk78_coefficients_a7( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 31 )/static_cast< Value >( 300 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 0 );
|
||||
(*this)[4] = static_cast< Value >( 61 )/static_cast< Value >( 225 );
|
||||
(*this)[5] = static_cast< Value >( -2 )/static_cast< Value >( 9 );
|
||||
(*this)[6] = static_cast< Value >( 13 )/static_cast< Value >( 900 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a8 : boost::array< Value , 8 >
|
||||
{
|
||||
rk78_coefficients_a8( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 2 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( -53 )/static_cast< Value >( 6 );
|
||||
(*this)[4] = static_cast< Value >( 704 )/static_cast< Value >( 45 );
|
||||
(*this)[5] = static_cast< Value >( -107 )/static_cast< Value >( 9 );
|
||||
(*this)[6] = static_cast< Value >( 67 )/static_cast< Value >( 90 );
|
||||
(*this)[7] = static_cast< Value >( 3 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a9 : boost::array< Value , 9 >
|
||||
{
|
||||
rk78_coefficients_a9( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( -91 )/static_cast< Value >( 108 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 23 )/static_cast< Value >( 108 );
|
||||
(*this)[4] = static_cast< Value >( -976 )/static_cast< Value >( 135 );
|
||||
(*this)[5] = static_cast< Value >( 311 )/static_cast< Value >( 54 );
|
||||
(*this)[6] = static_cast< Value >( -19 )/static_cast< Value >( 60 );
|
||||
(*this)[7] = static_cast< Value >( 17 )/static_cast< Value >( 6 );
|
||||
(*this)[8] = static_cast< Value >( -1 )/static_cast< Value >( 12 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a10 : boost::array< Value , 10 >
|
||||
{
|
||||
rk78_coefficients_a10( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 2383 )/static_cast< Value >( 4100 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( -341 )/static_cast< Value >( 164 );
|
||||
(*this)[4] = static_cast< Value >( 4496 )/static_cast< Value >( 1025 );
|
||||
(*this)[5] = static_cast< Value >( -301 )/static_cast< Value >( 82 );
|
||||
(*this)[6] = static_cast< Value >( 2133 )/static_cast< Value >( 4100 );
|
||||
(*this)[7] = static_cast< Value >( 45 )/static_cast< Value >( 82 );
|
||||
(*this)[8] = static_cast< Value >( 45 )/static_cast< Value >( 164 );
|
||||
(*this)[9] = static_cast< Value >( 18 )/static_cast< Value >( 41 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a11 : boost::array< Value , 11 >
|
||||
{
|
||||
rk78_coefficients_a11( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 3 )/static_cast< Value >( 205 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 0 );
|
||||
(*this)[4] = static_cast< Value >( 0 );
|
||||
(*this)[5] = static_cast< Value >( -6 )/static_cast< Value >( 41 );
|
||||
(*this)[6] = static_cast< Value >( -3 )/static_cast< Value >( 205 );
|
||||
(*this)[7] = static_cast< Value >( -3 )/static_cast< Value >( 41 );
|
||||
(*this)[8] = static_cast< Value >( 3 )/static_cast< Value >( 41 );
|
||||
(*this)[9] = static_cast< Value >( 6 )/static_cast< Value >( 41 );
|
||||
(*this)[10] = static_cast< Value >( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_a12 : boost::array< Value , 12 >
|
||||
{
|
||||
rk78_coefficients_a12( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( -1777 )/static_cast< Value >( 4100 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( -341 )/static_cast< Value >( 164 );
|
||||
(*this)[4] = static_cast< Value >( 4496 )/static_cast< Value >( 1025 );
|
||||
(*this)[5] = static_cast< Value >( -289 )/static_cast< Value >( 82 );
|
||||
(*this)[6] = static_cast< Value >( 2193 )/static_cast< Value >( 4100 );
|
||||
(*this)[7] = static_cast< Value >( 51 )/static_cast< Value >( 82 );
|
||||
(*this)[8] = static_cast< Value >( 33 )/static_cast< Value >( 164 );
|
||||
(*this)[9] = static_cast< Value >( 12 )/static_cast< Value >( 41 );
|
||||
(*this)[10] = static_cast< Value >( 0 );
|
||||
(*this)[11] = static_cast< Value >( 1 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_b : boost::array< Value , 13 >
|
||||
{
|
||||
rk78_coefficients_b( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 0 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 0 );
|
||||
(*this)[4] = static_cast< Value >( 0 );
|
||||
(*this)[5] = static_cast< Value >( 34 )/static_cast<Value>( 105 );
|
||||
(*this)[6] = static_cast< Value >( 9 )/static_cast<Value>( 35 );
|
||||
(*this)[7] = static_cast< Value >( 9 )/static_cast<Value>( 35 );
|
||||
(*this)[8] = static_cast< Value >( 9 )/static_cast<Value>( 280 );
|
||||
(*this)[9] = static_cast< Value >( 9 )/static_cast<Value>( 280 );
|
||||
(*this)[10] = static_cast< Value >( 0 );
|
||||
(*this)[11] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
|
||||
(*this)[12] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_db : boost::array< Value , 13 >
|
||||
{
|
||||
rk78_coefficients_db( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 0 ) - static_cast< Value >( 41 )/static_cast<Value>( 840 );
|
||||
(*this)[1] = static_cast< Value >( 0 );
|
||||
(*this)[2] = static_cast< Value >( 0 );
|
||||
(*this)[3] = static_cast< Value >( 0 );
|
||||
(*this)[4] = static_cast< Value >( 0 );
|
||||
(*this)[5] = static_cast< Value >( 0 );
|
||||
(*this)[6] = static_cast< Value >( 0 );
|
||||
(*this)[7] = static_cast< Value >( 0 );
|
||||
(*this)[8] = static_cast< Value >( 0 );
|
||||
(*this)[9] = static_cast< Value >( 0 );
|
||||
(*this)[10] = static_cast< Value >( 0 ) - static_cast< Value >( 41 )/static_cast<Value>( 840 );
|
||||
(*this)[11] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
|
||||
(*this)[12] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template< class Value = double >
|
||||
struct rk78_coefficients_c : boost::array< Value , 13 >
|
||||
{
|
||||
rk78_coefficients_c( void )
|
||||
{
|
||||
(*this)[0] = static_cast< Value >( 0 );
|
||||
(*this)[1] = static_cast< Value >( 2 )/static_cast< Value >( 27 );
|
||||
(*this)[2] = static_cast< Value >( 1 )/static_cast< Value >( 9 );
|
||||
(*this)[3] = static_cast< Value >( 1 )/static_cast<Value>( 6 );
|
||||
(*this)[4] = static_cast< Value >( 5 )/static_cast<Value>( 12 );
|
||||
(*this)[5] = static_cast< Value >( 1 )/static_cast<Value>( 2 );
|
||||
(*this)[6] = static_cast< Value >( 5 )/static_cast<Value>( 6 );
|
||||
(*this)[7] = static_cast< Value >( 1 )/static_cast<Value>( 6 );
|
||||
(*this)[8] = static_cast< Value >( 2 )/static_cast<Value>( 3 );
|
||||
(*this)[9] = static_cast< Value >( 1 )/static_cast<Value>( 3 );
|
||||
(*this)[10] = static_cast< Value >( 1 );
|
||||
(*this)[11] = static_cast< Value >( 0 );
|
||||
(*this)[12] = static_cast< Value >( 1 );
|
||||
}
|
||||
};
|
||||
#endif // DOXYGEN_SKIP
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template<
|
||||
class State ,
|
||||
class Value = double ,
|
||||
class Deriv = State ,
|
||||
class Time = Value ,
|
||||
class Algebra = typename algebra_dispatcher< State >::algebra_type ,
|
||||
class Operations = typename operations_dispatcher< State >::operations_type ,
|
||||
class Resizer = initially_resizer
|
||||
>
|
||||
#ifndef DOXYGEN_SKIP
|
||||
class runge_kutta_fehlberg78 : public explicit_error_generic_rk< 13 , 8 , 8 , 7 , State , Value , Deriv , Time ,
|
||||
Algebra , Operations , Resizer >
|
||||
#else
|
||||
class runge_kutta_fehlberg78 : public explicit_error_generic_rk
|
||||
#endif
|
||||
{
|
||||
|
||||
public:
|
||||
#ifndef DOXYGEN_SKIP
|
||||
typedef explicit_error_generic_rk< 13 , 8 , 8 , 7 , State , Value , Deriv , Time ,
|
||||
Algebra , Operations , Resizer > stepper_base_type;
|
||||
#endif
|
||||
typedef typename stepper_base_type::state_type state_type;
|
||||
typedef typename stepper_base_type::value_type value_type;
|
||||
typedef typename stepper_base_type::deriv_type deriv_type;
|
||||
typedef typename stepper_base_type::time_type time_type;
|
||||
typedef typename stepper_base_type::algebra_type algebra_type;
|
||||
typedef typename stepper_base_type::operations_type operations_type;
|
||||
typedef typename stepper_base_type::resizer_type resizer_type;
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
typedef typename stepper_base_type::stepper_type stepper_type;
|
||||
typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
|
||||
typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
|
||||
#endif // DOXYGEN_SKIP
|
||||
|
||||
|
||||
runge_kutta_fehlberg78( const algebra_type &algebra = algebra_type() ) : stepper_base_type(
|
||||
boost::fusion::make_vector( rk78_coefficients_a1<Value>() , rk78_coefficients_a2<Value>() , rk78_coefficients_a3<Value>() ,
|
||||
rk78_coefficients_a4<Value>() , rk78_coefficients_a5<Value>() , rk78_coefficients_a6<Value>() ,
|
||||
rk78_coefficients_a7<Value>() , rk78_coefficients_a8<Value>() , rk78_coefficients_a9<Value>() ,
|
||||
rk78_coefficients_a10<Value>() , rk78_coefficients_a11<Value>() , rk78_coefficients_a12<Value>() ) ,
|
||||
rk78_coefficients_b<Value>() , rk78_coefficients_db<Value>() , rk78_coefficients_c<Value>() , algebra )
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
|
||||
/************* DOXYGEN *************/
|
||||
|
||||
/**
|
||||
* \class runge_kutta_fehlberg78
|
||||
* \brief The Runge-Kutta Fehlberg 78 method.
|
||||
*
|
||||
* The Runge-Kutta Fehlberg 78 method is a standard method for high-precision applications.
|
||||
* The method is explicit and fulfills the Error Stepper concept. Step size control
|
||||
* is provided but continuous output is not available for this method.
|
||||
*
|
||||
* This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring template pattern).
|
||||
* Furthermore, it derivs from explicit_error_generic_rk which is a generic Runge-Kutta algorithm with error estimation.
|
||||
* For more details see explicit_error_stepper_base and explicit_error_generic_rk.
|
||||
*
|
||||
* \tparam State The state type.
|
||||
* \tparam Value The value type.
|
||||
* \tparam Deriv The type representing the time derivative of the state.
|
||||
* \tparam Time The time representing the independent variable - the time.
|
||||
* \tparam Algebra The algebra type.
|
||||
* \tparam Operations The operations type.
|
||||
* \tparam Resizer The resizer policy type.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn runge_kutta_fehlberg78::runge_kutta_fehlberg78( const algebra_type &algebra )
|
||||
* \brief Constructs the runge_kutta_cash_fehlberg78 class. This constructor can be used as a default
|
||||
* constructor if the algebra has a default constructor.
|
||||
* \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif //BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_grep.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Provides regex_grep implementation.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_V4_REGEX_GREP_HPP
|
||||
#define BOOST_REGEX_V4_REGEX_GREP_HPP
|
||||
|
||||
|
||||
namespace boost{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
//
|
||||
// regex_grep:
|
||||
// find all non-overlapping matches within the sequence first last:
|
||||
//
|
||||
template <class Predicate, class BidiIterator, class charT, class traits>
|
||||
inline unsigned int regex_grep(Predicate foo,
|
||||
BidiIterator first,
|
||||
BidiIterator last,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
if(e.flags() & regex_constants::failbit)
|
||||
return false;
|
||||
|
||||
typedef typename match_results<BidiIterator>::allocator_type match_allocator_type;
|
||||
|
||||
match_results<BidiIterator> m;
|
||||
BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first);
|
||||
unsigned int count = 0;
|
||||
while(matcher.find())
|
||||
{
|
||||
++count;
|
||||
if(0 == foo(m))
|
||||
return count; // caller doesn't want to go on
|
||||
if(m[0].second == last)
|
||||
return count; // we've reached the end, don't try and find an extra null match.
|
||||
if(m.length() == 0)
|
||||
{
|
||||
if(m[0].second == last)
|
||||
return count;
|
||||
// we found a NULL-match, now try to find
|
||||
// a non-NULL one at the same position:
|
||||
match_results<BidiIterator, match_allocator_type> m2(m);
|
||||
matcher.setf(match_not_null | match_continuous);
|
||||
if(matcher.find())
|
||||
{
|
||||
++count;
|
||||
if(0 == foo(m))
|
||||
return count;
|
||||
}
|
||||
else
|
||||
{
|
||||
// reset match back to where it was:
|
||||
m = m2;
|
||||
}
|
||||
matcher.unsetf((match_not_null | match_continuous) & ~flags);
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
//
|
||||
// regex_grep convenience interfaces:
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
//
|
||||
// this isn't really a partial specialisation, but template function
|
||||
// overloading - if the compiler doesn't support partial specialisation
|
||||
// then it really won't support this either:
|
||||
template <class Predicate, class charT, class traits>
|
||||
inline unsigned int regex_grep(Predicate foo, const charT* str,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, str, str + traits::length(str), e, flags);
|
||||
}
|
||||
|
||||
template <class Predicate, class ST, class SA, class charT, class traits>
|
||||
inline unsigned int regex_grep(Predicate foo, const std::basic_string<charT, ST, SA>& s,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#else // partial specialisation
|
||||
inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags);
|
||||
}
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, str, str + wregex::traits_type::length(str), e, flags);
|
||||
}
|
||||
#endif
|
||||
inline unsigned int regex_grep(bool (*foo)(const match_results<std::string::const_iterator>&), const std::string& s,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#if !defined(BOOST_NO_WREGEX)
|
||||
inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string<wchar_t>::const_iterator>&),
|
||||
const std::basic_string<wchar_t>& s,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_V4_REGEX_GREP_HPP
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
# /* Copyright (C) 2001
|
||||
# * Housemarque Oy
|
||||
# * http://www.housemarque.com
|
||||
# *
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_COMPARISON_LESS_EQUAL_HPP
|
||||
# define BOOST_PREPROCESSOR_COMPARISON_LESS_EQUAL_HPP
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/logical/not.hpp>
|
||||
#
|
||||
# /* BOOST_PP_LESS_EQUAL */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_LESS_EQUAL(x, y) BOOST_PP_NOT(BOOST_PP_SUB(x, y))
|
||||
# else
|
||||
# define BOOST_PP_LESS_EQUAL(x, y) BOOST_PP_LESS_EQUAL_I(x, y)
|
||||
# define BOOST_PP_LESS_EQUAL_I(x, y) BOOST_PP_NOT(BOOST_PP_SUB(x, y))
|
||||
# endif
|
||||
#
|
||||
# /* BOOST_PP_LESS_EQUAL_D */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_LESS_EQUAL_D(d, x, y) BOOST_PP_NOT(BOOST_PP_SUB_D(d, x, y))
|
||||
# else
|
||||
# define BOOST_PP_LESS_EQUAL_D(d, x, y) BOOST_PP_LESS_EQUAL_D_I(d, x, y)
|
||||
# define BOOST_PP_LESS_EQUAL_D_I(d, x, y) BOOST_PP_NOT(BOOST_PP_SUB_D(d, x, y))
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
@@ -0,0 +1,63 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_ASYNC_WAIT_GUARD_HPP
|
||||
#define BOOST_COMPUTE_ASYNC_WAIT_GUARD_HPP
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// \class wait_guard
|
||||
/// \brief A guard object for synchronizing an operation on the device
|
||||
///
|
||||
/// The wait_guard class stores a waitable object representing an operation
|
||||
/// on a compute device (e.g. \ref event, \ref future "future<T>") and calls
|
||||
/// its \c wait() method when the guard object goes out of scope.
|
||||
///
|
||||
/// This is useful for ensuring that an OpenCL operation completes before
|
||||
/// leaving the current scope and cleaning up any resources.
|
||||
///
|
||||
/// For example:
|
||||
/// \code
|
||||
/// // enqueue a compute kernel for execution
|
||||
/// event e = queue.enqueue_nd_range_kernel(...);
|
||||
///
|
||||
/// // call e.wait() upon exiting the current scope
|
||||
/// wait_guard<event> guard(e);
|
||||
/// \endcode
|
||||
///
|
||||
/// \ref wait_list, wait_for_all()
|
||||
template<class Waitable>
|
||||
class wait_guard : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
/// Creates a new wait_guard object for \p waitable.
|
||||
wait_guard(const Waitable &waitable)
|
||||
: m_waitable(waitable)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destroys the wait_guard object. The default implementation will call
|
||||
/// \c wait() on the stored waitable object.
|
||||
~wait_guard()
|
||||
{
|
||||
m_waitable.wait();
|
||||
}
|
||||
|
||||
private:
|
||||
Waitable m_waitable;
|
||||
};
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_ASYNC_WAIT_GUARD_HPP
|
||||
@@ -0,0 +1,22 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if FUSION_MAX_MAP_SIZE <= 10
|
||||
#include <boost/fusion/container/map/detail/cpp03/preprocessed/map10.hpp>
|
||||
#elif FUSION_MAX_MAP_SIZE <= 20
|
||||
#include <boost/fusion/container/map/detail/cpp03/preprocessed/map20.hpp>
|
||||
#elif FUSION_MAX_MAP_SIZE <= 30
|
||||
#include <boost/fusion/container/map/detail/cpp03/preprocessed/map30.hpp>
|
||||
#elif FUSION_MAX_MAP_SIZE <= 40
|
||||
#include <boost/fusion/container/map/detail/cpp03/preprocessed/map40.hpp>
|
||||
#elif FUSION_MAX_MAP_SIZE <= 50
|
||||
#include <boost/fusion/container/map/detail/cpp03/preprocessed/map50.hpp>
|
||||
#else
|
||||
#error "FUSION_MAX_MAP_SIZE out of bounds for preprocessed headers"
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_UNITS_SI_CAPACITANCE_HPP
|
||||
#define BOOST_UNITS_SI_CAPACITANCE_HPP
|
||||
|
||||
#include <boost/units/systems/si/base.hpp>
|
||||
#include <boost/units/physical_dimensions/capacitance.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
namespace si {
|
||||
|
||||
typedef unit<capacitance_dimension,si::system> capacitance;
|
||||
|
||||
BOOST_UNITS_STATIC_CONSTANT(farad,capacitance);
|
||||
BOOST_UNITS_STATIC_CONSTANT(farads,capacitance);
|
||||
|
||||
} // namespace si
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_SI_CAPACITANCE_HPP
|
||||
@@ -0,0 +1,86 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_VALUE_AT_KEY_05052005_0229)
|
||||
#define FUSION_VALUE_AT_KEY_05052005_0229
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/empty_base.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
#include <boost/fusion/algorithm/query/find.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct sequence_facade_tag;
|
||||
struct boost_array_tag; // boost::array tag
|
||||
struct mpl_sequence_tag; // mpl sequence tag
|
||||
struct std_pair_tag; // std::pair tag
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_at_key_impl
|
||||
{
|
||||
template <typename Seq, typename Key>
|
||||
struct apply
|
||||
: result_of::value_of_data<
|
||||
typename result_of::find<Seq, Key>::type
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct value_at_key_impl<sequence_facade_tag>
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct apply : Sequence::template value_at_key<Sequence, Key> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct value_at_key_impl<boost_array_tag>;
|
||||
|
||||
template <>
|
||||
struct value_at_key_impl<mpl_sequence_tag>;
|
||||
|
||||
template <>
|
||||
struct value_at_key_impl<std_pair_tag>;
|
||||
}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename Sequence, typename N, typename Tag>
|
||||
struct value_at_key_impl
|
||||
: mpl::if_<
|
||||
mpl::or_<
|
||||
typename extension::has_key_impl<Tag>::template apply<Sequence, N>
|
||||
, traits::is_unbounded<Sequence>
|
||||
>
|
||||
, typename extension::value_at_key_impl<Tag>::template apply<Sequence, N>
|
||||
, mpl::empty_base
|
||||
>::type
|
||||
{};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct value_at_key
|
||||
: detail::value_at_key_impl<Sequence, N, typename detail::tag_of<Sequence>::type>
|
||||
{};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2013 Vicente J. Botet Escriba
|
||||
//
|
||||
// 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/thread for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_THREAD_DETAIL_IS_CONVERTIBLE_HPP
|
||||
#define BOOST_THREAD_DETAIL_IS_CONVERTIBLE_HPP
|
||||
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace thread_detail
|
||||
{
|
||||
template <typename T1, typename T2>
|
||||
struct is_convertible : boost::is_convertible<T1,T2> {};
|
||||
|
||||
#if defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#if defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 1300)
|
||||
|
||||
#if defined BOOST_THREAD_USES_MOVE
|
||||
template <typename T1, typename T2>
|
||||
struct is_convertible<
|
||||
rv<T1> &,
|
||||
rv<rv<T2> > &
|
||||
> : false_type {};
|
||||
#endif
|
||||
|
||||
#elif defined __GNUC__ && (__GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ <= 4 ))
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct is_convertible<T1&, T2&> : boost::is_convertible<T1, T2> {};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_THREAD_DETAIL_MEMORY_HPP
|
||||
@@ -0,0 +1,22 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if FUSION_MAX_SET_SIZE <= 10
|
||||
#include <boost/fusion/container/generation/detail/preprocessed/make_set10.hpp>
|
||||
#elif FUSION_MAX_SET_SIZE <= 20
|
||||
#include <boost/fusion/container/generation/detail/preprocessed/make_set20.hpp>
|
||||
#elif FUSION_MAX_SET_SIZE <= 30
|
||||
#include <boost/fusion/container/generation/detail/preprocessed/make_set30.hpp>
|
||||
#elif FUSION_MAX_SET_SIZE <= 40
|
||||
#include <boost/fusion/container/generation/detail/preprocessed/make_set40.hpp>
|
||||
#elif FUSION_MAX_SET_SIZE <= 50
|
||||
#include <boost/fusion/container/generation/detail/preprocessed/make_set50.hpp>
|
||||
#else
|
||||
#error "FUSION_MAX_SET_SIZE out of bounds for preprocessed headers"
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
// Status=review
|
||||
.Main Window:
|
||||
- Select *FT8* on the *Mode* menu.
|
||||
- Set Tx and Rx frequencies to 1200 Hz.
|
||||
- Double-click on *Erase* to clear both text windows.
|
||||
|
||||
.Wide Graph Settings:
|
||||
|
||||
- *Bins/Pixel* = 4, *Start* = 200 Hz, *N Avg* = 2
|
||||
- Adjust the width of the Wide Graph window so that the upper
|
||||
frequency limit is approximately 2600 Hz.
|
||||
|
||||
.Open a Wave File:
|
||||
|
||||
- Select *File | Open* and navigate to
|
||||
+...\save\samples\FT8\170709_135615.wav+. The waterfall and decoded
|
||||
text window should look something like the following screen shots:
|
||||
|
||||
[[X15]]
|
||||
image::170709_135615.wav.png[align="left",alt="Wide Graph Decode 170709_135615"]
|
||||
|
||||
image::ft8_decodes.png[align="left"]
|
||||
|
||||
- Click with the mouse anywhere on the waterfall display. The green Rx
|
||||
frequency marker will jump to your selected frequency, and the Rx
|
||||
frequency control on the main window will be updated accordingly.
|
||||
|
||||
- Do the same thing with the Shift key held down. Now the red Tx
|
||||
frequency marker and its associated control on the main window will
|
||||
follow your frequency selections.
|
||||
|
||||
- Do the same thing with the Ctrl key held down. Now the both colored
|
||||
markers and both spinner controls will follow your selections.
|
||||
|
||||
- Double-clicking at any frequency on the waterfall does all the
|
||||
things just described and also invokes the decoder in a small range
|
||||
around that frequency.
|
||||
|
||||
- Now double-click on any of the the lines of decoded text in the main
|
||||
window. Unless you have *My Call* set to K1JT or KY7M on the
|
||||
*Settings -> General* tab, all three lines will show the same
|
||||
behavior, setting both RxFreq and TxFreq to the frequency of the
|
||||
selected message. However, if MyCall is set to K1JT then clicking on
|
||||
a message directed to K1JT will move only the Rx frequency setting.
|
||||
This behavior is desirable so that you will not inadvertently change
|
||||
your Tx frequency to that of a tail-ender who called you somewhere
|
||||
else in the FT8 subband.
|
||||
|
||||
IMPORTANT: When finished with this Tutorial, don't forget to re-enter
|
||||
your own callsign as *My Call* on the *Settings | General* tab.
|
||||
@@ -0,0 +1,371 @@
|
||||
<HTML><HEAD>
|
||||
|
||||
<TITLE> Creating a Parity Check Matrix </TITLE>
|
||||
|
||||
</HEAD><BODY>
|
||||
|
||||
|
||||
<H1> Creating a Parity Check Matrix </H1>
|
||||
|
||||
<P>This software deals only with linear block codes for binary (ie,
|
||||
modulo-2, GF(2)) vectors. The set of valid codewords for a linear
|
||||
code can be specified by giving a <I>parity check matrix</I>,
|
||||
<B>H</B>, with <I>M</I> rows and <I>N</I> columns. The valid
|
||||
codewords are the vectors, <B>x</B>, of length <I>N</I>, for which
|
||||
<B>Hx</B>=<B>0</B>, where all arithmetic is done modulo-2. Each row
|
||||
of <B>H</B> represents a parity check on a subset of the bits in
|
||||
<B>x</B>; all these parity checks must be satisfied for <B>x</B> to be
|
||||
a codeword. Note that the parity check matrix for a given code (ie,
|
||||
for a given set of valid codewords) is not unique, even after
|
||||
eliminating rows of <B>H</B> that are redundant because they are
|
||||
linear combinations of other rows.
|
||||
|
||||
<P>This software stores parity check matrices in files in a sparse
|
||||
format. These parity-check files are <I>not</I> human-readable
|
||||
(except by using the <A HREF="#print-pchk"><TT>print-pchk</TT></A>
|
||||
program). However, they <I>are</I> readable on a machine with a
|
||||
different architecture than they were written on.
|
||||
|
||||
<P>Some LDPC software by David MacKay and others uses the
|
||||
<A HREF="http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html">alist
|
||||
format</A> for parity check matrices. Two programs for converting
|
||||
between this format and the format for sparse parity check matrices
|
||||
used by this software are provided.
|
||||
|
||||
|
||||
<A NAME="ldpc"><H2>Methods for constructing LDPC codes</H2></A>
|
||||
|
||||
<P>This software is primarily intended for experimentation with Low
|
||||
Density Parity Check (LDPC) codes. These codes can be constructed by
|
||||
various methods, which generally involve some random selection of
|
||||
where to put 1s in a parity check matrix. Any such method for
|
||||
constructing LDPC codes will have the property that it produces parity
|
||||
check matrices in which the number of 1s in a column is approximately
|
||||
the same (perhaps on average) for any size parity check matrix. For a
|
||||
given code rate, these matrices therefore become increasingly sparse
|
||||
as the length of a codeword, and hence the number of parity checks,
|
||||
increases.
|
||||
|
||||
<P>Many methods for constructing LDPC matrices are described in the
|
||||
<A HREF="refs.html">references</A>. Two simple methods are currently
|
||||
implemented by this software, both of which operate according to the
|
||||
following scheme:
|
||||
<OL>
|
||||
<LI> Create a preliminary parity check matrix by one of the methods.
|
||||
<LI> Add 1s to the parity check matrix in order to avoid rows that have no
|
||||
1s in them, and hence are redundant, or which have only one 1 in them,
|
||||
in which case the corresponding codeword bits will always be zero.
|
||||
The places within such a row to add these 1s are selected randomly.
|
||||
<LI> If the preliminary parity check matrix constructed in step (1) had
|
||||
an even number of 1s in each column, add further 1s to avoid the problem
|
||||
that this will cause the rows to add to zero, and hence at least
|
||||
one check will be redundant. Up to two 1s are added (since it is also
|
||||
undesirable for the sum of the rows to have only one 1 in it), at
|
||||
positions selected randomly from the entire matrix. However, the
|
||||
number of 1s to add in this step is reduced by the number already added
|
||||
in step (2). (Note that although redundant checks are not disastrous,
|
||||
they are better avoided; see the discussion of <A HREF="dep-H.html">linear
|
||||
dependence in parity check matrices</A>.)
|
||||
<LI> If requested, try to eliminate
|
||||
situations where a pair of columns both have 1s in a particular pair of
|
||||
rows, which correspond to cycles of length four in the factor graph of
|
||||
the parity check matrix. When such a situation is detected, one of the
|
||||
1s involved is moved randomly within its column. This continues until
|
||||
no such situations remain, or until 10 passes over all columns have
|
||||
failed to eliminate all such situations.
|
||||
</OL>
|
||||
|
||||
<P>The <I>evencol</I> method is the simplest way of performing step
|
||||
(1) of the above procedure. For each column of the parity check
|
||||
matrix, independently, it places a specified number of 1s in positions
|
||||
selected uniformly at random, with the only constraint being that
|
||||
these 1s be in distinct rows. Note that despite the name, the columns
|
||||
do not have to have the same number of 1s - a distribution over
|
||||
several values for the number of 1s in a column can be specified
|
||||
instead. Such codes with different-weight columns are sometimes
|
||||
better than codes in which every column has the same weight.
|
||||
|
||||
<P>The <I>evenboth</I> method also puts a specified number of 1s in
|
||||
each column, but it tries as well to keep the numbers of 1s in the
|
||||
rows approximately the same. Initially, it creates indicators for all
|
||||
the 1s that will be required, and assigns these 1s to rows as evenly
|
||||
as it can, favouring earlier rows if an exactly even split is not
|
||||
possible. It then assigns 1s to successive columns by selecting
|
||||
randomly, without replacement, from this initial supply of 1s, subject
|
||||
only to the constraint that the 1s assigned to a column must be in
|
||||
distinct rows. If at some point it is impossible to put the required
|
||||
number of 1s in a column by picking from the 1s remaining, a 1 is set
|
||||
in that column without reference to other columns, creating a possible
|
||||
unevenness.
|
||||
|
||||
<P>Note that regardless of how evenly 1s are distributed in the
|
||||
preliminary parity check matrix created in step (1), steps (2) and (3)
|
||||
can make the numbers of 1s in the both rows and columns be uneven, and
|
||||
step (4), if done, can make the numbers of 1s in rows be uneven.
|
||||
|
||||
|
||||
<P><A NAME="make-pchk"><HR><B>make-pchk</B>: Make a parity check
|
||||
matrix by explicit specification.
|
||||
|
||||
<BLOCKQUOTE><PRE>
|
||||
make-pchk <I>pchk-file n-checks n-bits row</I>:<I>col ...</I>
|
||||
</PRE></BLOCKQUOTE>
|
||||
|
||||
<P>Creates a file named <TT><I>pchk-file</I></TT> in
|
||||
which it stores a parity check matrix with <TT><I>n-checks</I></TT>
|
||||
rows and <TT><I>n-bits</I></TT> columns. This parity check matrix
|
||||
consists of all 0s except for 1s at the <I>row</I>:<I>col</I>
|
||||
positions listed. Rows and columns are numbered starting at zero.
|
||||
This program is intended primarily for testing and demonstration
|
||||
purposes.
|
||||
|
||||
<P><B>Example:</B> The well-known Hamming code with codewords of
|
||||
length <I>N</I>=7 and with <I>M</I>=3 parity checks can be can be
|
||||
created as follows:
|
||||
<UL><PRE>
|
||||
<LI>make-pchk ham7.pchk 3 7 0:0 0:3 0:4 0:5 1:1 1:3 1:4 1:6 2:2 2:4 2:5 2:6
|
||||
</PRE></UL>
|
||||
|
||||
|
||||
<P><A NAME="alist-to-pchk"><HR><B>alist-to-pchk</B>: Convert a parity
|
||||
check matrix from alist format to the sparse matrix format used by
|
||||
this software.
|
||||
|
||||
<BLOCKQUOTE><PRE>
|
||||
alist-to-pchk [ -t ] <I>alist-file pchk-file</I>
|
||||
</PRE></BLOCKQUOTE>
|
||||
|
||||
<P>Converts a parity check matrix in
|
||||
<A HREF="http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html">alist
|
||||
format</A> stored in the file named <TT><I>alist-file</I></TT> to
|
||||
the sparse matrix format used by this software, storing it in the
|
||||
file named <TT><I>pchk-file</I></TT>.
|
||||
|
||||
<P>If the <B>-t</B> option is given, the transpose of the parity check
|
||||
matrix in <TT><I>alist-file</I></TT> is stored in the
|
||||
<TT><I>pchk-file</I></TT>.
|
||||
|
||||
<P>Any zeros indexes in the alist file are ignored, so that alist files
|
||||
with zero padding (as required in the specification) are accepted,
|
||||
but files without this zero padding are also accepted. Newlines
|
||||
are ignored by <TT>alist-to-pchk</TT>, so no error is reported if
|
||||
the set of indexes in a row or column description are not those
|
||||
on a single line.
|
||||
|
||||
|
||||
<P><A NAME="pchk-to-alist"><HR><B>pchk-to-alist</B>: Convert a parity
|
||||
check matrix to alist format.
|
||||
|
||||
<BLOCKQUOTE><PRE>
|
||||
pchk-to-alist [ -t ] [ -z ] <I>pchk-file alist-file</I>
|
||||
</PRE></BLOCKQUOTE>
|
||||
|
||||
<P>Converts a parity check matrix stored in the sparse matrix format
|
||||
used by this software, in the file named <TT><I>pchk-file</I></TT>, to
|
||||
the <A
|
||||
HREF="http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html">alist
|
||||
format</A>, storing it in the file named <TT><I>alist-file</I></TT>.
|
||||
|
||||
<P>If the <B>-t</B> option is given, the transpose of the parity check
|
||||
matrix is converted to alist format.
|
||||
|
||||
<P>If the number of 1s is not
|
||||
the same for each row or each column, the alist format specification
|
||||
says that the list of indexes of 1s for each row or column should
|
||||
be padded with zeros to the maximum number of indexes. By default,
|
||||
<TT>pchk-to-alist</TT> does this, but output of these 0s can be
|
||||
suppressed by specifying the <B>-z</B> option. (The <TT>alist-to-pchk</TT>
|
||||
program will accept alist files produced with or without the <B>-z</B>
|
||||
option.)
|
||||
|
||||
|
||||
<P><A NAME="print-pchk"><HR><B>print-pchk</B>: Print a parity check matrix.
|
||||
|
||||
<BLOCKQUOTE><PRE>
|
||||
print-pchk [ -d ] [ -t ] <I>pchk-file</I>
|
||||
</PRE></BLOCKQUOTE>
|
||||
|
||||
<P>Prints a human-readable representation of the parity check matrix stored
|
||||
in <TT><I>pchk-file</I></TT>.
|
||||
The <B>-d</B> option causes the matrix to be printed in a dense
|
||||
format, even though parity check matrices are always stored in the
|
||||
file in a sparse format. If the <B>-t</B> option is present, what is
|
||||
printed is the transpose of the parity check matrix.
|
||||
|
||||
<P>The sparse display format consists of one line for every row of the
|
||||
matrix, consisting of the row number, a colon, and the column numbers
|
||||
at which 1s are located (possibly none). Row and columns numbers
|
||||
start at zero. No attempt is made to wrap long lines.
|
||||
|
||||
<P>The dense display is the obvious array of 0s and 1s. Long lines
|
||||
are not wrapped.
|
||||
|
||||
<P><B>Example</B>: The parity check matrix for the Hamming code created
|
||||
by the example for <A HREF="#make-pchk"><TT>make-pchk</TT></A> would print
|
||||
as follows:
|
||||
<UL><PRE>
|
||||
<LI>print-pchk ham7.pchk
|
||||
|
||||
Parity check matrix in ham7.pchk (sparse format):
|
||||
|
||||
0: 0 3 4 5
|
||||
1: 1 3 4 6
|
||||
2: 2 4 5 6
|
||||
|
||||
<LI>print-pchk -d ham7.pchk
|
||||
|
||||
Parity check matrix in ham7.pchk (dense format):
|
||||
|
||||
1 0 0 1 1 1 0
|
||||
0 1 0 1 1 0 1
|
||||
0 0 1 0 1 1 1
|
||||
</PRE></UL>
|
||||
|
||||
|
||||
<P><A NAME="make-ldpc"><HR><B>make-ldpc</B>: Make a low density parity
|
||||
check matrix, by random generation.
|
||||
|
||||
<BLOCKQUOTE><PRE>
|
||||
make-ldpc <I>pchk-file n-checks n-bits seed method</I>
|
||||
</PRE>
|
||||
<BLOCKQUOTE>
|
||||
where <TT><I>method</I></TT> is one of the following:
|
||||
<BLOCKQUOTE><PRE>
|
||||
evencol <I>checks-per-col</I> [ no4cycle ]
|
||||
|
||||
evencol <I>checks-distribution</I> [ no4cycle ]
|
||||
|
||||
evenboth <I>checks-per-col</I> [ no4cycle ]
|
||||
|
||||
evenboth <I>checks-distribution</I> [ no4cycle ]
|
||||
</PRE></BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<P>Creates a Low Density Parity Check matrix with
|
||||
<TT><I>n-checks</I></TT> rows and <TT><I>n-bits</I></TT> columns. The
|
||||
parity check matrix will be generated pseudo-randomly by the indicated
|
||||
method, using a pseudo-random number stream determined by <TT><I>seed</I></TT>.
|
||||
The actual random number seed used is 10 times <TT><I>seed</I></TT> plus 1,
|
||||
so as to avoid using the same stream as any of the other programs.
|
||||
|
||||
<P>Two methods are currently available for creating the LDPC matrix,
|
||||
specified by <TT>evencol</TT> or <TT>evenboth</TT>. Both methods
|
||||
produce a matrix in which the number of 1s in each column is
|
||||
approximately <TT><I>checks-per-col</I></TT>, or varies from column
|
||||
to column according the the <TT><I>checks-distribution</I></TT>.
|
||||
The <TT>evenboth</TT> method also tries to make the number of checks per row be
|
||||
approximately uniform; if this is not achieved, a message saying that
|
||||
how many bits were placed unevenly is displayed on standard error.
|
||||
|
||||
<P>For both methods, the <TT>no4cycle</TT> option will cause cycles of
|
||||
length four in the factor graph representation of the code to be
|
||||
eliminated (if possible). A message is displayed on standard error if
|
||||
this is not achieved.
|
||||
|
||||
<P>A <TT><I>checks-distribution</I></TT> has the form
|
||||
<BLOCKQUOTE><PRE>
|
||||
<I>prop</I>x<I>count</I>/<I>prop</I>x<I>count</I>/...
|
||||
</PRE></BLOCKQUOTE>
|
||||
Here, <TT><I>prop</I></TT> is a proportion of columns that have the
|
||||
associated <TT><I>count</I></TT>. The proportions need not sum to one,
|
||||
since they will be automatically normalized. For example, <TT>0.3x4/0.2x5</TT>
|
||||
specifies that 60% of the columns will contain four 1s and 40% will
|
||||
contain five 1s.
|
||||
|
||||
<P>See the <A HREF="#ldpc">discussion above</A> for more details
|
||||
on how these methods construct LDPC matrices.
|
||||
|
||||
<P><B>Example 1:</B> The <TT>make-ldpc</TT> command below creates
|
||||
a 20 by 40 low density parity check matrix with three 1s per
|
||||
column and six 1s per row, using random seed 1. The matrix
|
||||
is then printed in sparse format
|
||||
using <A HREF="#print-pchk">print-pchk</A>.
|
||||
<UL><PRE>
|
||||
<LI>make-ldpc ldpc.pchk 20 40 1 evenboth 3
|
||||
<LI>print-pchk ldpc.pchk
|
||||
|
||||
Parity check matrix in ldpc.pchk (sparse format):
|
||||
|
||||
0: 10 14 18 27 38 39
|
||||
1: 2 3 5 11 27 30
|
||||
2: 15 19 20 21 24 26
|
||||
3: 2 4 25 28 32 38
|
||||
4: 7 9 12 22 33 34
|
||||
5: 5 6 21 22 26 32
|
||||
6: 1 4 13 24 25 28
|
||||
7: 1 14 28 29 30 36
|
||||
8: 11 13 22 23 32 37
|
||||
9: 6 8 13 20 31 33
|
||||
10: 0 3 24 29 31 38
|
||||
11: 7 12 15 16 17 23
|
||||
12: 3 16 29 34 35 39
|
||||
13: 0 8 10 18 36 37
|
||||
14: 6 11 18 20 35 39
|
||||
15: 0 7 14 16 25 37
|
||||
16: 2 4 9 19 30 31
|
||||
17: 5 9 10 17 19 23
|
||||
18: 8 15 17 21 26 27
|
||||
19: 1 12 33 34 35 36
|
||||
</PRE></UL>
|
||||
|
||||
<P><B>Example 2:</B> The two <TT>make-ldpc</TT> commands
|
||||
below both create a 20 by 40 low density parity check matrix with 30%
|
||||
of columns with two 1s, 60% of columns with three 1s, and 10% of
|
||||
columns with seven 1s. The transpose of the parity check matrix
|
||||
is then printed in sparse format.
|
||||
<UL><PRE>
|
||||
<LI>make-ldpc ldpc.pchk 20 40 1 evenboth 0.3x2/0.6x3/0.1x7
|
||||
<LI>make-ldpc ldpc.pchk 20 40 1 evenboth 3x2/6x3/1x7
|
||||
<LI>print-pchk -t ldpc.pchk
|
||||
|
||||
Transpose of parity check matrix in ldpc.pchk (sparse format):
|
||||
|
||||
0: 13 16
|
||||
1: 9 18
|
||||
2: 1 10
|
||||
3: 3 15
|
||||
4: 4 14
|
||||
5: 14 17
|
||||
6: 4 5
|
||||
7: 1 8
|
||||
8: 0 4
|
||||
9: 9 14
|
||||
10: 5 8
|
||||
11: 6 16
|
||||
12: 2 12 19
|
||||
13: 3 17 18
|
||||
14: 2 16 17
|
||||
15: 2 11 18
|
||||
16: 12 13 19
|
||||
17: 7 13 18
|
||||
18: 2 5 11
|
||||
19: 10 12 14
|
||||
20: 1 8 16
|
||||
21: 10 18 19
|
||||
22: 3 6 17
|
||||
23: 7 11 12
|
||||
24: 1 2 19
|
||||
25: 0 6 7
|
||||
26: 5 8 15
|
||||
27: 1 4 7
|
||||
28: 6 13 19
|
||||
29: 3 4 11
|
||||
30: 3 8 17
|
||||
31: 4 5 9
|
||||
32: 0 10 15
|
||||
33: 7 11 13
|
||||
34: 8 12 19
|
||||
35: 0 2 10
|
||||
36: 0 5 9 11 15 17 18
|
||||
37: 0 1 2 6 7 14 16
|
||||
38: 0 1 3 9 12 13 15
|
||||
39: 3 6 9 10 14 15 16
|
||||
</PRE></UL>
|
||||
|
||||
<HR>
|
||||
|
||||
<A HREF="index.html">Back to index for LDPC software</A>
|
||||
|
||||
</BODY></HTML>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
subroutine genft8refsig(itone,cref,f0)
|
||||
complex cref(79*1920)
|
||||
integer itone(79)
|
||||
real*8 twopi,phi,dphi,dt,xnsps
|
||||
data twopi/0.d0/
|
||||
save twopi
|
||||
if( twopi .lt. 0.1 ) twopi=8.d0*atan(1.d0)
|
||||
|
||||
xnsps=1920.d0
|
||||
dt=1.d0/12000.d0
|
||||
phi=0.d0
|
||||
k=1
|
||||
do i=1,79
|
||||
dphi=twopi*(f0*dt+itone(i)/xnsps)
|
||||
do is=1,1920
|
||||
cref(k)=cmplx(cos(phi),sin(phi))
|
||||
phi=mod(phi+dphi,twopi)
|
||||
k=k+1
|
||||
enddo
|
||||
enddo
|
||||
return
|
||||
end subroutine genft8refsig
|
||||
@@ -0,0 +1,30 @@
|
||||
<table cellpadding=5>
|
||||
<tr>
|
||||
<th align="right">Click on</th>
|
||||
<th align="left">Action</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Waterfall:</td>
|
||||
<td><b>Click</b> to set the Rx frequency.<br/>
|
||||
<b>Shift-click</b> to set Tx frequency.<br/>
|
||||
<b>Ctrl-click</b> to set Rx and Tx frequencies.<br/>
|
||||
<b>Double-click</b> to decode at resulting Rx frequency.<br/>
|
||||
If <b>Lock Tx=Rx</b> is checked all actions set Tx/Rx.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Decoded text:</td>
|
||||
<td><b>Double-click</b> to copy second callsign to Dx Call,<br/>
|
||||
locator to Dx Grid; change Rx and Tx frequencies to<br/>
|
||||
decoded signal's frequency; generate standard messages.<br/>
|
||||
If first callsign is your own, Tx frequency is not<br/>
|
||||
changed unless Ctrl is held down when double-clicking.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Erase button:</td>
|
||||
<td><b>Click</b> to erase QSO window.<br/>
|
||||
<b>Double-click</b> to erase QSO and Band Activity windows.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,22 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
|
||||
#if FUSION_MAX_LIST_SIZE <= 10
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list10_fwd.hpp>
|
||||
#elif FUSION_MAX_LIST_SIZE <= 20
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list20_fwd.hpp>
|
||||
#elif FUSION_MAX_LIST_SIZE <= 30
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list30_fwd.hpp>
|
||||
#elif FUSION_MAX_LIST_SIZE <= 40
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list40_fwd.hpp>
|
||||
#elif FUSION_MAX_LIST_SIZE <= 50
|
||||
#include <boost/fusion/container/list/detail/cpp03/preprocessed/list50_fwd.hpp>
|
||||
#else
|
||||
#error "FUSION_MAX_LIST_SIZE out of bounds for preprocessed headers"
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
// pdmath.h
|
||||
// Elementary math on probability distributions
|
||||
//
|
||||
// (c) 2016 - Nico Palermo, IV3NWV - Microtelecom Srl, Italy
|
||||
// ------------------------------------------------------------------------------
|
||||
// This file is part of the qracodes project, a Forward Error Control
|
||||
// encoding/decoding package based on Q-ary RA (repeat and accumulate) LDPC codes.
|
||||
//
|
||||
// qracodes is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
// qracodes is distributed in the hope that it 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.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with qracodes source distribution.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef _pdmath_h_
|
||||
#define _pdmath_h_
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PD_NDIM(nlogdim) ((1<<(nlogdim))
|
||||
#define PD_SIZE(ndim) ((ndim)*sizeof(float))
|
||||
#define PD_ROWADDR(fp,ndim,idx) (fp+((ndim)*(idx)))
|
||||
|
||||
const float *pd_uniform(int nlogdim);
|
||||
// Returns a pointer to a (constant) uniform distribution of the given log2 size
|
||||
|
||||
#define pd_init(dst,src,ndim) memcpy(dst,src,PD_SIZE(ndim))
|
||||
// Distribution copy
|
||||
|
||||
void pd_memset(float *dst, const float *src, int ndim, int nitems);
|
||||
// Copy the distribution pointed by src to the array of distributions dst
|
||||
// src is a pointer to the input distribution (a vector of size ndim)
|
||||
// dst is a pointer to a linear array of distributions (a vector of size ndim*nitems)
|
||||
|
||||
void pd_imul(float *dst, const float *src, int nlogdim);
|
||||
// In place multiplication
|
||||
// Compute dst = dst*src for any element of the distrib give their log2 size
|
||||
// src and dst arguments must be pointers to array of floats of the given size
|
||||
|
||||
float pd_norm(float *pd, int nlogdim);
|
||||
// In place normalizazion
|
||||
// Normalizes the input vector so that the sum of its components are one
|
||||
// pd must be a pointer to an array of floats of the given size.
|
||||
// If the norm of the input vector is non-positive the vector components
|
||||
// are replaced with a uniform distribution
|
||||
// Returns the norm of the distribution prior to the normalization
|
||||
|
||||
void pd_fwdperm(float *dst, float *src, const int *perm, int ndim);
|
||||
// Forward permutation of a distribution
|
||||
// Computes dst[k] = src[perm[k]] for every element in the distribution
|
||||
// perm must be a pointer to an array of integers of length ndim
|
||||
|
||||
void pd_bwdperm(float *dst, float *src, const int *perm, int ndim);
|
||||
// Backward permutation of a distribution
|
||||
// Computes dst[perm[k]] = src[k] for every element in the distribution
|
||||
// perm must be a pointer to an array of integers of length ndim
|
||||
|
||||
float pd_max(float *src, int ndim);
|
||||
// Return the maximum of the elements of the given distribution
|
||||
// Assumes that the input vector is a probability distribution and that each element in the
|
||||
// distribution is non negative
|
||||
|
||||
int pd_argmax(float *pmax, float *src, int ndim);
|
||||
// Return the index of the maximum element of the given distribution
|
||||
// The maximum is stored in the variable pointed by pmax if pmax is not null
|
||||
// Same note of pd_max applies.
|
||||
// Return -1 if all the elements in the distribution are negative
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _pdmath_h_
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,57 @@
|
||||
#ifndef BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP
|
||||
#define BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// xml_archive_exception.hpp:
|
||||
|
||||
// (C) Copyright 2007 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <exception>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// exceptions thrown by xml archives
|
||||
//
|
||||
class BOOST_SYMBOL_VISIBLE xml_archive_exception :
|
||||
public virtual boost::archive::archive_exception
|
||||
{
|
||||
public:
|
||||
typedef enum {
|
||||
xml_archive_parsing_error, // see save_register
|
||||
xml_archive_tag_mismatch,
|
||||
xml_archive_tag_name_error
|
||||
} exception_code;
|
||||
BOOST_ARCHIVE_DECL xml_archive_exception(
|
||||
exception_code c,
|
||||
const char * e1 = NULL,
|
||||
const char * e2 = NULL
|
||||
);
|
||||
BOOST_ARCHIVE_DECL xml_archive_exception(xml_archive_exception const &) ;
|
||||
virtual BOOST_ARCHIVE_DECL ~xml_archive_exception() BOOST_NOEXCEPT_OR_NOTHROW ;
|
||||
};
|
||||
|
||||
}// namespace archive
|
||||
}// namespace boost
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#endif //BOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP
|
||||
@@ -0,0 +1 @@
|
||||
svn status | grep -v "?"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_NEGATE_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_NEGATE_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_negate
|
||||
#define BOOST_TT_TRAIT_OP -
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer */\
|
||||
::boost::is_pointer< Rhs_noref >::value
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2008 Joel de Guzman
|
||||
Copyright (c) 2001-2008 Hartmut Kaiser
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CHSET
|
||||
#define BOOST_SPIRIT_INCLUDE_CLASSIC_CHSET
|
||||
#include <boost/spirit/home/classic/utility/chset.hpp>
|
||||
#endif
|
||||
Reference in New Issue
Block a user