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,244 @@
<HTML><HEAD>
<TITLE>Release Notes for LDPC-codes Software</TITLE>
</HEAD><BODY>
<H1>Release Notes for LDPC-codes Software</H1>
These notes describe all the stable public releases of this software. Old
and future releases can be obtained via
<BLOCKQUOTE>
<A HREF="http://www.cs.toronto.edu/~radford/ldpc.software.html">
<TT>http://www.cs.toronto.edu/~radford/ldpc.software.html</TT></A>
</BLOCKQUOTE>
The current development version is now maintained at
<BLOCKQUOTE>
<A HREF="http://github.com/radfordneal/LDPC-codes">
<TT>http://github.com/radfordneal/LDPC-code</TT></A>
</BLOCKQUOTE>
<H2>Version of 2012-02-11.</H2>
This version has a few bug fixes and some minor new features. The major
change is that a source repository for the software is now hosted
at github.com, making it easier for people to create and release
their own versions of this software.
<OL>
<LI> Changed the copyright notice (in the file COPYRIGHT, and elsewhere)
to remove the requirement that my web site be referenced. (Nowadays,
I think users should have no problem finding the sources using a
search engine.)
<LI> Included a copy of the nrand48 routine from the GNU C library
in the rand.c module, to ensure that it is always available
and always the same. (This isn't so on some versions of cygwin.)
<LI> Added a -f option to encode and decode that forces flushing
after writing each block. Useful for allowing encode or
decode to be used as a server, reading and writing blocks
from named pipes.
<LI> Added a -z option for pchk-to-alist to suppress output of 0
row and column indexes that pad up to the maximum number used.
<LI> Documented the previously undocumented -t options for pchk-to-alist
and alist-to-pchk.
<LI> Changed alist-to-pchk so that it no longer requires zero indexes
that pad out to the maximum needed for a row or column (thanks
to Monica Kolb for suggesting this).
<LI> Changed mod2word type in mod2dense.c to uint32_t, to avoid
wasted space when long is 64 bits (thanks to Mathieu Cunche
and Vincent Roca for suggesting this).
<LI> Fixed bug in distrib.c affecting distributions with a single
number (thanks to Mike Vicuna for pointing it out).
<LI> Fixed bug in -t option for pchk-to-alist (thanks to Andrea Fontana
for reporting this).
<LI> Fixed references in the documentation to mod2sparse_multvec
that should be to mod2sparse_mulvec (thanks to Andrea Fontana
for reporting this).
</OL>
<H2>Version of 2006-02-08.</H2>
The copyright notice has been changed in this release to no longer
restrict use to purposes of research or education. The new copyright
notice can be read <A HREF="index.html#copyright">here</A>. It is now
possible to create LDPC codes with varying numbers of checks per bit
(an extension based on work by Peter Junteng Liu). New programs for
converting to and from the <A
HREF="http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html">alist
format</A> for parity check matrices, used by David MacKay and others,
have also been added.
<P>The following new features have been added:
<OL>
<LI> The <A HREF="pchk.html#make-ldpc"><TT>make-ldpc</TT></A> program can
new create LDPC codes with varying numbers of checks per bit. The
<A HREF="examples.html">examples</A> now include a code of this sort.
<LI> New programs <A HREF="pchk.html#pchk-to-alist"><TT>pchk-to-alist</TT></A>
and <A HREF="pchk.html#alist-to-pchk"><TT>alist-to-pchk</TT></A> have
been added, which convert to and from <A
HREF="http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html">alist
format</A>.
<LI> A <A HREF="run-examples"><TT>run-examples</TT></A> script has been
added, which runs all the <A HREF="examples.html">examples</A> and
compares with the saved output that I obtained.
</OL>
<H2>Version of 2001-11-18.</H2>
This is a minor release, whose main purpose is fixing bug (1) below.
Also, this release has been tested and found to work with the <A
HREF="http://www.cygwin.com">cygwin</A> Unix environment that runs
under Microsoft Windows.
<P>The following new feature has been added:
<OL>
<LI> A new <B>-t</B> option has been added to
<A HREF="pchk.html#print-pchk"><TT>print-pchk</TT></A>, which
causes it to print the transpose of the parity check matrix.
</OL>
The following program module change was made:
<OL>
<LI> The behaviour of <A
HREF="mod2dense.html#invert_selected">mod2dense_invert_selected</A>
has been changed when the matrix has dependent rows. The result returned
contains the inverse of a sub-matrix in its initial columns. The contents
of the remaining columns up to the number of rows was previously undefined,
but these columns are now set to contain zeros. This was done to fix
bug (1) below.
</OL>
The following bugs were fixed:
<OL>
<LI> A bug has been fixed in
<A HREF="encoding.html#make-gen"><TT>make-gen</TT></A>
which sometimes
produced invalid `dense' or `mixed' generator matrices when the parity
check matrix had redundant rows.
The `sparse' generator matrices were not affected. The output of the
<A HREF="ex-dep"><TT>ex-dep</TT></A> example has changed slightly as a
result.
<LI> The open mode for reading the file of random numbers has been changed from
"r" to "rb", for compatibility with non-Unix systems.
<LI> <A HREF="mod2sparse.html#copy"><TT>mod2sparse_copy</TT></A> has
been fixed so that it copies the <B>lr</B> and <B>pr</B> fields
of entries.
<LI> The "set -v -e" in the command files for the examples has
been replaced by two commands, "set -e" and "set -v", since some
shells can't set two options at once.
</OL>
A few minor fixes to the documentation have also been made.
<H2>Version of 2001-05-04.</H2>
Changes and new features regarding programs and associated
documentation and examples:
<OL>
<LI> Warnings have been added to the documentation about the dangers of
using zero codewords for testing (due to the possibility of the decoder
accidently being non-symmetric). The examples have been changed to
not use zero codewords, except for
<A HREF="ex-ham7a"><TT>ex-ham7a</TT></A>, which still
demonstrates this facility.
<LI> Decoding by probability propagation has been changed so that if
a probability ratio gets set to NaN ("not a number", the result of
infinite but conflicting evidence from different sources), the probability
ratio is changed to 1, in hopes that something sensible may result.
<LI> The decoding procedures have been changed to decode a bit to a 1 if
there is a tie, so that any resulting asymmetry in decoding will
make zero decoding less, rather than more, likely. See point (1) above.
<LI> All programs now allow a file name argument to be "-", which specifies
standard input or standard output, as appropriate. The
<A HREF="ex-ldpc36-5000a"><TT>ex-ldpc36-5000a</TT></A> example has been
changed to use this facility in order to avoid creating lots of files.
<LI> Channels with noise from a logistic distribution (AWLN) have been
implemented. For details,
see the <A HREF="channel.html">channel documentation</A>.
<LI> The <B>make-gen</B> program for "dense" or "mixed" options was modified
so that when some parity checks are redundant, others are not declared
redundant when they aren't. This makes the result compatible with
what is obtained with the "sparse" option. The example in the
<A HREF="dep-H.html">discussion of linear dependence in parity check
matrices</A> has changed slightly as a result.
<LI> The messages displayed by the <A HREF="decoding.html#decode">decode</A>
program have changed slightly: The block size is no longer displayed,
and the percentage of bits changed is now shown. The data output
when the <B>-t</B> option is specified now includes the number of
bits changed in each block.
<LI> A new <B>-T</B> option to <A HREF="decoding.html#decode">decode</A>
for displaying
<A HREF="decode-detail.html">detailed information on decoding</A>
has been added.
<LI> Doing a <B>make clean</B> will now remove the files created
by running the <A HREF="examples.html">examples</A>.
<LI> The files created by the <A HREF="examples.html">examples</A> now
start with "<TT>ex-</TT>" and contain a ".", to make them easier to
identify for cleanup, and the saved output file now ends in
"<TT>-out</TT>" rather than "<TT>.out</TT>".
<LI> The scripts for the examples now use the <B>-v</B> option of <B>set</B>
rather than <B>-x</B>, so that the command lines are echoed
faithfully as they are read.
<LI> Two new <A HREF="examples.html">examples</A> have been added:
<TT>ex-dep</TT> demonstrates what happens when parity check matrices
have redundant row, and <TT>ex-wrong-model</TT> investigates what
happens when the wrong model is used to decode.
</OL>
Changes and new features regarding program modules and other internals:
<OL>
<LI> Instructions have been added on
<A HREF="modify.html">how to modify the programs</A>, and some
code has been reorganized to facilitate modifications.
<LI> The makefile has been made trivial, simply recompiling everything
from scratch every time. This is simpler and less error prone
than putting in dependencies.
Compiling all the programs takes only about five seconds on a
modern PC.
<LI> The
<A HREF="mod2dense.html#invert_selected"><TT>mod2dense_invert_selected</TT></A>
procedure has been changed
to take an additional argument in which a permutation of rows is
returned. This extension is needed in order for the result when
the matrix is not of full rank to include as many rows as possible,
as needed for the above modification of <B>make-gen</B>.
<LI> New routines
<A HREF="mod2dense.html#copyrows"><TT>mod2dense_copyrows</TT></A> and
<A HREF="mod2sparse.html#copyrows"><TT>mod2sparse_copyrows</TT></A> have
been added, analogous to the previous routines for copying columns.
<LI> The decoding procedures have been changed to always return the bit
probabilities (previously, one could pass a null pointer to suppress
this). This makes things simpler, and facilitates the production of
detailed trace output when the <B>-T</B> option is used.
</OL>
The following bugs were fixed:
<OL>
<LI> A problem with <B>print-gen</B> prevented the <B>-d</B> option from working
in most cases. The documentation was also fixed to note what
the <B>L</B> and <B>U</B> matrices printed will look like.
<LI> The documentation for
<A HREF="mod2sparse.html#copycols"><TT>mod2sparse_copycols</TT></A> and
<A HREF="mod2dense.html#copycols"><TT>mod2dense_copycols</TT></A>
was ambiguous. It has been clarified. The dense and sparse
implementations were inconsistent. The sparse version has been changed
to match the dense version, which was and is the only version actually
used in the LDPC software.
<LI> In <TT>decode.c</TT>, a variable declared to be <TT>float</TT> was printed
using "<TT>%f</TT>", which strangely didn't work with one compiler.
It's now declared as <TT>double</TT>.
</OL>
There were also numerous minor cleanups of program code and documentation.
<H2>Version of 2000-03-19.</H2>
This was the first public release.
<HR>
<A HREF="index.html">Back to index for LDPC software</A>
</BODY></HTML>
@@ -0,0 +1,321 @@
/*
*
* 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 states.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Declares internal state machine structures.
*/
#ifndef BOOST_REGEX_V4_STATES_HPP
#define BOOST_REGEX_V4_STATES_HPP
#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
namespace boost{
namespace BOOST_REGEX_DETAIL_NS{
/*** mask_type *******************************************************
Whenever we have a choice of two alternatives, we use an array of bytes
to indicate which of the two alternatives it is possible to take for any
given input character. If mask_take is set, then we can take the next
state, and if mask_skip is set then we can take the alternative.
***********************************************************************/
enum mask_type
{
mask_take = 1,
mask_skip = 2,
mask_init = 4,
mask_any = mask_skip | mask_take,
mask_all = mask_any
};
/*** helpers **********************************************************
These helpers let us use function overload resolution to detect whether
we have narrow or wide character strings:
***********************************************************************/
struct _narrow_type{};
struct _wide_type{};
template <class charT> struct is_byte;
template<> struct is_byte<char> { typedef _narrow_type width_type; };
template<> struct is_byte<unsigned char>{ typedef _narrow_type width_type; };
template<> struct is_byte<signed char> { typedef _narrow_type width_type; };
template <class charT> struct is_byte { typedef _wide_type width_type; };
/*** enum syntax_element_type ******************************************
Every record in the state machine falls into one of the following types:
***********************************************************************/
enum syntax_element_type
{
// start of a marked sub-expression, or perl-style (?...) extension
syntax_element_startmark = 0,
// end of a marked sub-expression, or perl-style (?...) extension
syntax_element_endmark = syntax_element_startmark + 1,
// any sequence of literal characters
syntax_element_literal = syntax_element_endmark + 1,
// start of line assertion: ^
syntax_element_start_line = syntax_element_literal + 1,
// end of line assertion $
syntax_element_end_line = syntax_element_start_line + 1,
// match any character: .
syntax_element_wild = syntax_element_end_line + 1,
// end of expression: we have a match when we get here
syntax_element_match = syntax_element_wild + 1,
// perl style word boundary: \b
syntax_element_word_boundary = syntax_element_match + 1,
// perl style within word boundary: \B
syntax_element_within_word = syntax_element_word_boundary + 1,
// start of word assertion: \<
syntax_element_word_start = syntax_element_within_word + 1,
// end of word assertion: \>
syntax_element_word_end = syntax_element_word_start + 1,
// start of buffer assertion: \`
syntax_element_buffer_start = syntax_element_word_end + 1,
// end of buffer assertion: \'
syntax_element_buffer_end = syntax_element_buffer_start + 1,
// backreference to previously matched sub-expression
syntax_element_backref = syntax_element_buffer_end + 1,
// either a wide character set [..] or one with multicharacter collating elements:
syntax_element_long_set = syntax_element_backref + 1,
// narrow character set: [...]
syntax_element_set = syntax_element_long_set + 1,
// jump to a new state in the machine:
syntax_element_jump = syntax_element_set + 1,
// choose between two production states:
syntax_element_alt = syntax_element_jump + 1,
// a repeat
syntax_element_rep = syntax_element_alt + 1,
// match a combining character sequence
syntax_element_combining = syntax_element_rep + 1,
// perl style soft buffer end: \z
syntax_element_soft_buffer_end = syntax_element_combining + 1,
// perl style continuation: \G
syntax_element_restart_continue = syntax_element_soft_buffer_end + 1,
// single character repeats:
syntax_element_dot_rep = syntax_element_restart_continue + 1,
syntax_element_char_rep = syntax_element_dot_rep + 1,
syntax_element_short_set_rep = syntax_element_char_rep + 1,
syntax_element_long_set_rep = syntax_element_short_set_rep + 1,
// a backstep for lookbehind repeats:
syntax_element_backstep = syntax_element_long_set_rep + 1,
// an assertion that a mark was matched:
syntax_element_assert_backref = syntax_element_backstep + 1,
syntax_element_toggle_case = syntax_element_assert_backref + 1,
// a recursive expression:
syntax_element_recurse = syntax_element_toggle_case + 1,
// Verbs:
syntax_element_fail = syntax_element_recurse + 1,
syntax_element_accept = syntax_element_fail + 1,
syntax_element_commit = syntax_element_accept + 1,
syntax_element_then = syntax_element_commit + 1
};
#ifdef BOOST_REGEX_DEBUG
// dwa 09/26/00 - This is needed to suppress warnings about an ambiguous conversion
std::ostream& operator<<(std::ostream&, syntax_element_type);
#endif
struct re_syntax_base;
/*** union offset_type ************************************************
Points to another state in the machine. During machine construction
we use integral offsets, but these are converted to pointers before
execution of the machine.
***********************************************************************/
union offset_type
{
re_syntax_base* p;
std::ptrdiff_t i;
};
/*** struct re_syntax_base ********************************************
Base class for all states in the machine.
***********************************************************************/
struct re_syntax_base
{
syntax_element_type type; // what kind of state this is
offset_type next; // next state in the machine
};
/*** struct re_brace **************************************************
A marked parenthesis.
***********************************************************************/
struct re_brace : public re_syntax_base
{
// The index to match, can be zero (don't mark the sub-expression)
// or negative (for perl style (?...) extentions):
int index;
bool icase;
};
/*** struct re_dot **************************************************
Match anything.
***********************************************************************/
enum
{
dont_care = 1,
force_not_newline = 0,
force_newline = 2,
test_not_newline = 2,
test_newline = 3
};
struct re_dot : public re_syntax_base
{
unsigned char mask;
};
/*** struct re_literal ************************************************
A string of literals, following this structure will be an
array of characters: charT[length]
***********************************************************************/
struct re_literal : public re_syntax_base
{
unsigned int length;
};
/*** struct re_case ************************************************
Indicates whether we are moving to a case insensive block or not
***********************************************************************/
struct re_case : public re_syntax_base
{
bool icase;
};
/*** struct re_set_long ***********************************************
A wide character set of characters, following this structure will be
an array of type charT:
First csingles null-terminated strings
Then 2 * cranges NULL terminated strings
Then cequivalents NULL terminated strings
***********************************************************************/
template <class mask_type>
struct re_set_long : public re_syntax_base
{
unsigned int csingles, cranges, cequivalents;
mask_type cclasses;
mask_type cnclasses;
bool isnot;
bool singleton;
};
/*** struct re_set ****************************************************
A set of narrow-characters, matches any of _map which is none-zero
***********************************************************************/
struct re_set : public re_syntax_base
{
unsigned char _map[1 << CHAR_BIT];
};
/*** struct re_jump ***************************************************
Jump to a new location in the machine (not next).
***********************************************************************/
struct re_jump : public re_syntax_base
{
offset_type alt; // location to jump to
};
/*** struct re_alt ***************************************************
Jump to a new location in the machine (possibly next).
***********************************************************************/
struct re_alt : public re_jump
{
unsigned char _map[1 << CHAR_BIT]; // which characters can take the jump
unsigned int can_be_null; // true if we match a NULL string
};
/*** struct re_repeat *************************************************
Repeat a section of the machine
***********************************************************************/
struct re_repeat : public re_alt
{
std::size_t min, max; // min and max allowable repeats
int state_id; // Unique identifier for this repeat
bool leading; // True if this repeat is at the start of the machine (lets us optimize some searches)
bool greedy; // True if this is a greedy repeat
};
/*** struct re_recurse ************************************************
Recurse to a particular subexpression.
**********************************************************************/
struct re_recurse : public re_jump
{
int state_id; // identifier of first nested repeat within the recursion.
};
/*** struct re_commit *************************************************
Used for the PRUNE, SKIP and COMMIT verbs which basically differ only in what happens
if no match is found and we start searching forward.
**********************************************************************/
enum commit_type
{
commit_prune,
commit_skip,
commit_commit
};
struct re_commit : public re_syntax_base
{
commit_type action;
};
/*** enum re_jump_size_type *******************************************
Provides compiled size of re_jump structure (allowing for trailing alignment).
We provide this so we know how manybytes to insert when constructing the machine
(The value of padding_mask is defined in regex_raw_buffer.hpp).
***********************************************************************/
enum re_jump_size_type
{
re_jump_size = (sizeof(re_jump) + padding_mask) & ~(padding_mask),
re_repeater_size = (sizeof(re_repeat) + padding_mask) & ~(padding_mask),
re_alt_size = (sizeof(re_alt) + padding_mask) & ~(padding_mask)
};
/*** proc re_is_set_member *********************************************
Forward declaration: we'll need this one later...
***********************************************************************/
template<class charT, class traits>
struct regex_data;
template <class iterator, class charT, class traits_type, class char_classT>
iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
iterator last,
const re_set_long<char_classT>* set_,
const regex_data<charT, traits_type>& e, bool icase);
} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#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
#endif
@@ -0,0 +1,13 @@
// Status=review
[[FIG_CONFIG_RPT]]
image::reporting.png[align="center",alt="Reporting Screen"]
- _Logging_: Choose any desired options from this group.
- _Network Services_: Check *Enable PSK Reporter Spotting* to send
reception reports to the {pskreporter} mapping facility.
- _UDP Server_: This group of options controls the network name or
address and port number used by a program that will receive status
updates from _WSJT-X_. Cooperating applications like _JTAlert_ use
this feature to obtain information about a running _WSJT-X_ instance.
@@ -0,0 +1,175 @@
/*=============================================================================
Copyright (c) 1998-2003 Joel de Guzman
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_RULE_HPP)
#define BOOST_SPIRIT_RULE_HPP
#include <boost/static_assert.hpp>
///////////////////////////////////////////////////////////////////////////////
//
// Spirit predefined maximum number of simultaneously usable different
// scanner types.
//
// This limit defines the maximum number of possible different scanner
// types for which a specific rule<> may be used. If this isn't defined, a
// rule<> may be used with one scanner type only (multiple scanner support
// is disabled).
//
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT)
# define BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT 1
#endif
// Ensure a meaningful maximum number of simultaneously usable scanner types
BOOST_STATIC_ASSERT(BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 0);
#include <boost/scoped_ptr.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/non_terminal/impl/rule.ipp>
#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1
# include <boost/preprocessor/enum_params.hpp>
#endif
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1
///////////////////////////////////////////////////////////////////////////
//
// scanner_list (a fake scanner)
//
// Typically, rules are tied to a specific scanner type and
// a particular rule cannot be used with anything else. Sometimes
// there's a need for rules that can accept more than one scanner
// type. The scanner_list<S0, ...SN> can be used as a template
// parameter to the rule class to specify up to the number of
// scanner types defined by the BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT
// constant. Example:
//
// rule<scanner_list<ScannerT0, ScannerT1> > r;
//
// *** This feature is available only to compilers that support
// partial template specialization. ***
//
///////////////////////////////////////////////////////////////////////////
template <
BOOST_PP_ENUM_PARAMS(
BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT,
typename ScannerT
)
>
struct scanner_list : scanner_base {};
#endif
///////////////////////////////////////////////////////////////////////////
//
// rule class
//
// The rule is a polymorphic parser that acts as a named place-
// holder capturing the behavior of an EBNF expression assigned to
// it.
//
// The rule is a template class parameterized by:
//
// 1) scanner (scanner_t, see scanner.hpp),
// 2) the rule's context (context_t, see parser_context.hpp)
// 3) an arbitrary tag (tag_t, see parser_id.hpp) that allows
// a rule to be tagged for identification.
//
// These template parameters may be specified in any order. The
// scanner will default to scanner<> when it is not specified.
// The context will default to parser_context when not specified.
// The tag will default to parser_address_tag when not specified.
//
// The definition of the rule (its right hand side, RHS) held by
// the rule through a scoped_ptr. When a rule is seen in the RHS
// of an assignment or copy construction EBNF expression, the rule
// is held by the LHS rule by reference.
//
///////////////////////////////////////////////////////////////////////////
template <
typename T0 = nil_t
, typename T1 = nil_t
, typename T2 = nil_t
>
class rule
: public impl::rule_base<
rule<T0, T1, T2>
, rule<T0, T1, T2> const&
, T0, T1, T2>
{
public:
typedef rule<T0, T1, T2> self_t;
typedef impl::rule_base<
self_t
, self_t const&
, T0, T1, T2>
base_t;
typedef typename base_t::scanner_t scanner_t;
typedef typename base_t::attr_t attr_t;
typedef impl::abstract_parser<scanner_t, attr_t> abstract_parser_t;
rule() : ptr() {}
~rule() {}
rule(rule const& r)
: ptr(new impl::concrete_parser<rule, scanner_t, attr_t>(r)) {}
template <typename ParserT>
rule(ParserT const& p)
: ptr(new impl::concrete_parser<ParserT, scanner_t, attr_t>(p)) {}
template <typename ParserT>
rule& operator=(ParserT const& p)
{
ptr.reset(new impl::concrete_parser<ParserT, scanner_t, attr_t>(p));
return *this;
}
rule& operator=(rule const& r)
{
ptr.reset(new impl::concrete_parser<rule, scanner_t, attr_t>(r));
return *this;
}
rule<T0, T1, T2>
copy() const
{
return rule<T0, T1, T2>(ptr.get() ? ptr->clone() : 0);
}
private:
friend class impl::rule_base_access;
abstract_parser_t*
get() const
{
return ptr.get();
}
rule(abstract_parser_t* ptr_)
: ptr(ptr_) {}
rule(abstract_parser_t const* ptr_)
: ptr(ptr_) {}
scoped_ptr<abstract_parser_t> ptr;
};
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
#endif
@@ -0,0 +1,65 @@
#ifndef BOOST_SERIALIZATION_TRAITS_HPP
#define BOOST_SERIALIZATION_TRAITS_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// traits.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// This header is used to apply serialization traits to templates. The
// standard system can't be used for platforms which don't support
// Partial Templlate Specialization.
// The motivation for this is the Name-Value Pair (NVP) template.
// it has to work the same on all platforms in order for archives
// to be portable accross platforms.
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/bool_fwd.hpp>
#include <boost/serialization/level_enum.hpp>
#include <boost/serialization/tracking_enum.hpp>
namespace boost {
namespace serialization {
// common base class used to detect appended traits class
struct basic_traits {};
template <class T>
struct extended_type_info_impl;
template<
class T,
int Level,
int Tracking,
unsigned int Version = 0,
class ETII = extended_type_info_impl< T >,
class Wrapper = mpl::false_
>
struct traits : public basic_traits {
BOOST_STATIC_ASSERT(Version == 0 || Level >= object_class_info);
BOOST_STATIC_ASSERT(Tracking == track_never || Level >= object_serializable);
typedef typename mpl::int_<Level> level;
typedef typename mpl::int_<Tracking> tracking;
typedef typename mpl::int_<Version> version;
typedef ETII type_info_implementation;
typedef Wrapper is_wrapper;
};
} // namespace serialization
} // namespace boost
#endif // BOOST_SERIALIZATION_TRAITS_HPP
@@ -0,0 +1,71 @@
/*=============================================================================
Copyright (c) 2011 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_BOOST_PHOENIX_SUPPORT_PP_ROUND_HPP
#define BOOST_BOOST_PHOENIX_SUPPORT_PP_ROUND_HPP
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/control/if.hpp>
#define BOOST_PHOENIX_PP_ROUND_UP(N) \
BOOST_PP_CAT(BOOST_PHOENIX_PP_DO_ROUND_UP_, N)() \
/**/
#define BOOST_PHOENIX_PP_DO_ROUND_UP_0() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_1() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_2() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_3() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_4() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_5() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_6() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_7() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_8() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_9() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_10() 10
#define BOOST_PHOENIX_PP_DO_ROUND_UP_11() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_12() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_13() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_14() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_15() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_16() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_17() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_18() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_19() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_20() 20
#define BOOST_PHOENIX_PP_DO_ROUND_UP_21() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_22() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_23() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_24() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_25() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_26() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_27() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_28() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_29() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_30() 30
#define BOOST_PHOENIX_PP_DO_ROUND_UP_31() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_32() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_33() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_34() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_35() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_36() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_37() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_38() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_39() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_40() 40
#define BOOST_PHOENIX_PP_DO_ROUND_UP_41() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_42() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_43() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_44() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_45() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_46() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_47() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_48() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_49() 50
#define BOOST_PHOENIX_PP_DO_ROUND_UP_50() 50
#endif
@@ -0,0 +1,137 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29> >
{
struct category : forward_traversal_tag, associative_tag {};
typedef set_tag fusion_tag;
typedef fusion_sequence_tag tag;
typedef mpl::false_ is_view;
typedef vector<
T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29>
storage_type;
typedef typename storage_type::size size;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set()
: data() {}
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
set(typename detail::call_param<T0 >::type arg0)
: data(arg0) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1)
: data(arg0 , arg1) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2)
: data(arg0 , arg1 , arg2) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3)
: data(arg0 , arg1 , arg2 , arg3) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4)
: data(arg0 , arg1 , arg2 , arg3 , arg4) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23 , typename detail::call_param<T24 >::type arg24)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23 , arg24) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23 , typename detail::call_param<T24 >::type arg24 , typename detail::call_param<T25 >::type arg25)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23 , arg24 , arg25) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23 , typename detail::call_param<T24 >::type arg24 , typename detail::call_param<T25 >::type arg25 , typename detail::call_param<T26 >::type arg26)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23 , arg24 , arg25 , arg26) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23 , typename detail::call_param<T24 >::type arg24 , typename detail::call_param<T25 >::type arg25 , typename detail::call_param<T26 >::type arg26 , typename detail::call_param<T27 >::type arg27)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23 , arg24 , arg25 , arg26 , arg27) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23 , typename detail::call_param<T24 >::type arg24 , typename detail::call_param<T25 >::type arg25 , typename detail::call_param<T26 >::type arg26 , typename detail::call_param<T27 >::type arg27 , typename detail::call_param<T28 >::type arg28)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23 , arg24 , arg25 , arg26 , arg27 , arg28) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(typename detail::call_param<T0 >::type arg0 , typename detail::call_param<T1 >::type arg1 , typename detail::call_param<T2 >::type arg2 , typename detail::call_param<T3 >::type arg3 , typename detail::call_param<T4 >::type arg4 , typename detail::call_param<T5 >::type arg5 , typename detail::call_param<T6 >::type arg6 , typename detail::call_param<T7 >::type arg7 , typename detail::call_param<T8 >::type arg8 , typename detail::call_param<T9 >::type arg9 , typename detail::call_param<T10 >::type arg10 , typename detail::call_param<T11 >::type arg11 , typename detail::call_param<T12 >::type arg12 , typename detail::call_param<T13 >::type arg13 , typename detail::call_param<T14 >::type arg14 , typename detail::call_param<T15 >::type arg15 , typename detail::call_param<T16 >::type arg16 , typename detail::call_param<T17 >::type arg17 , typename detail::call_param<T18 >::type arg18 , typename detail::call_param<T19 >::type arg19 , typename detail::call_param<T20 >::type arg20 , typename detail::call_param<T21 >::type arg21 , typename detail::call_param<T22 >::type arg22 , typename detail::call_param<T23 >::type arg23 , typename detail::call_param<T24 >::type arg24 , typename detail::call_param<T25 >::type arg25 , typename detail::call_param<T26 >::type arg26 , typename detail::call_param<T27 >::type arg27 , typename detail::call_param<T28 >::type arg28 , typename detail::call_param<T29 >::type arg29)
: data(arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 , arg9 , arg10 , arg11 , arg12 , arg13 , arg14 , arg15 , arg16 , arg17 , arg18 , arg19 , arg20 , arg21 , arg22 , arg23 , arg24 , arg25 , arg26 , arg27 , arg28 , arg29) {}
template <typename T>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set&
operator=(T const& rhs)
{
data = rhs;
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type& get_data() { return data; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type const& get_data() const { return data; }
private:
storage_type data;
};
}}
@@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
template <
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ , typename T40 = void_ , typename T41 = void_ , typename T42 = void_ , typename T43 = void_ , typename T44 = void_ , typename T45 = void_ , typename T46 = void_ , typename T47 = void_ , typename T48 = void_ , typename T49 = void_
>
struct tuple;
}}
@@ -0,0 +1,18 @@
//-----------------------------------------------------------------------------
// boost aligned_storage.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002-2003
// Eric Friedman, Itay Maman
//
// 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_ALIGNED_STORAGE_HPP
#define BOOST_ALIGNED_STORAGE_HPP
#include <boost/type_traits/aligned_storage.hpp>
#endif // BOOST_ALIGNED_STORAGE_HPP
@@ -0,0 +1,30 @@
// 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_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP
#define BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP
#include <boost/units/derived_dimension.hpp>
#include <boost/units/physical_dimensions/length.hpp>
#include <boost/units/physical_dimensions/time.hpp>
namespace boost {
namespace units {
/// derived dimension for kinematic viscosity : L^2 T^-1
typedef derived_dimension<length_base_dimension,2,
time_base_dimension,-1>::type kinematic_viscosity_dimension;
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP
@@ -0,0 +1,34 @@
// Copyright 2005 Daniel Wallin.
// Copyright 2005 Joel de Guzman.
//
// 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)
//
// Modeled after range_ex, Copyright 2004 Eric Niebler
///////////////////////////////////////////////////////////////////////////////
//
// has_unique.hpp
//
/////////////////////////////////////////////////////////////////////////////
#if defined(_MSC_VER)
#pragma once
#endif
#ifndef BOOST_PHOENIX_HAS_UNIQUE_EN_14_12_2004
#define BOOST_PHOENIX_HAS_UNIQUE_EN_14_12_2004
#include "./is_std_list.hpp"
namespace boost
{
// Specialize this for user-defined types
template<typename T>
struct has_unique
: is_std_list<T>
{
};
}
#endif
@@ -0,0 +1,27 @@
/*
[auto_generated]
boost/numeric/odeint/external/thrust/thrust.hpp
[begin_description]
includes all headers required for using odeint with thrust
[end_description]
Copyright 2013 Karsten Ahnert
Copyright 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_EXTERNAL_THRUST_HPP_DEFINED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED
#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
#include <boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp>
#include <boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp>
#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp>
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED
@@ -0,0 +1,21 @@
subroutine fmtmsg(msg,iz)
character*22 msg
! Convert all letters to upper case
iz=22
do i=1,22
if(msg(i:i).ge.'a' .and. msg(i:i).le.'z') &
msg(i:i)= char(ichar(msg(i:i))+ichar('A')-ichar('a'))
if(msg(i:i).ne.' ') iz=i
enddo
do iter=1,5 !Collapse multiple blanks into one
ib2=index(msg(1:iz),' ')
if(ib2.lt.1) go to 100
msg=msg(1:ib2)//msg(ib2+2:)
iz=iz-1
enddo
100 return
end subroutine fmtmsg
@@ -0,0 +1,158 @@
///////////////////////////////////////////////////////////////////////////////
/// \file iterator.hpp
/// Proto callables for std functions found in \<iterator\>
//
// Copyright 2012 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PROTO_FUNCTIONAL_STD_ITERATOR_HPP_EAN_27_08_2012
#define BOOST_PROTO_FUNCTIONAL_STD_ITERATOR_HPP_EAN_27_08_2012
#include <iterator>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/proto/proto_fwd.hpp>
namespace boost { namespace proto { namespace functional
{
// A PolymorphicFunctionObject wrapping std::advance
struct advance
{
BOOST_PROTO_CALLABLE()
typedef void result_type;
template<typename InputIterator, typename Distance>
void operator()(InputIterator &x, Distance n) const
{
std::advance(x, n);
}
};
// A PolymorphicFunctionObject wrapping std::distance
struct distance
{
BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
template<typename This, typename InputIter1, typename InputIter2>
struct result<This(InputIter1, InputIter2)>
{
typedef
typename std::iterator_traits<
typename boost::remove_const<
typename boost::remove_reference<InputIter1>::type
>::type
>::difference_type
type;
};
template<typename InputIterator>
typename std::iterator_traits<InputIterator>::difference_type
operator()(InputIterator first, InputIterator last) const
{
return std::distance(first, last);
}
};
// A PolymorphicFunctionObject wrapping std::next
struct next
{
BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
template<typename This, typename ForwardIterator>
struct result<This(ForwardIterator)>
{
typedef
typename boost::remove_const<
typename boost::remove_reference<ForwardIterator>::type
>::type
type;
};
template<typename This, typename ForwardIterator, typename Distance>
struct result<This(ForwardIterator, Distance)>
{
typedef
typename boost::remove_const<
typename boost::remove_reference<ForwardIterator>::type
>::type
type;
};
template<typename ForwardIterator>
ForwardIterator operator()(ForwardIterator x) const
{
return std::advance(
x
, static_cast<typename std::iterator_traits<ForwardIterator>::difference_type>(1)
);
}
template<typename ForwardIterator>
ForwardIterator operator()(
ForwardIterator x
, typename std::iterator_traits<ForwardIterator>::difference_type n
) const
{
return std::advance(x, n);
}
};
// A PolymorphicFunctionObject wrapping std::prior
struct prior
{
BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
template<typename This, typename BidirectionalIterator>
struct result<This(BidirectionalIterator)>
{
typedef
typename boost::remove_const<
typename boost::remove_reference<BidirectionalIterator>::type
>::type
type;
};
template<typename This, typename BidirectionalIterator, typename Distance>
struct result<This(BidirectionalIterator, Distance)>
{
typedef
typename boost::remove_const<
typename boost::remove_reference<BidirectionalIterator>::type
>::type
type;
};
template<typename BidirectionalIterator>
BidirectionalIterator operator()(BidirectionalIterator x) const
{
return std::advance(
x
, -static_cast<typename std::iterator_traits<BidirectionalIterator>::difference_type>(1)
);
}
template<typename BidirectionalIterator>
BidirectionalIterator operator()(
BidirectionalIterator x
, typename std::iterator_traits<BidirectionalIterator>::difference_type n
) const
{
return std::advance(x, -n);
}
};
}}}
#endif
@@ -0,0 +1,97 @@
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/shift_right.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct shift_right_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< shift_right_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< shift_right_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct shift_right_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct shift_right_impl< na,Tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct shift_right_impl< Tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct shift_right_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct shift_right
: shift_right_impl<
typename shift_right_tag<N1>::type
, typename shift_right_tag<N2>::type
>::template apply< N1,N2 >::type
{
};
BOOST_MPL_AUX_NA_SPEC2(2, 2, shift_right)
}}
namespace boost { namespace mpl {
template<>
struct shift_right_impl< integral_c_tag,integral_c_tag >
{
template< typename N, typename S > struct apply
: integral_c<
typename N::value_type
, ( BOOST_MPL_AUX_VALUE_WKND(N)::value
>> BOOST_MPL_AUX_VALUE_WKND(S)::value
)
>
{
};
};
}}
@@ -0,0 +1,116 @@
/*=============================================================================
Copyright (c) 2002-2003 Joel de Guzman
Copyright (c) 2002-2003 Hartmut Kaiser
Copyright (c) 2003 Martin Wille
http://spirit.sourceforge.net/
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)
=============================================================================*/
#if !defined(BOOST_SPIRIT_PARSER_TRAITS_IPP)
#define BOOST_SPIRIT_PARSER_TRAITS_IPP
#include <boost/spirit/home/classic/core/composite/operators.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
namespace impl
{
///////////////////////////////////////////////////////////////////////////
struct parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_alternative = false);
BOOST_STATIC_CONSTANT(bool, is_sequence = false);
BOOST_STATIC_CONSTANT(bool, is_sequential_or = false);
BOOST_STATIC_CONSTANT(bool, is_intersection = false);
BOOST_STATIC_CONSTANT(bool, is_difference = false);
BOOST_STATIC_CONSTANT(bool, is_exclusive_or = false);
BOOST_STATIC_CONSTANT(bool, is_optional = false);
BOOST_STATIC_CONSTANT(bool, is_kleene_star = false);
BOOST_STATIC_CONSTANT(bool, is_positive = false);
};
template <typename ParserT>
struct parser_type_traits : public parser_type_traits_base {
// no definition here, fallback for all not explicitly mentioned parser
// types
};
template <typename A, typename B>
struct parser_type_traits<alternative<A, B> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_alternative = true);
};
template <typename A, typename B>
struct parser_type_traits<sequence<A, B> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_sequence = true);
};
template <typename A, typename B>
struct parser_type_traits<sequential_or<A, B> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_sequential_or = true);
};
template <typename A, typename B>
struct parser_type_traits<intersection<A, B> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_intersection = true);
};
template <typename A, typename B>
struct parser_type_traits<difference<A, B> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_difference = true);
};
template <typename A, typename B>
struct parser_type_traits<exclusive_or<A, B> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_exclusive_or = true);
};
template <typename S>
struct parser_type_traits<optional<S> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_optional = true);
};
template <typename S>
struct parser_type_traits<kleene_star<S> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_kleene_star = true);
};
template <typename S>
struct parser_type_traits<positive<S> >
: public parser_type_traits_base {
BOOST_STATIC_CONSTANT(bool, is_positive = true);
};
} // namespace impl
///////////////////////////////////////////////////////////////////////////////
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace boost::spirit
#endif // !defined(BOOST_SPIRIT_PARSER_TRAITS_IPP)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,37 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONTAINER_DETAIL_MIN_MAX_HPP
#define BOOST_CONTAINER_DETAIL_MIN_MAX_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
namespace boost {
namespace container {
namespace container_detail {
template<class T>
const T &max_value(const T &a, const T &b)
{ return a > b ? a : b; }
template<class T>
const T &min_value(const T &a, const T &b)
{ return a < b ? a : b; }
} //namespace container_detail {
} //namespace container {
} //namespace boost {
#endif //#ifndef BOOST_CONTAINER_DETAIL_MIN_MAX_HPP
@@ -0,0 +1,71 @@
#include "FrequencyLineEdit.hpp"
#include <limits>
#include <QDoubleValidator>
#include <QString>
#include <QLocale>
#include "moc_FrequencyLineEdit.cpp"
namespace
{
class MHzValidator
: public QDoubleValidator
{
public:
MHzValidator (double bottom, double top, QObject * parent = nullptr)
: QDoubleValidator {bottom, top, 6, parent}
{
}
State validate (QString& input, int& pos) const override
{
State result = QDoubleValidator::validate (input, pos);
if (Acceptable == result)
{
bool ok;
(void)QLocale {}.toDouble (input, &ok);
if (!ok)
{
result = Intermediate;
}
}
return result;
}
};
}
FrequencyLineEdit::FrequencyLineEdit (QWidget * parent)
: QLineEdit (parent)
{
setValidator (new MHzValidator {0., std::numeric_limits<Radio::Frequency>::max () / 10.e6, this});
}
auto FrequencyLineEdit::frequency () const -> Frequency
{
return Radio::frequency (text (), 6);
}
void FrequencyLineEdit::frequency (Frequency f)
{
setText (Radio::frequency_MHz_string (f));
}
FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent)
: QLineEdit (parent)
{
setValidator (new MHzValidator {-std::numeric_limits<FrequencyDelta>::max () / 10.e6,
std::numeric_limits<FrequencyDelta>::max () / 10.e6, this});
}
auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta
{
return Radio::frequency_delta (text (), 6);
}
void FrequencyDeltaLineEdit::frequency_delta (FrequencyDelta d)
{
setText (Radio::frequency_MHz_string (d));
}
@@ -0,0 +1,79 @@
// Status=review
At the center of the main window are a number of controls used when
making QSOs. Controls not relevant to a particular mode or submode
may be "grayed out" (disabled) or removed from the display.
//.Misc Controls Center
image::misc-controls-center.png[align="center",alt="Misc Controls Center"]
* Check *Tx even* to transmit in even-numbered UTC minutes or
sequences, starting at 0. Uncheck this box to transmit in the odd
sequences. The correct selection is made automatically when you
double-click on a decoded text line, as described in the
<<TUTORIAL,Basic Operating Tutorial>>.
* The Tx and Rx audio frequencies can be set automatically by
double-clicking on decoded text or a signal in the waterfall. They
can also be adjusted using the spinner controls.
* You can force Tx frequency to the current Rx frequency by clicking
the *Tx<-Rx* button, and vice-versa for *Rx<-Tx*. The on-the-air
frequency of your lowest JT9 or JT65 tone is the sum of dial frequency
and audio Tx frequency.
* Check the box *Lock Tx=Rx* to make the frequencies always track one
another.
IMPORTANT: In general we do not recommend using *Lock Tx=Rx* since it
encourages poor radio etiquette when running a frequency. With this
box checked, your own Tx frequency will move around following your
callers.
* For modes lacking a multi-decode feature, or when *Enable
VHF/UHF/Microwave features* has been checked on the *Settings ->
General* tab, the *F Tol* control sets a frequency toilerance range
over which decoding will be attempted, centered on the Rx frequency.
* The *Report* control lets you change a signal report that has been
inserted automatically. Typical reports for the various modes fall in
the range 30 to +20 dB. Remember that JT65 reports saturate at an
upper limit of -1 dB.
TIP: Consider reducing power if your QSO partner reports your
signal above -5 dB in one of the _WSJT-X_ slow modes. These are
supposed to be weak signal modes!
* In some circumstances, especially on VHF and higher bands, you can
select a supported submode of the active mode by using the *Submode*
control. The *Sync* control sets a minimum threshold for establishing
time and frequency synchronization with a received signal.
* Spinner control *T/R xx s* sets sequence lengths for transmission
and reception in ISCAT, MSK144, and the fast JT9 modes.
* With *Split operation* activated on the *Settings -> Radio* tab, in
MSK144 and the fast JT9 submodes you can activate the spinner control
*Tx CQ nnn* by checking the box to its right. The program will then
generate something like `CQ nnn K1ABC FN42` for your CQ message, where
`nnn` is the kHz portion of your current operating frequency. Your CQ
message *Tx6* will then be transmitted at the calling frequency
selected in the *Tx CQ nnn* spinner control. All other messages will
be transmitted at your current operating frequency. On reception,
when you double-click on a message like `CQ nnn K1ABC FN42` your rig
will QSY to the specified frequency so you can call the station at his
specified response frequency.
* Checkboxes at bottom center of the main window control special
features for particular operating modes:
** *Sh* enables shorthand messages in JT4, JT65, and MSK144 modes
** *Fast* enables fast JT9 submodes
** *Auto Seq* enables auto-sequencing of Tx messages
** *Call 1st* enables automatic response to the first decoded
responder to your CQ
** *Tx6* toggles between two types of shorthand messages in JT4 mode
@@ -0,0 +1,113 @@
// Copyright 2004 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
#ifndef BOOST_GRAPH_PARALLEL_PROPERTIES_HPP
#define BOOST_GRAPH_PARALLEL_PROPERTIES_HPP
#ifndef BOOST_GRAPH_USE_MPI
#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
#endif
#include <boost/graph/properties.hpp>
#include <boost/property_map/parallel/distributed_property_map.hpp>
namespace boost {
/***************************************************************************
* Property map reduction operations
***************************************************************************/
/**
* Metafunction that produces a reduction operation for the given
* property. The default behavior merely forwards to @ref
* basic_reduce, but it is expected that this class template will be
* specified for important properties.
*/
template<typename Property>
struct property_reduce
{
template<typename Value>
class apply : public parallel::basic_reduce<Value> {};
};
/**
* Reduction of vertex colors can only darken, not lighten, the
* color. Black cannot turn black, grey can only turn black, and
* white can be changed to either color. The default color is white.
*/
template<>
struct property_reduce<vertex_color_t>
{
template<typename Color>
class apply
{
typedef color_traits<Color> traits;
public:
BOOST_STATIC_CONSTANT(bool, non_default_resolver = true);
template<typename Key>
Color operator()(const Key&) const { return traits::white(); }
template<typename Key>
Color operator()(const Key&, Color local, Color remote) const {
if (local == traits::white()) return remote;
else if (remote == traits::black()) return remote;
else return local;
}
};
};
/**
* Reduction of a distance always takes the shorter distance. The
* default distance value is the maximum value for the data type.
*/
template<>
struct property_reduce<vertex_distance_t>
{
template<typename T>
class apply
{
public:
BOOST_STATIC_CONSTANT(bool, non_default_resolver = true);
template<typename Key>
T operator()(const Key&) const { return (std::numeric_limits<T>::max)(); }
template<typename Key>
T operator()(const Key&, T x, T y) const { return x < y? x : y; }
};
};
template<>
struct property_reduce<vertex_predecessor_t>
{
template<typename T>
class apply
{
public:
BOOST_STATIC_CONSTANT(bool, non_default_resolver = true);
template<typename Key>
T operator()(Key key) const { return key; }
template<typename Key>
T operator()(Key key, T, T y) const { return y; }
};
};
template<typename Property, typename PropertyMap>
inline void set_property_map_role(Property p, PropertyMap pm)
{
typedef typename property_traits<PropertyMap>::value_type value_type;
typedef property_reduce<Property> property_red;
typedef typename property_red::template apply<value_type> reduce;
pm.set_reduce(reduce());
}
} // end namespace boost
#endif // BOOST_GRAPH_PARALLEL_PROPERTIES_HPP
@@ -0,0 +1,19 @@
/*=============================================================================
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_CATEGORY_OF_07212005_1025)
#define FUSION_CATEGORY_OF_07212005_1025
namespace boost { namespace fusion { namespace detail
{
template <typename T>
struct fusion_category_of
{
typedef typename T::category type;
};
}}}
#endif
@@ -0,0 +1,304 @@
#ifndef BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_archive.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstring> // count
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp> // size_t
#include <boost/noncopyable.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
#if defined(_MSC_VER)
#pragma warning( push )
#pragma warning( disable : 4244 4267 )
#endif
/* NOTE : Warning : Warning : Warning : Warning : Warning
* Don't ever changes this. If you do, they previously created
* binary archives won't be readable !!!
*/
class library_version_type {
private:
typedef uint_least16_t base_type;
base_type t;
public:
library_version_type(): t(0) {};
explicit library_version_type(const unsigned int & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
library_version_type(const library_version_type & t_) :
t(t_.t)
{}
library_version_type & operator=(const library_version_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator base_type () const {
return t;
}
// used for text input
operator base_type & (){
return t;
}
bool operator==(const library_version_type & rhs) const {
return t == rhs.t;
}
bool operator<(const library_version_type & rhs) const {
return t < rhs.t;
}
};
BOOST_ARCHIVE_DECL library_version_type
BOOST_ARCHIVE_VERSION();
class version_type {
private:
typedef uint_least32_t base_type;
base_type t;
public:
// should be private - but MPI fails if it's not!!!
version_type(): t(0) {};
explicit version_type(const unsigned int & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
version_type(const version_type & t_) :
t(t_.t)
{}
version_type & operator=(const version_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator base_type () const {
return t;
}
// used for text intput
operator base_type & (){
return t;
}
bool operator==(const version_type & rhs) const {
return t == rhs.t;
}
bool operator<(const version_type & rhs) const {
return t < rhs.t;
}
};
class class_id_type {
private:
typedef int_least16_t base_type;
base_type t;
public:
// should be private - but then can't use BOOST_STRONG_TYPE below
class_id_type() : t(0) {};
explicit class_id_type(const int t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
explicit class_id_type(const std::size_t t_) : t(t_){
// BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
class_id_type(const class_id_type & t_) :
t(t_.t)
{}
class_id_type & operator=(const class_id_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator int () const {
return t;
}
// used for text input
operator int_least16_t &() {
return t;
}
bool operator==(const class_id_type & rhs) const {
return t == rhs.t;
}
bool operator<(const class_id_type & rhs) const {
return t < rhs.t;
}
};
#define NULL_POINTER_TAG boost::archive::class_id_type(-1)
class object_id_type {
private:
typedef uint_least32_t base_type;
base_type t;
public:
object_id_type(): t(0) {};
// note: presumes that size_t >= unsigned int.
explicit object_id_type(const std::size_t & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
object_id_type(const object_id_type & t_) :
t(t_.t)
{}
object_id_type & operator=(const object_id_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator uint_least32_t () const {
return t;
}
// used for text input
operator uint_least32_t & () {
return t;
}
bool operator==(const object_id_type & rhs) const {
return t == rhs.t;
}
bool operator<(const object_id_type & rhs) const {
return t < rhs.t;
}
};
#if defined(_MSC_VER)
#pragma warning( pop )
#endif
struct tracking_type {
bool t;
explicit tracking_type(const bool t_ = false)
: t(t_)
{};
tracking_type(const tracking_type & t_)
: t(t_.t)
{}
operator bool () const {
return t;
};
operator bool & () {
return t;
};
tracking_type & operator=(const bool t_){
t = t_;
return *this;
}
bool operator==(const tracking_type & rhs) const {
return t == rhs.t;
}
bool operator==(const bool & rhs) const {
return t == rhs;
}
tracking_type & operator=(const tracking_type & rhs){
t = rhs.t;
return *this;
}
};
struct class_name_type :
private boost::noncopyable
{
char *t;
operator const char * & () const {
return const_cast<const char * &>(t);
}
operator char * () {
return t;
}
std::size_t size() const {
return std::strlen(t);
}
explicit class_name_type(const char *key_)
: t(const_cast<char *>(key_)){}
explicit class_name_type(char *key_)
: t(key_){}
class_name_type & operator=(const class_name_type & rhs){
t = rhs.t;
return *this;
}
};
enum archive_flags {
no_header = 1, // suppress archive header info
no_codecvt = 2, // suppress alteration of codecvt facet
no_xml_tag_checking = 4, // suppress checking of xml tags
no_tracking = 8, // suppress ALL tracking
flags_last = 8
};
BOOST_ARCHIVE_DECL const char *
BOOST_ARCHIVE_SIGNATURE();
/* NOTE : Warning : Warning : Warning : Warning : Warning
* If any of these are changed to different sized types,
* binary_iarchive won't be able to read older archives
* unless you rev the library version and include conditional
* code based on the library version. There is nothing
* inherently wrong in doing this - but you have to be super
* careful because it's easy to get wrong and start breaking
* old archives !!!
*/
#define BOOST_ARCHIVE_STRONG_TYPEDEF(T, D) \
class D : public T { \
public: \
explicit D(const T tt) : T(tt){} \
}; \
/**/
BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_reference_type)
BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_optional_type)
BOOST_ARCHIVE_STRONG_TYPEDEF(object_id_type, object_reference_type)
}// namespace archive
}// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#include <boost/serialization/level.hpp>
// set implementation level to primitive for all types
// used internally by the serialization library
BOOST_CLASS_IMPLEMENTATION(boost::archive::library_version_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_optional_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_name_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::object_id_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)
#include <boost/serialization/is_bitwise_serializable.hpp>
// set types used internally by the serialization library
// to be bitwise serializable
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_optional_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_name_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_id_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_reference_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::tracking_type)
#endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
@@ -0,0 +1,92 @@
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/integral_c.hpp>
# include <boost/mpl/aux_/largest_int.hpp>
# include <boost/mpl/aux_/value_wknd.hpp>
#endif
#if !defined(AUX778076_OP_PREFIX)
# define AUX778076_OP_PREFIX AUX778076_OP_NAME
#endif
#include <boost/mpl/aux_/numeric_op.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER AUX778076_OP_PREFIX.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/aux_/config/workaround.hpp>
# include <boost/preprocessor/cat.hpp>
namespace boost { namespace mpl {
#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
namespace aux {
template< typename T, T n1, T n2 >
struct BOOST_PP_CAT(AUX778076_OP_PREFIX,_wknd)
{
BOOST_STATIC_CONSTANT(T, value = (n1 AUX778076_OP_TOKEN n2));
typedef integral_c<T,value> type;
};
}
#endif
template<>
struct AUX778076_OP_IMPL_NAME<integral_c_tag,integral_c_tag>
{
template< typename N1, typename N2 > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
: integral_c<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
AUX778076_OP_TOKEN BOOST_MPL_AUX_VALUE_WKND(N2)::value
)
>
#else
: aux::BOOST_PP_CAT(AUX778076_OP_PREFIX,_wknd)<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, N1::value
, N2::value
>::type
#endif
{
};
};
}}
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#undef AUX778076_OP_TAG_NAME
#undef AUX778076_OP_IMPL_NAME
#undef AUX778076_OP_ARITY
#undef AUX778076_OP_PREFIX
#undef AUX778076_OP_NAME
#undef AUX778076_OP_TOKEN
@@ -0,0 +1,57 @@
// (C) Copyright Joel de Guzman 2003.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef PY_CONTAINER_UTILS_JDG20038_HPP
# define PY_CONTAINER_UTILS_JDG20038_HPP
# include <utility>
# include <boost/foreach.hpp>
# include <boost/python/object.hpp>
# include <boost/python/handle.hpp>
# include <boost/python/extract.hpp>
# include <boost/python/stl_iterator.hpp>
namespace boost { namespace python { namespace container_utils {
template <typename Container>
void
extend_container(Container& container, object l)
{
typedef typename Container::value_type data_type;
// l must be iterable
BOOST_FOREACH(object elem,
std::make_pair(
boost::python::stl_input_iterator<object>(l),
boost::python::stl_input_iterator<object>()
))
{
extract<data_type const&> x(elem);
// try if elem is an exact data_type type
if (x.check())
{
container.push_back(x());
}
else
{
// try to convert elem to data_type type
extract<data_type> x(elem);
if (x.check())
{
container.push_back(x());
}
else
{
PyErr_SetString(PyExc_TypeError, "Incompatible Data Type");
throw_error_already_set();
}
}
}
}
}}} // namespace boost::python::container_utils
#endif
@@ -0,0 +1,147 @@
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// *Preprocessed* version of the main "bitand.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct bitand_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< bitand_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< bitand_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct bitand_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct bitand_impl< na,Tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct bitand_impl< Tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct bitand_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
, typename N3 = na, typename N4 = na, typename N5 = na
>
struct bitand_
: bitand_< bitand_< bitand_< bitand_< N1,N2 >, N3>, N4>, N5>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, bitand_
, ( N1, N2, N3, N4, N5 )
)
};
template<
typename N1, typename N2, typename N3, typename N4
>
struct bitand_< N1,N2,N3,N4,na >
: bitand_< bitand_< bitand_< N1,N2 >, N3>, N4>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, bitand_
, ( N1, N2, N3, N4, na )
)
};
template<
typename N1, typename N2, typename N3
>
struct bitand_< N1,N2,N3,na,na >
: bitand_< bitand_< N1,N2 >, N3>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, bitand_
, ( N1, N2, N3, na, na )
)
};
template<
typename N1, typename N2
>
struct bitand_< N1,N2,na,na,na >
: bitand_impl<
typename bitand_tag<N1>::type
, typename bitand_tag<N2>::type
>::template apply< N1,N2 >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, bitand_
, ( N1, N2, na, na, na )
)
};
BOOST_MPL_AUX_NA_SPEC2(2, 5, bitand_)
}}
namespace boost { namespace mpl {
template<>
struct bitand_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: integral_c<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
& BOOST_MPL_AUX_VALUE_WKND(N2)::value
)
>
{
};
};
}}
@@ -0,0 +1,381 @@
/*
[auto_generated]
boost/numeric/odeint/stepper/velocity_verlet.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_STEPPER_VELOCITY_VERLET_HPP_DEFINED
#define BOOST_NUMERIC_ODEINT_STEPPER_VELOCITY_VERLET_HPP_DEFINED
#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/unwrap_reference.hpp>
#include <boost/numeric/odeint/util/bind.hpp>
#include <boost/numeric/odeint/util/copy.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
// #include <boost/numeric/odeint/util/is_pair.hpp>
// #include <boost/array.hpp>
namespace boost {
namespace numeric {
namespace odeint {
template <
class Coor ,
class Velocity = Coor ,
class Value = double ,
class Acceleration = Coor ,
class Time = Value ,
class TimeSq = Time ,
class Algebra = typename algebra_dispatcher< Coor >::algebra_type ,
class Operations = typename operations_dispatcher< Coor >::operations_type ,
class Resizer = initially_resizer
>
class velocity_verlet : public algebra_stepper_base< Algebra , Operations >
{
public:
typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
typedef typename algebra_stepper_base_type::algebra_type algebra_type;
typedef typename algebra_stepper_base_type::operations_type operations_type;
typedef Coor coor_type;
typedef Velocity velocity_type;
typedef Acceleration acceleration_type;
typedef std::pair< coor_type , velocity_type > state_type;
typedef std::pair< velocity_type , acceleration_type > deriv_type;
typedef state_wrapper< acceleration_type > wrapped_acceleration_type;
typedef Value value_type;
typedef Time time_type;
typedef TimeSq time_square_type;
typedef Resizer resizer_type;
typedef stepper_tag stepper_category;
typedef unsigned short order_type;
static const order_type order_value = 1;
/**
* \return Returns the order of the stepper.
*/
order_type order( void ) const
{
return order_value;
}
velocity_verlet( const algebra_type & algebra = algebra_type() )
: algebra_stepper_base_type( algebra ) , m_first_call( true )
, m_a1() , m_a2() , m_current_a1( true ) { }
template< class System , class StateInOut >
void do_step( System system , StateInOut & x , time_type t , time_type dt )
{
do_step_v1( system , x , t , dt );
}
template< class System , class StateInOut >
void do_step( System system , const StateInOut & x , time_type t , time_type dt )
{
do_step_v1( system , x , t , dt );
}
template< class System , class CoorIn , class VelocityIn , class AccelerationIn ,
class CoorOut , class VelocityOut , class AccelerationOut >
void do_step( System system , CoorIn const & qin , VelocityIn const & pin , AccelerationIn const & ain ,
CoorOut & qout , VelocityOut & pout , AccelerationOut & aout , time_type t , time_type dt )
{
const value_type one = static_cast< value_type >( 1.0 );
const value_type one_half = static_cast< value_type >( 0.5 );
algebra_stepper_base_type::m_algebra.for_each4(
qout , qin , pin , ain ,
typename operations_type::template scale_sum3< value_type , time_type , time_square_type >( one , one * dt , one_half * dt * dt ) );
typename odeint::unwrap_reference< System >::type & sys = system;
sys( qout , pin , aout , t + dt );
algebra_stepper_base_type::m_algebra.for_each4(
pout , pin , ain , aout ,
typename operations_type::template scale_sum3< value_type , time_type , time_type >( one , one_half * dt , one_half * dt ) );
}
template< class StateIn >
void adjust_size( const StateIn & x )
{
if( resize_impl( x ) )
m_first_call = true;
}
void reset( void )
{
m_first_call = true;
}
/**
* \fn velocity_verlet::initialize( const AccelerationIn &qin )
* \brief Initializes the internal state of the stepper.
* \param deriv The acceleration of x. The next call of `do_step` expects that the acceleration of `x` passed to `do_step`
* has the value of `qin`.
*/
template< class AccelerationIn >
void initialize( const AccelerationIn & ain )
{
// alloc a
m_resizer.adjust_size( ain ,
detail::bind( &velocity_verlet::template resize_impl< AccelerationIn > ,
detail::ref( *this ) , detail::_1 ) );
boost::numeric::odeint::copy( ain , get_current_acc() );
m_first_call = false;
}
template< class System , class CoorIn , class VelocityIn >
void initialize( System system , const CoorIn & qin , const VelocityIn & pin , time_type t )
{
m_resizer.adjust_size( qin ,
detail::bind( &velocity_verlet::template resize_impl< CoorIn > ,
detail::ref( *this ) , detail::_1 ) );
initialize_acc( system , qin , pin , t );
}
bool is_initialized( void ) const
{
return ! m_first_call;
}
private:
template< class System , class CoorIn , class VelocityIn >
void initialize_acc( System system , const CoorIn & qin , const VelocityIn & pin , time_type t )
{
typename odeint::unwrap_reference< System >::type & sys = system;
sys( qin , pin , get_current_acc() , t );
m_first_call = false;
}
template< class System , class StateInOut >
void do_step_v1( System system , StateInOut & x , time_type t , time_type dt )
{
typedef typename odeint::unwrap_reference< StateInOut >::type state_in_type;
typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type;
typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type;
typedef typename boost::remove_reference< coor_in_type >::type xyz_type;
state_in_type & statein = x;
coor_in_type & qinout = statein.first;
momentum_in_type & pinout = statein.second;
// alloc a
if( m_resizer.adjust_size( qinout ,
detail::bind( &velocity_verlet::template resize_impl< xyz_type > ,
detail::ref( *this ) , detail::_1 ) )
|| m_first_call )
{
initialize_acc( system , qinout , pinout , t );
}
// check first
do_step( system , qinout , pinout , get_current_acc() , qinout , pinout , get_old_acc() , t , dt );
toggle_current_acc();
}
template< class StateIn >
bool resize_impl( const StateIn & x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_a1 , x , typename is_resizeable< acceleration_type >::type() );
resized |= adjust_size_by_resizeability( m_a2 , x , typename is_resizeable< acceleration_type >::type() );
return resized;
}
acceleration_type & get_current_acc( void )
{
return m_current_a1 ? m_a1.m_v : m_a2.m_v ;
}
const acceleration_type & get_current_acc( void ) const
{
return m_current_a1 ? m_a1.m_v : m_a2.m_v ;
}
acceleration_type & get_old_acc( void )
{
return m_current_a1 ? m_a2.m_v : m_a1.m_v ;
}
const acceleration_type & get_old_acc( void ) const
{
return m_current_a1 ? m_a2.m_v : m_a1.m_v ;
}
void toggle_current_acc( void )
{
m_current_a1 = ! m_current_a1;
}
resizer_type m_resizer;
bool m_first_call;
wrapped_acceleration_type m_a1 , m_a2;
bool m_current_a1;
};
/**
* \class velocity_verlet
* \brief The Velocity-Verlet algorithm.
*
* <a href="http://en.wikipedia.org/wiki/Verlet_integration" >The Velocity-Verlet algorithm</a> is a method for simulation of molecular dynamics systems. It solves the ODE
* a=f(r,v',t) where r are the coordinates, v are the velocities and a are the accelerations, hence v = dr/dt, a=dv/dt.
*
* \tparam Coor The type representing the coordinates.
* \tparam Velocity The type representing the velocities.
* \tparam Value The type value type.
* \tparam Acceleration The type representing the acceleration.
* \tparam Time The time representing the independent variable - the time.
* \tparam TimeSq The time representing the square of the time.
* \tparam Algebra The algebra.
* \tparam Operations The operations type.
* \tparam Resizer The resizer policy type.
*/
/**
* \fn velocity_verlet::velocity_verlet( const algebra_type &algebra )
* \brief Constructs the velocity_verlet 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.
*/
/**
* \fn velocity_verlet::do_step( System system , StateInOut &x , time_type t , time_type dt )
* \brief This method performs one step. It transforms the result in-place.
*
* It can be used like
* \code
* pair< coordinates , velocities > state;
* stepper.do_step( sys , x , t , dt );
* \endcode
*
* \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the
* Second Order System concept.
* \param x The state of the ODE which should be solved. The state is pair of Coor and Velocity.
* \param t The value of the time, at which the step should be performed.
* \param dt The step size.
*/
/**
* \fn velocity_verlet::do_step( System system , const StateInOut &x , time_type t , time_type dt )
* \brief This method performs one step. It transforms the result in-place.
*
* It can be used like
* \code
* pair< coordinates , velocities > state;
* stepper.do_step( sys , x , t , dt );
* \endcode
*
* \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the
* Second Order System concept.
* \param x The state of the ODE which should be solved. The state is pair of Coor and Velocity.
* \param t The value of the time, at which the step should be performed.
* \param dt The step size.
*/
/**
* \fn velocity_verlet::do_step( System system , CoorIn const & qin , VelocityIn const & pin , AccelerationIn const & ain , CoorOut & qout , VelocityOut & pout , AccelerationOut & aout , time_type t , time_type dt )
* \brief This method performs one step. It transforms the result in-place. Additionally to the other methods
* the coordinates, velocities and accelerations are passed directly to do_step and they are transformed out-of-place.
*
* It can be used like
* \code
* coordinates qin , qout;
* velocities pin , pout;
* accelerations ain, aout;
* stepper.do_step( sys , qin , pin , ain , qout , pout , aout , t , dt );
* \endcode
*
* \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the
* Second Order System concept.
* \param x The state of the ODE which should be solved. The state is pair of Coor and Velocity.
* \param t The value of the time, at which the step should be performed.
* \param dt The step size.
*/
/**
* \fn void velocity_verlet::adjust_size( const StateIn &x )
* \brief Adjust the size of all temporaries in the stepper manually.
* \param x A state from which the size of the temporaries to be resized is deduced.
*/
/**
* \fn velocity_verlet::reset( void )
* \brief Resets the internal state of this stepper. After calling this method it is safe to use all
* `do_step` method without explicitly initializing the stepper.
*/
/**
* \fn velocity_verlet::initialize( System system , const CoorIn &qin , const VelocityIn &pin , time_type t )
* \brief Initializes the internal state of the stepper.
*
* This method is equivalent to
* \code
* Acceleration a;
* system( qin , pin , a , t );
* stepper.initialize( a );
* \endcode
*
* \param system The system function for the next calls of `do_step`.
* \param qin The current coordinates of the ODE.
* \param pin The current velocities of the ODE.
* \param t The current time of the ODE.
*/
/**
* \fn velocity_verlet::is_initialized()
* \returns Returns if the stepper is initialized.
*/
} // namespace odeint
} // namespace numeric
} // namespace boost
#endif // BOOST_NUMERIC_ODEINT_STEPPER_VELOCITY_VERLET_HPP_DEFINED
@@ -0,0 +1,90 @@
program genmet
! Generate metric table for M-FSK modulation.
character*12 arg
real*4 r(0:255)
integer hist(2,-128:128)
data hist/514*0/,idum/-1/
lim(x)=min(127,max(-128,nint(scale*x)))
nargs=iargc()
if(nargs.ne.5) then
print*,'Usage: genmet ncoh nadd m0 snr iters'
go to 999
endif
call getarg(1,arg)
read(arg,*) ncoh
call getarg(2,arg)
read(arg,*) nadd
call getarg(3,arg)
read(arg,*) m0
call getarg(4,arg)
read(arg,*) snr
call getarg(5,arg)
read(arg,*) iters
ntones=2**m0
xm0=m0
scale=5.0
fac=sqrt(1.0/nadd)
s=sqrt(10.0**(0.1*snr))
hist=0
nerr=0
call sgran()
do iter=1,iters
do i=0,ntones-1
r(i)=0.
do n=1,nadd
x1=0.707*gran()
y1=0.707*gran()
if(i.eq.0) x1=x1+s
if(ncoh.eq.0) r(i)=r(i) + x1*x1 + y1*y1
if(ncoh.ne.0) r(i)=r(i) + x1
enddo
r(i)=fac*r(i)
enddo
do m=0,m0-1
n=2**m
r1=0.
r2=0.
do i=0,ntones-1
if(iand(i,n).ne.0) r1=max(r1,r(i))
if(iand(i,n).eq.0) r2=max(r2,r(i))
enddo
don=r2-r1
doff=r1-r2
if(don.lt.0.0) nerr=nerr+1
j1=lim(doff)
hist(1,j1)=hist(1,j1)+1
j2=lim(don)
hist(2,j2)=hist(2,j2)+1
enddo
enddo
do i=-128,127
write(13,1010) i/scale,hist(1,i)/(xm0*iters),hist(2,i)/(xm0*iters)
1010 format(f8.3,2f12.9)
enddo
ber=nerr/(xm0*iters)
write(*,1020) nadd,m0,snr,ber
1020 format('nadd:',i3,' m0:',i2,' snr: 'f5.1,' BER:',f8.3)
xln2=log(2.0)
do i=-128,127
p1=hist(2,i)/(xm0*iters)
p0=hist(1,i)/(xm0*iters)
if(p0+p1.eq.0.0 .and. i.lt.0) p0=1.e-6
if(p0+p1.eq.0.0 .and. i.gt.0) p1=1.e-6
xlhd0=log(max(0.001,2.0*p0/(p0+p1)))/xln2
xlhd1=log(max(0.001,2.0*p1/(p0+p1)))/xln2
write(14,1012) i/scale,xlhd0,xlhd1,p0/(p0+p1),p1/(p0+p1)
1012 format(f7.1,2f8.3,2f9.6)
enddo
999 end program genmet
@@ -0,0 +1,842 @@
///////////////////////////////////////////////////////////////
// Copyright 2012 John Maddock. 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_
//
// Comparison operators for cpp_int_backend:
//
#ifndef BOOST_MP_CPP_INT_BIT_HPP
#define BOOST_MP_CPP_INT_BIT_HPP
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4319)
#endif
namespace boost{ namespace multiprecision{ namespace backends{
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
void is_valid_bitwise_op(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o, const mpl::int_<checked>&)
{
if(result.sign() || o.sign())
BOOST_THROW_EXCEPTION(std::range_error("Bitwise operations on negative values results in undefined behavior."));
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
void is_valid_bitwise_op(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>&,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& , const mpl::int_<unchecked>&){}
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
void is_valid_bitwise_op(
const cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>& result, const mpl::int_<checked>&)
{
if(result.sign())
BOOST_THROW_EXCEPTION(std::range_error("Bitwise operations on negative values results in undefined behavior."));
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
void is_valid_bitwise_op(
const cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1>&, const mpl::int_<checked>&){}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
void is_valid_bitwise_op(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>&, const mpl::int_<unchecked>&){}
template <class CppInt1, class CppInt2, class Op>
void bitwise_op(
CppInt1& result,
const CppInt2& o,
Op op, const mpl::true_&) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<CppInt1>::value))
{
//
// There are 4 cases:
// * Both positive.
// * result negative, o positive.
// * o negative, result positive.
// * Both negative.
//
// When one arg is negative we convert to 2's complement form "on the fly",
// and then convert back to signed-magnitude form at the end.
//
// Note however, that if the type is checked, then bitwise ops on negative values
// are not permitted and an exception will result.
//
is_valid_bitwise_op(result, o, typename CppInt1::checked_type());
//
// First figure out how big the result needs to be and set up some data:
//
unsigned rs = result.size();
unsigned os = o.size();
unsigned m, x;
minmax(rs, os, m, x);
result.resize(x, x);
typename CppInt1::limb_pointer pr = result.limbs();
typename CppInt2::const_limb_pointer po = o.limbs();
for(unsigned i = rs; i < x; ++i)
pr[i] = 0;
limb_type next_limb = 0;
if(!result.sign())
{
if(!o.sign())
{
for(unsigned i = 0; i < os; ++i)
pr[i] = op(pr[i], po[i]);
for(unsigned i = os; i < x; ++i)
pr[i] = op(pr[i], limb_type(0));
}
else
{
// "o" is negative:
double_limb_type carry = 1;
for(unsigned i = 0; i < os; ++i)
{
carry += static_cast<double_limb_type>(~po[i]);
pr[i] = op(pr[i], static_cast<limb_type>(carry));
carry >>= CppInt1::limb_bits;
}
for(unsigned i = os; i < x; ++i)
{
carry += static_cast<double_limb_type>(~limb_type(0));
pr[i] = op(pr[i], static_cast<limb_type>(carry));
carry >>= CppInt1::limb_bits;
}
// Set the overflow into the "extra" limb:
carry += static_cast<double_limb_type>(~limb_type(0));
next_limb = op(limb_type(0), static_cast<limb_type>(carry));
}
}
else
{
if(!o.sign())
{
// "result" is negative:
double_limb_type carry = 1;
for(unsigned i = 0; i < os; ++i)
{
carry += static_cast<double_limb_type>(~pr[i]);
pr[i] = op(static_cast<limb_type>(carry), po[i]);
carry >>= CppInt1::limb_bits;
}
for(unsigned i = os; i < x; ++i)
{
carry += static_cast<double_limb_type>(~pr[i]);
pr[i] = op(static_cast<limb_type>(carry), limb_type(0));
carry >>= CppInt1::limb_bits;
}
// Set the overflow into the "extra" limb:
carry += static_cast<double_limb_type>(~limb_type(0));
next_limb = op(static_cast<limb_type>(carry), limb_type(0));
}
else
{
// both are negative:
double_limb_type r_carry = 1;
double_limb_type o_carry = 1;
for(unsigned i = 0; i < os; ++i)
{
r_carry += static_cast<double_limb_type>(~pr[i]);
o_carry += static_cast<double_limb_type>(~po[i]);
pr[i] = op(static_cast<limb_type>(r_carry), static_cast<limb_type>(o_carry));
r_carry >>= CppInt1::limb_bits;
o_carry >>= CppInt1::limb_bits;
}
for(unsigned i = os; i < x; ++i)
{
r_carry += static_cast<double_limb_type>(~pr[i]);
o_carry += static_cast<double_limb_type>(~limb_type(0));
pr[i] = op(static_cast<limb_type>(r_carry), static_cast<limb_type>(o_carry));
r_carry >>= CppInt1::limb_bits;
o_carry >>= CppInt1::limb_bits;
}
// Set the overflow into the "extra" limb:
r_carry += static_cast<double_limb_type>(~limb_type(0));
o_carry += static_cast<double_limb_type>(~limb_type(0));
next_limb = op(static_cast<limb_type>(r_carry), static_cast<limb_type>(o_carry));
}
}
//
// See if the result is negative or not:
//
if(static_cast<signed_limb_type>(next_limb) < 0)
{
double_limb_type carry = 1;
for(unsigned i = 0; i < x; ++i)
{
carry += static_cast<double_limb_type>(~pr[i]);
pr[i] = static_cast<limb_type>(carry);
carry >>= CppInt1::limb_bits;
}
if(carry)
{
result.resize(x + 1, x);
if(result.size() > x)
result.limbs()[x] = static_cast<limb_type>(carry);
}
result.sign(true);
}
else
result.sign(false);
result.normalize();
}
template <class CppInt1, class CppInt2, class Op>
void bitwise_op(
CppInt1& result,
const CppInt2& o,
Op op, const mpl::false_&) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<CppInt1>::value))
{
//
// Both arguments are unsigned types, very simple case handled as a special case.
//
// First figure out how big the result needs to be and set up some data:
//
unsigned rs = result.size();
unsigned os = o.size();
unsigned m, x;
minmax(rs, os, m, x);
result.resize(x, x);
typename CppInt1::limb_pointer pr = result.limbs();
typename CppInt2::const_limb_pointer po = o.limbs();
for(unsigned i = rs; i < x; ++i)
pr[i] = 0;
for(unsigned i = 0; i < os; ++i)
pr[i] = op(pr[i], po[i]);
for(unsigned i = os; i < x; ++i)
pr[i] = op(pr[i], limb_type(0));
result.normalize();
}
struct bit_and{ limb_type operator()(limb_type a, limb_type b)const BOOST_NOEXCEPT { return a & b; } };
struct bit_or { limb_type operator()(limb_type a, limb_type b)const BOOST_NOEXCEPT { return a | b; } };
struct bit_xor{ limb_type operator()(limb_type a, limb_type b)const BOOST_NOEXCEPT { return a ^ b; } };
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value >::type
eval_bitwise_and(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
bitwise_op(result, o, bit_and(),
mpl::bool_<std::numeric_limits<number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> > >::is_signed || std::numeric_limits<number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> > >::is_signed>());
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value >::type
eval_bitwise_or(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
bitwise_op(result, o, bit_or(),
mpl::bool_<std::numeric_limits<number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> > >::is_signed || std::numeric_limits<number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> > >::is_signed>());
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value >::type
eval_bitwise_xor(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
bitwise_op(result, o, bit_xor(),
mpl::bool_<std::numeric_limits<number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> > >::is_signed || std::numeric_limits<number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> > >::is_signed>());
}
//
// Again for operands which are single limbs:
//
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1> >::value>::type
eval_bitwise_and(
cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1>& result,
limb_type l) BOOST_NOEXCEPT
{
result.limbs()[0] &= l;
result.resize(1, 1);
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1> >::value>::type
eval_bitwise_or(
cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1>& result,
limb_type l) BOOST_NOEXCEPT
{
result.limbs()[0] |= l;
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
BOOST_MP_FORCEINLINE typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1> >::value>::type
eval_bitwise_xor(
cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1>& result,
limb_type l) BOOST_NOEXCEPT
{
result.limbs()[0] ^= l;
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
BOOST_MP_FORCEINLINE typename enable_if_c<is_signed_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value >::type
eval_complement(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
BOOST_STATIC_ASSERT_MSG(((Checked1 != checked) || (Checked2 != checked)), "Attempt to take the complement of a signed type results in undefined behavior.");
// Increment and negate:
result = o;
eval_increment(result);
result.negate();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
BOOST_MP_FORCEINLINE typename enable_if_c<is_unsigned_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value >::type
eval_complement(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
unsigned os = o.size();
result.resize(UINT_MAX, os);
for(unsigned i = 0; i < os; ++i)
result.limbs()[i] = ~o.limbs()[i];
for(unsigned i = os; i < result.size(); ++i)
result.limbs()[i] = ~static_cast<limb_type>(0);
result.normalize();
}
template <class Int>
inline void left_shift_byte(Int& result, double_limb_type s)
{
limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
limb_type shift = static_cast<limb_type>(s % Int::limb_bits);
unsigned ors = result.size();
if((ors == 1) && (!*result.limbs()))
return; // shifting zero yields zero.
unsigned rs = ors;
if(shift && (result.limbs()[ors - 1] >> (Int::limb_bits - shift)))
++rs; // Most significant limb will overflow when shifted
rs += offset;
result.resize(rs, rs);
rs = result.size();
typename Int::limb_pointer pr = result.limbs();
if(rs != ors)
pr[rs - 1] = 0u;
std::size_t bytes = static_cast<std::size_t>(s / CHAR_BIT);
std::size_t len = std::min(ors * sizeof(limb_type), rs * sizeof(limb_type) - bytes);
if(bytes >= rs * sizeof(limb_type))
result = static_cast<limb_type>(0u);
else
{
unsigned char* pc = reinterpret_cast<unsigned char*>(pr);
std::memmove(pc + bytes, pc, len);
std::memset(pc, 0, bytes);
}
}
template <class Int>
inline void left_shift_limb(Int& result, double_limb_type s)
{
limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
limb_type shift = static_cast<limb_type>(s % Int::limb_bits);
unsigned ors = result.size();
if((ors == 1) && (!*result.limbs()))
return; // shifting zero yields zero.
unsigned rs = ors;
if(shift && (result.limbs()[ors - 1] >> (Int::limb_bits - shift)))
++rs; // Most significant limb will overflow when shifted
rs += offset;
result.resize(rs, rs);
typename Int::limb_pointer pr = result.limbs();
if(offset > rs)
{
// The result is shifted past the end of the result:
result = static_cast<limb_type>(0);
return;
}
unsigned i = rs - result.size();
for(; i < ors; ++i)
pr[rs - 1 - i] = pr[ors - 1 - i];
for(; i < rs; ++i)
pr[rs - 1 - i] = 0;
}
template <class Int>
inline void left_shift_generic(Int& result, double_limb_type s)
{
limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
limb_type shift = static_cast<limb_type>(s % Int::limb_bits);
unsigned ors = result.size();
if((ors == 1) && (!*result.limbs()))
return; // shifting zero yields zero.
unsigned rs = ors;
if(shift && (result.limbs()[ors - 1] >> (Int::limb_bits - shift)))
++rs; // Most significant limb will overflow when shifted
rs += offset;
result.resize(rs, rs);
bool truncated = result.size() != rs;
typename Int::limb_pointer pr = result.limbs();
if(offset > rs)
{
// The result is shifted past the end of the result:
result = static_cast<limb_type>(0);
return;
}
unsigned i = rs - result.size();
// This code only works when shift is non-zero, otherwise we invoke undefined behaviour!
BOOST_ASSERT(shift);
if(!truncated)
{
if(rs > ors + offset)
{
pr[rs - 1 - i] = pr[ors - 1 - i] >> (Int::limb_bits - shift);
--rs;
}
else
{
pr[rs - 1 - i] = pr[ors - 1 - i] << shift;
if(ors > 1)
pr[rs - 1 - i] |= pr[ors - 2 - i] >> (Int::limb_bits - shift);
++i;
}
}
for(; ors > 1 + i; ++i)
{
pr[rs - 1 - i] = pr[ors - 1 - i] << shift;
pr[rs - 1 - i] |= pr[ors - 2 - i] >> (Int::limb_bits - shift);
}
if(ors >= 1 + i)
{
pr[rs - 1 - i] = pr[ors - 1 - i] << shift;
++i;
}
for(; i < rs; ++i)
pr[rs - 1 - i] = 0;
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value>::type
eval_left_shift(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
double_limb_type s) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
if(!s)
return;
#if defined(BOOST_LITTLE_ENDIAN) && defined(BOOST_MP_USE_LIMB_SHIFT)
static const limb_type limb_shift_mask = cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits - 1;
static const limb_type byte_shift_mask = CHAR_BIT - 1;
if((s & limb_shift_mask) == 0)
{
left_shift_limb(result, s);
}
else if((s & byte_shift_mask) == 0)
{
left_shift_byte(result, s);
}
#elif defined(BOOST_LITTLE_ENDIAN)
static const limb_type byte_shift_mask = CHAR_BIT - 1;
if((s & byte_shift_mask) == 0)
{
left_shift_byte(result, s);
}
#else
static const limb_type limb_shift_mask = cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits - 1;
if((s & limb_shift_mask) == 0)
{
left_shift_limb(result, s);
}
#endif
else
{
left_shift_generic(result, s);
}
//
// We may have shifted off the end and have leading zeros:
//
result.normalize();
}
template <class Int>
inline void right_shift_byte(Int& result, double_limb_type s)
{
limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
limb_type shift;
BOOST_ASSERT((s % CHAR_BIT) == 0);
unsigned ors = result.size();
unsigned rs = ors;
if(offset >= rs)
{
result = limb_type(0);
return;
}
rs -= offset;
typename Int::limb_pointer pr = result.limbs();
unsigned char* pc = reinterpret_cast<unsigned char*>(pr);
shift = static_cast<limb_type>(s / CHAR_BIT);
std::memmove(pc, pc + shift, ors * sizeof(pr[0]) - shift);
shift = (sizeof(limb_type) - shift % sizeof(limb_type)) * CHAR_BIT;
if(shift < Int::limb_bits)
{
pr[ors - offset - 1] &= (static_cast<limb_type>(1u) << shift) - 1;
if(!pr[ors - offset - 1] && (rs > 1))
--rs;
}
result.resize(rs, rs);
}
template <class Int>
inline void right_shift_limb(Int& result, double_limb_type s)
{
limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
BOOST_ASSERT((s % Int::limb_bits) == 0);
unsigned ors = result.size();
unsigned rs = ors;
if(offset >= rs)
{
result = limb_type(0);
return;
}
rs -= offset;
typename Int::limb_pointer pr = result.limbs();
unsigned i = 0;
for(; i < rs; ++i)
pr[i] = pr[i + offset];
result.resize(rs, rs);
}
template <class Int>
inline void right_shift_generic(Int& result, double_limb_type s)
{
limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
limb_type shift = static_cast<limb_type>(s % Int::limb_bits);
unsigned ors = result.size();
unsigned rs = ors;
if(offset >= rs)
{
result = limb_type(0);
return;
}
rs -= offset;
typename Int::limb_pointer pr = result.limbs();
if((pr[ors - 1] >> shift) == 0)
{
if(--rs == 0)
{
result = limb_type(0);
return;
}
}
unsigned i = 0;
// This code only works for non-zero shift, otherwise we invoke undefined behaviour!
BOOST_ASSERT(shift);
for(; i + offset + 1 < ors; ++i)
{
pr[i] = pr[i + offset] >> shift;
pr[i] |= pr[i + offset + 1] << (Int::limb_bits - shift);
}
pr[i] = pr[i + offset] >> shift;
result.resize(rs, rs);
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1> >::value>::type
eval_right_shift(
cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1>& result,
double_limb_type s) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, typename cpp_int_backend<MinBits1, MaxBits1, unsigned_magnitude, Checked1, Allocator1>::checked_type());
if(!s)
return;
#if defined(BOOST_LITTLE_ENDIAN) && defined(BOOST_MP_USE_LIMB_SHIFT)
static const limb_type limb_shift_mask = cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>::limb_bits - 1;
static const limb_type byte_shift_mask = CHAR_BIT - 1;
if((s & limb_shift_mask) == 0)
right_shift_limb(result, s);
else if((s & byte_shift_mask) == 0)
right_shift_byte(result, s);
#elif defined(BOOST_LITTLE_ENDIAN)
static const limb_type byte_shift_mask = CHAR_BIT - 1;
if((s & byte_shift_mask) == 0)
right_shift_byte(result, s);
#else
static const limb_type limb_shift_mask = cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>::limb_bits - 1;
if((s & limb_shift_mask) == 0)
right_shift_limb(result, s);
#endif
else
right_shift_generic(result, s);
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_int_check_type Checked1, class Allocator1>
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1> >::value>::type
eval_right_shift(
cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>& result,
double_limb_type s) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, typename cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>::checked_type());
if(!s)
return;
bool is_neg = result.sign();
if(is_neg)
eval_increment(result);
#if defined(BOOST_LITTLE_ENDIAN) && defined(BOOST_MP_USE_LIMB_SHIFT)
static const limb_type limb_shift_mask = cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>::limb_bits - 1;
static const limb_type byte_shift_mask = CHAR_BIT - 1;
if((s & limb_shift_mask) == 0)
right_shift_limb(result, s);
else if((s & byte_shift_mask) == 0)
right_shift_byte(result, s);
#elif defined(BOOST_LITTLE_ENDIAN)
static const limb_type byte_shift_mask = CHAR_BIT - 1;
if((s & byte_shift_mask) == 0)
right_shift_byte(result, s);
#else
static const limb_type limb_shift_mask = cpp_int_backend<MinBits1, MaxBits1, signed_magnitude, Checked1, Allocator1>::limb_bits - 1;
if((s & limb_shift_mask) == 0)
right_shift_limb(result, s);
#endif
else
right_shift_generic(result, s);
if(is_neg)
eval_decrement(result);
}
//
// Over again for trivial cpp_int's:
//
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class T>
BOOST_MP_FORCEINLINE typename enable_if<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> > >::type
eval_left_shift(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result, T s) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
*result.limbs() = detail::checked_left_shift(*result.limbs(), s, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
result.normalize();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, class T>
BOOST_MP_FORCEINLINE typename enable_if<is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> > >::type
eval_right_shift(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result, T s) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
// Nothing to check here... just make sure we don't invoke undefined behavior:
is_valid_bitwise_op(result, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
*result.limbs() = (static_cast<unsigned>(s) >= sizeof(*result.limbs()) * CHAR_BIT) ? 0 : (result.sign() ? ((--*result.limbs()) >> s) + 1 : *result.limbs() >> s);
if(result.sign() && (*result.limbs() == 0))
result = static_cast<signed_limb_type>(-1);
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& (is_signed_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value || is_signed_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value)
>::type
eval_complement(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
BOOST_STATIC_ASSERT_MSG(((Checked1 != checked) || (Checked2 != checked)), "Attempt to take the complement of a signed type results in undefined behavior.");
//
// If we're not checked then emulate 2's complement behavior:
//
if(o.sign())
{
*result.limbs() = *o.limbs() - 1;
result.sign(false);
}
else
{
*result.limbs() = 1 + *o.limbs();
result.sign(true);
}
result.normalize();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& is_unsigned_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_unsigned_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
>::type
eval_complement(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
*result.limbs() = ~*o.limbs();
result.normalize();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& is_unsigned_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_unsigned_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
>::type
eval_bitwise_and(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
*result.limbs() &= *o.limbs();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& (is_signed_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value || is_signed_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value)
>::type
eval_bitwise_and(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, o, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
using default_ops::eval_bit_test;
using default_ops::eval_increment;
if(result.sign() || o.sign())
{
static const unsigned m = static_unsigned_max<static_unsigned_max<MinBits1, MinBits2>::value, static_unsigned_max<MaxBits1, MaxBits2>::value>::value;
cpp_int_backend<m + 1, m + 1, unsigned_magnitude, unchecked, void> t1(result);
cpp_int_backend<m + 1, m + 1, unsigned_magnitude, unchecked, void> t2(o);
eval_bitwise_and(t1, t2);
bool s = eval_bit_test(t1, m + 1);
if(s)
{
eval_complement(t1, t1);
eval_increment(t1);
}
result = t1;
result.sign(s);
}
else
{
*result.limbs() &= *o.limbs();
}
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& is_unsigned_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_unsigned_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
>::type
eval_bitwise_or(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
*result.limbs() |= *o.limbs();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& (is_signed_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value || is_signed_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value)
>::type
eval_bitwise_or(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, o, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
using default_ops::eval_bit_test;
using default_ops::eval_increment;
if(result.sign() || o.sign())
{
static const unsigned m = static_unsigned_max<static_unsigned_max<MinBits1, MinBits2>::value, static_unsigned_max<MaxBits1, MaxBits2>::value>::value;
cpp_int_backend<m + 1, m + 1, unsigned_magnitude, unchecked, void> t1(result);
cpp_int_backend<m + 1, m + 1, unsigned_magnitude, unchecked, void> t2(o);
eval_bitwise_or(t1, t2);
bool s = eval_bit_test(t1, m + 1);
if(s)
{
eval_complement(t1, t1);
eval_increment(t1);
}
result = t1;
result.sign(s);
}
else
{
*result.limbs() |= *o.limbs();
result.normalize();
}
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& is_unsigned_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_unsigned_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
>::type
eval_bitwise_xor(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
*result.limbs() ^= *o.limbs();
}
template <unsigned MinBits1, unsigned MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1, unsigned MinBits2, unsigned MaxBits2, cpp_integer_type SignType2, cpp_int_check_type Checked2, class Allocator2>
inline typename enable_if_c<
is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value
&& is_trivial_cpp_int<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value
&& (is_signed_number<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value || is_signed_number<cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2> >::value)
>::type
eval_bitwise_xor(
cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& result,
const cpp_int_backend<MinBits2, MaxBits2, SignType2, Checked2, Allocator2>& o) BOOST_MP_NOEXCEPT_IF((is_non_throwing_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value))
{
is_valid_bitwise_op(result, o, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::checked_type());
using default_ops::eval_bit_test;
using default_ops::eval_increment;
if(result.sign() || o.sign())
{
static const unsigned m = static_unsigned_max<static_unsigned_max<MinBits1, MinBits2>::value, static_unsigned_max<MaxBits1, MaxBits2>::value>::value;
cpp_int_backend<m + 1, m + 1, unsigned_magnitude, unchecked, void> t1(result);
cpp_int_backend<m + 1, m + 1, unsigned_magnitude, unchecked, void> t2(o);
eval_bitwise_xor(t1, t2);
bool s = eval_bit_test(t1, m + 1);
if(s)
{
eval_complement(t1, t1);
eval_increment(t1);
}
result = t1;
result.sign(s);
}
else
{
*result.limbs() ^= *o.limbs();
}
}
}}} // namespaces
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
@@ -0,0 +1,180 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2013.
// (C) Copyright Gennaro Prota 2003 - 2004.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP
#define BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/iterator.hpp>
namespace boost {
namespace container {
template <class PseudoReference>
struct operator_arrow_proxy
{
operator_arrow_proxy(const PseudoReference &px)
: m_value(px)
{}
typedef PseudoReference element_type;
PseudoReference* operator->() const { return &m_value; }
mutable PseudoReference m_value;
};
template <class T>
struct operator_arrow_proxy<T&>
{
operator_arrow_proxy(T &px)
: m_value(px)
{}
typedef T element_type;
T* operator->() const { return const_cast<T*>(&m_value); }
T &m_value;
};
template <class Iterator, class UnaryFunction>
class transform_iterator
: public UnaryFunction
, public boost::container::iterator
< typename Iterator::iterator_category
, typename container_detail::remove_reference<typename UnaryFunction::result_type>::type
, typename Iterator::difference_type
, operator_arrow_proxy<typename UnaryFunction::result_type>
, typename UnaryFunction::result_type>
{
public:
explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction())
: UnaryFunction(f), m_it(it)
{}
explicit transform_iterator()
: UnaryFunction(), m_it()
{}
//Constructors
transform_iterator& operator++()
{ increment(); return *this; }
transform_iterator operator++(int)
{
transform_iterator result (*this);
increment();
return result;
}
friend bool operator== (const transform_iterator& i, const transform_iterator& i2)
{ return i.equal(i2); }
friend bool operator!= (const transform_iterator& i, const transform_iterator& i2)
{ return !(i == i2); }
/*
friend bool operator> (const transform_iterator& i, const transform_iterator& i2)
{ return i2 < i; }
friend bool operator<= (const transform_iterator& i, const transform_iterator& i2)
{ return !(i > i2); }
friend bool operator>= (const transform_iterator& i, const transform_iterator& i2)
{ return !(i < i2); }
*/
friend typename Iterator::difference_type operator- (const transform_iterator& i, const transform_iterator& i2)
{ return i2.distance_to(i); }
//Arithmetic
transform_iterator& operator+=(typename Iterator::difference_type off)
{ this->advance(off); return *this; }
transform_iterator operator+(typename Iterator::difference_type off) const
{
transform_iterator other(*this);
other.advance(off);
return other;
}
friend transform_iterator operator+(typename Iterator::difference_type off, const transform_iterator& right)
{ return right + off; }
transform_iterator& operator-=(typename Iterator::difference_type off)
{ this->advance(-off); return *this; }
transform_iterator operator-(typename Iterator::difference_type off) const
{ return *this + (-off); }
typename UnaryFunction::result_type operator*() const
{ return dereference(); }
operator_arrow_proxy<typename UnaryFunction::result_type>
operator->() const
{ return operator_arrow_proxy<typename UnaryFunction::result_type>(dereference()); }
Iterator & base()
{ return m_it; }
const Iterator & base() const
{ return m_it; }
private:
Iterator m_it;
void increment()
{ ++m_it; }
void decrement()
{ --m_it; }
bool equal(const transform_iterator &other) const
{ return m_it == other.m_it; }
bool less(const transform_iterator &other) const
{ return other.m_it < m_it; }
typename UnaryFunction::result_type dereference() const
{ return UnaryFunction::operator()(*m_it); }
void advance(typename Iterator::difference_type n)
{ boost::container::iterator_advance(m_it, n); }
typename Iterator::difference_type distance_to(const transform_iterator &other)const
{ return boost::container::iterator_distance(other.m_it, m_it); }
};
template <class Iterator, class UnaryFunc>
transform_iterator<Iterator, UnaryFunc>
make_transform_iterator(Iterator it, UnaryFunc fun)
{
return transform_iterator<Iterator, UnaryFunc>(it, fun);
}
} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
#endif //#ifndef BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP
@@ -0,0 +1,43 @@
#ifndef BOOST_MPL_MAP_AUX_CONTAINS_IMPL_HPP_INCLUDED
#define BOOST_MPL_MAP_AUX_CONTAINS_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/contains_fwd.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/map/aux_/at_impl.hpp>
#include <boost/mpl/map/aux_/tag.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl {
template<>
struct contains_impl< aux::map_tag >
{
template< typename Map, typename Pair > struct apply
: is_same<
typename at_impl<aux::map_tag>::apply<
Map
, typename Pair::first
>::type
, typename Pair::second
>
{
};
};
}}
#endif // BOOST_MPL_MAP_AUX_CONTAINS_IMPL_HPP_INCLUDED