merge vendor source.

Fri, 04 Mar 2011 12:48:37 -0800

author
Andrew A. de Laix <alain@lindenlab.com>
date
Fri, 04 Mar 2011 12:48:37 -0800
changeset 15
97cc37b6e95e
parent 11
2fc1855aaec1
parent 14
71830a62a785
child 16
f52596dba2a6

merge vendor source.

     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgtags	Fri Mar 04 12:48:37 2011 -0800
     1.3 @@ -0,0 +1,2 @@
     1.4 +30a18f5cbb06d6a2e1eaa4439e3d0b7f9e4d37f3 current
     1.5 +30a18f5cbb06d6a2e1eaa4439e3d0b7f9e4d37f3 1.45.0
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/boost_1_45_0/INSTALL	Fri Mar 04 12:48:37 2011 -0800
     2.3 @@ -0,0 +1,8 @@
     2.4 +See ./index.html for information about this release. The "Getting Started" 
     2.5 +section is a useful starting place.
     2.6 +
     2.7 +---------------------------
     2.8 +Copyright Beman Dawes, 2008
     2.9 +
    2.10 +Distributed under the Boost Software License, Version 1.0.
    2.11 +See ./LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt 
    2.12 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/boost_1_45_0/Jamroot	Fri Mar 04 12:48:37 2011 -0800
     3.3 @@ -0,0 +1,757 @@
     3.4 +# Copyright Vladimir Prus 2002-2006.
     3.5 +# Copyright Dave Abrahams 2005-2006.
     3.6 +# Copyright Rene Rivera 2005-2007.
     3.7 +# Copyright Douglas Gregor 2005.
     3.8 +#
     3.9 +# Distributed under the Boost Software License, Version 1.0.
    3.10 +#    (See accompanying file LICENSE_1_0.txt or copy at
    3.11 +#          http://www.boost.org/LICENSE_1_0.txt)
    3.12 +
    3.13 +# Usage:
    3.14 +#
    3.15 +#   bjam [options] [properties] [install|stage]
    3.16 +#
    3.17 +#   Builds and installs Boost.
    3.18 +#
    3.19 +# Targets and Related Options:
    3.20 +#
    3.21 +#   install                 Install headers and compiled library files to the
    3.22 +#   =======                 configured locations (below).
    3.23 +#
    3.24 +#   --prefix=<PREFIX>       Install architecture independent files here.
    3.25 +#                           Default; C:\Boost on Win32
    3.26 +#                           Default; /usr/local on Unix. Linux, etc.
    3.27 +#
    3.28 +#   --exec-prefix=<EPREFIX> Install architecture dependent files here.
    3.29 +#                           Default; <PREFIX>
    3.30 +#
    3.31 +#   --libdir=<DIR>          Install library files here.
    3.32 +#                           Default; <EPREFIX>/lib
    3.33 +#
    3.34 +#   --includedir=<HDRDIR>   Install header files here.
    3.35 +#                           Default; <PREFIX>/include
    3.36 +#
    3.37 +#   stage                   Build and install only compiled library files
    3.38 +#   =====                   to the stage directory.
    3.39 +#
    3.40 +#   --stagedir=<STAGEDIR>   Install library files here
    3.41 +#                           Default; ./stage
    3.42 +#
    3.43 +# Other Options:
    3.44 +#
    3.45 +#   --build-type=<type>     Build the specified pre-defined set of variations
    3.46 +#                           of the libraries. Note, that which variants get
    3.47 +#                           built depends on what each library supports.
    3.48 +#
    3.49 +#                               minimal (default) - Builds a minimal set of 
    3.50 +#                               variants. On Windows, these are static 
    3.51 +#                               multithreaded libraries in debug and release
    3.52 +#                               modes, using shared runtime. On Linux, these
    3.53 +#                               are static and shared multithreaded libraries
    3.54 +#                               in release mode.
    3.55 +#
    3.56 +#                               complete - Build all possible variations.
    3.57 +#
    3.58 +#   --build-dir=DIR         Build in this location instead of building
    3.59 +#                           within the distribution tree. Recommended!
    3.60 +#
    3.61 +#   --show-libraries        Displays the list of Boost libraries that require
    3.62 +#                           build and installation steps, then exit.
    3.63 +#
    3.64 +#   --layout=<layout>       Determines whether to choose library names
    3.65 +#                           and header locations such that multiple
    3.66 +#                           versions of Boost or multiple compilers can
    3.67 +#                           be used on the same system.
    3.68 +#
    3.69 +#                               versioned - Names of boost binaries
    3.70 +#                               include the Boost version number, name and
    3.71 +#                               version of the compiler and encoded build
    3.72 +#                               properties.  Boost headers are installed in a
    3.73 +#                               subdirectory of <HDRDIR> whose name contains
    3.74 +#                               the Boost version number.
    3.75 +#
    3.76 +#                               tagged -- Names of boost binaries include the
    3.77 +#                               encoded build properties such as variant and
    3.78 +#                               threading, but do not including compiler name
    3.79 +#                               and version, or Boost version. This option is
    3.80 +#                               useful if you build several variants of Boost,
    3.81 +#                               using the same compiler.
    3.82 +#
    3.83 +#                               system - Binaries names do not include the
    3.84 +#                               Boost version number or the name and version
    3.85 +#                               number of the compiler.  Boost headers are
    3.86 +#                               installed directly into <HDRDIR>.  This option
    3.87 +#                               is intended for system integrators who are
    3.88 +#                               building distribution packages.
    3.89 +#
    3.90 +#                           The default value is 'versioned' on Windows, and
    3.91 +#                           'system' on Unix.
    3.92 +#
    3.93 +#   --buildid=ID            Adds the specified ID to the name of built
    3.94 +#                           libraries.  The default is to not add anything.
    3.95 +#
    3.96 +#   --python-buildid=ID     Adds the specified ID to the name of built
    3.97 +#                           libraries that depend on Python.  The default 
    3.98 +#                           is to not add anything. This ID is added in 
    3.99 +#                           addition t --buildid.
   3.100 +#
   3.101 +#
   3.102 +#   --help                  This message.
   3.103 +#
   3.104 +#   --with-<library>        Build and install the specified <library>
   3.105 +#                           If this option is used, only libraries
   3.106 +#                           specified using this option will be built.
   3.107 +#
   3.108 +#   --without-<library>     Do not build, stage, or install the specified
   3.109 +#                           <library>. By default, all libraries are built.
   3.110 +#
   3.111 +# Properties:
   3.112 +#
   3.113 +#   toolset=toolset         Indicates the toolset to build with.
   3.114 +#
   3.115 +#   variant=debug|release   Select the build variant
   3.116 +#
   3.117 +#   link=static|shared      Whether to build static or shared libraries
   3.118 +#
   3.119 +#   threading=single|multi  Whether to build single or multithreaded binaries
   3.120 +# 
   3.121 +#   runtime-link=static|shared      
   3.122 +#                           Whether to link to static or shared C and C++ runtime.
   3.123 +#   
   3.124 +
   3.125 +# TODO:
   3.126 +#  - handle boost version
   3.127 +#  - handle python options such as pydebug
   3.128 +
   3.129 +import generate ;
   3.130 +import modules ;
   3.131 +import set ;
   3.132 +import stage ;
   3.133 +import package ;
   3.134 +import path ;
   3.135 +import common ;
   3.136 +import os ;
   3.137 +import regex ;
   3.138 +import errors ;
   3.139 +import "class" : new ;
   3.140 +import common ;
   3.141 +import sequence ;
   3.142 +import symlink ;
   3.143 +import targets ;
   3.144 +import project ;
   3.145 +import option ;
   3.146 +import xsltproc ;
   3.147 +import build-system ;
   3.148 +import configure ;
   3.149 +
   3.150 +path-constant BOOST_ROOT : . ;
   3.151 +constant BOOST_VERSION : 1.45.0 ;
   3.152 +constant BOOST_JAMROOT_MODULE : $(__name__) ;
   3.153 +
   3.154 +local version-tag = [ MATCH "^([^.]+)[.]([^.]+)[.]([^.]+)" : $(BOOST_VERSION) ]
   3.155 +    ;
   3.156 +if $(version-tag[3]) = 0
   3.157 +{
   3.158 +    version-tag = $(version-tag[1-2]) ;
   3.159 +}
   3.160 +
   3.161 +constant BOOST_VERSION_TAG : $(version-tag:J="_") ;
   3.162 +
   3.163 +# Option to choose how many variants to build. The default is "minimal".
   3.164 +local build-type = [ MATCH "^--build-type=(.*)" : [ modules.peek : ARGV ] ] ;
   3.165 +build-type ?= minimal ;
   3.166 +if ! ( $(build-type) in minimal complete )
   3.167 +{
   3.168 +    ECHO "The value of the --build-type option should be either 'complete' or 'minimal'" ;
   3.169 +    EXIT ;
   3.170 +}
   3.171 +
   3.172 +rule handle-static-runtime ( properties * )
   3.173 +{
   3.174 +    # Using static runtime with shared libraries is impossible on Linux,
   3.175 +    # and dangerous on Windows. Therefore, we disallow it. This might
   3.176 +    # be drastic, but it was disabled for a while with nobody complaining.
   3.177 +
   3.178 +    # For CW, static runtime is needed so that std::locale works.
   3.179 +    if <link>shared in $(properties) && <runtime-link>static in $(properties) &&
   3.180 +        ! ( <toolset>cw in $(properties) )
   3.181 +    {
   3.182 +        ECHO "error: link=shared together with runtime-link=static is not allowed" ;
   3.183 +        ECHO "error: such property combination is either impossible " ;
   3.184 +        ECHO "error: or too dangerious to be of any use" ;
   3.185 +        EXIT ;
   3.186 +    }
   3.187 +}
   3.188 +
   3.189 +
   3.190 +project boost
   3.191 +    : requirements <include>.
   3.192 +      # Disable auto-linking for all targets here, primarily because it caused
   3.193 +      # troubles with V2.
   3.194 +      <define>BOOST_ALL_NO_LIB=1
   3.195 +      # Used to encode variant in target name. See the 'tag' rule below.
   3.196 +      <tag>@$(__name__).tag
   3.197 +      <conditional>@handle-static-runtime
   3.198 +      # The standard library Sun compilers use by default has no chance
   3.199 +      # of working with Boost. Override it.
   3.200 +      <toolset>sun:<stdlib>sun-stlport
   3.201 +      # Comeau does not support shared lib
   3.202 +      <toolset>como:<link>static
   3.203 +      <toolset>como-linux:<define>_GNU_SOURCE=1
   3.204 +      # When building docs within Boost, we want the standard Boost style
   3.205 +      <xsl:param>boost.defaults=Boost
   3.206 +    : usage-requirements <include>.
   3.207 +    : build-dir bin.v2
   3.208 +    ;
   3.209 +
   3.210 +
   3.211 +# Setup convenient aliases for all libraries.
   3.212 +
   3.213 +all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
   3.214 +    [ glob libs/*/build/Jamfile ] ]
   3.215 +    ;
   3.216 +
   3.217 +all-libraries = [ sequence.unique $(all-libraries) ] ;
   3.218 +# The function_types library has a Jamfile, but it's used for maintenance
   3.219 +# purposes, there's no library to build and install.
   3.220 +all-libraries = [ set.difference $(all-libraries) : function_types ] ;
   3.221 +
   3.222 +configure.register-components $(all-libraries) ;
   3.223 +
   3.224 +local rule explicit-alias ( id : targets + )
   3.225 +{
   3.226 +    alias $(id) : $(targets) ;
   3.227 +    explicit $(id) ;
   3.228 +}
   3.229 +
   3.230 +
   3.231 +# First, the complicated libraries: where the target name in Jamfile is
   3.232 +# different from its directory name.
   3.233 +explicit-alias prg_exec_monitor : libs/test/build//boost_prg_exec_monitor ;
   3.234 +explicit-alias test_exec_monitor : libs/test/build//boost_test_exec_monitor ;
   3.235 +explicit-alias unit_test_framework : libs/test/build//boost_unit_test_framework ;
   3.236 +explicit-alias bgl-vis : libs/graps/build//bgl-vis ;
   3.237 +explicit-alias serialization : libs/serialization/build//boost_serialization ;
   3.238 +explicit-alias wserialization : libs/serialization/build//boost_wserialization ;
   3.239 +for local l in $(all-libraries)
   3.240 +{
   3.241 +    if ! $(l) in test graph serialization
   3.242 +    {
   3.243 +        explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
   3.244 +    }
   3.245 +}
   3.246 +
   3.247 +alias headers : : : : <include>. ;
   3.248 +
   3.249 +
   3.250 +# Decides which libraries are to be installed by looking at --with-<library>
   3.251 +# --without-<library> arguments. Returns the list of directories under "libs"
   3.252 +# which must be built and installed.
   3.253 +#
   3.254 +rule libraries-to-install ( existing-libraries * )
   3.255 +{
   3.256 +   local argv = [ modules.peek : ARGV ] ;
   3.257 +   local with-parameter = [ MATCH --with-(.*) : $(argv) ] ;
   3.258 +   local without-parameter = [ MATCH --without-(.*) : $(argv) ] ;
   3.259 +   
   3.260 +   if ! $(with-parameter) && ! $(without-parameter)
   3.261 +   {
   3.262 +       # Nothing is specified on command line. See if maybe
   3.263 +       # project-config.jam has some choices. 
   3.264 +       local project-config-libs = [ modules.peek project-config : libraries ] ;
   3.265 +       with-parameter = [ MATCH --with-(.*) : $(project-config-libs) ] ;
   3.266 +       without-parameter = [ MATCH --without-(.*) : $(project-config-libs) ] ;
   3.267 +   }
   3.268 +
   3.269 +   # Do some checks.
   3.270 +   if $(with-parameter) && $(without-parameter)
   3.271 +   {
   3.272 +       ECHO "error: both --with-<library> and --without-<library> specified" ;
   3.273 +       EXIT ;
   3.274 +   }
   3.275 +
   3.276 +   local wrong = [ set.difference $(with-parameter) : $(existing-libraries) ] ;
   3.277 +   if $(wrong)
   3.278 +   {
   3.279 +       ECHO "error: wrong library name '$(wrong[1])' in the --with-<library> option." ;
   3.280 +       EXIT ;
   3.281 +   }
   3.282 +   local wrong = [ set.difference $(without-parameter) : $(existing-libraries) ] ;
   3.283 +   if $(wrong)
   3.284 +   {
   3.285 +       ECHO "error: wrong library name '$(wrong[1])' in the --without-<library> option." ;
   3.286 +       EXIT ;
   3.287 +   }
   3.288 +
   3.289 +   if $(with-parameter)
   3.290 +   {
   3.291 +       return [ set.intersection $(existing-libraries) : $(with-parameter) ] ;
   3.292 +   }
   3.293 +   else
   3.294 +   {
   3.295 +       return [ set.difference $(existing-libraries) : $(without-parameter) ] ;
   3.296 +   }
   3.297 +}
   3.298 +
   3.299 +
   3.300 +# What kind of layout are we doing?
   3.301 +layout = [ option.get layout : "" ] ;
   3.302 +# On Windows, we used versioned layout by default in order to
   3.303 +# be compatible with autolink. On other systems, we use system
   3.304 +# layout which is what every other program uses. Note that windows
   3.305 +# check is static, and won't 
   3.306 +if ! $(layout)
   3.307 +{
   3.308 +    if [ modules.peek : NT ]
   3.309 +    {
   3.310 +        layout = versioned ;
   3.311 +    }
   3.312 +    else
   3.313 +    {
   3.314 +        layout = system ;
   3.315 +    }
   3.316 +}
   3.317 +layout-$(layout) = true ;
   3.318 +
   3.319 +if $(layout) = system && $(build-type) = complete
   3.320 +{
   3.321 +    ECHO "error: Cannot use --layout=system with --build-type complete." ;
   3.322 +    ECHO "error: Please used either --layout=versioned or --layout=tagged " ;
   3.323 +    ECHO "error: if you wish to build multiple variants." ;
   3.324 +    if ! [ modules.peek : NT ] 
   3.325 +    {        
   3.326 +        ECHO "error: Note that --layout=system is default on Unix starting with Boost 1.40." ;
   3.327 +    }    
   3.328 +    EXIT ;
   3.329 +}
   3.330 +
   3.331 +# Possible stage only location.
   3.332 +local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
   3.333 +stage-locate ?= stage ;
   3.334 +path-constant BOOST_STAGE_LOCATE : $(stage-locate) ;
   3.335 +
   3.336 +
   3.337 +# Python location.
   3.338 +local python-root = [ MATCH "^--with-python-root=(.*)" : [ modules.peek : ARGV ]
   3.339 +    ] ;
   3.340 +PYTHON_ROOT ?= $(python-root) ;
   3.341 +
   3.342 +
   3.343 +# Select the libraries to install.
   3.344 +libraries = [ libraries-to-install $(all-libraries) ] ;
   3.345 +configure.components-building $(libraries) ;
   3.346 +
   3.347 +if --show-libraries in [ modules.peek : ARGV ]
   3.348 +{
   3.349 +    ECHO "The following libraries require building:" ;
   3.350 +    for local l in $(libraries)
   3.351 +    {
   3.352 +        ECHO "    - $(l)" ;
   3.353 +    }
   3.354 +    EXIT ;
   3.355 +}
   3.356 +
   3.357 +# Custom build ID.
   3.358 +local build-id = [ MATCH "^--buildid=(.*)" : [ modules.peek : ARGV ] ] ;
   3.359 +if $(build-id)
   3.360 +{
   3.361 +    constant BUILD_ID : [ regex.replace $(build-id) "[*\\/:.\"\' ]" "_" ] ;
   3.362 +}
   3.363 +
   3.364 +# Python build id (only for Python libraries)
   3.365 +local python-id = [ MATCH "^--python-buildid=(.*)" : [ modules.peek : ARGV ] ] ;
   3.366 +if $(python-id)
   3.367 +{
   3.368 +    constant PYTHON_ID : [ regex.replace $(python-id) "[*\\/:.\"\']" "_" ] ;
   3.369 +}
   3.370 +
   3.371 +# This rule is called by Boost.Build to determine the name of target. We use it
   3.372 +# to encode the build variant, compiler name and boost version in the target
   3.373 +# name.
   3.374 +#
   3.375 +rule tag ( name : type ? : property-set )
   3.376 +{
   3.377 +    if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
   3.378 +    {
   3.379 +        local result ;
   3.380 +        if $(layout) = versioned
   3.381 +        {
   3.382 +            result = [ common.format-name
   3.383 +                <base> <toolset> <threading> <runtime> -$(BOOST_VERSION_TAG)
   3.384 +                -$(BUILD_ID)
   3.385 +                : $(name) : $(type) : $(property-set) ] ;
   3.386 +        }        
   3.387 +        else if $(layout) = tagged
   3.388 +        {
   3.389 +            result = [ common.format-name
   3.390 +                <base> <threading> <runtime>
   3.391 +                -$(BUILD_ID)
   3.392 +                : $(name) : $(type) : $(property-set) ] ;            
   3.393 +        }
   3.394 +        else if $(layout) = system
   3.395 +        {
   3.396 +            result = [ common.format-name
   3.397 +                <base> 
   3.398 +                -$(BUILD_ID)
   3.399 +                : $(name) : $(type) : $(property-set) ] ;
   3.400 +        }
   3.401 +        else
   3.402 +        {
   3.403 +            ECHO "error: invalid layout '$(layout)'" ;
   3.404 +            EXIT ;               
   3.405 +        }
   3.406 +                
   3.407 +        # Optionally add version suffix. On NT, library with version suffix
   3.408 +        # will not be recognized by linkers. On CYGWIN, we get strage
   3.409 +        # duplicate symbol errors when library is generated with version
   3.410 +        # suffix. On OSX, version suffix is not needed -- the linker expects
   3.411 +        # the libFoo.1.2.3.dylib format. AIX linkers do not accept version
   3.412 +        # suffixes either. Pgi compilers can not accept library with version
   3.413 +        # suffix.
   3.414 +        if $(type) = SHARED_LIB &&
   3.415 +          ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
   3.416 +            ! ( [ $(property-set).get <toolset> ] in pgi ) )
   3.417 +        {
   3.418 +            result = $(result).$(BOOST_VERSION)  ;
   3.419 +        }
   3.420 +            
   3.421 +        return $(result) ;
   3.422 +    }    
   3.423 +}
   3.424 +
   3.425 +
   3.426 +# Install to system location.
   3.427 +
   3.428 +install-requirements = <install-source-root>$(BOOST_ROOT)/boost ;
   3.429 +
   3.430 +if $(layout-versioned)
   3.431 +{
   3.432 +    install-requirements += <install-header-subdir>boost-$(BOOST_VERSION_TAG)/boost ;
   3.433 +}
   3.434 +else
   3.435 +{
   3.436 +    install-requirements += <install-header-subdir>boost ;
   3.437 +}
   3.438 +if [ modules.peek : NT ]
   3.439 +{
   3.440 +    install-requirements += <install-default-prefix>C:/Boost ;
   3.441 +}
   3.442 +else if [ modules.peek : UNIX ]
   3.443 +{
   3.444 +    install-requirements += <install-default-prefix>/usr/local ;
   3.445 +}
   3.446 +
   3.447 +local headers =
   3.448 +    # The .SUNWCCh files are present in tr1 include directory and have to be installed,
   3.449 +    # see http://lists.boost.org/Archives/boost/2007/05/121430.php
   3.450 +    [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
   3.451 +    [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* : CVS .svn ] 
   3.452 +    [ path.glob boost/tr1/tr1 : * : bcc32 sun CVS .svn ]
   3.453 +          ;
   3.454 +
   3.455 +# Complete install.
   3.456 +package.install install-proper
   3.457 +    : $(install-requirements) <install-no-version-symlinks>on
   3.458 +    :
   3.459 +    : libs/$(libraries)/build
   3.460 +    : $(headers)
   3.461 +    ;
   3.462 +explicit install-proper ;
   3.463 +
   3.464 +# Install just library.
   3.465 +install stage-proper
   3.466 +    : libs/$(libraries)/build
   3.467 +    : <location>$(stage-locate)/lib
   3.468 +      <install-dependencies>on <install-type>LIB
   3.469 +      <install-no-version-symlinks>on
   3.470 +    ;
   3.471 +explicit stage-proper ;
   3.472 +
   3.473 +
   3.474 +if $(layout-versioned) && ( [ modules.peek : NT ] || [ modules.peek : UNIX ] )
   3.475 +{
   3.476 +    rule make-unversioned-links ( project name ? : property-set : sources * )
   3.477 +    {
   3.478 +        local result ;
   3.479 +        local filtered ;
   3.480 +        local pattern ;
   3.481 +        local nt = [ modules.peek : NT ] ;
   3.482 +
   3.483 +        # Collect the libraries that have the version number in 'filtered'.
   3.484 +        for local s in $(sources)
   3.485 +        {
   3.486 +            local m ;
   3.487 +            if $(nt)
   3.488 +            {
   3.489 +                m = [ MATCH "(.*[.]lib)" : [ $(s).name ] ] ;
   3.490 +            }
   3.491 +            else
   3.492 +            {
   3.493 +                m = [ MATCH "(.*[.]so[.0-9]+)" "(.*[.]dylib)" "(.*[.]a)" :
   3.494 +                    [ $(s).name ] ] ;
   3.495 +            }
   3.496 +            if $(m)
   3.497 +            {
   3.498 +                filtered += $(s) ;
   3.499 +            }
   3.500 +        }
   3.501 +
   3.502 +        # Create links without version.
   3.503 +        for local s in $(filtered)
   3.504 +        {
   3.505 +            local name = [ $(s).name ] ;
   3.506 +            local ea = [ $(s).action ] ;
   3.507 +            local ep = [ $(ea).properties ] ;
   3.508 +            local a  = [ new non-scanning-action $(s) : symlink.ln : $(ep) ] ;
   3.509 +
   3.510 +            local noversion-file ;
   3.511 +            if $(nt)
   3.512 +            {
   3.513 +                noversion-file = [ MATCH "(.*)-[0-9_]+(.*[.]lib)" : $(name) ] ;
   3.514 +            }
   3.515 +            else
   3.516 +            {
   3.517 +                noversion-file =
   3.518 +                  [ MATCH "(.*)-[0-9_]+(.*[.]so)[.0-9]*" : $(name) ]
   3.519 +                  [ MATCH "(.*)-[0-9_]+(.*[.]dylib)" : $(name) ]
   3.520 +                  [ MATCH "(.*)-[0-9_]+(.*[.]a)" : $(name) ]
   3.521 +                  [ MATCH "(.*)-[0-9_]+(.*[.]dll[.]a)" : $(name) ] ;
   3.522 +            }
   3.523 +
   3.524 +            local new-name =
   3.525 +               $(noversion-file[1])$(noversion-file[2]) ;
   3.526 +            result += [ new file-target $(new-name) exact : [ $(s).type ] : $(project)
   3.527 +                    : $(a) ] ;
   3.528 +
   3.529 +        }
   3.530 +        return $(result) ;
   3.531 +    }
   3.532 +
   3.533 +    generate stage-unversioned : stage-proper :
   3.534 +        <generating-rule>@make-unversioned-links ;
   3.535 +    explicit stage-unversioned ;
   3.536 +
   3.537 +    generate install-unversioned : install-proper :
   3.538 +        <generating-rule>@make-unversioned-links ;
   3.539 +    explicit install-unversioned ;
   3.540 +}
   3.541 +else
   3.542 +{
   3.543 +    # Create do-nothing aliases.
   3.544 +    alias stage-unversioned ;
   3.545 +    explicit stage-unversioned ;
   3.546 +    alias install-unversioned ;
   3.547 +    explicit install-unversioned ;
   3.548 +}
   3.549 +
   3.550 +# This is a special metatarget class that handles the --build-type=complete
   3.551 +# option.
   3.552 +class top-level-target : alias-target-class
   3.553 +{
   3.554 +    import modules ;
   3.555 +    import errors ; 
   3.556 +    
   3.557 +    rule __init__ ( name : project : sources * : requirements *
   3.558 +        : default-build * : usage-requirements * )
   3.559 +    {
   3.560 +        alias-target-class.__init__ $(name) : $(project) : $(sources) :
   3.561 +            $(requirements) : $(default-build) : $(usage-requirements) ;
   3.562 +        
   3.563 +        local m = [ $(project).project-module ] ;
   3.564 +        self.build-type = [ modules.peek $(m) : build-type ] ;
   3.565 +        # On Linux, we build release variant by default, since few users will
   3.566 +        # ever want to debug C++ Boost libraries, and there's no ABI
   3.567 +        # incompatibility between debug and release variants. We build
   3.568 +        # shared and static libraries since that's what most packages
   3.569 +        # seem to provide (.so in libfoo and .a in libfoo-dev).
   3.570 +        self.minimal-properties = [ property-set.create 
   3.571 +            <variant>release <threading>multi <link>shared <link>static <runtime-link>shared ] ;
   3.572 +        # On Windows, new IDE projects use:
   3.573 +        #
   3.574 +        #   runtime-link=dynamic, threading=multi, variant=(debug|release)
   3.575 +        #
   3.576 +        # and in addition, C++ Boost's autolink defaults to static linking.
   3.577 +        self.minimal-properties-win = [ property-set.create 
   3.578 +            <variant>debug <variant>release <threading>multi <link>static <runtime-link>shared ] ;
   3.579 +
   3.580 +        self.complete-properties = [ property-set.create
   3.581 +            <variant>debug <variant>release
   3.582 +            <threading>single <threading>multi
   3.583 +            <link>shared <link>static
   3.584 +            <runtime-link>shared <runtime-link>static ] ;
   3.585 +    }
   3.586 +    
   3.587 +    rule generate ( property-set )
   3.588 +    {
   3.589 +        local x = [ modules.peek : top-level-targets ] ;
   3.590 +        x += $(self.name) ;
   3.591 +        modules.poke : top-level-targets : $(x) ;
   3.592 +        if $(self.build-type) = minimal
   3.593 +        {
   3.594 +            local expanded ;
   3.595 +            
   3.596 +            local os = [ $(property-set).get <target-os> ] ;
   3.597 +            # Because we completely override parent's 'generate'
   3.598 +            # we need to check for default value of feature ourself.
   3.599 +            if ! $(os)
   3.600 +            {
   3.601 +                os = [ feature.defaults <target-os> ] ;
   3.602 +                os = $(os:G=) ;
   3.603 +            }
   3.604 +            
   3.605 +            if $(os) = windows
   3.606 +            {                
   3.607 +                expanded = [ targets.apply-default-build $(property-set)
   3.608 +                  : $(self.minimal-properties-win) ] ;
   3.609 +            }
   3.610 +            else
   3.611 +            {
   3.612 +                expanded = [ targets.apply-default-build $(property-set)
   3.613 +                  : $(self.minimal-properties) ] ;
   3.614 +            }            
   3.615 +            return [ build-multiple $(expanded) ] ;
   3.616 +        }
   3.617 +        else if $(self.build-type) = complete
   3.618 +        {                                    
   3.619 +            local expanded = [ targets.apply-default-build $(property-set)
   3.620 +              : $(self.complete-properties) ] ;
   3.621 +            
   3.622 +            # Filter inappopriate combinations
   3.623 +            local filtered ;
   3.624 +            for local p in $(expanded)
   3.625 +            {
   3.626 +                # See comment in handle-static-runtime regarding this logic.
   3.627 +                if [ $(p).get <link> ] = shared && [ $(p).get <runtime-link> ] = static
   3.628 +                   && [ $(p).get <toolset> ] != cw
   3.629 +                {
   3.630 +                    # Skip this
   3.631 +                }
   3.632 +                else
   3.633 +                {
   3.634 +                    filtered += $(p) ;
   3.635 +                }
   3.636 +            }            
   3.637 +            return [ build-multiple $(filtered) ] ;            
   3.638 +        }
   3.639 +        else
   3.640 +        {
   3.641 +            errors.error "Unknown build type" ; 
   3.642 +        }               
   3.643 +    }
   3.644 +    
   3.645 +    rule build-multiple ( property-sets * )
   3.646 +    {
   3.647 +        local usage-requirements = [ property-set.empty ] ;
   3.648 +        local result ;
   3.649 +        for local p in $(property-sets)
   3.650 +        {
   3.651 +            local r = [ alias-target-class.generate $(p) ] ;
   3.652 +            if $(r)
   3.653 +            {
   3.654 +                usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;
   3.655 +                result += $(r[2-]) ;
   3.656 +            }
   3.657 +        }
   3.658 +        return $(usage-requirements) [ sequence.unique $(result) ] ;
   3.659 +    }
   3.660 +    
   3.661 +}
   3.662 +
   3.663 +targets.create-metatarget top-level-target : [ project.current ]
   3.664 +  : install
   3.665 +  : install-proper install-unversioned 
   3.666 +  ;
   3.667 +targets.create-metatarget top-level-target : [ project.current ]
   3.668 +  : stage
   3.669 +  : stage-proper stage-unversioned 
   3.670 +  ;
   3.671 +
   3.672 +explicit install ;
   3.673 +explicit stage ;
   3.674 +
   3.675 +stage-abs = [ path.native [ path.root $(stage-locate)/lib [ path.pwd ] ] ] ;
   3.676 +
   3.677 +# This target is built by default, and will forward to 'stage'
   3.678 +# after producing some explanations.
   3.679 +targets.create-metatarget top-level-target : [ project.current ]
   3.680 +  : forward
   3.681 +  : explain stage
   3.682 +  ;
   3.683 +
   3.684 +
   3.685 +message explain :
   3.686 +"\nBuilding the Boost C++ Libraries.\n\n" ;
   3.687 +explicit explain ;
   3.688 +
   3.689 +rule pre-build ( )
   3.690 +{
   3.691 +    local tl = [ modules.peek : top-level-targets ] ;
   3.692 +    if stage in $(tl) || install in $(tl)
   3.693 +    {
   3.694 +        # FIXME: remove if when Boost regression tests use trunk
   3.695 +        # bjam.
   3.696 +        if PAD in [ RULENAMES ]
   3.697 +        {            
   3.698 +            configure.print-component-configuration ;
   3.699 +        }        
   3.700 +    }
   3.701 +}
   3.702 +IMPORT $(__name__) : pre-build : : $(__name__).pre-build ;
   3.703 +build-system.set-pre-build-hook $(__name__).pre-build ;
   3.704 +
   3.705 +rule post-build ( ok ? ) 
   3.706 +{
   3.707 +    if forward in [ modules.peek : top-level-targets ] 
   3.708 +    {        
   3.709 +        if $(ok)
   3.710 +        {
   3.711 +        ECHO 
   3.712 +"\n\nThe Boost C++ Libraries were successfully built!
   3.713 +          
   3.714 +The following directory should be added to compiler include paths:
   3.715 +          
   3.716 +    $(BOOST_ROOT)
   3.717 +      
   3.718 +The following directory should be added to linker library paths:
   3.719 +      
   3.720 +    $(stage-abs)
   3.721 +" ;
   3.722 +        }    
   3.723 +    }    
   3.724 +}
   3.725 +IMPORT $(__name__) : post-build : : $(__name__).post-build ;
   3.726 +build-system.set-post-build-hook $(__name__).post-build ;
   3.727 +
   3.728 +# This rule should be called from libraries' Jamfiles and will create two
   3.729 +# targets, "install" and "stage", that will install or stage that library. The
   3.730 +# --prefix option is respected, but --with and --without options, naturally, are
   3.731 +# ignored.
   3.732 +#
   3.733 +# - libraries -- list of library targets to install.
   3.734 +#
   3.735 +rule boost-install ( libraries * )
   3.736 +{
   3.737 +    package.install install
   3.738 +        : <dependency>/boost//install-proper-headers $(install-requirements)
   3.739 +        : # No binaries
   3.740 +        : $(libraries)
   3.741 +        : # No headers, it is handled by the dependency.
   3.742 +    ;
   3.743 +
   3.744 +    install stage : $(libraries) : <location>$(BOOST_STAGE_LOCATE) ;
   3.745 +
   3.746 +    local c = [ project.current ] ;
   3.747 +    local project-module = [ $(c).project-module ] ;
   3.748 +    module $(project-module)
   3.749 +    {
   3.750 +        explicit stage ;
   3.751 +        explicit install ;
   3.752 +    }
   3.753 +}
   3.754 +
   3.755 +
   3.756 +# Make project ids of all libraries known.
   3.757 +for local l in $(all-libraries)
   3.758 +{
   3.759 +    use-project /boost/$(l) : libs/$(l)/build ;
   3.760 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/boost_1_45_0/LICENSE_1_0.txt	Fri Mar 04 12:48:37 2011 -0800
     4.3 @@ -0,0 +1,23 @@
     4.4 +Boost Software License - Version 1.0 - August 17th, 2003
     4.5 +
     4.6 +Permission is hereby granted, free of charge, to any person or organization
     4.7 +obtaining a copy of the software and accompanying documentation covered by
     4.8 +this license (the "Software") to use, reproduce, display, distribute,
     4.9 +execute, and transmit the Software, and to prepare derivative works of the
    4.10 +Software, and to permit third-parties to whom the Software is furnished to
    4.11 +do so, all subject to the following:
    4.12 +
    4.13 +The copyright notices in the Software and this entire statement, including
    4.14 +the above license grant, this restriction and the following disclaimer,
    4.15 +must be included in all copies of the Software, in whole or in part, and
    4.16 +all derivative works of the Software, unless such copies or derivative
    4.17 +works are solely in the form of machine-executable object code generated by
    4.18 +a source language processor.
    4.19 +
    4.20 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    4.21 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    4.22 +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
    4.23 +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
    4.24 +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
    4.25 +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    4.26 +DEALINGS IN THE SOFTWARE.
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/boost_1_45_0/boost-build.jam	Fri Mar 04 12:48:37 2011 -0800
     5.3 @@ -0,0 +1,17 @@
     5.4 +# Copyright (C) 2002-2003 David Abrahams.
     5.5 +# Copyright (C) 2002-2003 Vladimir Prus.
     5.6 +# Copyright (C) 2003,2007 Rene Rivera.
     5.7 +# Use, modification and distribution are subject to the
     5.8 +# Boost Software License, Version 1.0. (See accompanying file
     5.9 +# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    5.10 +
    5.11 +#   This is the initial file loaded by Boost Jam when run from any Boost library
    5.12 +# folder. It allows us to choose which Boost Build installation to use for
    5.13 +# building Boost libraries. Unless explicitly selected using a command-line
    5.14 +# option, the version included with the Boost library distribution is used (as
    5.15 +# opposed to any other Boost Build version installed on the user's sytem).
    5.16 +
    5.17 +BOOST_ROOT = $(.boost-build-file:D) ;
    5.18 +BOOST_BUILD = [ MATCH --boost-build=(.*) : $(ARGV) ] ;
    5.19 +BOOST_BUILD ?= tools/build/v2 ;
    5.20 +boost-build $(BOOST_BUILD) ;
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/boost_1_45_0/boost.css	Fri Mar 04 12:48:37 2011 -0800
     6.3 @@ -0,0 +1,66 @@
     6.4 +/*=============================================================================
     6.5 +    Copyright 2002 William E. Kempf
     6.6 +    Distributed under the Boost Software License, Version 1.0. (See accompany-
     6.7 +    ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     6.8 +=============================================================================*/
     6.9 +
    6.10 +H1
    6.11 +{
    6.12 +    FONT-SIZE: 200%;
    6.13 +    COLOR: #00008B;
    6.14 +}
    6.15 +H2
    6.16 +{
    6.17 +    FONT-SIZE: 150%;
    6.18 +}
    6.19 +H3
    6.20 +{
    6.21 +    FONT-SIZE: 125%;
    6.22 +}
    6.23 +H4
    6.24 +{
    6.25 +    FONT-SIZE: 108%;
    6.26 +}
    6.27 +BODY
    6.28 +{
    6.29 +    FONT-SIZE: 100%;
    6.30 +    BACKGROUND-COLOR: #ffffff;
    6.31 +    COLOR: #000000;
    6.32 +}
    6.33 +PRE
    6.34 +{
    6.35 +    MARGIN-LEFT: 2em;
    6.36 +    FONT-FAMILY: Courier,
    6.37 +                 monospace;
    6.38 +}
    6.39 +CODE
    6.40 +{
    6.41 +    FONT-FAMILY: Courier,
    6.42 +                 monospace;
    6.43 +}
    6.44 +CODE.as_pre
    6.45 +{
    6.46 +    white-space: pre;
    6.47 +}
    6.48 +.index
    6.49 +{
    6.50 +    TEXT-ALIGN: left;
    6.51 +}
    6.52 +.page-index
    6.53 +{
    6.54 +    TEXT-ALIGN: left;
    6.55 +}
    6.56 +.definition
    6.57 +{
    6.58 +    TEXT-ALIGN: left;
    6.59 +}
    6.60 +.footnote
    6.61 +{
    6.62 +    FONT-SIZE: 66%;
    6.63 +    VERTICAL-ALIGN: super;
    6.64 +    TEXT-DECORATION: none;
    6.65 +}
    6.66 +.function-semantics
    6.67 +{
    6.68 +    CLEAR: left;
    6.69 +}
    6.70 \ No newline at end of file
     7.1 Binary file boost_1_45_0/boost.png has changed
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/boost_1_45_0/boost/accumulators/accumulators.hpp	Fri Mar 04 12:48:37 2011 -0800
     8.3 @@ -0,0 +1,27 @@
     8.4 +///////////////////////////////////////////////////////////////////////////////
     8.5 +/// \file accumulators.hpp
     8.6 +/// Includes all of the Accumulators Framework
     8.7 +//
     8.8 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
     8.9 +//  Software License, Version 1.0. (See accompanying file
    8.10 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    8.11 +
    8.12 +#ifndef BOOST_ACCUMULATORS_ACCUMULATORS_HPP_EAN_28_10_2005
    8.13 +#define BOOST_ACCUMULATORS_ACCUMULATORS_HPP_EAN_28_10_2005
    8.14 +
    8.15 +#include <boost/accumulators/framework/accumulator_set.hpp>
    8.16 +#include <boost/accumulators/framework/accumulator_concept.hpp>
    8.17 +#include <boost/accumulators/framework/accumulator_base.hpp>
    8.18 +#include <boost/accumulators/framework/extractor.hpp>
    8.19 +#include <boost/accumulators/framework/external.hpp>
    8.20 +#include <boost/accumulators/framework/features.hpp>
    8.21 +#include <boost/accumulators/framework/parameters/accumulator.hpp>
    8.22 +#include <boost/accumulators/framework/parameters/sample.hpp>
    8.23 +#include <boost/accumulators/framework/parameters/weight.hpp>
    8.24 +#include <boost/accumulators/framework/parameters/weights.hpp>
    8.25 +#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
    8.26 +#include <boost/accumulators/framework/accumulators/droppable_accumulator.hpp>
    8.27 +#include <boost/accumulators/framework/accumulators/reference_accumulator.hpp>
    8.28 +#include <boost/accumulators/framework/accumulators/value_accumulator.hpp>
    8.29 +
    8.30 +#endif
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/boost_1_45_0/boost/accumulators/accumulators_fwd.hpp	Fri Mar 04 12:48:37 2011 -0800
     9.3 @@ -0,0 +1,216 @@
     9.4 +///////////////////////////////////////////////////////////////////////////////
     9.5 +// accumulators_fwd.hpp
     9.6 +//
     9.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
     9.8 +//  Software License, Version 1.0. (See accompanying file
     9.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    9.10 +
    9.11 +#ifndef BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
    9.12 +#define BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
    9.13 +
    9.14 +#include <boost/config.hpp>
    9.15 +#include <boost/mpl/apply_fwd.hpp> // for mpl::na
    9.16 +#include <boost/mpl/limits/vector.hpp>
    9.17 +#include <boost/preprocessor/arithmetic/inc.hpp>
    9.18 +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
    9.19 +#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
    9.20 +#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
    9.21 +#include <boost/preprocessor/repetition/repeat_from_to.hpp>
    9.22 +#include <boost/accumulators/numeric/functional_fwd.hpp>
    9.23 +
    9.24 +#ifndef BOOST_ACCUMULATORS_MAX_FEATURES
    9.25 +  /// The maximum number of accumulators that may be put in an accumulator_set.
    9.26 +  /// Defaults to BOOST_MPL_LIMIT_VECTOR_SIZE (which defaults to 20).
    9.27 +# define BOOST_ACCUMULATORS_MAX_FEATURES BOOST_MPL_LIMIT_VECTOR_SIZE
    9.28 +#endif
    9.29 +
    9.30 +#if BOOST_ACCUMULATORS_MAX_FEATURES > BOOST_MPL_LIMIT_VECTOR_SIZE
    9.31 +# error BOOST_ACCUMULATORS_MAX_FEATURES cannot be larger than BOOST_MPL_LIMIT_VECTOR_SIZE
    9.32 +#endif
    9.33 +
    9.34 +#ifndef BOOST_ACCUMULATORS_MAX_ARGS
    9.35 +  /// The maximum number of arguments that may be specified to an accumulator_set's
    9.36 +  /// accumulation function. Defaults to 15.
    9.37 +# define BOOST_ACCUMULATORS_MAX_ARGS 15
    9.38 +#endif
    9.39 +
    9.40 +#if BOOST_WORKAROUND(__GNUC__, == 3) \
    9.41 + || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
    9.42 +# define BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
    9.43 +#endif
    9.44 +
    9.45 +#ifdef BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
    9.46 +# include <boost/utility/enable_if.hpp>
    9.47 +# include <boost/type_traits/is_const.hpp>
    9.48 +# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)\
    9.49 +    , typename boost::disable_if<boost::is_const<T> >::type * = 0
    9.50 +#else
    9.51 +# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)
    9.52 +#endif
    9.53 +
    9.54 +namespace boost { namespace accumulators
    9.55 +{
    9.56 +
    9.57 +///////////////////////////////////////////////////////////////////////////////
    9.58 +// Named parameters tags
    9.59 +//
    9.60 +namespace tag
    9.61 +{
    9.62 +    struct sample;
    9.63 +    struct weight;
    9.64 +    struct accumulator;
    9.65 +    struct weights;
    9.66 +}
    9.67 +
    9.68 +///////////////////////////////////////////////////////////////////////////////
    9.69 +// User-level features
    9.70 +//
    9.71 +namespace tag
    9.72 +{
    9.73 +    template<typename ValueType, typename Tag>
    9.74 +    struct value;
    9.75 +
    9.76 +    template<typename Tag>
    9.77 +    struct value_tag;
    9.78 +
    9.79 +    template<typename Referent, typename Tag>
    9.80 +    struct reference;
    9.81 +
    9.82 +    template<typename Tag>
    9.83 +    struct reference_tag;
    9.84 +
    9.85 +    template<typename Type, typename Tag = void, typename AccumulatorSet = void>
    9.86 +    struct external;
    9.87 +
    9.88 +    template<typename Feature>
    9.89 +    struct droppable;
    9.90 +}
    9.91 +
    9.92 +template<typename Accumulator>
    9.93 +struct droppable_accumulator_base;
    9.94 +
    9.95 +template<typename Accumulator>
    9.96 +struct droppable_accumulator;
    9.97 +
    9.98 +template<typename Accumulator>
    9.99 +struct with_cached_result;
   9.100 +
   9.101 +template<typename Sample, typename Features, typename Weight = void>
   9.102 +struct accumulator_set;
   9.103 +
   9.104 +template<typename Feature>
   9.105 +struct extractor;
   9.106 +
   9.107 +template<typename Feature>
   9.108 +struct feature_of;
   9.109 +
   9.110 +template<typename Feature>
   9.111 +struct as_feature;
   9.112 +
   9.113 +template<typename Feature>
   9.114 +struct as_weighted_feature;
   9.115 +
   9.116 +template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
   9.117 +struct depends_on;
   9.118 +
   9.119 +template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
   9.120 +struct features;
   9.121 +
   9.122 +template<typename Feature, typename AccumulatorSet>
   9.123 +typename mpl::apply<AccumulatorSet, Feature>::type const &
   9.124 +find_accumulator(AccumulatorSet const &acc);
   9.125 +
   9.126 +template<typename Feature, typename AccumulatorSet>
   9.127 +typename mpl::apply<AccumulatorSet, Feature>::type::result_type
   9.128 +extract_result(AccumulatorSet const &acc);
   9.129 +
   9.130 +template<typename Feature, typename AccumulatorSet, typename A1>
   9.131 +typename mpl::apply<AccumulatorSet, Feature>::type::result_type
   9.132 +extract_result(AccumulatorSet const &acc, A1 const &a1);
   9.133 +
   9.134 +// ... other overloads generated by Boost.Preprocessor:
   9.135 +
   9.136 +/// INTERNAL ONLY
   9.137 +///
   9.138 +#define BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD(z, n, _)                      \
   9.139 +    template<                                                               \
   9.140 +        typename Feature                                                    \
   9.141 +      , typename AccumulatorSet                                             \
   9.142 +        BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A)                   \
   9.143 +    >                                                                       \
   9.144 +    typename mpl::apply<AccumulatorSet, Feature>::type::result_type         \
   9.145 +    extract_result(                                                         \
   9.146 +        AccumulatorSet const &acc                                           \
   9.147 +        BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a)           \
   9.148 +    );
   9.149 +
   9.150 +/// INTERNAL ONLY
   9.151 +///
   9.152 +BOOST_PP_REPEAT_FROM_TO(
   9.153 +    2
   9.154 +  , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
   9.155 +  , BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD
   9.156 +  , _
   9.157 +)
   9.158 +
   9.159 +#ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
   9.160 +template<typename Feature, typename AccumulatorSet, typename A1, typename A2 ...>
   9.161 +typename mpl::apply<AccumulatorSet, Feature>::type::result_type
   9.162 +extract_result(AccumulatorSet const &acc, A1 const &a1, A2 const &a2 ...);
   9.163 +#endif
   9.164 +
   9.165 +namespace impl
   9.166 +{
   9.167 +    using namespace numeric::operators;
   9.168 +
   9.169 +    template<typename Accumulator, typename Tag>
   9.170 +    struct external_impl;
   9.171 +}
   9.172 +
   9.173 +namespace detail
   9.174 +{
   9.175 +    template<typename Accumulator>
   9.176 +    struct feature_tag;
   9.177 +
   9.178 +    template<typename Feature, typename Sample, typename Weight>
   9.179 +    struct to_accumulator;
   9.180 +
   9.181 +    struct accumulator_set_base;
   9.182 +
   9.183 +    template<typename T>
   9.184 +    struct is_accumulator_set;
   9.185 +
   9.186 +    inline void ignore_variable(void const *) {}
   9.187 +
   9.188 +  #define BOOST_ACCUMULATORS_IGNORE_GLOBAL(X)\
   9.189 +    namespace detail { inline void BOOST_PP_CAT(ignore_, X)() { boost::accumulators::detail::ignore_variable(&X); } }
   9.190 +}
   9.191 +
   9.192 +}} // namespace boost::accumulators
   9.193 +
   9.194 +// For defining boost::parameter keywords that can be inherited from to
   9.195 +// get a nested, class-scoped keyword with the requested alias
   9.196 +#define BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)                                  \
   9.197 +    namespace tag_namespace                                                                         \
   9.198 +    {                                                                                               \
   9.199 +        template<int Dummy = 0>                                                                     \
   9.200 +        struct name ## _                                                                            \
   9.201 +        {                                                                                           \
   9.202 +            static char const* keyword_name()                                                       \
   9.203 +            {                                                                                       \
   9.204 +                return #name;                                                                       \
   9.205 +            }                                                                                       \
   9.206 +            static ::boost::parameter::keyword<name ## _<Dummy> > &alias;                           \
   9.207 +        };                                                                                          \
   9.208 +        template<int Dummy>                                                                         \
   9.209 +        ::boost::parameter::keyword<name ## _<Dummy> > &name ## _<Dummy>::alias =                   \
   9.210 +        ::boost::parameter::keyword<name ## _<Dummy> >::get();                                      \
   9.211 +        typedef name ## _ <> name;                                                                  \
   9.212 +    }                                                                                               \
   9.213 +    namespace                                                                                       \
   9.214 +    {                                                                                               \
   9.215 +        ::boost::parameter::keyword<tag_namespace::name> &name =                                    \
   9.216 +        ::boost::parameter::keyword<tag_namespace::name>::get();                                    \
   9.217 +    }
   9.218 +
   9.219 +#endif
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulator_base.hpp	Fri Mar 04 12:48:37 2011 -0800
    10.3 @@ -0,0 +1,65 @@
    10.4 +///////////////////////////////////////////////////////////////////////////////
    10.5 +// accumulator_base.hpp
    10.6 +//
    10.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    10.8 +//  Software License, Version 1.0. (See accompanying file
    10.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   10.10 +
   10.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_BASE_HPP_EAN_28_10_2005
   10.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_BASE_HPP_EAN_28_10_2005
   10.13 +
   10.14 +#include <boost/mpl/placeholders.hpp>
   10.15 +#include <boost/mpl/joint_view.hpp>
   10.16 +#include <boost/mpl/single_view.hpp>
   10.17 +#include <boost/mpl/fold.hpp>
   10.18 +#include <boost/mpl/contains.hpp>
   10.19 +#include <boost/mpl/empty_sequence.hpp>
   10.20 +#include <boost/accumulators/framework/accumulator_concept.hpp>
   10.21 +
   10.22 +namespace boost { namespace accumulators
   10.23 +{
   10.24 +
   10.25 +namespace detail
   10.26 +{
   10.27 +    typedef void void_;
   10.28 +}
   10.29 +
   10.30 +///////////////////////////////////////////////////////////////////////////////
   10.31 +// dont_care
   10.32 +//
   10.33 +struct dont_care
   10.34 +{
   10.35 +    template<typename Args>
   10.36 +    dont_care(Args const &)
   10.37 +    {
   10.38 +    }
   10.39 +};
   10.40 +
   10.41 +///////////////////////////////////////////////////////////////////////////////
   10.42 +// accumulator_base
   10.43 +//
   10.44 +struct accumulator_base
   10.45 +{
   10.46 +    // hidden if defined in derived classes
   10.47 +    detail::void_ operator ()(dont_care)
   10.48 +    {
   10.49 +    }
   10.50 +
   10.51 +    typedef mpl::false_ is_droppable;
   10.52 +
   10.53 +    detail::void_ add_ref(dont_care)
   10.54 +    {
   10.55 +    }
   10.56 +
   10.57 +    detail::void_ drop(dont_care)
   10.58 +    {
   10.59 +    }
   10.60 +
   10.61 +    detail::void_ on_drop(dont_care)
   10.62 +    {
   10.63 +    }
   10.64 +};
   10.65 +
   10.66 +}} // namespace boost::accumulators
   10.67 +
   10.68 +#endif
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulator_concept.hpp	Fri Mar 04 12:48:37 2011 -0800
    11.3 @@ -0,0 +1,29 @@
    11.4 +///////////////////////////////////////////////////////////////////////////////
    11.5 +// accumulator_concept.hpp
    11.6 +//
    11.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    11.8 +//  Software License, Version 1.0. (See accompanying file
    11.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   11.10 +
   11.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_CONCEPT_HPP_EAN_28_10_2005
   11.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_CONCEPT_HPP_EAN_28_10_2005
   11.13 +
   11.14 +#include <boost/concept_check.hpp>
   11.15 +
   11.16 +namespace boost { namespace accumulators
   11.17 +{
   11.18 +
   11.19 +template<typename Stat>
   11.20 +struct accumulator_concept
   11.21 +{
   11.22 +    void constraints()
   11.23 +    {
   11.24 +        // TODO: define the stat concept
   11.25 +    }
   11.26 +
   11.27 +    Stat stat;
   11.28 +};
   11.29 +
   11.30 +}} // namespace boost::accumulators
   11.31 +
   11.32 +#endif
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulator_set.hpp	Fri Mar 04 12:48:37 2011 -0800
    12.3 @@ -0,0 +1,401 @@
    12.4 +///////////////////////////////////////////////////////////////////////////////
    12.5 +// accumulator_set.hpp
    12.6 +//
    12.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    12.8 +//  Software License, Version 1.0. (See accompanying file
    12.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   12.10 +
   12.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_SET_HPP_EAN_28_10_2005
   12.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_SET_HPP_EAN_28_10_2005
   12.13 +
   12.14 +#include <boost/version.hpp>
   12.15 +#include <boost/mpl/apply.hpp>
   12.16 +#include <boost/mpl/assert.hpp>
   12.17 +#include <boost/mpl/protect.hpp>
   12.18 +#include <boost/mpl/identity.hpp>
   12.19 +#include <boost/mpl/is_sequence.hpp>
   12.20 +#include <boost/type_traits/is_same.hpp>
   12.21 +#include <boost/type_traits/is_base_and_derived.hpp>
   12.22 +#include <boost/parameter/parameters.hpp>
   12.23 +#include <boost/preprocessor/repetition/repeat_from_to.hpp>
   12.24 +#include <boost/preprocessor/repetition/enum_binary_params.hpp>
   12.25 +#include <boost/accumulators/accumulators_fwd.hpp>
   12.26 +#include <boost/accumulators/framework/depends_on.hpp>
   12.27 +#include <boost/accumulators/framework/accumulator_concept.hpp>
   12.28 +#include <boost/accumulators/framework/parameters/accumulator.hpp>
   12.29 +#include <boost/accumulators/framework/parameters/sample.hpp>
   12.30 +#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
   12.31 +#include <boost/accumulators/framework/accumulators/droppable_accumulator.hpp>
   12.32 +#include <boost/fusion/include/any.hpp>
   12.33 +#include <boost/fusion/include/find_if.hpp>
   12.34 +#include <boost/fusion/include/for_each.hpp>
   12.35 +#include <boost/fusion/include/filter_view.hpp>
   12.36 +
   12.37 +namespace boost { namespace accumulators
   12.38 +{
   12.39 +
   12.40 +namespace detail
   12.41 +{
   12.42 +    ///////////////////////////////////////////////////////////////////////////////
   12.43 +    // accumulator_visitor
   12.44 +    //   wrap a boost::parameter argument pack in a Fusion extractor object
   12.45 +    template<typename Args>
   12.46 +    struct accumulator_visitor
   12.47 +    {
   12.48 +        explicit accumulator_visitor(Args const &a)
   12.49 +          : args(a)
   12.50 +        {
   12.51 +        }
   12.52 +
   12.53 +        template<typename Accumulator>
   12.54 +        void operator ()(Accumulator &accumulator) const
   12.55 +        {
   12.56 +            accumulator(this->args);
   12.57 +        }
   12.58 +
   12.59 +    private:
   12.60 +        accumulator_visitor &operator =(accumulator_visitor const &);
   12.61 +        Args const &args;
   12.62 +    };
   12.63 +
   12.64 +    template<typename Args>
   12.65 +    inline accumulator_visitor<Args> const make_accumulator_visitor(Args const &args)
   12.66 +    {
   12.67 +        return accumulator_visitor<Args>(args);
   12.68 +    }
   12.69 +
   12.70 +    typedef
   12.71 +        parameter::parameters<
   12.72 +            parameter::required<tag::accumulator>
   12.73 +          , parameter::optional<tag::sample>
   12.74 +          // ... and others which are not specified here...
   12.75 +        >
   12.76 +    accumulator_params;
   12.77 +
   12.78 +    ///////////////////////////////////////////////////////////////////////////////
   12.79 +    // accumulator_set_base
   12.80 +    struct accumulator_set_base
   12.81 +    {
   12.82 +    };
   12.83 +
   12.84 +    ///////////////////////////////////////////////////////////////////////////////
   12.85 +    // is_accumulator_set
   12.86 +    template<typename T>
   12.87 +    struct is_accumulator_set
   12.88 +      : is_base_and_derived<accumulator_set_base, T>
   12.89 +    {
   12.90 +    };
   12.91 +
   12.92 +} // namespace detail
   12.93 +
   12.94 +#ifdef _MSC_VER
   12.95 +#pragma warning(push)
   12.96 +#pragma warning(disable: 4355) // warning C4355: 'this' : used in base member initializer list
   12.97 +#endif
   12.98 +
   12.99 +///////////////////////////////////////////////////////////////////////////////
  12.100 +/// \brief A set of accumulators.
  12.101 +///
  12.102 +/// accumulator_set resolves the dependencies between features and ensures that
  12.103 +/// the accumulators in the set are updated in the proper order.
  12.104 +///
  12.105 +/// acccumulator_set provides a general mechanism to visit the accumulators
  12.106 +/// in the set in order, with or without a filter. You can also fetch a reference
  12.107 +/// to an accumulator that corresponds to a feature.
  12.108 +///
  12.109 +template<typename Sample, typename Features, typename Weight>
  12.110 +struct accumulator_set
  12.111 +  : detail::accumulator_set_base
  12.112 +{
  12.113 +    typedef Sample sample_type;     ///< The type of the samples that will be accumulated
  12.114 +    typedef Features features_type; ///< An MPL sequence of the features that should be accumulated.
  12.115 +    typedef Weight weight_type;     ///< The type of the weight parameter. Must be a scalar. Defaults to void.
  12.116 +
  12.117 +    /// INTERNAL ONLY
  12.118 +    ///
  12.119 +    typedef
  12.120 +        typename detail::make_accumulator_tuple<
  12.121 +            Features
  12.122 +          , Sample
  12.123 +          , Weight
  12.124 +        >::type
  12.125 +    accumulators_mpl_vector;
  12.126 +
  12.127 +    // generate a fusion::list of accumulators
  12.128 +    /// INTERNAL ONLY
  12.129 +    ///
  12.130 +    typedef
  12.131 +        typename detail::meta::make_acc_list<
  12.132 +            accumulators_mpl_vector
  12.133 +        >::type
  12.134 +    accumulators_type;
  12.135 +
  12.136 +    /// INTERNAL ONLY
  12.137 +    ///
  12.138 +    //BOOST_MPL_ASSERT((mpl::is_sequence<accumulators_type>));
  12.139 +
  12.140 +    ///////////////////////////////////////////////////////////////////////////////
  12.141 +    /// default-construct all contained accumulators
  12.142 +    accumulator_set()
  12.143 +      : accumulators(
  12.144 +            detail::make_acc_list(
  12.145 +                accumulators_mpl_vector()
  12.146 +              , detail::accumulator_params()(*this)
  12.147 +            )
  12.148 +        )
  12.149 +    {
  12.150 +        // Add-ref the Features that the user has specified
  12.151 +        this->template visit_if<detail::contains_feature_of_<Features> >(
  12.152 +            detail::make_add_ref_visitor(detail::accumulator_params()(*this))
  12.153 +        );
  12.154 +    }
  12.155 +
  12.156 +    /// \overload
  12.157 +    ///
  12.158 +    /// \param a1 Optional named parameter to be passed to all the accumulators
  12.159 +    template<typename A1>
  12.160 +    explicit accumulator_set(A1 const &a1)
  12.161 +      : accumulators(
  12.162 +            detail::make_acc_list(
  12.163 +                accumulators_mpl_vector()
  12.164 +              , detail::accumulator_params()(*this, a1)
  12.165 +            )
  12.166 +        )
  12.167 +    {
  12.168 +        // Add-ref the Features that the user has specified
  12.169 +        this->template visit_if<detail::contains_feature_of_<Features> >(
  12.170 +            detail::make_add_ref_visitor(detail::accumulator_params()(*this))
  12.171 +        );
  12.172 +    }
  12.173 +
  12.174 +    // ... other overloads generated by Boost.Preprocessor:
  12.175 +
  12.176 +    /// INTERNAL ONLY
  12.177 +    ///
  12.178 +#define BOOST_ACCUMULATORS_ACCUMULATOR_SET_CTOR(z, n, _)                                \
  12.179 +    template<BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)>                                  \
  12.180 +    accumulator_set(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, A, const &a))                   \
  12.181 +      : accumulators(                                                                   \
  12.182 +            detail::make_acc_list(                                                      \
  12.183 +                accumulators_mpl_vector()                                               \
  12.184 +              , detail::accumulator_params()(                                           \
  12.185 +                    *this BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a)                      \
  12.186 +                )                                                                       \
  12.187 +            )                                                                           \
  12.188 +        )                                                                               \
  12.189 +    {                                                                                   \
  12.190 +        /* Add-ref the Features that the user has specified */                          \
  12.191 +        this->template visit_if<detail::contains_feature_of_<Features> >(               \
  12.192 +            detail::make_add_ref_visitor(detail::accumulator_params()(*this))           \
  12.193 +        );                                                                              \
  12.194 +    }
  12.195 +
  12.196 +    /// INTERNAL ONLY
  12.197 +    ///
  12.198 +    BOOST_PP_REPEAT_FROM_TO(
  12.199 +        2
  12.200 +      , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
  12.201 +      , BOOST_ACCUMULATORS_ACCUMULATOR_SET_CTOR
  12.202 +      , _
  12.203 +    )
  12.204 +
  12.205 +    #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
  12.206 +    /// \overload
  12.207 +    ///
  12.208 +    template<typename A1, typename A2, ...>
  12.209 +    accumulator_set(A1 const &a1, A2 const &a2, ...);
  12.210 +    #endif
  12.211 +
  12.212 +    // ... other overloads generated by Boost.Preprocessor below ...
  12.213 +
  12.214 +    ///////////////////////////////////////////////////////////////////////////////
  12.215 +    /// Visitation
  12.216 +    /// \param func UnaryFunction which is invoked with each accumulator in turn.
  12.217 +    template<typename UnaryFunction>
  12.218 +    void visit(UnaryFunction const &func)
  12.219 +    {
  12.220 +        fusion::for_each(this->accumulators, func);
  12.221 +    }
  12.222 +
  12.223 +    ///////////////////////////////////////////////////////////////////////////////
  12.224 +    /// Conditional visitation
  12.225 +    /// \param func UnaryFunction which is invoked with each accumulator in turn,
  12.226 +    ///     provided the accumulator satisfies the MPL predicate FilterPred.
  12.227 +    template<typename FilterPred, typename UnaryFunction>
  12.228 +    void visit_if(UnaryFunction const &func)
  12.229 +    {
  12.230 +        fusion::filter_view<accumulators_type, FilterPred> filtered_accs(this->accumulators);
  12.231 +        fusion::for_each(filtered_accs, func);
  12.232 +    }
  12.233 +    
  12.234 +    ///////////////////////////////////////////////////////////////////////////////
  12.235 +    /// The return type of the operator() overloads is void.
  12.236 +    typedef void result_type;
  12.237 +
  12.238 +    ///////////////////////////////////////////////////////////////////////////////
  12.239 +    /// Accumulation
  12.240 +    /// \param a1 Optional named parameter to be passed to all the accumulators
  12.241 +    void operator ()()
  12.242 +    {
  12.243 +        this->visit(
  12.244 +            detail::make_accumulator_visitor(
  12.245 +                detail::accumulator_params()(*this)
  12.246 +            )
  12.247 +        );
  12.248 +    }
  12.249 +
  12.250 +    template<typename A1>
  12.251 +    void operator ()(A1 const &a1)
  12.252 +    {
  12.253 +        this->visit(
  12.254 +            detail::make_accumulator_visitor(
  12.255 +                detail::accumulator_params()(*this, a1)
  12.256 +            )
  12.257 +        );
  12.258 +    }
  12.259 +
  12.260 +    // ... other overloads generated by Boost.Preprocessor:
  12.261 +
  12.262 +    /// INTERNAL ONLY
  12.263 +    ///
  12.264 +#define BOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP(z, n, _)                              \
  12.265 +    template<BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)>                                  \
  12.266 +    void operator ()(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, A, const &a))                  \
  12.267 +    {                                                                                   \
  12.268 +        this->visit(                                                                    \
  12.269 +            detail::make_accumulator_visitor(                                           \
  12.270 +                detail::accumulator_params()(                                           \
  12.271 +                    *this BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a)                      \
  12.272 +                )                                                                       \
  12.273 +            )                                                                           \
  12.274 +        );                                                                              \
  12.275 +    }
  12.276 +
  12.277 +    /// INTERNAL ONLY
  12.278 +    ///
  12.279 +    BOOST_PP_REPEAT_FROM_TO(
  12.280 +        2
  12.281 +      , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
  12.282 +      , BOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP
  12.283 +      , _
  12.284 +    )
  12.285 +
  12.286 +    #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
  12.287 +    /// \overload
  12.288 +    ///
  12.289 +    template<typename A1, typename A2, ...>
  12.290 +    void operator ()(A1 const &a1, A2 const &a2, ...);
  12.291 +    #endif
  12.292 +
  12.293 +    ///////////////////////////////////////////////////////////////////////////////
  12.294 +    /// Extraction
  12.295 +    template<typename Feature>
  12.296 +    struct apply
  12.297 +      : fusion::result_of::value_of<
  12.298 +            typename fusion::result_of::find_if<
  12.299 +                accumulators_type
  12.300 +              , detail::matches_feature<Feature>
  12.301 +            >::type
  12.302 +        >
  12.303 +    {
  12.304 +    };
  12.305 +
  12.306 +    ///////////////////////////////////////////////////////////////////////////////
  12.307 +    /// Extraction
  12.308 +    template<typename Feature>
  12.309 +    typename apply<Feature>::type &extract()
  12.310 +    {
  12.311 +        return *fusion::find_if<detail::matches_feature<Feature> >(this->accumulators);
  12.312 +    }
  12.313 +
  12.314 +    /// \overload
  12.315 +    template<typename Feature>
  12.316 +    typename apply<Feature>::type const &extract() const
  12.317 +    {
  12.318 +        return *fusion::find_if<detail::matches_feature<Feature> >(this->accumulators);
  12.319 +    }
  12.320 +
  12.321 +    ///////////////////////////////////////////////////////////////////////////////
  12.322 +    /// Drop
  12.323 +    template<typename Feature>
  12.324 +    void drop()
  12.325 +    {
  12.326 +        // You can only drop the features that you have specified explicitly
  12.327 +        typedef typename apply<Feature>::type the_accumulator;
  12.328 +        BOOST_MPL_ASSERT((detail::contains_feature_of<Features, the_accumulator>));
  12.329 +
  12.330 +        typedef
  12.331 +            typename feature_of<typename as_feature<Feature>::type>::type
  12.332 +        the_feature;
  12.333 +
  12.334 +        (*fusion::find_if<detail::matches_feature<Feature> >(this->accumulators))
  12.335 +            .drop(detail::accumulator_params()(*this));
  12.336 +
  12.337 +        // Also drop accumulators that this feature depends on
  12.338 +        typedef typename the_feature::dependencies dependencies;
  12.339 +        this->template visit_if<detail::contains_feature_of_<dependencies> >(
  12.340 +            detail::make_drop_visitor(detail::accumulator_params()(*this))
  12.341 +        );
  12.342 +    }
  12.343 +
  12.344 +private:
  12.345 +
  12.346 +    accumulators_type accumulators;
  12.347 +};
  12.348 +
  12.349 +#ifdef _MSC_VER
  12.350 +#pragma warning(pop)
  12.351 +#endif
  12.352 +
  12.353 +///////////////////////////////////////////////////////////////////////////////
  12.354 +// find_accumulator
  12.355 +//   find an accumulator in an accumulator_set corresponding to a feature
  12.356 +template<typename Feature, typename AccumulatorSet>
  12.357 +typename mpl::apply<AccumulatorSet, Feature>::type &
  12.358 +find_accumulator(AccumulatorSet &acc BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(AccumulatorSet))
  12.359 +{
  12.360 +    return acc.template extract<Feature>();
  12.361 +}
  12.362 +
  12.363 +/// \overload
  12.364 +template<typename Feature, typename AccumulatorSet>
  12.365 +typename mpl::apply<AccumulatorSet, Feature>::type const &
  12.366 +find_accumulator(AccumulatorSet const &acc)
  12.367 +{
  12.368 +    return acc.template extract<Feature>();
  12.369 +}
  12.370 +
  12.371 +///////////////////////////////////////////////////////////////////////////////
  12.372 +// extract_result
  12.373 +//   extract a result from an accumulator set
  12.374 +/// INTERNAL ONLY
  12.375 +///
  12.376 +#define BOOST_ACCUMULATORS_EXTRACT_RESULT_FUN(z, n, _)                      \
  12.377 +    template<                                                               \
  12.378 +        typename Feature                                                    \
  12.379 +      , typename AccumulatorSet                                             \
  12.380 +        BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A)                   \
  12.381 +    >                                                                       \
  12.382 +    typename mpl::apply<AccumulatorSet, Feature>::type::result_type         \
  12.383 +    extract_result(                                                         \
  12.384 +        AccumulatorSet const &acc                                           \
  12.385 +        BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a)           \
  12.386 +    )                                                                       \
  12.387 +    {                                                                       \
  12.388 +        return find_accumulator<Feature>(acc).result(                       \
  12.389 +            detail::accumulator_params()(                                   \
  12.390 +                acc                                                         \
  12.391 +                BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a)                    \
  12.392 +            )                                                               \
  12.393 +        );                                                                  \
  12.394 +    }
  12.395 +
  12.396 +BOOST_PP_REPEAT(
  12.397 +    BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
  12.398 +  , BOOST_ACCUMULATORS_EXTRACT_RESULT_FUN
  12.399 +  , _
  12.400 +)
  12.401 +
  12.402 +}} // namespace boost::accumulators
  12.403 +
  12.404 +#endif
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulators/droppable_accumulator.hpp	Fri Mar 04 12:48:37 2011 -0800
    13.3 @@ -0,0 +1,317 @@
    13.4 +///////////////////////////////////////////////////////////////////////////////
    13.5 +// droppable_accumulator.hpp
    13.6 +//
    13.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    13.8 +//  Software License, Version 1.0. (See accompanying file
    13.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   13.10 +
   13.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_DROPPABLE_ACCUMULATOR_HPP_EAN_13_12_2005
   13.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_DROPPABLE_ACCUMULATOR_HPP_EAN_13_12_2005
   13.13 +
   13.14 +#include <new>
   13.15 +#include <boost/assert.hpp>
   13.16 +#include <boost/mpl/apply.hpp>
   13.17 +#include <boost/aligned_storage.hpp>
   13.18 +#include <boost/accumulators/framework/depends_on.hpp> // for feature_of
   13.19 +#include <boost/accumulators/framework/parameters/accumulator.hpp> // for accumulator
   13.20 +
   13.21 +namespace boost { namespace accumulators
   13.22 +{
   13.23 +
   13.24 +    template<typename Accumulator>
   13.25 +    struct droppable_accumulator;
   13.26 +
   13.27 +    namespace detail
   13.28 +    {
   13.29 +        ///////////////////////////////////////////////////////////////////////////////
   13.30 +        // add_ref_visitor
   13.31 +        //   a fusion function object for add_ref'ing accumulators
   13.32 +        template<typename Args>
   13.33 +        struct add_ref_visitor
   13.34 +        {
   13.35 +            explicit add_ref_visitor(Args const &args)
   13.36 +              : args_(args)
   13.37 +            {
   13.38 +            }
   13.39 +
   13.40 +            template<typename Accumulator>
   13.41 +            void operator ()(Accumulator &acc) const
   13.42 +            {
   13.43 +                typedef typename Accumulator::feature_tag::dependencies dependencies;
   13.44 +
   13.45 +                acc.add_ref(this->args_);
   13.46 +
   13.47 +                // Also add_ref accumulators that this feature depends on
   13.48 +                this->args_[accumulator].template
   13.49 +                    visit_if<detail::contains_feature_of_<dependencies> >(
   13.50 +                        *this
   13.51 +                );
   13.52 +            }
   13.53 +
   13.54 +        private:
   13.55 +            add_ref_visitor &operator =(add_ref_visitor const &);
   13.56 +            Args const &args_;
   13.57 +        };
   13.58 +
   13.59 +        template<typename Args>
   13.60 +        add_ref_visitor<Args> make_add_ref_visitor(Args const &args)
   13.61 +        {
   13.62 +            return add_ref_visitor<Args>(args);
   13.63 +        }
   13.64 +
   13.65 +        ///////////////////////////////////////////////////////////////////////////////
   13.66 +        // drop_visitor
   13.67 +        //   a fusion function object for dropping accumulators
   13.68 +        template<typename Args>
   13.69 +        struct drop_visitor
   13.70 +        {
   13.71 +            explicit drop_visitor(Args const &args)
   13.72 +              : args_(args)
   13.73 +            {
   13.74 +            }
   13.75 +
   13.76 +            template<typename Accumulator>
   13.77 +            void operator ()(Accumulator &acc) const
   13.78 +            {
   13.79 +                if(typename Accumulator::is_droppable())
   13.80 +                {
   13.81 +                    typedef typename Accumulator::feature_tag::dependencies dependencies;
   13.82 +
   13.83 +                    acc.drop(this->args_);
   13.84 +                    // Also drop accumulators that this feature depends on
   13.85 +                    this->args_[accumulator].template
   13.86 +                        visit_if<detail::contains_feature_of_<dependencies> >(
   13.87 +                            *this
   13.88 +                    );
   13.89 +                }
   13.90 +            }
   13.91 +
   13.92 +        private:
   13.93 +            drop_visitor &operator =(drop_visitor const &);
   13.94 +            Args const &args_;
   13.95 +        };
   13.96 +
   13.97 +        template<typename Args>
   13.98 +        drop_visitor<Args> make_drop_visitor(Args const &args)
   13.99 +        {
  13.100 +            return drop_visitor<Args>(args);
  13.101 +        }
  13.102 +    }
  13.103 +
  13.104 +    //////////////////////////////////////////////////////////////////////////
  13.105 +    // droppable_accumulator_base
  13.106 +    template<typename Accumulator>
  13.107 +    struct droppable_accumulator_base
  13.108 +      : Accumulator
  13.109 +    {
  13.110 +        typedef droppable_accumulator_base base;
  13.111 +        typedef mpl::true_ is_droppable;
  13.112 +        typedef typename Accumulator::result_type result_type;
  13.113 +
  13.114 +        template<typename Args>
  13.115 +        droppable_accumulator_base(Args const &args)
  13.116 +          : Accumulator(args)
  13.117 +          , ref_count_(0)
  13.118 +        {
  13.119 +        }
  13.120 +
  13.121 +        template<typename Args>
  13.122 +        void operator ()(Args const &args)
  13.123 +        {
  13.124 +            if(!this->is_dropped())
  13.125 +            {
  13.126 +                this->Accumulator::operator ()(args);
  13.127 +            }
  13.128 +        }
  13.129 +
  13.130 +        template<typename Args>
  13.131 +        void add_ref(Args const &)
  13.132 +        {
  13.133 +            ++this->ref_count_;
  13.134 +        }
  13.135 +
  13.136 +        template<typename Args>
  13.137 +        void drop(Args const &args)
  13.138 +        {
  13.139 +            BOOST_ASSERT(0 < this->ref_count_);
  13.140 +            if(1 == this->ref_count_)
  13.141 +            {
  13.142 +                static_cast<droppable_accumulator<Accumulator> *>(this)->on_drop(args);
  13.143 +            }
  13.144 +            --this->ref_count_;
  13.145 +        }
  13.146 +
  13.147 +        bool is_dropped() const
  13.148 +        {
  13.149 +            return 0 == this->ref_count_;
  13.150 +        }
  13.151 +
  13.152 +    private:
  13.153 +        int ref_count_;
  13.154 +    };
  13.155 +
  13.156 +    //////////////////////////////////////////////////////////////////////////
  13.157 +    // droppable_accumulator
  13.158 +    //   this can be specialized for any type that needs special handling
  13.159 +    template<typename Accumulator>
  13.160 +    struct droppable_accumulator
  13.161 +      : droppable_accumulator_base<Accumulator>
  13.162 +    {
  13.163 +        template<typename Args>
  13.164 +        droppable_accumulator(Args const &args)
  13.165 +          : droppable_accumulator::base(args)
  13.166 +        {
  13.167 +        }
  13.168 +    };
  13.169 +
  13.170 +    //////////////////////////////////////////////////////////////////////////
  13.171 +    // with_cached_result
  13.172 +    template<typename Accumulator>
  13.173 +    struct with_cached_result
  13.174 +      : Accumulator
  13.175 +    {
  13.176 +        typedef typename Accumulator::result_type result_type;
  13.177 +
  13.178 +        template<typename Args>
  13.179 +        with_cached_result(Args const &args)
  13.180 +          : Accumulator(args)
  13.181 +          , cache()
  13.182 +        {
  13.183 +        }
  13.184 +
  13.185 +        with_cached_result(with_cached_result const &that)
  13.186 +          : Accumulator(*static_cast<Accumulator const *>(&that))
  13.187 +          , cache()
  13.188 +        {
  13.189 +            if(that.has_result())
  13.190 +            {
  13.191 +                this->set(that.get());
  13.192 +            }
  13.193 +        }
  13.194 +
  13.195 +        ~with_cached_result()
  13.196 +        {
  13.197 +            // Since this is a base class of droppable_accumulator_base,
  13.198 +            // this destructor is called before any of droppable_accumulator_base's
  13.199 +            // members get cleaned up, including is_dropped, so the following
  13.200 +            // call to has_result() is valid.
  13.201 +            if(this->has_result())
  13.202 +            {
  13.203 +                this->get().~result_type();
  13.204 +            }
  13.205 +        }
  13.206 +
  13.207 +        template<typename Args>
  13.208 +        void on_drop(Args const &args)
  13.209 +        {
  13.210 +            // cache the result at the point this calcuation was dropped
  13.211 +            BOOST_ASSERT(!this->has_result());
  13.212 +            this->set(this->Accumulator::result(args));
  13.213 +        }
  13.214 +
  13.215 +        template<typename Args>
  13.216 +        result_type result(Args const &args) const
  13.217 +        {
  13.218 +            return this->has_result() ? this->get() : this->Accumulator::result(args);
  13.219 +        }
  13.220 +
  13.221 +    private:
  13.222 +        with_cached_result &operator =(with_cached_result const &);
  13.223 +
  13.224 +        void set(result_type const &r)
  13.225 +        {
  13.226 +            ::new(this->cache.address()) result_type(r);
  13.227 +        }
  13.228 +
  13.229 +        result_type const &get() const
  13.230 +        {
  13.231 +            return *static_cast<result_type const *>(this->cache.address());
  13.232 +        }
  13.233 +
  13.234 +        bool has_result() const
  13.235 +        {
  13.236 +            typedef with_cached_result<Accumulator> this_type;
  13.237 +            typedef droppable_accumulator_base<this_type> derived_type;
  13.238 +            return static_cast<derived_type const *>(this)->is_dropped();
  13.239 +        }
  13.240 +
  13.241 +        aligned_storage<sizeof(result_type)> cache;
  13.242 +    };
  13.243 +
  13.244 +    namespace tag
  13.245 +    {
  13.246 +        template<typename Feature>
  13.247 +        struct as_droppable
  13.248 +        {
  13.249 +            typedef droppable<Feature> type;
  13.250 +        };
  13.251 +
  13.252 +        template<typename Feature>
  13.253 +        struct as_droppable<droppable<Feature> >
  13.254 +        {
  13.255 +            typedef droppable<Feature> type;
  13.256 +        };
  13.257 +
  13.258 +        //////////////////////////////////////////////////////////////////////////
  13.259 +        // droppable
  13.260 +        template<typename Feature>
  13.261 +        struct droppable
  13.262 +          : as_feature<Feature>::type
  13.263 +        {
  13.264 +            typedef typename as_feature<Feature>::type feature_type;
  13.265 +            typedef typename feature_type::dependencies tmp_dependencies_;
  13.266 +
  13.267 +            typedef
  13.268 +                typename mpl::transform<
  13.269 +                    typename feature_type::dependencies
  13.270 +                  , as_droppable<mpl::_1>
  13.271 +                >::type
  13.272 +            dependencies;
  13.273 +
  13.274 +            struct impl
  13.275 +            {
  13.276 +                template<typename Sample, typename Weight>
  13.277 +                struct apply
  13.278 +                {
  13.279 +                    typedef
  13.280 +                        droppable_accumulator<
  13.281 +                            typename mpl::apply2<typename feature_type::impl, Sample, Weight>::type
  13.282 +                        >
  13.283 +                    type;
  13.284 +                };
  13.285 +            };
  13.286 +        };
  13.287 +    }
  13.288 +
  13.289 +    // make droppable<tag::feature(modifier)> work
  13.290 +    template<typename Feature>
  13.291 +    struct as_feature<tag::droppable<Feature> >
  13.292 +    {
  13.293 +        typedef tag::droppable<typename as_feature<Feature>::type> type;
  13.294 +    };
  13.295 +
  13.296 +    // make droppable<tag::mean> work with non-void weights (should become
  13.297 +    // droppable<tag::weighted_mean>
  13.298 +    template<typename Feature>
  13.299 +    struct as_weighted_feature<tag::droppable<Feature> >
  13.300 +    {
  13.301 +        typedef tag::droppable<typename as_weighted_feature<Feature>::type> type;
  13.302 +    };
  13.303 +
  13.304 +    // for the purposes of feature-based dependency resolution,
  13.305 +    // droppable<Foo> provides the same feature as Foo
  13.306 +    template<typename Feature>
  13.307 +    struct feature_of<tag::droppable<Feature> >
  13.308 +      : feature_of<Feature>
  13.309 +    {
  13.310 +    };
  13.311 +
  13.312 +    // Note: Usually, the extractor is pulled into the accumulators namespace with
  13.313 +    // a using directive, not the tag. But the droppable<> feature doesn't have an
  13.314 +    // extractor, so we can put the droppable tag in the accumulators namespace
  13.315 +    // without fear of a name conflict.
  13.316 +    using tag::droppable;
  13.317 +
  13.318 +}} // namespace boost::accumulators
  13.319 +
  13.320 +#endif
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulators/external_accumulator.hpp	Fri Mar 04 12:48:37 2011 -0800
    14.3 @@ -0,0 +1,108 @@
    14.4 +///////////////////////////////////////////////////////////////////////////////
    14.5 +// external_accumulator.hpp
    14.6 +//
    14.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    14.8 +//  Software License, Version 1.0. (See accompanying file
    14.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   14.10 +
   14.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_EXTERNAL_ACCUMULATOR_HPP_EAN_01_12_2005
   14.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_EXTERNAL_ACCUMULATOR_HPP_EAN_01_12_2005
   14.13 +
   14.14 +#include <boost/mpl/placeholders.hpp>
   14.15 +#include <boost/parameter/keyword.hpp>
   14.16 +#include <boost/accumulators/framework/extractor.hpp>
   14.17 +#include <boost/accumulators/framework/depends_on.hpp> // for feature_tag
   14.18 +#include <boost/accumulators/framework/accumulator_base.hpp>
   14.19 +#include <boost/accumulators/framework/accumulators/reference_accumulator.hpp>
   14.20 +
   14.21 +namespace boost { namespace accumulators { namespace impl
   14.22 +{
   14.23 +
   14.24 +    //////////////////////////////////////////////////////////////////////////
   14.25 +    // external_impl
   14.26 +    /// INTERNAL ONLY
   14.27 +    ///
   14.28 +    template<typename Accumulator, typename Tag>
   14.29 +    struct external_impl
   14.30 +      : accumulator_base
   14.31 +    {
   14.32 +        typedef typename Accumulator::result_type result_type;
   14.33 +        typedef typename detail::feature_tag<Accumulator>::type feature_tag;
   14.34 +
   14.35 +        external_impl(dont_care) {}
   14.36 +
   14.37 +        template<typename Args>
   14.38 +        result_type result(Args const &args) const
   14.39 +        {
   14.40 +            return this->extract_(args, args[parameter::keyword<Tag>::get() | 0]);
   14.41 +        }
   14.42 +
   14.43 +    private:
   14.44 +
   14.45 +        template<typename Args>
   14.46 +        static result_type extract_(Args const &args, int)
   14.47 +        {
   14.48 +            // No named parameter passed to the extractor. Maybe the external
   14.49 +            // feature is held by reference<>.
   14.50 +            extractor<feature_tag> extract;
   14.51 +            return extract(accumulators::reference_tag<Tag>(args));
   14.52 +        }
   14.53 +
   14.54 +        template<typename Args, typename AccumulatorSet>
   14.55 +        static result_type extract_(Args const &, AccumulatorSet const &acc)
   14.56 +        {
   14.57 +            // OK, a named parameter for this external feature was passed to the
   14.58 +            // extractor, so use that.
   14.59 +            extractor<feature_tag> extract;
   14.60 +            return extract(acc);
   14.61 +        }
   14.62 +    };
   14.63 +
   14.64 +} // namespace impl
   14.65 +
   14.66 +namespace tag
   14.67 +{
   14.68 +    //////////////////////////////////////////////////////////////////////////
   14.69 +    // external
   14.70 +    template<typename Feature, typename Tag, typename AccumulatorSet>
   14.71 +    struct external
   14.72 +      : depends_on<reference<AccumulatorSet, Tag> >
   14.73 +    {
   14.74 +        typedef
   14.75 +            accumulators::impl::external_impl<
   14.76 +                detail::to_accumulator<Feature, mpl::_1, mpl::_2>
   14.77 +              , Tag
   14.78 +            >
   14.79 +        impl;
   14.80 +    };
   14.81 +
   14.82 +    template<typename Feature, typename Tag>
   14.83 +    struct external<Feature, Tag, void>
   14.84 +      : depends_on<>
   14.85 +    {
   14.86 +        typedef
   14.87 +            accumulators::impl::external_impl<
   14.88 +                detail::to_accumulator<Feature, mpl::_1, mpl::_2>
   14.89 +              , Tag
   14.90 +            >
   14.91 +        impl;
   14.92 +    };
   14.93 +}
   14.94 +
   14.95 +// for the purposes of feature-based dependency resolution,
   14.96 +// external_accumulator<Feature, Tag> provides the same feature as Feature
   14.97 +template<typename Feature, typename Tag, typename AccumulatorSet>
   14.98 +struct feature_of<tag::external<Feature, Tag, AccumulatorSet> >
   14.99 +  : feature_of<Feature>
  14.100 +{
  14.101 +};
  14.102 +
  14.103 +// Note: Usually, the extractor is pulled into the accumulators namespace with
  14.104 +// a using directive, not the tag. But the external<> feature doesn't have an
  14.105 +// extractor, so we can put the external tag in the accumulators namespace
  14.106 +// without fear of a name conflict.
  14.107 +using tag::external;
  14.108 +
  14.109 +}} // namespace boost::accumulators
  14.110 +
  14.111 +#endif
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulators/reference_accumulator.hpp	Fri Mar 04 12:48:37 2011 -0800
    15.3 @@ -0,0 +1,89 @@
    15.4 +///////////////////////////////////////////////////////////////////////////////
    15.5 +// reference_accumulator.hpp
    15.6 +//
    15.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    15.8 +//  Software License, Version 1.0. (See accompanying file
    15.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   15.10 +
   15.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006
   15.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006
   15.13 +
   15.14 +#include <boost/ref.hpp>
   15.15 +#include <boost/mpl/always.hpp>
   15.16 +#include <boost/parameter/keyword.hpp>
   15.17 +#include <boost/accumulators/framework/depends_on.hpp> // for feature_tag
   15.18 +#include <boost/accumulators/framework/accumulator_base.hpp>
   15.19 +#include <boost/accumulators/framework/extractor.hpp>
   15.20 +
   15.21 +namespace boost { namespace accumulators
   15.22 +{
   15.23 +
   15.24 +namespace impl
   15.25 +{
   15.26 +    //////////////////////////////////////////////////////////////////////////
   15.27 +    // reference_accumulator_impl
   15.28 +    //
   15.29 +    template<typename Referent, typename Tag>
   15.30 +    struct reference_accumulator_impl
   15.31 +      : accumulator_base
   15.32 +    {
   15.33 +        typedef Referent &result_type;
   15.34 +
   15.35 +        template<typename Args>
   15.36 +        reference_accumulator_impl(Args const &args)
   15.37 +          : ref(args[parameter::keyword<Tag>::get()])
   15.38 +        {
   15.39 +        }
   15.40 +
   15.41 +        result_type result(dont_care) const
   15.42 +        {
   15.43 +            return this->ref;
   15.44 +        }
   15.45 +
   15.46 +    private:
   15.47 +        reference_wrapper<Referent> ref;
   15.48 +    };
   15.49 +} // namespace impl
   15.50 +
   15.51 +namespace tag
   15.52 +{
   15.53 +    //////////////////////////////////////////////////////////////////////////
   15.54 +    // reference_tag
   15.55 +    template<typename Tag>
   15.56 +    struct reference_tag
   15.57 +    {
   15.58 +    };
   15.59 +
   15.60 +    //////////////////////////////////////////////////////////////////////////
   15.61 +    // reference
   15.62 +    template<typename Referent, typename Tag>
   15.63 +    struct reference
   15.64 +      : depends_on<>
   15.65 +    {
   15.66 +        /// INTERNAL ONLY
   15.67 +        ///
   15.68 +        typedef mpl::always<accumulators::impl::reference_accumulator_impl<Referent, Tag> > impl;
   15.69 +    };
   15.70 +}
   15.71 +
   15.72 +namespace extract
   15.73 +{
   15.74 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference, (typename)(typename))
   15.75 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference_tag, (typename))
   15.76 +}
   15.77 +
   15.78 +using extract::reference;
   15.79 +using extract::reference_tag;
   15.80 +
   15.81 +// Map all reference<V,T> features to reference_tag<T> so
   15.82 +// that references can be extracted using reference_tag<T>
   15.83 +// without specifying the referent type.
   15.84 +template<typename ValueType, typename Tag>
   15.85 +struct feature_of<tag::reference<ValueType, Tag> >
   15.86 +  : feature_of<tag::reference_tag<Tag> >
   15.87 +{
   15.88 +};
   15.89 +
   15.90 +}} // namespace boost::accumulators
   15.91 +
   15.92 +#endif
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/boost_1_45_0/boost/accumulators/framework/accumulators/value_accumulator.hpp	Fri Mar 04 12:48:37 2011 -0800
    16.3 @@ -0,0 +1,89 @@
    16.4 +///////////////////////////////////////////////////////////////////////////////
    16.5 +// value_accumulator.hpp
    16.6 +//
    16.7 +//  Copyright 2005 Eric Niebler, Daniel Egloff. Distributed under the Boost
    16.8 +//  Software License, Version 1.0. (See accompanying file
    16.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   16.10 +
   16.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006
   16.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006
   16.13 +
   16.14 +#include <boost/mpl/always.hpp>
   16.15 +#include <boost/parameter/keyword.hpp>
   16.16 +#include <boost/accumulators/framework/depends_on.hpp> // for feature_tag
   16.17 +#include <boost/accumulators/framework/accumulator_base.hpp>
   16.18 +#include <boost/accumulators/framework/extractor.hpp>
   16.19 +
   16.20 +namespace boost { namespace accumulators
   16.21 +{
   16.22 +
   16.23 +namespace impl
   16.24 +{
   16.25 +
   16.26 +    //////////////////////////////////////////////////////////////////////////
   16.27 +    // value_accumulator_impl
   16.28 +    template<typename ValueType, typename Tag>
   16.29 +    struct value_accumulator_impl
   16.30 +      : accumulator_base
   16.31 +    {
   16.32 +        typedef ValueType result_type;
   16.33 +
   16.34 +        template<typename Args>
   16.35 +        value_accumulator_impl(Args const &args)
   16.36 +          : val(args[parameter::keyword<Tag>::get()])
   16.37 +        {
   16.38 +        }
   16.39 +
   16.40 +        result_type result(dont_care) const
   16.41 +        {
   16.42 +            return this->val;
   16.43 +        }
   16.44 +
   16.45 +    private:
   16.46 +        ValueType val;
   16.47 +    };
   16.48 +
   16.49 +} // namespace impl
   16.50 +
   16.51 +namespace tag
   16.52 +{
   16.53 +    //////////////////////////////////////////////////////////////////////////
   16.54 +    // value_tag
   16.55 +    template<typename Tag>
   16.56 +    struct value_tag
   16.57 +    {
   16.58 +    };
   16.59 +
   16.60 +    //////////////////////////////////////////////////////////////////////////
   16.61 +    // value
   16.62 +    template<typename ValueType, typename Tag>
   16.63 +    struct value
   16.64 +      : depends_on<>
   16.65 +    {
   16.66 +        /// INTERNAL ONLY
   16.67 +        ///
   16.68 +        typedef mpl::always<accumulators::impl::value_accumulator_impl<ValueType, Tag> > impl;
   16.69 +    };
   16.70 +}
   16.71 +
   16.72 +namespace extract
   16.73 +{
   16.74 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value, (typename)(typename))
   16.75 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value_tag, (typename))
   16.76 +}
   16.77 +
   16.78 +using extract::value;
   16.79 +using extract::value_tag;
   16.80 +
   16.81 +// Map all value<V,T> features to value_tag<T> so
   16.82 +// that values can be extracted using value_tag<T>
   16.83 +// without specifying the value type.
   16.84 +template<typename ValueType, typename Tag>
   16.85 +struct feature_of<tag::value<ValueType, Tag> >
   16.86 +  : feature_of<tag::value_tag<Tag> >
   16.87 +{
   16.88 +};
   16.89 +
   16.90 +}} // namespace boost::accumulators
   16.91 +
   16.92 +#endif
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/boost_1_45_0/boost/accumulators/framework/depends_on.hpp	Fri Mar 04 12:48:37 2011 -0800
    17.3 @@ -0,0 +1,411 @@
    17.4 +///////////////////////////////////////////////////////////////////////////////
    17.5 +// depends_on.hpp
    17.6 +//
    17.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    17.8 +//  Software License, Version 1.0. (See accompanying file
    17.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   17.10 +
   17.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005
   17.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005
   17.13 +
   17.14 +#include <boost/version.hpp>
   17.15 +#include <boost/mpl/end.hpp>
   17.16 +#include <boost/mpl/map.hpp>
   17.17 +#include <boost/mpl/fold.hpp>
   17.18 +#include <boost/mpl/size.hpp>
   17.19 +#include <boost/mpl/sort.hpp>
   17.20 +#include <boost/mpl/insert.hpp>
   17.21 +#include <boost/mpl/assert.hpp>
   17.22 +#include <boost/mpl/remove.hpp>
   17.23 +#include <boost/mpl/vector.hpp>
   17.24 +#include <boost/mpl/inherit.hpp>
   17.25 +#include <boost/mpl/identity.hpp>
   17.26 +#include <boost/mpl/equal_to.hpp>
   17.27 +#include <boost/mpl/contains.hpp>
   17.28 +#include <boost/mpl/transform.hpp>
   17.29 +#include <boost/mpl/is_sequence.hpp>
   17.30 +#include <boost/mpl/placeholders.hpp>
   17.31 +#include <boost/mpl/insert_range.hpp>
   17.32 +#include <boost/mpl/transform_view.hpp>
   17.33 +#include <boost/mpl/inherit_linearly.hpp>
   17.34 +#include <boost/type_traits/is_base_and_derived.hpp>
   17.35 +#include <boost/preprocessor/repetition/repeat.hpp>
   17.36 +#include <boost/preprocessor/repetition/enum_params.hpp>
   17.37 +#include <boost/preprocessor/facilities/intercept.hpp>
   17.38 +#include <boost/accumulators/accumulators_fwd.hpp>
   17.39 +#include <boost/fusion/include/next.hpp>
   17.40 +#include <boost/fusion/include/equal_to.hpp>
   17.41 +#include <boost/fusion/include/value_of.hpp>
   17.42 +#include <boost/fusion/include/mpl.hpp>
   17.43 +#include <boost/fusion/include/end.hpp>
   17.44 +#include <boost/fusion/include/begin.hpp>
   17.45 +#include <boost/fusion/include/cons.hpp>
   17.46 +
   17.47 +namespace boost { namespace accumulators
   17.48 +{
   17.49 +    ///////////////////////////////////////////////////////////////////////////
   17.50 +    // as_feature
   17.51 +    template<typename Feature>
   17.52 +    struct as_feature
   17.53 +    {
   17.54 +        typedef Feature type;
   17.55 +    };
   17.56 +
   17.57 +    ///////////////////////////////////////////////////////////////////////////
   17.58 +    // weighted_feature
   17.59 +    template<typename Feature>
   17.60 +    struct as_weighted_feature
   17.61 +    {
   17.62 +        typedef Feature type;
   17.63 +    };
   17.64 +
   17.65 +    ///////////////////////////////////////////////////////////////////////////
   17.66 +    // feature_of
   17.67 +    template<typename Feature>
   17.68 +    struct feature_of
   17.69 +    {
   17.70 +        typedef Feature type;
   17.71 +    };
   17.72 +
   17.73 +    namespace detail
   17.74 +    {
   17.75 +        ///////////////////////////////////////////////////////////////////////////
   17.76 +        // feature_tag
   17.77 +        template<typename Accumulator>
   17.78 +        struct feature_tag
   17.79 +        {
   17.80 +            typedef typename Accumulator::feature_tag type;
   17.81 +        };
   17.82 +
   17.83 +        template<typename Feature>
   17.84 +        struct undroppable
   17.85 +        {
   17.86 +            typedef Feature type;
   17.87 +        };
   17.88 +
   17.89 +        template<typename Feature>
   17.90 +        struct undroppable<tag::droppable<Feature> >
   17.91 +        {
   17.92 +            typedef Feature type;
   17.93 +        };
   17.94 +
   17.95 +        // For the purpose of determining whether one feature depends on another,
   17.96 +        // disregard whether the feature is droppable or not.
   17.97 +        template<typename A, typename B>
   17.98 +        struct is_dependent_on
   17.99 +          : is_base_and_derived<
  17.100 +                typename undroppable<B>::type
  17.101 +              , typename undroppable<A>::type
  17.102 +            >
  17.103 +        {};
  17.104 +
  17.105 +        template<typename Features>
  17.106 +        struct depends_on_base
  17.107 +          : mpl::inherit_linearly<
  17.108 +                typename mpl::sort<Features, is_dependent_on<mpl::_1, mpl::_2> >::type
  17.109 +                // Don't inherit multiply from a feature
  17.110 +              , mpl::if_<
  17.111 +                    is_dependent_on<mpl::_1, mpl::_2>
  17.112 +                  , mpl::_1
  17.113 +                  , mpl::inherit<mpl::_1, mpl::_2>
  17.114 +                >
  17.115 +            >::type
  17.116 +        {
  17.117 +        };
  17.118 +    }
  17.119 +
  17.120 +    ///////////////////////////////////////////////////////////////////////////
  17.121 +    /// depends_on
  17.122 +    template<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature)>
  17.123 +    struct depends_on
  17.124 +      : detail::depends_on_base<
  17.125 +            typename mpl::transform<
  17.126 +                mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
  17.127 +              , as_feature<mpl::_1>
  17.128 +            >::type
  17.129 +        >
  17.130 +    {
  17.131 +        typedef mpl::false_ is_weight_accumulator;
  17.132 +        typedef
  17.133 +            typename mpl::transform<
  17.134 +                mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
  17.135 +              , as_feature<mpl::_1>
  17.136 +            >::type
  17.137 +        dependencies;
  17.138 +    };
  17.139 +
  17.140 +    namespace detail
  17.141 +    {
  17.142 +        template<typename Feature>
  17.143 +        struct matches_feature
  17.144 +        {
  17.145 +            template<typename Accumulator>
  17.146 +            struct apply
  17.147 +              : is_same<
  17.148 +                    typename feature_of<typename as_feature<Feature>::type>::type
  17.149 +                  , typename feature_of<typename as_feature<typename feature_tag<Accumulator>::type>::type>::type
  17.150 +                >
  17.151 +            {};
  17.152 +        };
  17.153 +
  17.154 +        template<typename Features, typename Accumulator>
  17.155 +        struct contains_feature_of
  17.156 +        {
  17.157 +            typedef
  17.158 +                mpl::transform_view<Features, feature_of<as_feature<mpl::_> > >
  17.159 +            features_list;
  17.160 +
  17.161 +            typedef
  17.162 +                typename feature_of<typename feature_tag<Accumulator>::type>::type
  17.163 +            the_feature;
  17.164 +
  17.165 +            typedef
  17.166 +                typename mpl::contains<features_list, the_feature>::type
  17.167 +            type;
  17.168 +        };
  17.169 +
  17.170 +        // This is to work around a bug in early versions of Fusion which caused
  17.171 +        // a compile error if contains_feature_of<List, mpl::_> is used as a
  17.172 +        // predicate to fusion::find_if
  17.173 +        template<typename Features>
  17.174 +        struct contains_feature_of_
  17.175 +        {
  17.176 +            template<typename Accumulator>
  17.177 +            struct apply
  17.178 +              : contains_feature_of<Features, Accumulator>
  17.179 +            {};
  17.180 +        };
  17.181 +
  17.182 +        template<
  17.183 +            typename First
  17.184 +          , typename Last
  17.185 +          , bool is_empty = fusion::result_of::equal_to<First, Last>::value
  17.186 +        >
  17.187 +        struct build_acc_list;
  17.188 +
  17.189 +        template<typename First, typename Last>
  17.190 +        struct build_acc_list<First, Last, true>
  17.191 +        {
  17.192 +            typedef fusion::nil type;
  17.193 +
  17.194 +            template<typename Args>
  17.195 +            static fusion::nil
  17.196 +            call(Args const &, First const&, Last const&)
  17.197 +            {
  17.198 +                return fusion::nil();
  17.199 +            }
  17.200 +        };
  17.201 +
  17.202 +        template<typename First, typename Last>
  17.203 +        struct build_acc_list<First, Last, false>
  17.204 +        {
  17.205 +            typedef
  17.206 +                build_acc_list<typename fusion::result_of::next<First>::type, Last>
  17.207 +            next_build_acc_list;
  17.208 +
  17.209 +            typedef fusion::cons<
  17.210 +                typename fusion::result_of::value_of<First>::type
  17.211 +              , typename next_build_acc_list::type>
  17.212 +            type;
  17.213 +
  17.214 +            template<typename Args>
  17.215 +            static type
  17.216 +            call(Args const &args, First const& f, Last const& l)
  17.217 +            {
  17.218 +                return type(args, next_build_acc_list::call(args, fusion::next(f), l));
  17.219 +            }
  17.220 +        };
  17.221 +
  17.222 +        namespace meta
  17.223 +        {
  17.224 +            template<typename Sequence>
  17.225 +            struct make_acc_list
  17.226 +              : build_acc_list<
  17.227 +                    typename fusion::result_of::begin<Sequence>::type
  17.228 +                  , typename fusion::result_of::end<Sequence>::type
  17.229 +                >
  17.230 +            {};
  17.231 +        }
  17.232 +
  17.233 +        template<typename Sequence, typename Args>
  17.234 +        typename meta::make_acc_list<Sequence>::type
  17.235 +        make_acc_list(Sequence const &seq, Args const &args)
  17.236 +        {
  17.237 +            return meta::make_acc_list<Sequence>::call(args, fusion::begin(seq), fusion::end(seq));
  17.238 +        }
  17.239 +
  17.240 +        ///////////////////////////////////////////////////////////////////////////
  17.241 +        // checked_as_weighted_feature
  17.242 +        template<typename Feature>
  17.243 +        struct checked_as_weighted_feature
  17.244 +        {
  17.245 +            typedef typename as_feature<Feature>::type feature_type;
  17.246 +            typedef typename as_weighted_feature<feature_type>::type type;
  17.247 +            // weighted and non-weighted flavors should provide the same feature.
  17.248 +            BOOST_MPL_ASSERT((
  17.249 +                is_same<
  17.250 +                    typename feature_of<feature_type>::type
  17.251 +                  , typename feature_of<type>::type
  17.252 +                >
  17.253 +            ));
  17.254 +        };
  17.255 +
  17.256 +        ///////////////////////////////////////////////////////////////////////////
  17.257 +        // as_feature_list
  17.258 +        template<typename Features, typename Weight>
  17.259 +        struct as_feature_list
  17.260 +          : mpl::transform_view<Features, checked_as_weighted_feature<mpl::_1> >
  17.261 +        {
  17.262 +        };
  17.263 +
  17.264 +        template<typename Features>
  17.265 +        struct as_feature_list<Features, void>
  17.266 +          : mpl::transform_view<Features, as_feature<mpl::_1> >
  17.267 +        {
  17.268 +        };
  17.269 +
  17.270 +        ///////////////////////////////////////////////////////////////////////////
  17.271 +        // accumulator_wrapper
  17.272 +        template<typename Accumulator, typename Feature>
  17.273 +        struct accumulator_wrapper
  17.274 +          : Accumulator
  17.275 +        {
  17.276 +            typedef Feature feature_tag;
  17.277 +
  17.278 +            accumulator_wrapper(accumulator_wrapper const &that)
  17.279 +              : Accumulator(*static_cast<Accumulator const *>(&that))
  17.280 +            {
  17.281 +            }
  17.282 +
  17.283 +            template<typename Args>
  17.284 +            accumulator_wrapper(Args const &args)
  17.285 +              : Accumulator(args)
  17.286 +            {
  17.287 +            }
  17.288 +        };
  17.289 +
  17.290 +        ///////////////////////////////////////////////////////////////////////////
  17.291 +        // to_accumulator
  17.292 +        template<typename Feature, typename Sample, typename Weight>
  17.293 +        struct to_accumulator
  17.294 +        {
  17.295 +            typedef
  17.296 +                accumulator_wrapper<
  17.297 +                    typename mpl::apply2<typename Feature::impl, Sample, Weight>::type
  17.298 +                  , Feature
  17.299 +                >
  17.300 +            type;
  17.301 +        };
  17.302 +
  17.303 +        template<typename Feature, typename Sample, typename Weight, typename Tag, typename AccumulatorSet>
  17.304 +        struct to_accumulator<Feature, Sample, tag::external<Weight, Tag, AccumulatorSet> >
  17.305 +        {
  17.306 +            BOOST_MPL_ASSERT((is_same<Tag, void>));
  17.307 +            BOOST_MPL_ASSERT((is_same<AccumulatorSet, void>));
  17.308 +
  17.309 +            typedef
  17.310 +                accumulator_wrapper<
  17.311 +                    typename mpl::apply2<typename Feature::impl, Sample, Weight>::type
  17.312 +                  , Feature
  17.313 +                >
  17.314 +            accumulator_type;
  17.315 +
  17.316 +            typedef
  17.317 +                typename mpl::if_<
  17.318 +                    typename Feature::is_weight_accumulator
  17.319 +                  , accumulator_wrapper<impl::external_impl<accumulator_type, tag::weights>, Feature>
  17.320 +                  , accumulator_type
  17.321 +                >::type
  17.322 +            type;
  17.323 +        };
  17.324 +
  17.325 +        // BUGBUG work around a MPL bug wrt map insertion
  17.326 +        template<typename FeatureMap, typename Feature>
  17.327 +        struct insert_feature
  17.328 +          : mpl::eval_if<
  17.329 +                mpl::has_key<FeatureMap, typename feature_of<Feature>::type>
  17.330 +              , mpl::identity<FeatureMap>
  17.331 +              , mpl::insert<FeatureMap, mpl::pair<typename feature_of<Feature>::type, Feature> >
  17.332 +            >
  17.333 +        {
  17.334 +        };
  17.335 +
  17.336 +        template<typename FeatureMap, typename Feature, typename Weight>
  17.337 +        struct insert_dependencies
  17.338 +          : mpl::fold<
  17.339 +                as_feature_list<typename Feature::dependencies, Weight>
  17.340 +              , FeatureMap
  17.341 +              , insert_dependencies<
  17.342 +                    insert_feature<mpl::_1, mpl::_2>
  17.343 +                  , mpl::_2
  17.344 +                  , Weight
  17.345 +                >
  17.346 +            >
  17.347 +        {
  17.348 +        };
  17.349 +
  17.350 +        template<typename FeatureMap, typename Features, typename Weight>
  17.351 +        struct insert_sequence
  17.352 +          : mpl::fold< // BUGBUG should use insert_range, but doesn't seem to work for maps
  17.353 +                as_feature_list<Features, Weight>
  17.354 +              , FeatureMap
  17.355 +              , insert_feature<mpl::_1, mpl::_2>
  17.356 +            >
  17.357 +        {
  17.358 +        };
  17.359 +
  17.360 +        template<typename Features, typename Sample, typename Weight>
  17.361 +        struct make_accumulator_tuple
  17.362 +        {
  17.363 +            typedef
  17.364 +                typename mpl::fold<
  17.365 +                    as_feature_list<Features, Weight>
  17.366 +                  , mpl::map0<>
  17.367 +                  , mpl::if_<
  17.368 +                        mpl::is_sequence<mpl::_2>
  17.369 +                      , insert_sequence<mpl::_1, mpl::_2, Weight>
  17.370 +                      , insert_feature<mpl::_1, mpl::_2>
  17.371 +                    >
  17.372 +                >::type
  17.373 +            feature_map;
  17.374 +
  17.375 +            // for each element in the map, add its dependencies also
  17.376 +            typedef
  17.377 +                typename mpl::fold<
  17.378 +                    feature_map
  17.379 +                  , feature_map
  17.380 +                  , insert_dependencies<mpl::_1, mpl::second<mpl::_2>, Weight>
  17.381 +                >::type
  17.382 +            feature_map_with_dependencies;
  17.383 +
  17.384 +            // turn the map into a vector so we can sort it
  17.385 +            typedef
  17.386 +                typename mpl::insert_range<
  17.387 +                    mpl::vector<>
  17.388 +                  , mpl::end<mpl::vector<> >::type
  17.389 +                  , mpl::transform_view<feature_map_with_dependencies, mpl::second<mpl::_1> >
  17.390 +                >::type
  17.391 +            feature_vector_with_dependencies;
  17.392 +
  17.393 +            // sort the features according to which is derived from which
  17.394 +            typedef
  17.395 +                typename mpl::sort<
  17.396 +                    feature_vector_with_dependencies
  17.397 +                  , is_dependent_on<mpl::_2, mpl::_1>
  17.398 +                >::type
  17.399 +            sorted_feature_vector;
  17.400 +
  17.401 +            // From the vector of features, construct a vector of accumulators
  17.402 +            typedef
  17.403 +                typename mpl::transform<
  17.404 +                    sorted_feature_vector
  17.405 +                  , to_accumulator<mpl::_1, Sample, Weight>
  17.406 +                >::type
  17.407 +            type;
  17.408 +        };
  17.409 +
  17.410 +    } // namespace detail
  17.411 +
  17.412 +}} // namespace boost::accumulators
  17.413 +
  17.414 +#endif
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/boost_1_45_0/boost/accumulators/framework/external.hpp	Fri Mar 04 12:48:37 2011 -0800
    18.3 @@ -0,0 +1,27 @@
    18.4 +///////////////////////////////////////////////////////////////////////////////
    18.5 +// external.hpp
    18.6 +//
    18.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    18.8 +//  Software License, Version 1.0. (See accompanying file
    18.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   18.10 +
   18.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_EXTERNAL_HPP_EAN_01_12_2005
   18.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_EXTERNAL_HPP_EAN_01_12_2005
   18.13 +
   18.14 +#include <boost/mpl/apply.hpp>
   18.15 +#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
   18.16 +
   18.17 +//namespace boost { namespace accumulators
   18.18 +//{
   18.19 +//
   18.20 +/////////////////////////////////////////////////////////////////////////////////
   18.21 +//// external
   18.22 +////
   18.23 +//template<typename Type>
   18.24 +//struct external
   18.25 +//{
   18.26 +//};
   18.27 +//
   18.28 +//}} // namespace boost::accumulators
   18.29 +
   18.30 +#endif
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/boost_1_45_0/boost/accumulators/framework/extractor.hpp	Fri Mar 04 12:48:37 2011 -0800
    19.3 @@ -0,0 +1,229 @@
    19.4 +///////////////////////////////////////////////////////////////////////////////
    19.5 +// extractor.hpp
    19.6 +//
    19.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    19.8 +//  Software License, Version 1.0. (See accompanying file
    19.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   19.10 +
   19.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_EXTRACTOR_HPP_EAN_28_10_2005
   19.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_EXTRACTOR_HPP_EAN_28_10_2005
   19.13 +
   19.14 +#include <boost/preprocessor/tuple/rem.hpp>
   19.15 +#include <boost/preprocessor/array/size.hpp>
   19.16 +#include <boost/preprocessor/array/data.hpp>
   19.17 +#include <boost/preprocessor/array/elem.hpp>
   19.18 +#include <boost/preprocessor/seq/to_array.hpp>
   19.19 +#include <boost/preprocessor/seq/transform.hpp>
   19.20 +#include <boost/preprocessor/repetition/enum_params.hpp>
   19.21 +#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
   19.22 +#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
   19.23 +#include <boost/parameter/binding.hpp>
   19.24 +#include <boost/mpl/apply.hpp>
   19.25 +#include <boost/mpl/eval_if.hpp>
   19.26 +#include <boost/type_traits/remove_reference.hpp>
   19.27 +#include <boost/accumulators/accumulators_fwd.hpp>
   19.28 +#include <boost/accumulators/framework/parameters/accumulator.hpp>
   19.29 +
   19.30 +namespace boost { namespace accumulators
   19.31 +{
   19.32 +
   19.33 +namespace detail
   19.34 +{
   19.35 +    template<typename AccumulatorSet, typename Feature>
   19.36 +    struct accumulator_set_result
   19.37 +    {
   19.38 +        typedef typename as_feature<Feature>::type feature_type;
   19.39 +        typedef typename mpl::apply<AccumulatorSet, feature_type>::type::result_type type;
   19.40 +    };
   19.41 +
   19.42 +    template<typename Args, typename Feature>
   19.43 +    struct argument_pack_result
   19.44 +      : accumulator_set_result<
   19.45 +            typename remove_reference<
   19.46 +                typename parameter::binding<Args, tag::accumulator>::type
   19.47 +            >::type
   19.48 +          , Feature
   19.49 +        >
   19.50 +    {
   19.51 +    };
   19.52 +
   19.53 +    template<typename A, typename Feature>
   19.54 +    struct extractor_result
   19.55 +      : mpl::eval_if<
   19.56 +            detail::is_accumulator_set<A>
   19.57 +          , accumulator_set_result<A, Feature>
   19.58 +          , argument_pack_result<A, Feature>
   19.59 +        >
   19.60 +    {
   19.61 +    };
   19.62 +
   19.63 +    template<typename Feature, typename AccumulatorSet>
   19.64 +    typename extractor_result<AccumulatorSet, Feature>::type
   19.65 +    do_extract(AccumulatorSet const &acc, mpl::true_)
   19.66 +    {
   19.67 +        typedef typename as_feature<Feature>::type feature_type;
   19.68 +        return extract_result<feature_type>(acc);
   19.69 +    }
   19.70 +
   19.71 +    template<typename Feature, typename Args>
   19.72 +    typename extractor_result<Args, Feature>::type
   19.73 +    do_extract(Args const &args, mpl::false_)
   19.74 +    {
   19.75 +        typedef typename as_feature<Feature>::type feature_type;
   19.76 +        return find_accumulator<feature_type>(args[accumulator]).result(args);
   19.77 +    }
   19.78 +
   19.79 +} // namespace detail
   19.80 +
   19.81 +
   19.82 +///////////////////////////////////////////////////////////////////////////////
   19.83 +/// Extracts the result associated with Feature from the specified accumulator_set.
   19.84 +template<typename Feature>
   19.85 +struct extractor
   19.86 +{
   19.87 +    typedef extractor<Feature> this_type;
   19.88 +
   19.89 +    /// The result meta-function for determining the return type of the extractor
   19.90 +    template<typename F>
   19.91 +    struct result;
   19.92 +
   19.93 +    template<typename A1>
   19.94 +    struct result<this_type(A1)>
   19.95 +      : detail::extractor_result<A1, Feature>
   19.96 +    {
   19.97 +    };
   19.98 +
   19.99 +    /// Extract the result associated with Feature from the accumulator set
  19.100 +    /// \param acc The accumulator set object from which to extract the result
  19.101 +    template<typename Arg1>
  19.102 +    typename detail::extractor_result<Arg1, Feature>::type
  19.103 +    operator ()(Arg1 const &arg1) const
  19.104 +    {
  19.105 +        // Arg1 could be an accumulator_set or an argument pack containing
  19.106 +        // an accumulator_set. Dispatch accordingly.
  19.107 +        return detail::do_extract<Feature>(arg1, detail::is_accumulator_set<Arg1>());
  19.108 +    }
  19.109 +
  19.110 +    /// \overload
  19.111 +    ///
  19.112 +    /// \param a1 Optional named parameter to be passed to the accumulator's result() function.
  19.113 +    template<typename AccumulatorSet, typename A1>
  19.114 +    typename detail::extractor_result<AccumulatorSet, Feature>::type
  19.115 +    operator ()(AccumulatorSet const &acc, A1 const &a1) const
  19.116 +    {
  19.117 +        BOOST_MPL_ASSERT((detail::is_accumulator_set<AccumulatorSet>));
  19.118 +        typedef typename as_feature<Feature>::type feature_type;
  19.119 +        return extract_result<feature_type>(acc, a1);
  19.120 +    }
  19.121 +
  19.122 +    // ... other overloads generated by Boost.Preprocessor:
  19.123 +
  19.124 +    /// INTERNAL ONLY
  19.125 +    ///
  19.126 +#define BOOST_ACCUMULATORS_EXTRACTOR_FUN_OP(z, n, _)                                    \
  19.127 +    template<BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)>                                  \
  19.128 +    struct result<this_type(BOOST_PP_ENUM_PARAMS_Z(z, n, A))>                           \
  19.129 +      : detail::extractor_result<A1, Feature>                                           \
  19.130 +    {};                                                                                 \
  19.131 +    template<                                                                           \
  19.132 +        typename AccumulatorSet                                                         \
  19.133 +        BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A)                               \
  19.134 +    >                                                                                   \
  19.135 +    typename detail::extractor_result<AccumulatorSet, Feature>::type                    \
  19.136 +    operator ()(                                                                        \
  19.137 +        AccumulatorSet const &acc                                                       \
  19.138 +        BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a)                       \
  19.139 +    ) const                                                                             \
  19.140 +    {                                                                                   \
  19.141 +        BOOST_MPL_ASSERT((detail::is_accumulator_set<AccumulatorSet>));                 \
  19.142 +        typedef typename as_feature<Feature>::type feature_type;                        \
  19.143 +        return extract_result<feature_type>(acc BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a));\
  19.144 +    }
  19.145 +
  19.146 +    BOOST_PP_REPEAT_FROM_TO(
  19.147 +        2
  19.148 +      , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
  19.149 +      , BOOST_ACCUMULATORS_EXTRACTOR_FUN_OP
  19.150 +      , _
  19.151 +    )
  19.152 +
  19.153 +    #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
  19.154 +    /// \overload
  19.155 +    ///
  19.156 +    template<typename AccumulatorSet, typename A1, typename A2, ...>
  19.157 +    typename detail::extractor_result<AccumulatorSet, Feature>::type
  19.158 +    operator ()(AccumulatorSet const &acc, A1 const &a1, A2 const &a2, ...);
  19.159 +    #endif
  19.160 +};
  19.161 +
  19.162 +/// INTERNAL ONLY
  19.163 +///
  19.164 +#define BOOST_ACCUMULATORS_ARRAY_REM(Array)                                                         \
  19.165 +    BOOST_PP_TUPLE_REM_CTOR(BOOST_PP_ARRAY_SIZE(Array), BOOST_PP_ARRAY_DATA(Array))
  19.166 +
  19.167 +/// INTERNAL ONLY
  19.168 +///
  19.169 +#define BOOST_ACCUMULATORS_SEQ_REM(Seq)                                                             \
  19.170 +    BOOST_ACCUMULATORS_ARRAY_REM(BOOST_PP_SEQ_TO_ARRAY(Seq))
  19.171 +
  19.172 +/// INTERNAL ONLY
  19.173 +///
  19.174 +#define BOOST_ACCUMULATORS_ARGS_OP(s, data, elem)                                                   \
  19.175 +    T ## s
  19.176 +
  19.177 +/// INTERNAL ONLY
  19.178 +///
  19.179 +#define BOOST_ACCUMULATORS_PARAMS_OP(s, data, elem)                                                 \
  19.180 +    elem T ## s
  19.181 +
  19.182 +/// INTERNAL ONLY
  19.183 +///
  19.184 +#define BOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq)                                    \
  19.185 +    Tag::Feature<                                                                                   \
  19.186 +        BOOST_ACCUMULATORS_SEQ_REM(                                                                 \
  19.187 +            BOOST_PP_SEQ_TRANSFORM(BOOST_ACCUMULATORS_ARGS_OP, ~, ParamsSeq)                        \
  19.188 +        )                                                                                           \
  19.189 +    >
  19.190 +
  19.191 +/// INTERNAL ONLY
  19.192 +///
  19.193 +#define BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN_IMPL(z, n, Tag, Feature, ParamsSeq)                 \
  19.194 +    template<                                                                                       \
  19.195 +        BOOST_ACCUMULATORS_SEQ_REM(                                                                 \
  19.196 +            BOOST_PP_SEQ_TRANSFORM(BOOST_ACCUMULATORS_PARAMS_OP, ~, ParamsSeq)                      \
  19.197 +        )                                                                                           \
  19.198 +      , typename Arg1                                                                               \
  19.199 +        BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A)                                           \
  19.200 +    >                                                                                               \
  19.201 +    typename boost::accumulators::detail::extractor_result<                                         \
  19.202 +        Arg1                                                                                        \
  19.203 +      , BOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq)                                    \
  19.204 +    >::type                                                                                         \
  19.205 +    Feature(Arg1 const &arg1 BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) )            \
  19.206 +    {                                                                                               \
  19.207 +        typedef BOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) feature_type;              \
  19.208 +        return boost::accumulators::extractor<feature_type>()(                                      \
  19.209 +            arg1 BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a));                                         \
  19.210 +    }
  19.211 +
  19.212 +/// INTERNAL ONLY
  19.213 +///
  19.214 +#define BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN(z, n, _)                                            \
  19.215 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN_IMPL(                                                   \
  19.216 +        z                                                                                           \
  19.217 +      , n                                                                                           \
  19.218 +      , BOOST_PP_ARRAY_ELEM(0, _)                                                                   \
  19.219 +      , BOOST_PP_ARRAY_ELEM(1, _)                                                                   \
  19.220 +      , BOOST_PP_ARRAY_ELEM(2, _)                                                                   \
  19.221 +    )
  19.222 +
  19.223 +#define BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(Tag, Feature, ParamSeq)                                 \
  19.224 +    BOOST_PP_REPEAT(                                                                                \
  19.225 +        BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)                                                   \
  19.226 +      , BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN                                                     \
  19.227 +      , (3, (Tag, Feature, ParamSeq))                                                               \
  19.228 +    )
  19.229 +
  19.230 +}} // namespace boost::accumulators
  19.231 +
  19.232 +#endif
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/boost_1_45_0/boost/accumulators/framework/features.hpp	Fri Mar 04 12:48:37 2011 -0800
    20.3 @@ -0,0 +1,29 @@
    20.4 +///////////////////////////////////////////////////////////////////////////////
    20.5 +// features.hpp
    20.6 +//
    20.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    20.8 +//  Software License, Version 1.0. (See accompanying file
    20.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   20.10 +
   20.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_STATS_HPP_EAN_08_12_2005
   20.12 +#define BOOST_ACCUMULATORS_STATISTICS_STATS_HPP_EAN_08_12_2005
   20.13 +
   20.14 +#include <boost/preprocessor/repetition/enum_params.hpp>
   20.15 +#include <boost/mpl/vector.hpp>
   20.16 +#include <boost/accumulators/accumulators_fwd.hpp>
   20.17 +
   20.18 +namespace boost { namespace accumulators
   20.19 +{
   20.20 +
   20.21 +///////////////////////////////////////////////////////////////////////////////
   20.22 +// features
   20.23 +//
   20.24 +template<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature)>
   20.25 +struct features
   20.26 +  : mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
   20.27 +{
   20.28 +};
   20.29 +
   20.30 +}} // namespace boost::accumulators
   20.31 +
   20.32 +#endif
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/boost_1_45_0/boost/accumulators/framework/parameters/accumulator.hpp	Fri Mar 04 12:48:37 2011 -0800
    21.3 @@ -0,0 +1,20 @@
    21.4 +///////////////////////////////////////////////////////////////////////////////
    21.5 +// accumulator.hpp
    21.6 +//
    21.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    21.8 +//  Software License, Version 1.0. (See accompanying file
    21.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   21.10 +
   21.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005
   21.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005
   21.13 +
   21.14 +#include <boost/parameter/keyword.hpp>
   21.15 +
   21.16 +namespace boost { namespace accumulators
   21.17 +{
   21.18 +
   21.19 +BOOST_PARAMETER_KEYWORD(tag, accumulator)
   21.20 +
   21.21 +}} // namespace boost::accumulators
   21.22 +
   21.23 +#endif
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/boost_1_45_0/boost/accumulators/framework/parameters/sample.hpp	Fri Mar 04 12:48:37 2011 -0800
    22.3 @@ -0,0 +1,20 @@
    22.4 +///////////////////////////////////////////////////////////////////////////////
    22.5 +// sample.hpp
    22.6 +//
    22.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    22.8 +//  Software License, Version 1.0. (See accompanying file
    22.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   22.10 +
   22.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005
   22.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005
   22.13 +
   22.14 +#include <boost/parameter/keyword.hpp>
   22.15 +
   22.16 +namespace boost { namespace accumulators
   22.17 +{
   22.18 +
   22.19 +BOOST_PARAMETER_KEYWORD(tag, sample)
   22.20 +
   22.21 +}} // namespace boost::accumulators
   22.22 +
   22.23 +#endif
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/boost_1_45_0/boost/accumulators/framework/parameters/weight.hpp	Fri Mar 04 12:48:37 2011 -0800
    23.3 @@ -0,0 +1,21 @@
    23.4 +///////////////////////////////////////////////////////////////////////////////
    23.5 +// weight.hpp
    23.6 +//
    23.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    23.8 +//  Software License, Version 1.0. (See accompanying file
    23.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   23.10 +
   23.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005
   23.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005
   23.13 +
   23.14 +#include <boost/parameter/keyword.hpp>
   23.15 +
   23.16 +namespace boost { namespace accumulators
   23.17 +{
   23.18 +
   23.19 +// The weight of a single sample
   23.20 +BOOST_PARAMETER_KEYWORD(tag, weight)
   23.21 +
   23.22 +}} // namespace boost::accumulators
   23.23 +
   23.24 +#endif
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/boost_1_45_0/boost/accumulators/framework/parameters/weights.hpp	Fri Mar 04 12:48:37 2011 -0800
    24.3 @@ -0,0 +1,21 @@
    24.4 +///////////////////////////////////////////////////////////////////////////////
    24.5 +// weights.hpp
    24.6 +//
    24.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    24.8 +//  Software License, Version 1.0. (See accompanying file
    24.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   24.10 +
   24.11 +#ifndef BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005
   24.12 +#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005
   24.13 +
   24.14 +#include <boost/parameter/keyword.hpp>
   24.15 +
   24.16 +namespace boost { namespace accumulators
   24.17 +{
   24.18 +
   24.19 +// The weight accumulator
   24.20 +BOOST_PARAMETER_KEYWORD(tag, weights)
   24.21 +
   24.22 +}} // namespace boost::accumulators
   24.23 +
   24.24 +#endif
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/boost_1_45_0/boost/accumulators/numeric/detail/function1.hpp	Fri Mar 04 12:48:37 2011 -0800
    25.3 @@ -0,0 +1,75 @@
    25.4 +// Copyright David Abrahams 2006. Distributed under the Boost
    25.5 +// Software License, Version 1.0. (See accompanying
    25.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    25.7 +#ifndef BOOST_DETAIL_FUNCTION1_DWA200655_HPP
    25.8 +# define BOOST_DETAIL_FUNCTION1_DWA200655_HPP
    25.9 +
   25.10 +# include <boost/concept_check.hpp>
   25.11 +# include <boost/type_traits/remove_reference.hpp>
   25.12 +# include <boost/type_traits/add_const.hpp>
   25.13 +# include <boost/mpl/apply.hpp>
   25.14 +
   25.15 +namespace boost { namespace detail {
   25.16 +
   25.17 +// A utility for creating unary function objects that play nicely with
   25.18 +// boost::result_of and that handle the forwarding problem.
   25.19 +//
   25.20 +// mpl::apply<F, A0>::type is expected to be a stateless function
   25.21 +// object that accepts an argument of type A0&.  It is also expected
   25.22 +// to have a nested ::result_type identical to its return type.
   25.23 +template<typename F>
   25.24 +struct function1
   25.25 +{
   25.26 +    template<typename Signature>
   25.27 +    struct result
   25.28 +    {};
   25.29 +
   25.30 +    template<typename This, typename A0>
   25.31 +    struct result<This(A0)>
   25.32 +    {
   25.33 +        // How adding const to arguments handles rvalues.
   25.34 +        //
   25.35 +        // if A0 is     arg0 is       represents actual argument
   25.36 +        // --------     -------       --------------------------
   25.37 +        // T const &    T const       const T lvalue
   25.38 +        // T &          T             non-const T lvalue
   25.39 +        // T const      T const       const T rvalue
   25.40 +        // T            T const       non-const T rvalue
   25.41 +        typedef typename remove_reference<
   25.42 +            typename add_const< A0 >::type
   25.43 +        >::type arg0;
   25.44 +
   25.45 +        typedef typename mpl::apply1<F, arg0>::type impl;
   25.46 +        typedef typename impl::result_type type;
   25.47 +    };
   25.48 +
   25.49 +    // Handles mutable lvalues
   25.50 +    template<typename A0>
   25.51 +    typename result<function1(A0 &)>::type
   25.52 +    operator ()(A0 &a0) const
   25.53 +    {
   25.54 +        typedef typename result<function1(A0 &)>::impl impl;
   25.55 +        typedef typename result<function1(A0 &)>::type type;
   25.56 +        typedef A0 &arg0;
   25.57 +        BOOST_CONCEPT_ASSERT((UnaryFunction<impl, type, arg0>));
   25.58 +        //boost::function_requires<UnaryFunctionConcept<impl, type, arg0> >();
   25.59 +        return impl()(a0);
   25.60 +    }
   25.61 +
   25.62 +    // Handles const lvalues and all rvalues
   25.63 +    template<typename A0>
   25.64 +    typename result<function1(A0 const &)>::type
   25.65 +    operator ()(A0 const &a0) const
   25.66 +    {
   25.67 +        typedef typename result<function1(A0 const &)>::impl impl;
   25.68 +        typedef typename result<function1(A0 const &)>::type type;
   25.69 +        typedef A0 const &arg0;
   25.70 +        BOOST_CONCEPT_ASSERT((UnaryFunction<impl, type, arg0>));
   25.71 +        //boost::function_requires<UnaryFunctionConcept<impl, type, arg0> >();
   25.72 +        return impl()(a0);
   25.73 +    }
   25.74 +};
   25.75 +
   25.76 +}} // namespace boost::detail
   25.77 +
   25.78 +#endif // BOOST_DETAIL_FUNCTION1_DWA200655_HPP
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/boost_1_45_0/boost/accumulators/numeric/detail/function2.hpp	Fri Mar 04 12:48:37 2011 -0800
    26.3 @@ -0,0 +1,10 @@
    26.4 +// Copyright David Abrahams 2006. Distributed under the Boost
    26.5 +// Software License, Version 1.0. (See accompanying
    26.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    26.7 +#ifndef BOOST_DETAIL_FUNCTION2_DWA200655_HPP
    26.8 +# define BOOST_DETAIL_FUNCTION2_DWA200655_HPP
    26.9 +
   26.10 +# define args (2)
   26.11 +# include <boost/accumulators/numeric/detail/function_n.hpp>
   26.12 +
   26.13 +#endif // BOOST_DETAIL_FUNCTION2_DWA200655_HPP
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/boost_1_45_0/boost/accumulators/numeric/detail/function3.hpp	Fri Mar 04 12:48:37 2011 -0800
    27.3 @@ -0,0 +1,10 @@
    27.4 +// Copyright David Abrahams 2006. Distributed under the Boost
    27.5 +// Software License, Version 1.0. (See accompanying
    27.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    27.7 +#ifndef BOOST_DETAIL_FUNCTION3_DWA2006514_HPP
    27.8 +# define BOOST_DETAIL_FUNCTION3_DWA2006514_HPP
    27.9 +
   27.10 +# define args (3)
   27.11 +# include <boost/accumulators/numeric/detail/function_n.hpp>
   27.12 +
   27.13 +#endif // BOOST_DETAIL_FUNCTION3_DWA2006514_HPP
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/boost_1_45_0/boost/accumulators/numeric/detail/function4.hpp	Fri Mar 04 12:48:37 2011 -0800
    28.3 @@ -0,0 +1,10 @@
    28.4 +// Copyright David Abrahams 2006. Distributed under the Boost
    28.5 +// Software License, Version 1.0. (See accompanying
    28.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    28.7 +#ifndef BOOST_DETAIL_FUNCTION4_DWA2006514_HPP
    28.8 +# define BOOST_DETAIL_FUNCTION4_DWA2006514_HPP
    28.9 +
   28.10 +# define args (4)
   28.11 +# include <boost/accumulators/numeric/detail/function_n.hpp>
   28.12 +
   28.13 +#endif // BOOST_DETAIL_FUNCTION4_DWA2006514_HPP
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/boost_1_45_0/boost/accumulators/numeric/detail/function_n.hpp	Fri Mar 04 12:48:37 2011 -0800
    29.3 @@ -0,0 +1,148 @@
    29.4 +// Copyright David Abrahams 2006. Distributed under the Boost
    29.5 +// Software License, Version 1.0. (See accompanying
    29.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    29.7 +//
    29.8 +// #include guards intentionally disabled.
    29.9 +// #ifndef BOOST_DETAIL_FUNCTION_N_DWA2006514_HPP
   29.10 +// # define BOOST_DETAIL_FUNCTION_N_DWA2006514_HPP
   29.11 +
   29.12 +#include <boost/mpl/void.hpp>
   29.13 +#include <boost/mpl/apply.hpp>
   29.14 +
   29.15 +#include <boost/preprocessor/control/if.hpp>
   29.16 +#include <boost/preprocessor/cat.hpp>
   29.17 +#include <boost/preprocessor/punctuation/comma_if.hpp>
   29.18 +#include <boost/preprocessor/repetition/enum_params.hpp>
   29.19 +#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
   29.20 +#include <boost/preprocessor/repetition/repeat.hpp>
   29.21 +#include <boost/preprocessor/seq/fold_left.hpp>
   29.22 +#include <boost/preprocessor/seq/seq.hpp>
   29.23 +#include <boost/preprocessor/seq/for_each.hpp>
   29.24 +#include <boost/preprocessor/seq/for_each_i.hpp>
   29.25 +#include <boost/preprocessor/seq/for_each_product.hpp>
   29.26 +#include <boost/preprocessor/seq/size.hpp>
   29.27 +#include <boost/type_traits/add_const.hpp>
   29.28 +#include <boost/type_traits/remove_reference.hpp>
   29.29 +
   29.30 +namespace boost { namespace detail {
   29.31 +
   29.32 +# define BOOST_DETAIL_default_arg(z, n, _)                                      \
   29.33 +    typedef mpl::void_ BOOST_PP_CAT(arg, n);
   29.34 +
   29.35 +# define BOOST_DETAIL_function_arg(z, n, _)                                     \
   29.36 +    typedef typename remove_reference<                                          \
   29.37 +        typename add_const< BOOST_PP_CAT(A, n) >::type                          \
   29.38 +    >::type BOOST_PP_CAT(arg, n);
   29.39 +
   29.40 +#define BOOST_DETAIL_cat_arg_counts(s, state, n)                                \
   29.41 +    BOOST_PP_IF(                                                                \
   29.42 +        n                                                                       \
   29.43 +      , BOOST_PP_CAT(state, BOOST_PP_CAT(_, n))                                 \
   29.44 +      , state                                                                   \
   29.45 +    )                                                                           \
   29.46 +    /**/
   29.47 +
   29.48 +#define function_name                                                           \
   29.49 +    BOOST_PP_SEQ_FOLD_LEFT(                                                     \
   29.50 +        BOOST_DETAIL_cat_arg_counts                                             \
   29.51 +      , BOOST_PP_CAT(function, BOOST_PP_SEQ_HEAD(args))                         \
   29.52 +      , BOOST_PP_SEQ_TAIL(args)(0)                                              \
   29.53 +    )                                                                           \
   29.54 +    /**/
   29.55 +
   29.56 +template<typename F>
   29.57 +struct function_name
   29.58 +{
   29.59 +    BOOST_PP_REPEAT(
   29.60 +        BOOST_MPL_LIMIT_METAFUNCTION_ARITY
   29.61 +      , BOOST_DETAIL_default_arg
   29.62 +      , ~
   29.63 +    )
   29.64 +
   29.65 +    template<typename Signature>
   29.66 +    struct result {};
   29.67 +
   29.68 +#define BOOST_DETAIL_function_result(r, _, n)                                   \
   29.69 +    template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(n, typename A)>        \
   29.70 +    struct result<This(BOOST_PP_ENUM_PARAMS(n, A))>                             \
   29.71 +    {                                                                           \
   29.72 +        BOOST_PP_REPEAT(n, BOOST_DETAIL_function_arg, ~)                        \
   29.73 +        typedef                                                                 \
   29.74 +            typename BOOST_PP_CAT(mpl::apply, BOOST_MPL_LIMIT_METAFUNCTION_ARITY)<\
   29.75 +                F                                                               \
   29.76 +                BOOST_PP_ENUM_TRAILING_PARAMS(                                  \
   29.77 +                    BOOST_MPL_LIMIT_METAFUNCTION_ARITY                          \
   29.78 +                  , arg                                                         \
   29.79 +                )                                                               \
   29.80 +            >::type                                                             \
   29.81 +        impl;                                                                   \
   29.82 +        typedef typename impl::result_type type;                                \
   29.83 +    };                                                                          \
   29.84 +    /**/
   29.85 +
   29.86 +    BOOST_PP_SEQ_FOR_EACH(BOOST_DETAIL_function_result, _, args)
   29.87 +
   29.88 +# define arg_type(r, _, i, is_const)                                            \
   29.89 +    BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(A, i) BOOST_PP_CAT(const_if, is_const) &
   29.90 +
   29.91 +# define result_(r, n, constness)                                               \
   29.92 +    typename result<                                                            \
   29.93 +        function_name(                                                          \
   29.94 +            BOOST_PP_SEQ_FOR_EACH_I_R(r, arg_type, ~, constness)                \
   29.95 +        )                                                                       \
   29.96 +    >                                                                           \
   29.97 +    /**/
   29.98 +
   29.99 +# define param(r, _, i, is_const) BOOST_PP_COMMA_IF(i)                          \
  29.100 +    BOOST_PP_CAT(A, i) BOOST_PP_CAT(const_if, is_const) & BOOST_PP_CAT(x, i)
  29.101 +
  29.102 +# define param_list(r, n, constness)                                            \
  29.103 +    BOOST_PP_SEQ_FOR_EACH_I_R(r, param, ~, constness)
  29.104 +
  29.105 +# define call_operator(r, constness)                                            \
  29.106 +    template<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(constness), typename A)>    \
  29.107 +        result_(r, BOOST_PP_SEQ_SIZE(constness), constness)::type               \
  29.108 +    operator ()( param_list(r, BOOST_PP_SEQ_SIZE(constness), constness) ) const \
  29.109 +    {                                                                           \
  29.110 +        typedef result_(r, BOOST_PP_SEQ_SIZE(constness), constness)::impl impl; \
  29.111 +        return impl()(BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(constness), x));   \
  29.112 +    }                                                                           \
  29.113 +    /**/
  29.114 +
  29.115 +# define const_if0
  29.116 +# define const_if1 const
  29.117 +
  29.118 +# define bits(z, n, _) ((0)(1))
  29.119 +
  29.120 +# define gen_operator(r, _, n)                                                  \
  29.121 +    BOOST_PP_SEQ_FOR_EACH_PRODUCT_R(                                            \
  29.122 +        r                                                                       \
  29.123 +      , call_operator                                                           \
  29.124 +      , BOOST_PP_REPEAT(n, bits, ~)                                             \
  29.125 +    )                                                                           \
  29.126 +    /**/
  29.127 +
  29.128 +    BOOST_PP_SEQ_FOR_EACH(
  29.129 +        gen_operator
  29.130 +      , ~
  29.131 +      , args
  29.132 +    )
  29.133 +
  29.134 +# undef bits
  29.135 +# undef const_if1
  29.136 +# undef const_if0
  29.137 +# undef call_operator
  29.138 +# undef param_list
  29.139 +# undef param
  29.140 +# undef result_
  29.141 +# undef default_
  29.142 +# undef arg_type
  29.143 +# undef gen_operator
  29.144 +# undef function_name
  29.145 +
  29.146 +# undef args
  29.147 +};
  29.148 +
  29.149 +}} // namespace boost::detail
  29.150 +
  29.151 +//#endif // BOOST_DETAIL_FUNCTION_N_DWA2006514_HPP
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/boost_1_45_0/boost/accumulators/numeric/detail/pod_singleton.hpp	Fri Mar 04 12:48:37 2011 -0800
    30.3 @@ -0,0 +1,20 @@
    30.4 +// Copyright David Abrahams 2006. Distributed under the Boost
    30.5 +// Software License, Version 1.0. (See accompanying
    30.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    30.7 +#ifndef BOOST_DETAIL_POD_SINGLETON_DWA200655_HPP
    30.8 +# define BOOST_DETAIL_POD_SINGLETON_DWA200655_HPP
    30.9 +
   30.10 +namespace boost { namespace detail {
   30.11 +
   30.12 +template<typename T>
   30.13 +struct pod_singleton
   30.14 +{
   30.15 +    static T instance;
   30.16 +};
   30.17 +
   30.18 +template<typename T>
   30.19 +T pod_singleton<T>::instance;
   30.20 +
   30.21 +}} // namespace boost::detail
   30.22 +
   30.23 +#endif // BOOST_DETAIL_POD_SINGLETON_DWA200655_HPP
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/boost_1_45_0/boost/accumulators/numeric/functional.hpp	Fri Mar 04 12:48:37 2011 -0800
    31.3 @@ -0,0 +1,490 @@
    31.4 +///////////////////////////////////////////////////////////////////////////////
    31.5 +/// \file functional.hpp
    31.6 +///
    31.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    31.8 +//  Software License, Version 1.0. (See accompanying file
    31.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   31.10 +
   31.11 +#ifndef BOOST_NUMERIC_FUNCTIONAL_HPP_EAN_08_12_2005
   31.12 +#define BOOST_NUMERIC_FUNCTIONAL_HPP_EAN_08_12_2005
   31.13 +
   31.14 +#include <limits>
   31.15 +#include <functional>
   31.16 +#include <boost/mpl/if.hpp>
   31.17 +#include <boost/mpl/and.hpp>
   31.18 +#include <boost/type_traits/remove_const.hpp>
   31.19 +#include <boost/type_traits/add_reference.hpp>
   31.20 +#include <boost/type_traits/is_empty.hpp>
   31.21 +#include <boost/type_traits/is_integral.hpp>
   31.22 +#include <boost/type_traits/is_floating_point.hpp>
   31.23 +#include <boost/utility/enable_if.hpp>
   31.24 +#include <boost/typeof/typeof.hpp>
   31.25 +#include <boost/accumulators/numeric/functional_fwd.hpp>
   31.26 +#include <boost/accumulators/numeric/detail/function1.hpp>
   31.27 +#include <boost/accumulators/numeric/detail/function2.hpp>
   31.28 +#include <boost/accumulators/numeric/detail/pod_singleton.hpp>
   31.29 +
   31.30 +#ifdef BOOST_NUMERIC_FUNCTIONAL_STD_VECTOR_SUPPORT
   31.31 +# include <boost/accumulators/numeric/functional/vector.hpp>
   31.32 +#endif
   31.33 +
   31.34 +#ifdef BOOST_NUMERIC_FUNCTIONAL_STD_VALARRAY_SUPPORT
   31.35 +# include <boost/accumulators/numeric/functional/valarray.hpp>
   31.36 +#endif
   31.37 +
   31.38 +#ifdef BOOST_NUMERIC_FUNCTIONAL_STD_COMPLEX_SUPPORT
   31.39 +# include <boost/accumulators/numeric/functional/complex.hpp>
   31.40 +#endif
   31.41 +
   31.42 +/// INTERNAL ONLY
   31.43 +///
   31.44 +#define BOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED
   31.45 +
   31.46 +#ifdef BOOST_NUMERIC_FUNCTIONAL_DOXYGEN_INVOKED
   31.47 +// Hack to make Doxygen show the inheritance relationships
   31.48 +/// INTERNAL ONLY
   31.49 +///
   31.50 +namespace std
   31.51 +{
   31.52 +    /// INTERNAL ONLY
   31.53 +    ///
   31.54 +    template<class Arg, class Ret> struct unary_function {};
   31.55 +    /// INTERNAL ONLY
   31.56 +    ///
   31.57 +    template<class Left, class Right, class Ret> struct binary_function {};
   31.58 +}
   31.59 +#endif
   31.60 +
   31.61 +namespace boost { namespace numeric
   31.62 +{
   31.63 +    namespace functional
   31.64 +    {
   31.65 +        /// INTERNAL ONLY
   31.66 +        ///
   31.67 +        template<typename A0, typename A1>
   31.68 +        struct are_integral
   31.69 +          : mpl::and_<is_integral<A0>, is_integral<A1> >
   31.70 +        {};
   31.71 +
   31.72 +        template<typename Left, typename Right>
   31.73 +        struct left_ref
   31.74 +        {
   31.75 +            typedef Left &type;
   31.76 +        };
   31.77 +
   31.78 +        namespace detail
   31.79 +        {
   31.80 +            template<typename T>
   31.81 +            T &lvalue_of();
   31.82 +        }
   31.83 +    }
   31.84 +
   31.85 +    // TODO: handle complex weight, valarray, MTL vectors
   31.86 +
   31.87 +    /// INTERNAL ONLY
   31.88 +    ///
   31.89 +#define BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(Name, Op)                                      \
   31.90 +    namespace functional                                                                        \
   31.91 +    {                                                                                           \
   31.92 +        template<typename Arg>                                                                  \
   31.93 +        struct result_of_ ## Name                                                               \
   31.94 +        {                                                                                       \
   31.95 +            BOOST_TYPEOF_NESTED_TYPEDEF_TPL(                                                    \
   31.96 +                nested                                                                          \
   31.97 +              , Op boost::numeric::functional::detail::lvalue_of<Arg>()                         \
   31.98 +            )                                                                                   \
   31.99 +            typedef typename nested::type type;                                                 \
  31.100 +        };                                                                                      \
  31.101 +        template<typename Arg, typename EnableIf>                                               \
  31.102 +        struct Name ## _base                                                                    \
  31.103 +          : std::unary_function<                                                                \
  31.104 +                typename remove_const<Arg>::type                                                \
  31.105 +              , typename result_of_ ## Name<Arg>::type                                          \
  31.106 +            >                                                                                   \
  31.107 +        {                                                                                       \
  31.108 +            typename result_of_ ## Name<Arg>::type operator ()(Arg &arg) const                  \
  31.109 +            {                                                                                   \
  31.110 +                return Op arg;                                                                  \
  31.111 +            }                                                                                   \
  31.112 +        };                                                                                      \
  31.113 +        template<typename Arg, typename ArgTag>                                                 \
  31.114 +        struct Name                                                                             \
  31.115 +          : Name ## _base<Arg, void>                                                            \
  31.116 +        {};                                                                                     \
  31.117 +    }                                                                                           \
  31.118 +    namespace op                                                                                \
  31.119 +    {                                                                                           \
  31.120 +        struct Name                                                                             \
  31.121 +          : boost::detail::function1<functional::Name<_, functional::tag<_> > >                 \
  31.122 +        {};                                                                                     \
  31.123 +    }                                                                                           \
  31.124 +    namespace                                                                                   \
  31.125 +    {                                                                                           \
  31.126 +        op::Name const &Name = boost::detail::pod_singleton<op::Name>::instance;                \
  31.127 +    }                                                                                           \
  31.128 +    /**/
  31.129 +
  31.130 +    /// INTERNAL ONLY
  31.131 +    ///
  31.132 +#define BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(Name, Op, RetType)                            \
  31.133 +    namespace functional                                                                        \
  31.134 +    {                                                                                           \
  31.135 +        template<typename Left, typename Right, typename EnableIf>                              \
  31.136 +        struct result_of_ ## Name                                                               \
  31.137 +        {                                                                                       \
  31.138 +            RetType(Left, Op, Right)                                                            \
  31.139 +        };                                                                                      \
  31.140 +        template<typename Left, typename Right, typename EnableIf>                              \
  31.141 +        struct Name ## _base                                                                    \
  31.142 +          : std::binary_function<                                                               \
  31.143 +                typename remove_const<Left>::type                                               \
  31.144 +              , typename remove_const<Right>::type                                              \
  31.145 +              , typename result_of_ ## Name<Left, Right>::type                                  \
  31.146 +            >                                                                                   \
  31.147 +        {                                                                                       \
  31.148 +            typename result_of_ ## Name<Left, Right>::type                                      \
  31.149 +            operator ()(Left &left, Right &right) const                                         \
  31.150 +            {                                                                                   \
  31.151 +                return left Op right;                                                           \
  31.152 +            }                                                                                   \
  31.153 +        };                                                                                      \
  31.154 +        template<typename Left, typename Right, typename LeftTag, typename RightTag>            \
  31.155 +        struct Name                                                                             \
  31.156 +          : Name ## _base<Left, Right, void>                                                    \
  31.157 +        {};                                                                                     \
  31.158 +    }                                                                                           \
  31.159 +    namespace op                                                                                \
  31.160 +    {                                                                                           \
  31.161 +        struct Name                                                                             \
  31.162 +          : boost::detail::function2<                                                           \
  31.163 +                functional::Name<_1, _2, functional::tag<_1>, functional::tag<_2> >             \
  31.164 +            >                                                                                   \
  31.165 +        {};                                                                                     \
  31.166 +    }                                                                                           \
  31.167 +    namespace                                                                                   \
  31.168 +    {                                                                                           \
  31.169 +        op::Name const &Name = boost::detail::pod_singleton<op::Name>::instance;                \
  31.170 +    }                                                                                           \
  31.171 +    /**/
  31.172 +
  31.173 +    /// INTERNAL ONLY
  31.174 +    ///
  31.175 +#define BOOST_NUMERIC_FUNCTIONAL_DEDUCED(Left, Op, Right)                                       \
  31.176 +    BOOST_TYPEOF_NESTED_TYPEDEF_TPL(                                                            \
  31.177 +        nested                                                                                  \
  31.178 +      , boost::numeric::functional::detail::lvalue_of<Left>() Op                                \
  31.179 +        boost::numeric::functional::detail::lvalue_of<Right>()                                  \
  31.180 +    )                                                                                           \
  31.181 +    typedef typename nested::type type;                                                         \
  31.182 +    /**/
  31.183 +
  31.184 +    /// INTERNAL ONLY
  31.185 +    ///
  31.186 +#define BOOST_NUMERIC_FUNCTIONAL_LEFT(Left, Op, Right)                                          \
  31.187 +    typedef Left &type;                                                                         \
  31.188 +    /**/
  31.189 +
  31.190 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(plus, +, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.191 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(minus, -, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.192 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(multiplies, *, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.193 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(divides, /, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.194 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(modulus, %, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.195 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(greater, >, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.196 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(greater_equal, >=, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.197 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(less, <, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.198 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(less_equal, <=, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.199 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(equal_to, ==, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.200 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(not_equal_to, !=, BOOST_NUMERIC_FUNCTIONAL_DEDUCED)
  31.201 +
  31.202 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(assign, =, BOOST_NUMERIC_FUNCTIONAL_LEFT)
  31.203 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(plus_assign, +=, BOOST_NUMERIC_FUNCTIONAL_LEFT)
  31.204 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(minus_assign, -=, BOOST_NUMERIC_FUNCTIONAL_LEFT)
  31.205 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(multiplies_assign, *=, BOOST_NUMERIC_FUNCTIONAL_LEFT)
  31.206 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(divides_assign, /=, BOOST_NUMERIC_FUNCTIONAL_LEFT)
  31.207 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(modulus_assign, %=, BOOST_NUMERIC_FUNCTIONAL_LEFT)
  31.208 +
  31.209 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(unary_plus, +)
  31.210 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(unary_minus, -)
  31.211 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(complement, ~)
  31.212 +    BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(logical_not, !)
  31.213 +
  31.214 +#undef BOOST_NUMERIC_FUNCTIONAL_LEFT
  31.215 +#undef BOOST_NUMERIC_FUNCTIONAL_DEDUCED
  31.216 +#undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP
  31.217 +#undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP
  31.218 +
  31.219 +    namespace functional
  31.220 +    {
  31.221 +        template<typename Left, typename Right, typename EnableIf>
  31.222 +        struct min_assign_base
  31.223 +          : std::binary_function<Left, Right, void>
  31.224 +        {
  31.225 +            void operator ()(Left &left, Right &right) const
  31.226 +            {
  31.227 +                if(numeric::less(right, left))
  31.228 +                {
  31.229 +                    left = right;
  31.230 +                }
  31.231 +            }
  31.232 +        };
  31.233 +
  31.234 +        template<typename Left, typename Right, typename EnableIf>
  31.235 +        struct max_assign_base
  31.236 +          : std::binary_function<Left, Right, void>
  31.237 +        {
  31.238 +            void operator ()(Left &left, Right &right) const
  31.239 +            {
  31.240 +                if(numeric::greater(right, left))
  31.241 +                {
  31.242 +                    left = right;
  31.243 +                }
  31.244 +            }
  31.245 +        };
  31.246 +
  31.247 +        template<typename Left, typename Right, typename EnableIf>
  31.248 +        struct average_base
  31.249 +          : functional::divides<Left, Right>
  31.250 +        {};
  31.251 +
  31.252 +        // partial specialization that promotes the arguments to double for
  31.253 +        // integral division.
  31.254 +        template<typename Left, typename Right>
  31.255 +        struct average_base<Left, Right, typename enable_if<are_integral<Left, Right> >::type>
  31.256 +          : functional::divides<double const, double const>
  31.257 +        {};
  31.258 +
  31.259 +        template<typename To, typename From, typename EnableIf>
  31.260 +        struct promote_base
  31.261 +          : std::unary_function<From, To>
  31.262 +        {
  31.263 +            To operator ()(From &from) const
  31.264 +            {
  31.265 +                return from;
  31.266 +            }
  31.267 +        };
  31.268 +
  31.269 +        template<typename ToFrom>
  31.270 +        struct promote_base<ToFrom, ToFrom, void>
  31.271 +          : std::unary_function<ToFrom, ToFrom>
  31.272 +        {
  31.273 +            ToFrom &operator ()(ToFrom &tofrom)
  31.274 +            {
  31.275 +                return tofrom;
  31.276 +            }
  31.277 +        };
  31.278 +
  31.279 +        template<typename Arg, typename EnableIf>
  31.280 +        struct as_min_base
  31.281 +          : std::unary_function<Arg, typename remove_const<Arg>::type>
  31.282 +        {
  31.283 +            typename remove_const<Arg>::type operator ()(Arg &) const
  31.284 +            {
  31.285 +                return (std::numeric_limits<typename remove_const<Arg>::type>::min)();
  31.286 +            }
  31.287 +        };
  31.288 +
  31.289 +        template<typename Arg>
  31.290 +        struct as_min_base<Arg, typename enable_if<is_floating_point<Arg> >::type>
  31.291 +          : std::unary_function<Arg, typename remove_const<Arg>::type>
  31.292 +        {
  31.293 +            typename remove_const<Arg>::type operator ()(Arg &) const
  31.294 +            {
  31.295 +                return -(std::numeric_limits<typename remove_const<Arg>::type>::max)();
  31.296 +            }
  31.297 +        };
  31.298 +
  31.299 +        template<typename Arg, typename EnableIf>
  31.300 +        struct as_max_base
  31.301 +          : std::unary_function<Arg, typename remove_const<Arg>::type>
  31.302 +        {
  31.303 +            typename remove_const<Arg>::type operator ()(Arg &) const
  31.304 +            {
  31.305 +                return (std::numeric_limits<typename remove_const<Arg>::type>::max)();
  31.306 +            }
  31.307 +        };
  31.308 +
  31.309 +        template<typename Arg, typename EnableIf>
  31.310 +        struct as_zero_base
  31.311 +          : std::unary_function<Arg, typename remove_const<Arg>::type>
  31.312 +        {
  31.313 +            typename remove_const<Arg>::type operator ()(Arg &) const
  31.314 +            {
  31.315 +                return numeric::zero<typename remove_const<Arg>::type>::value;
  31.316 +            }
  31.317 +        };
  31.318 +
  31.319 +        template<typename Arg, typename EnableIf>
  31.320 +        struct as_one_base
  31.321 +          : std::unary_function<Arg, typename remove_const<Arg>::type>
  31.322 +        {
  31.323 +            typename remove_const<Arg>::type operator ()(Arg &) const
  31.324 +            {
  31.325 +                return numeric::one<typename remove_const<Arg>::type>::value;
  31.326 +            }
  31.327 +        };
  31.328 +
  31.329 +        template<typename To, typename From, typename ToTag, typename FromTag>
  31.330 +        struct promote
  31.331 +          : promote_base<To, From, void>
  31.332 +        {};
  31.333 +
  31.334 +        template<typename Left, typename Right, typename LeftTag, typename RightTag>
  31.335 +        struct min_assign
  31.336 +          : min_assign_base<Left, Right, void>
  31.337 +        {};
  31.338 +
  31.339 +        template<typename Left, typename Right, typename LeftTag, typename RightTag>
  31.340 +        struct max_assign
  31.341 +          : max_assign_base<Left, Right, void>
  31.342 +        {};
  31.343 +
  31.344 +        template<typename Left, typename Right, typename LeftTag, typename RightTag>
  31.345 +        struct average
  31.346 +          : average_base<Left, Right, void>
  31.347 +        {};
  31.348 +
  31.349 +        template<typename Arg, typename Tag>
  31.350 +        struct as_min
  31.351 +          : as_min_base<Arg, void>
  31.352 +        {};
  31.353 +
  31.354 +        template<typename Arg, typename Tag>
  31.355 +        struct as_max
  31.356 +          : as_max_base<Arg, void>
  31.357 +        {};
  31.358 +
  31.359 +        template<typename Arg, typename Tag>
  31.360 +        struct as_zero
  31.361 +          : as_zero_base<Arg, void>
  31.362 +        {};
  31.363 +
  31.364 +        template<typename Arg, typename Tag>
  31.365 +        struct as_one
  31.366 +          : as_one_base<Arg, void>
  31.367 +        {};
  31.368 +    }
  31.369 +
  31.370 +    namespace op
  31.371 +    {
  31.372 +        template<typename To>
  31.373 +        struct promote
  31.374 +          : boost::detail::function1<functional::promote<To, _, typename functional::tag<To>::type, functional::tag<_> > >
  31.375 +        {};
  31.376 +
  31.377 +        struct min_assign
  31.378 +          : boost::detail::function2<functional::min_assign<_1, _2, functional::tag<_1>, functional::tag<_2> > >
  31.379 +        {};
  31.380 +
  31.381 +        struct max_assign
  31.382 +          : boost::detail::function2<functional::max_assign<_1, _2, functional::tag<_1>, functional::tag<_2> > >
  31.383 +        {};
  31.384 +
  31.385 +        struct average
  31.386 +          : boost::detail::function2<functional::average<_1, _2, functional::tag<_1>, functional::tag<_2> > >
  31.387 +        {};
  31.388 +
  31.389 +        struct as_min
  31.390 +          : boost::detail::function1<functional::as_min<_, functional::tag<_> > >
  31.391 +        {};
  31.392 +
  31.393 +        struct as_max
  31.394 +          : boost::detail::function1<functional::as_max<_, functional::tag<_> > >
  31.395 +        {};
  31.396 +
  31.397 +        struct as_zero
  31.398 +          : boost::detail::function1<functional::as_zero<_, functional::tag<_> > >
  31.399 +        {};
  31.400 +
  31.401 +        struct as_one
  31.402 +          : boost::detail::function1<functional::as_one<_, functional::tag<_> > >
  31.403 +        {};
  31.404 +    }
  31.405 +
  31.406 +    namespace
  31.407 +    {
  31.408 +        op::min_assign const &min_assign = boost::detail::pod_singleton<op::min_assign>::instance;
  31.409 +        op::max_assign const &max_assign = boost::detail::pod_singleton<op::max_assign>::instance;
  31.410 +        op::average const &average = boost::detail::pod_singleton<op::average>::instance;
  31.411 +        op::as_min const &as_min = boost::detail::pod_singleton<op::as_min>::instance;
  31.412 +        op::as_max const &as_max = boost::detail::pod_singleton<op::as_max>::instance;
  31.413 +        op::as_zero const &as_zero = boost::detail::pod_singleton<op::as_zero>::instance;
  31.414 +        op::as_one const &as_one = boost::detail::pod_singleton<op::as_one>::instance;
  31.415 +    }
  31.416 +
  31.417 +    ///////////////////////////////////////////////////////////////////////////////
  31.418 +    // promote
  31.419 +    template<typename To, typename From>
  31.420 +    typename lazy_disable_if<is_const<From>, mpl::if_<is_same<To, From>, To &, To> >::type
  31.421 +    promote(From &from)
  31.422 +    {
  31.423 +        return functional::promote<To, From>()(from);
  31.424 +    }
  31.425 +
  31.426 +    template<typename To, typename From>
  31.427 +    typename mpl::if_<is_same<To const, From const>, To const &, To const>::type
  31.428 +    promote(From const &from)
  31.429 +    {
  31.430 +        return functional::promote<To const, From const>()(from);
  31.431 +    }
  31.432 +
  31.433 +    template<typename T>
  31.434 +    struct default_
  31.435 +    {
  31.436 +        typedef default_ type;
  31.437 +        typedef T value_type;
  31.438 +        static T const value;
  31.439 +
  31.440 +        operator T const & () const
  31.441 +        {
  31.442 +            return default_::value;
  31.443 +        }
  31.444 +    };
  31.445 +
  31.446 +    template<typename T>
  31.447 +    T const default_<T>::value = T();
  31.448 +
  31.449 +    template<typename T>
  31.450 +    struct one
  31.451 +    {
  31.452 +        typedef one type;
  31.453 +        typedef T value_type;
  31.454 +        static T const value;
  31.455 +
  31.456 +        operator T const & () const
  31.457 +        {
  31.458 +            return one::value;
  31.459 +        }
  31.460 +    };
  31.461 +
  31.462 +    template<typename T>
  31.463 +    T const one<T>::value = T(1);
  31.464 +
  31.465 +    template<typename T>
  31.466 +    struct zero
  31.467 +    {
  31.468 +        typedef zero type;
  31.469 +        typedef T value_type;
  31.470 +        static T const value;
  31.471 +
  31.472 +        operator T const & () const
  31.473 +        {
  31.474 +            return zero::value;
  31.475 +        }
  31.476 +    };
  31.477 +
  31.478 +    template<typename T>
  31.479 +    T const zero<T>::value = T();
  31.480 +
  31.481 +    template<typename T>
  31.482 +    struct one_or_default
  31.483 +      : mpl::if_<is_empty<T>, default_<T>, one<T> >::type
  31.484 +    {};
  31.485 +
  31.486 +    template<typename T>
  31.487 +    struct zero_or_default
  31.488 +      : mpl::if_<is_empty<T>, default_<T>, zero<T> >::type
  31.489 +    {};
  31.490 +
  31.491 +}} // namespace boost::numeric
  31.492 +
  31.493 +#endif
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/boost_1_45_0/boost/accumulators/numeric/functional/complex.hpp	Fri Mar 04 12:48:37 2011 -0800
    32.3 @@ -0,0 +1,82 @@
    32.4 +///////////////////////////////////////////////////////////////////////////////
    32.5 +/// \file complex.hpp
    32.6 +///
    32.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    32.8 +//  Software License, Version 1.0. (See accompanying file
    32.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   32.10 +
   32.11 +#ifndef BOOST_NUMERIC_FUNCTIONAL_COMPLEX_HPP_EAN_01_17_2006
   32.12 +#define BOOST_NUMERIC_FUNCTIONAL_COMPLEX_HPP_EAN_01_17_2006
   32.13 +
   32.14 +#ifdef BOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED
   32.15 +# error Include this file before boost/accumulators/numeric/functional.hpp
   32.16 +#endif
   32.17 +
   32.18 +#include <complex>
   32.19 +#include <boost/mpl/or.hpp>
   32.20 +#include <boost/type_traits/is_same.hpp>
   32.21 +#include <boost/utility/enable_if.hpp>
   32.22 +#include <boost/typeof/std/complex.hpp>
   32.23 +#include <boost/accumulators/numeric/functional_fwd.hpp>
   32.24 +
   32.25 +namespace boost { namespace numeric { namespace operators
   32.26 +{
   32.27 +    // So that the stats compile when Sample type is std::complex
   32.28 +    template<typename T, typename U>
   32.29 +    typename
   32.30 +        disable_if<
   32.31 +            mpl::or_<is_same<T, U>, is_same<std::complex<T>, U> >
   32.32 +          , std::complex<T>
   32.33 +        >::type
   32.34 +    operator *(std::complex<T> ri, U const &u)
   32.35 +    {
   32.36 +        // BUGBUG promote result to typeof(T()*u) ?
   32.37 +        return ri *= static_cast<T>(u);
   32.38 +    }
   32.39 +
   32.40 +    template<typename T, typename U>
   32.41 +    typename
   32.42 +        disable_if<
   32.43 +            mpl::or_<is_same<T, U>, is_same<std::complex<T>, U> >
   32.44 +          , std::complex<T>
   32.45 +        >::type
   32.46 +    operator /(std::complex<T> ri, U const &u)
   32.47 +    {
   32.48 +        // BUGBUG promote result to typeof(T()*u) ?
   32.49 +        return ri /= static_cast<T>(u);
   32.50 +    }
   32.51 +
   32.52 +}}} // namespace boost::numeric::operators
   32.53 +
   32.54 +namespace boost { namespace numeric
   32.55 +{
   32.56 +    namespace detail
   32.57 +    {
   32.58 +        template<typename T>
   32.59 +        struct one_complex
   32.60 +        {
   32.61 +            static std::complex<T> const value;
   32.62 +        };
   32.63 +
   32.64 +        template<typename T>
   32.65 +        std::complex<T> const one_complex<T>::value
   32.66 +          = std::complex<T>(numeric::one<T>::value, numeric::one<T>::value);
   32.67 +    }
   32.68 +
   32.69 +    /// INTERNAL ONLY
   32.70 +    ///
   32.71 +    template<typename T>
   32.72 +    struct one<std::complex<T> >
   32.73 +      : detail::one_complex<T>
   32.74 +    {
   32.75 +        typedef one type;
   32.76 +        typedef std::complex<T> value_type;
   32.77 +        operator value_type const & () const
   32.78 +        {
   32.79 +            return detail::one_complex<T>::value;
   32.80 +        }
   32.81 +    };
   32.82 +
   32.83 +}} // namespace boost::numeric
   32.84 +
   32.85 +#endif
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/boost_1_45_0/boost/accumulators/numeric/functional/valarray.hpp	Fri Mar 04 12:48:37 2011 -0800
    33.3 @@ -0,0 +1,360 @@
    33.4 +///////////////////////////////////////////////////////////////////////////////
    33.5 +/// \file valarray.hpp
    33.6 +///
    33.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    33.8 +//  Software License, Version 1.0. (See accompanying file
    33.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   33.10 +
   33.11 +#ifndef BOOST_NUMERIC_FUNCTIONAL_VALARRAY_HPP_EAN_12_12_2005
   33.12 +#define BOOST_NUMERIC_FUNCTIONAL_VALARRAY_HPP_EAN_12_12_2005
   33.13 +
   33.14 +#ifdef BOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED
   33.15 +# error Include this file before boost/accumulators/numeric/functional.hpp
   33.16 +#endif
   33.17 +
   33.18 +#include <valarray>
   33.19 +#include <functional>
   33.20 +#include <boost/assert.hpp>
   33.21 +#include <boost/mpl/and.hpp>
   33.22 +#include <boost/mpl/not.hpp>
   33.23 +#include <boost/mpl/assert.hpp>
   33.24 +#include <boost/utility/enable_if.hpp>
   33.25 +#include <boost/type_traits/is_same.hpp>
   33.26 +#include <boost/type_traits/is_scalar.hpp>
   33.27 +#include <boost/type_traits/remove_const.hpp>
   33.28 +#include <boost/typeof/std/valarray.hpp>
   33.29 +#include <boost/accumulators/numeric/functional_fwd.hpp>
   33.30 +
   33.31 +namespace boost { namespace numeric
   33.32 +{
   33.33 +    namespace operators
   33.34 +    {
   33.35 +        namespace acc_detail
   33.36 +        {
   33.37 +            template<typename Fun>
   33.38 +            struct make_valarray
   33.39 +            {
   33.40 +                typedef std::valarray<typename Fun::result_type> type;
   33.41 +            };
   33.42 +        }
   33.43 +
   33.44 +        ///////////////////////////////////////////////////////////////////////////////
   33.45 +        // Handle valarray<Left> / Right where Right is a scalar and Right != Left.
   33.46 +        template<typename Left, typename Right>
   33.47 +        typename lazy_enable_if<
   33.48 +            mpl::and_<is_scalar<Right>, mpl::not_<is_same<Left, Right> > >
   33.49 +          , acc_detail::make_valarray<functional::divides<Left, Right> >
   33.50 +        >::type
   33.51 +        operator /(std::valarray<Left> const &left, Right const &right)
   33.52 +        {
   33.53 +            typedef typename functional::divides<Left, Right>::result_type value_type;
   33.54 +            std::valarray<value_type> result(left.size());
   33.55 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
   33.56 +            {
   33.57 +                result[i] = numeric::divides(left[i], right);
   33.58 +            }
   33.59 +            return result;
   33.60 +        }
   33.61 +
   33.62 +        ///////////////////////////////////////////////////////////////////////////////
   33.63 +        // Handle valarray<Left> * Right where Right is a scalar and Right != Left.
   33.64 +        template<typename Left, typename Right>
   33.65 +        typename lazy_enable_if<
   33.66 +            mpl::and_<is_scalar<Right>, mpl::not_<is_same<Left, Right> > >
   33.67 +          , acc_detail::make_valarray<functional::multiplies<Left, Right> >
   33.68 +        >::type
   33.69 +        operator *(std::valarray<Left> const &left, Right const &right)
   33.70 +        {
   33.71 +            typedef typename functional::multiplies<Left, Right>::result_type value_type;
   33.72 +            std::valarray<value_type> result(left.size());
   33.73 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
   33.74 +            {
   33.75 +                result[i] = numeric::multiplies(left[i], right);
   33.76 +            }
   33.77 +            return result;
   33.78 +        }
   33.79 +
   33.80 +        ///////////////////////////////////////////////////////////////////////////////
   33.81 +        // Handle valarray<Left> + valarray<Right> where Right != Left.
   33.82 +        template<typename Left, typename Right>
   33.83 +        typename lazy_disable_if<
   33.84 +            is_same<Left, Right>
   33.85 +          , acc_detail::make_valarray<functional::plus<Left, Right> >
   33.86 +        >::type
   33.87 +        operator +(std::valarray<Left> const &left, std::valarray<Right> const &right)
   33.88 +        {
   33.89 +            typedef typename functional::plus<Left, Right>::result_type value_type;
   33.90 +            std::valarray<value_type> result(left.size());
   33.91 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
   33.92 +            {
   33.93 +                result[i] = numeric::plus(left[i], right[i]);
   33.94 +            }
   33.95 +            return result;
   33.96 +        }
   33.97 +    }
   33.98 +
   33.99 +    namespace functional
  33.100 +    {
  33.101 +        struct std_valarray_tag;
  33.102 +
  33.103 +        template<typename T>
  33.104 +        struct tag<std::valarray<T> >
  33.105 +        {
  33.106 +            typedef std_valarray_tag type;
  33.107 +        };
  33.108 +
  33.109 +    #ifdef __GLIBCXX__
  33.110 +        template<typename T, typename U>
  33.111 +        struct tag<std::_Expr<T, U> >
  33.112 +        {
  33.113 +            typedef std_valarray_tag type;
  33.114 +        };
  33.115 +    #endif
  33.116 +
  33.117 +        /// INTERNAL ONLY
  33.118 +        ///
  33.119 +        // This is necessary because the GCC stdlib uses expression templates, and
  33.120 +        // typeof(som-valarray-expression) is not an instance of std::valarray
  33.121 +    #define BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(Name, Op)                   \
  33.122 +        template<typename Left, typename Right>                                         \
  33.123 +        struct Name<Left, Right, std_valarray_tag, std_valarray_tag>                    \
  33.124 +          : std::binary_function<                                                       \
  33.125 +                Left                                                                    \
  33.126 +              , Right                                                                   \
  33.127 +              , std::valarray<                                                          \
  33.128 +                    typename Name<                                                      \
  33.129 +                        typename Left::value_type                                       \
  33.130 +                      , typename Right::value_type                                      \
  33.131 +                    >::result_type                                                      \
  33.132 +                >                                                                       \
  33.133 +            >                                                                           \
  33.134 +        {                                                                               \
  33.135 +            typedef typename Left::value_type left_value_type;                          \
  33.136 +            typedef typename Right::value_type right_value_type;                        \
  33.137 +            typedef                                                                     \
  33.138 +                std::valarray<                                                          \
  33.139 +                    typename Name<left_value_type, right_value_type>::result_type       \
  33.140 +                >                                                                       \
  33.141 +            result_type;                                                                \
  33.142 +            result_type                                                                 \
  33.143 +            operator ()(Left &left, Right &right) const                                 \
  33.144 +            {                                                                           \
  33.145 +                return numeric::promote<std::valarray<left_value_type> >(left)          \
  33.146 +                    Op numeric::promote<std::valarray<right_value_type> >(right);       \
  33.147 +            }                                                                           \
  33.148 +        };                                                                              \
  33.149 +        template<typename Left, typename Right>                                         \
  33.150 +        struct Name<Left, Right, std_valarray_tag, void>                                \
  33.151 +          : std::binary_function<                                                       \
  33.152 +                Left                                                                    \
  33.153 +              , Right                                                                   \
  33.154 +              , std::valarray<                                                          \
  33.155 +                    typename Name<typename Left::value_type, Right>::result_type        \
  33.156 +                >                                                                       \
  33.157 +            >                                                                           \
  33.158 +        {                                                                               \
  33.159 +            typedef typename Left::value_type left_value_type;                          \
  33.160 +            typedef                                                                     \
  33.161 +                std::valarray<                                                          \
  33.162 +                    typename Name<left_value_type, Right>::result_type                  \
  33.163 +                >                                                                       \
  33.164 +            result_type;                                                                \
  33.165 +            result_type                                                                 \
  33.166 +            operator ()(Left &left, Right &right) const                                 \
  33.167 +            {                                                                           \
  33.168 +                return numeric::promote<std::valarray<left_value_type> >(left) Op right;\
  33.169 +            }                                                                           \
  33.170 +        };                                                                              \
  33.171 +        template<typename Left, typename Right>                                         \
  33.172 +        struct Name<Left, Right, void, std_valarray_tag>                                \
  33.173 +          : std::binary_function<                                                       \
  33.174 +                Left                                                                    \
  33.175 +              , Right                                                                   \
  33.176 +              , std::valarray<                                                          \
  33.177 +                    typename Name<Left, typename Right::value_type>::result_type        \
  33.178 +                >                                                                       \
  33.179 +            >                                                                           \
  33.180 +        {                                                                               \
  33.181 +            typedef typename Right::value_type right_value_type;                        \
  33.182 +            typedef                                                                     \
  33.183 +                std::valarray<                                                          \
  33.184 +                    typename Name<Left, right_value_type>::result_type                  \
  33.185 +                >                                                                       \
  33.186 +            result_type;                                                                \
  33.187 +            result_type                                                                 \
  33.188 +            operator ()(Left &left, Right &right) const                                 \
  33.189 +            {                                                                           \
  33.190 +                return left Op numeric::promote<std::valarray<right_value_type> >(right);\
  33.191 +            }                                                                           \
  33.192 +        };
  33.193 +
  33.194 +        BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(plus, +)
  33.195 +        BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(minus, -)
  33.196 +        BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(multiplies, *)
  33.197 +        BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(divides, /)
  33.198 +        BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(modulus, %)
  33.199 +
  33.200 +    #undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP
  33.201 +
  33.202 +        ///////////////////////////////////////////////////////////////////////////////
  33.203 +        // element-wise min of std::valarray
  33.204 +        template<typename Left, typename Right>
  33.205 +        struct min_assign<Left, Right, std_valarray_tag, std_valarray_tag>
  33.206 +          : std::binary_function<Left, Right, void>
  33.207 +        {
  33.208 +            void operator ()(Left &left, Right &right) const
  33.209 +            {
  33.210 +                BOOST_ASSERT(left.size() == right.size());
  33.211 +                for(std::size_t i = 0, size = left.size(); i != size; ++i)
  33.212 +                {
  33.213 +                    if(numeric::less(right[i], left[i]))
  33.214 +                    {
  33.215 +                        left[i] = right[i];
  33.216 +                    }
  33.217 +                }
  33.218 +            }
  33.219 +        };
  33.220 +
  33.221 +        ///////////////////////////////////////////////////////////////////////////////
  33.222 +        // element-wise max of std::valarray
  33.223 +        template<typename Left, typename Right>
  33.224 +        struct max_assign<Left, Right, std_valarray_tag, std_valarray_tag>
  33.225 +          : std::binary_function<Left, Right, void>
  33.226 +        {
  33.227 +            void operator ()(Left &left, Right &right) const
  33.228 +            {
  33.229 +                BOOST_ASSERT(left.size() == right.size());
  33.230 +                for(std::size_t i = 0, size = left.size(); i != size; ++i)
  33.231 +                {
  33.232 +                    if(numeric::greater(right[i], left[i]))
  33.233 +                    {
  33.234 +                        left[i] = right[i];
  33.235 +                    }
  33.236 +                }
  33.237 +            }
  33.238 +        };
  33.239 +
  33.240 +        // partial specialization of numeric::average<> for std::valarray.
  33.241 +        template<typename Left, typename Right, typename RightTag>
  33.242 +        struct average<Left, Right, std_valarray_tag, RightTag>
  33.243 +          : mpl::if_<
  33.244 +                are_integral<typename Left::value_type, Right>
  33.245 +              , divides<Left, double const>
  33.246 +              , divides<Left, Right>
  33.247 +            >::type
  33.248 +        {};
  33.249 +
  33.250 +        // promote
  33.251 +        template<typename To, typename From>
  33.252 +        struct promote<To, From, std_valarray_tag, std_valarray_tag>
  33.253 +          : std::unary_function<From, To>
  33.254 +        {
  33.255 +            To operator ()(From &arr) const
  33.256 +            {
  33.257 +                typename remove_const<To>::type res(arr.size());
  33.258 +                for(std::size_t i = 0, size = arr.size(); i != size; ++i)
  33.259 +                {
  33.260 +                    res[i] = numeric::promote<typename To::value_type>(arr[i]);
  33.261 +                }
  33.262 +                return res;
  33.263 +            }
  33.264 +        };
  33.265 +
  33.266 +        template<typename ToFrom>
  33.267 +        struct promote<ToFrom, ToFrom, std_valarray_tag, std_valarray_tag>
  33.268 +          : std::unary_function<ToFrom, ToFrom>
  33.269 +        {
  33.270 +            ToFrom &operator ()(ToFrom &tofrom) const
  33.271 +            {
  33.272 +                return tofrom;
  33.273 +            }
  33.274 +        };
  33.275 +
  33.276 +        // for "promoting" a std::valarray<bool> to a bool, useful for
  33.277 +        // comparing 2 valarrays for equality:
  33.278 +        //   if(numeric::promote<bool>(a == b))
  33.279 +        template<typename From>
  33.280 +        struct promote<bool, From, void, std_valarray_tag>
  33.281 +          : std::unary_function<From, bool>
  33.282 +        {
  33.283 +            bool operator ()(From &arr) const
  33.284 +            {
  33.285 +                BOOST_MPL_ASSERT((is_same<bool, typename From::value_type>));
  33.286 +                for(std::size_t i = 0, size = arr.size(); i != size; ++i)
  33.287 +                {
  33.288 +                    if(!arr[i])
  33.289 +                    {
  33.290 +                        return false;
  33.291 +                    }
  33.292 +                }
  33.293 +                return true;
  33.294 +            }
  33.295 +        };
  33.296 +
  33.297 +        template<typename From>
  33.298 +        struct promote<bool const, From, void, std_valarray_tag>
  33.299 +          : promote<bool, From, void, std_valarray_tag>
  33.300 +        {};
  33.301 +
  33.302 +        ///////////////////////////////////////////////////////////////////////////////
  33.303 +        // functional::as_min
  33.304 +        template<typename T>
  33.305 +        struct as_min<T, std_valarray_tag>
  33.306 +            : std::unary_function<T, typename remove_const<T>::type>
  33.307 +        {
  33.308 +            typename remove_const<T>::type operator ()(T &arr) const
  33.309 +            {
  33.310 +                return 0 == arr.size()
  33.311 +                  ? T()
  33.312 +                  : T(numeric::as_min(arr[0]), arr.size());
  33.313 +            }
  33.314 +        };
  33.315 +
  33.316 +        ///////////////////////////////////////////////////////////////////////////////
  33.317 +        // functional::as_max
  33.318 +        template<typename T>
  33.319 +        struct as_max<T, std_valarray_tag>
  33.320 +          : std::unary_function<T, typename remove_const<T>::type>
  33.321 +        {
  33.322 +            typename remove_const<T>::type operator ()(T &arr) const
  33.323 +            {
  33.324 +                return 0 == arr.size()
  33.325 +                  ? T()
  33.326 +                  : T(numeric::as_max(arr[0]), arr.size());
  33.327 +            }
  33.328 +        };
  33.329 +
  33.330 +        ///////////////////////////////////////////////////////////////////////////////
  33.331 +        // functional::as_zero
  33.332 +        template<typename T>
  33.333 +        struct as_zero<T, std_valarray_tag>
  33.334 +          : std::unary_function<T, typename remove_const<T>::type>
  33.335 +        {
  33.336 +            typename remove_const<T>::type operator ()(T &arr) const
  33.337 +            {
  33.338 +                return 0 == arr.size()
  33.339 +                  ? T()
  33.340 +                  : T(numeric::as_zero(arr[0]), arr.size());
  33.341 +            }
  33.342 +        };
  33.343 +
  33.344 +        ///////////////////////////////////////////////////////////////////////////////
  33.345 +        // functional::as_one
  33.346 +        template<typename T>
  33.347 +        struct as_one<T, std_valarray_tag>
  33.348 +          : std::unary_function<T, typename remove_const<T>::type>
  33.349 +        {
  33.350 +            typename remove_const<T>::type operator ()(T &arr) const
  33.351 +            {
  33.352 +                return 0 == arr.size()
  33.353 +                  ? T()
  33.354 +                  : T(numeric::as_one(arr[0]), arr.size());
  33.355 +            }
  33.356 +        };
  33.357 +
  33.358 +    } // namespace functional
  33.359 +
  33.360 +}} // namespace boost::numeric
  33.361 +
  33.362 +#endif
  33.363 +
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/boost_1_45_0/boost/accumulators/numeric/functional/vector.hpp	Fri Mar 04 12:48:37 2011 -0800
    34.3 @@ -0,0 +1,329 @@
    34.4 +///////////////////////////////////////////////////////////////////////////////
    34.5 +/// \file vector.hpp
    34.6 +///
    34.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    34.8 +//  Software License, Version 1.0. (See accompanying file
    34.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   34.10 +
   34.11 +#ifndef BOOST_NUMERIC_FUNCTIONAL_VECTOR_HPP_EAN_12_12_2005
   34.12 +#define BOOST_NUMERIC_FUNCTIONAL_VECTOR_HPP_EAN_12_12_2005
   34.13 +
   34.14 +#ifdef BOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED
   34.15 +# error Include this file before boost/accumulators/numeric/functional.hpp
   34.16 +#endif
   34.17 +
   34.18 +#include <vector>
   34.19 +#include <functional>
   34.20 +#include <boost/assert.hpp>
   34.21 +#include <boost/mpl/and.hpp>
   34.22 +#include <boost/mpl/not.hpp>
   34.23 +#include <boost/utility/enable_if.hpp>
   34.24 +#include <boost/type_traits/is_same.hpp>
   34.25 +#include <boost/type_traits/is_scalar.hpp>
   34.26 +#include <boost/type_traits/remove_const.hpp>
   34.27 +#include <boost/typeof/std/vector.hpp>
   34.28 +#include <boost/accumulators/numeric/functional_fwd.hpp>
   34.29 +
   34.30 +namespace boost { namespace numeric
   34.31 +{
   34.32 +    namespace operators
   34.33 +    {
   34.34 +        namespace acc_detail
   34.35 +        {
   34.36 +            template<typename Fun>
   34.37 +            struct make_vector
   34.38 +            {
   34.39 +                typedef std::vector<typename Fun::result_type> type;
   34.40 +            };
   34.41 +        }
   34.42 +
   34.43 +        ///////////////////////////////////////////////////////////////////////////////
   34.44 +        // Handle vector<Left> / Right where Right is a scalar.
   34.45 +        template<typename Left, typename Right>
   34.46 +        typename lazy_enable_if<
   34.47 +            is_scalar<Right>
   34.48 +          , acc_detail::make_vector<functional::divides<Left, Right> >
   34.49 +        >::type
   34.50 +        operator /(std::vector<Left> const &left, Right const &right)
   34.51 +        {
   34.52 +            typedef typename functional::divides<Left, Right>::result_type value_type;
   34.53 +            std::vector<value_type> result(left.size());
   34.54 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
   34.55 +            {
   34.56 +                result[i] = numeric::divides(left[i], right);
   34.57 +            }
   34.58 +            return result;
   34.59 +        }
   34.60 +
   34.61 +        ///////////////////////////////////////////////////////////////////////////////
   34.62 +        // Handle vector<Left> / vector<Right>.
   34.63 +        template<typename Left, typename Right>
   34.64 +        std::vector<typename functional::divides<Left, Right>::result_type>
   34.65 +        operator /(std::vector<Left> const &left, std::vector<Right> const &right)
   34.66 +        {
   34.67 +            typedef typename functional::divides<Left, Right>::result_type value_type;
   34.68 +            std::vector<value_type> result(left.size());
   34.69 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
   34.70 +            {
   34.71 +                result[i] = numeric::divides(left[i], right[i]);
   34.72 +            }
   34.73 +            return result;
   34.74 +        }
   34.75 +
   34.76 +        ///////////////////////////////////////////////////////////////////////////////
   34.77 +        // Handle vector<Left> * Right where Right is a scalar.
   34.78 +        template<typename Left, typename Right>
   34.79 +        typename lazy_enable_if<
   34.80 +            is_scalar<Right>
   34.81 +          , acc_detail::make_vector<functional::multiplies<Left, Right> >
   34.82 +        >::type
   34.83 +        operator *(std::vector<Left> const &left, Right const &right)
   34.84 +        {
   34.85 +            typedef typename functional::multiplies<Left, Right>::result_type value_type;
   34.86 +            std::vector<value_type> result(left.size());
   34.87 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
   34.88 +            {
   34.89 +                result[i] = numeric::multiplies(left[i], right);
   34.90 +            }
   34.91 +            return result;
   34.92 +        }
   34.93 +
   34.94 +        ///////////////////////////////////////////////////////////////////////////////
   34.95 +        // Handle Left * vector<Right> where Left is a scalar.
   34.96 +        template<typename Left, typename Right>
   34.97 +        typename lazy_enable_if<
   34.98 +            is_scalar<Left>
   34.99 +          , acc_detail::make_vector<functional::multiplies<Left, Right> >
  34.100 +        >::type
  34.101 +        operator *(Left const &left, std::vector<Right> const &right)
  34.102 +        {
  34.103 +            typedef typename functional::multiplies<Left, Right>::result_type value_type;
  34.104 +            std::vector<value_type> result(right.size());
  34.105 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
  34.106 +            {
  34.107 +                result[i] = numeric::multiplies(left, right[i]);
  34.108 +            }
  34.109 +            return result;
  34.110 +        }
  34.111 +
  34.112 +        ///////////////////////////////////////////////////////////////////////////////
  34.113 +        // Handle vector<Left> * vector<Right>
  34.114 +        template<typename Left, typename Right>
  34.115 +        std::vector<typename functional::multiplies<Left, Right>::result_type>
  34.116 +        operator *(std::vector<Left> const &left, std::vector<Right> const &right)
  34.117 +        {
  34.118 +            typedef typename functional::multiplies<Left, Right>::result_type value_type;
  34.119 +            std::vector<value_type> result(left.size());
  34.120 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
  34.121 +            {
  34.122 +                result[i] = numeric::multiplies(left[i], right[i]);
  34.123 +            }
  34.124 +            return result;
  34.125 +        }
  34.126 +
  34.127 +        ///////////////////////////////////////////////////////////////////////////////
  34.128 +        // Handle vector<Left> + vector<Right>
  34.129 +        template<typename Left, typename Right>
  34.130 +        std::vector<typename functional::plus<Left, Right>::result_type>
  34.131 +        operator +(std::vector<Left> const &left, std::vector<Right> const &right)
  34.132 +        {
  34.133 +            typedef typename functional::plus<Left, Right>::result_type value_type;
  34.134 +            std::vector<value_type> result(left.size());
  34.135 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
  34.136 +            {
  34.137 +                result[i] = numeric::plus(left[i], right[i]);
  34.138 +            }
  34.139 +            return result;
  34.140 +        }
  34.141 +
  34.142 +        ///////////////////////////////////////////////////////////////////////////////
  34.143 +        // Handle vector<Left> - vector<Right>
  34.144 +        template<typename Left, typename Right>
  34.145 +        std::vector<typename functional::minus<Left, Right>::result_type>
  34.146 +        operator -(std::vector<Left> const &left, std::vector<Right> const &right)
  34.147 +        {
  34.148 +            typedef typename functional::minus<Left, Right>::result_type value_type;
  34.149 +            std::vector<value_type> result(left.size());
  34.150 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
  34.151 +            {
  34.152 +                result[i] = numeric::minus(left[i], right[i]);
  34.153 +            }
  34.154 +            return result;
  34.155 +        }
  34.156 +
  34.157 +        ///////////////////////////////////////////////////////////////////////////////
  34.158 +        // Handle vector<Left> += vector<Left>
  34.159 +        template<typename Left>
  34.160 +        std::vector<Left> &
  34.161 +        operator +=(std::vector<Left> &left, std::vector<Left> const &right)
  34.162 +        {
  34.163 +            BOOST_ASSERT(left.size() == right.size());
  34.164 +            for(std::size_t i = 0, size = left.size(); i != size; ++i)
  34.165 +            {
  34.166 +                numeric::plus_assign(left[i], right[i]);
  34.167 +            }
  34.168 +            return left;
  34.169 +        }
  34.170 +
  34.171 +        ///////////////////////////////////////////////////////////////////////////////
  34.172 +        // Handle -vector<Arg>
  34.173 +        template<typename Arg>
  34.174 +        std::vector<typename functional::unary_minus<Arg>::result_type>
  34.175 +        operator -(std::vector<Arg> const &arg)
  34.176 +        {
  34.177 +            typedef typename functional::unary_minus<Arg>::result_type value_type;
  34.178 +            std::vector<value_type> result(arg.size());
  34.179 +            for(std::size_t i = 0, size = result.size(); i != size; ++i)
  34.180 +            {
  34.181 +                result[i] = numeric::unary_minus(arg[i]);
  34.182 +            }
  34.183 +            return result;
  34.184 +        }
  34.185 +    }
  34.186 +
  34.187 +    namespace functional
  34.188 +    {
  34.189 +        struct std_vector_tag;
  34.190 +
  34.191 +        template<typename T, typename Al>
  34.192 +        struct tag<std::vector<T, Al> >
  34.193 +        {
  34.194 +            typedef std_vector_tag type;
  34.195 +        };
  34.196 +
  34.197 +        ///////////////////////////////////////////////////////////////////////////////
  34.198 +        // element-wise min of std::vector
  34.199 +        template<typename Left, typename Right>
  34.200 +        struct min_assign<Left, Right, std_vector_tag, std_vector_tag>
  34.201 +          : std::binary_function<Left, Right, void>
  34.202 +        {
  34.203 +            void operator ()(Left &left, Right &right) const
  34.204 +            {
  34.205 +                BOOST_ASSERT(left.size() == right.size());
  34.206 +                for(std::size_t i = 0, size = left.size(); i != size; ++i)
  34.207 +                {
  34.208 +                    if(numeric::less(right[i], left[i]))
  34.209 +                    {
  34.210 +                        left[i] = right[i];
  34.211 +                    }
  34.212 +                }
  34.213 +            }
  34.214 +        };
  34.215 +
  34.216 +        ///////////////////////////////////////////////////////////////////////////////
  34.217 +        // element-wise max of std::vector
  34.218 +        template<typename Left, typename Right>
  34.219 +        struct max_assign<Left, Right, std_vector_tag, std_vector_tag>
  34.220 +          : std::binary_function<Left, Right, void>
  34.221 +        {
  34.222 +            void operator ()(Left &left, Right &right) const
  34.223 +            {
  34.224 +                BOOST_ASSERT(left.size() == right.size());
  34.225 +                for(std::size_t i = 0, size = left.size(); i != size; ++i)
  34.226 +                {
  34.227 +                    if(numeric::greater(right[i], left[i]))
  34.228 +                    {
  34.229 +                        left[i] = right[i];
  34.230 +                    }
  34.231 +                }
  34.232 +            }
  34.233 +        };
  34.234 +
  34.235 +        // partial specialization for std::vector.
  34.236 +        template<typename Left, typename Right>
  34.237 +        struct average<Left, Right, std_vector_tag, void>
  34.238 +          : mpl::if_<
  34.239 +                are_integral<typename Left::value_type, Right>
  34.240 +              , divides<Left, double const>
  34.241 +              , divides<Left, Right>
  34.242 +            >::type
  34.243 +        {};
  34.244 +
  34.245 +        // promote
  34.246 +        template<typename To, typename From>
  34.247 +        struct promote<To, From, std_vector_tag, std_vector_tag>
  34.248 +          : std::unary_function<From, To>
  34.249 +        {
  34.250 +            To operator ()(From &arr) const
  34.251 +            {
  34.252 +                typename remove_const<To>::type res(arr.size());
  34.253 +                for(std::size_t i = 0, size = arr.size(); i != size; ++i)
  34.254 +                {
  34.255 +                    res[i] = numeric::promote<typename To::value_type>(arr[i]);
  34.256 +                }
  34.257 +                return res;
  34.258 +            }
  34.259 +        };
  34.260 +
  34.261 +        template<typename ToFrom>
  34.262 +        struct promote<ToFrom, ToFrom, std_vector_tag, std_vector_tag>
  34.263 +          : std::unary_function<ToFrom, ToFrom>
  34.264 +        {
  34.265 +            ToFrom &operator ()(ToFrom &tofrom) const
  34.266 +            {
  34.267 +                return tofrom;
  34.268 +            }
  34.269 +        };
  34.270 +
  34.271 +        ///////////////////////////////////////////////////////////////////////////////
  34.272 +        // functional::as_min
  34.273 +        template<typename T>
  34.274 +        struct as_min<T, std_vector_tag>
  34.275 +          : std::unary_function<T, typename remove_const<T>::type>
  34.276 +        {
  34.277 +            typename remove_const<T>::type operator ()(T &arr) const
  34.278 +            {
  34.279 +                return 0 == arr.size()
  34.280 +                  ? T()
  34.281 +                  : T(arr.size(), numeric::as_min(arr[0]));
  34.282 +            }
  34.283 +        };
  34.284 +
  34.285 +        ///////////////////////////////////////////////////////////////////////////////
  34.286 +        // functional::as_max
  34.287 +        template<typename T>
  34.288 +        struct as_max<T, std_vector_tag>
  34.289 +          : std::unary_function<T, typename remove_const<T>::type>
  34.290 +        {
  34.291 +            typename remove_const<T>::type operator ()(T &arr) const
  34.292 +            {
  34.293 +                return 0 == arr.size()
  34.294 +                  ? T()
  34.295 +                  : T(arr.size(), numeric::as_max(arr[0]));
  34.296 +            }
  34.297 +        };
  34.298 +
  34.299 +        ///////////////////////////////////////////////////////////////////////////////
  34.300 +        // functional::as_zero
  34.301 +        template<typename T>
  34.302 +        struct as_zero<T, std_vector_tag>
  34.303 +          : std::unary_function<T, typename remove_const<T>::type>
  34.304 +        {
  34.305 +            typename remove_const<T>::type operator ()(T &arr) const
  34.306 +            {
  34.307 +                return 0 == arr.size()
  34.308 +                  ? T()
  34.309 +                  : T(arr.size(), numeric::as_zero(arr[0]));
  34.310 +            }
  34.311 +        };
  34.312 +
  34.313 +        ///////////////////////////////////////////////////////////////////////////////
  34.314 +        // functional::as_one
  34.315 +        template<typename T>
  34.316 +        struct as_one<T, std_vector_tag>
  34.317 +          : std::unary_function<T, typename remove_const<T>::type>
  34.318 +        {
  34.319 +            typename remove_const<T>::type operator ()(T &arr) const
  34.320 +            {
  34.321 +                return 0 == arr.size()
  34.322 +                  ? T()
  34.323 +                  : T(arr.size(), numeric::as_one(arr[0]));
  34.324 +            }
  34.325 +        };
  34.326 +
  34.327 +    } // namespace functional
  34.328 +
  34.329 +}} // namespace boost::numeric
  34.330 +
  34.331 +#endif
  34.332 +
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/boost_1_45_0/boost/accumulators/numeric/functional_fwd.hpp	Fri Mar 04 12:48:37 2011 -0800
    35.3 @@ -0,0 +1,221 @@
    35.4 +///////////////////////////////////////////////////////////////////////////////
    35.5 +/// \file functional_fwd.hpp
    35.6 +///
    35.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    35.8 +//  Software License, Version 1.0. (See accompanying file
    35.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   35.10 +
   35.11 +#ifndef BOOST_NUMERIC_FUNCTIONAL_FWD_HPP_EAN_08_12_2005
   35.12 +#define BOOST_NUMERIC_FUNCTIONAL_FWD_HPP_EAN_08_12_2005
   35.13 +
   35.14 +#include <boost/mpl/if.hpp>
   35.15 +#include <boost/mpl/placeholders.hpp>
   35.16 +#include <boost/utility/enable_if.hpp>
   35.17 +#include <boost/type_traits/is_same.hpp>
   35.18 +#include <boost/type_traits/is_const.hpp>
   35.19 +
   35.20 +namespace boost { namespace numeric
   35.21 +{
   35.22 +    // For using directives -- this namespace may be re-opened elsewhere
   35.23 +    namespace operators
   35.24 +    {}
   35.25 +
   35.26 +    namespace op
   35.27 +    {
   35.28 +        using mpl::_;
   35.29 +        using mpl::_1;
   35.30 +        using mpl::_2;
   35.31 +    }
   35.32 +
   35.33 +    namespace functional
   35.34 +    {
   35.35 +        using namespace operators;
   35.36 +
   35.37 +        template<typename T>
   35.38 +        struct tag
   35.39 +        {
   35.40 +            typedef void type;
   35.41 +        };
   35.42 +
   35.43 +        template<typename T>
   35.44 +        struct tag<T const>
   35.45 +          : tag<T>
   35.46 +        {};
   35.47 +
   35.48 +        template<typename T>
   35.49 +        struct tag<T volatile>
   35.50 +          : tag<T>
   35.51 +        {};
   35.52 +
   35.53 +        template<typename T>
   35.54 +        struct tag<T const volatile>
   35.55 +          : tag<T>
   35.56 +        {};
   35.57 +
   35.58 +        template<typename T>
   35.59 +        struct static_;
   35.60 +
   35.61 +        template<typename A0, typename A1>
   35.62 +        struct are_integral;
   35.63 +    }
   35.64 +
   35.65 +    /// INTERNAL ONLY
   35.66 +    ///
   35.67 +#define BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(Name, Op)                                     \
   35.68 +    namespace functional                                                                        \
   35.69 +    {                                                                                           \
   35.70 +        template<typename Arg, typename EnableIf = void>                                        \
   35.71 +        struct Name ## _base;                                                                   \
   35.72 +        template<typename Arg, typename ArgTag = typename tag<Arg>::type>                       \
   35.73 +        struct Name;                                                                            \
   35.74 +    }                                                                                           \
   35.75 +    namespace op                                                                                \
   35.76 +    {                                                                                           \
   35.77 +        struct Name;                                                                            \
   35.78 +    }                                                                                           \
   35.79 +    namespace                                                                                   \
   35.80 +    {                                                                                           \
   35.81 +        extern op::Name const &Name;                                                            \
   35.82 +    }
   35.83 +
   35.84 +    /// INTERNAL ONLY
   35.85 +    ///
   35.86 +#define BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(Name)                                        \
   35.87 +    namespace functional                                                                        \
   35.88 +    {                                                                                           \
   35.89 +        template<typename Left, typename Right, typename EnableIf = void>                       \
   35.90 +        struct result_of_ ## Name;                                                              \
   35.91 +        template<typename Left, typename Right, typename EnableIf = void>                       \
   35.92 +        struct Name ## _base;                                                                   \
   35.93 +        template<                                                                               \
   35.94 +            typename Left                                                                       \
   35.95 +          , typename Right                                                                      \
   35.96 +          , typename LeftTag = typename tag<Left>::type                                         \
   35.97 +          , typename RightTag = typename tag<Right>::type                                       \
   35.98 +        >                                                                                       \
   35.99 +        struct Name;                                                                            \
  35.100 +    }                                                                                           \
  35.101 +    namespace op                                                                                \
  35.102 +    {                                                                                           \
  35.103 +        struct Name;                                                                            \
  35.104 +    }                                                                                           \
  35.105 +    namespace                                                                                   \
  35.106 +    {                                                                                           \
  35.107 +        extern op::Name const &Name;                                                            \
  35.108 +    }
  35.109 +
  35.110 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(plus)
  35.111 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(minus)
  35.112 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(multiplies)
  35.113 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(divides)
  35.114 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(modulus)
  35.115 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(greater)
  35.116 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(greater_equal)
  35.117 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(less)
  35.118 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(less_equal)
  35.119 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(equal_to)
  35.120 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(not_equal_to)
  35.121 +
  35.122 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(assign)
  35.123 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(plus_assign)
  35.124 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(minus_assign)
  35.125 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(multiplies_assign)
  35.126 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(divides_assign)
  35.127 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(modulus_assign)
  35.128 +
  35.129 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(unary_plus, +)
  35.130 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(unary_minus, -)
  35.131 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(complement, ~)
  35.132 +    BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(logical_not, !)
  35.133 +
  35.134 +#undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP
  35.135 +#undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP
  35.136 +
  35.137 +
  35.138 +    namespace functional
  35.139 +    {
  35.140 +        template<typename To, typename From, typename EnableIf = void>
  35.141 +        struct promote_base;
  35.142 +        template<typename Left, typename Right, typename EnableIf = void>
  35.143 +        struct min_assign_base;
  35.144 +        template<typename Left, typename Right, typename EnableIf = void>
  35.145 +        struct max_assign_base;
  35.146 +        template<typename Left, typename Right, typename EnableIf = void>
  35.147 +        struct average_base;
  35.148 +        template<typename Arg, typename EnableIf = void>
  35.149 +        struct as_min_base;
  35.150 +        template<typename Arg, typename EnableIf = void>
  35.151 +        struct as_max_base;
  35.152 +        template<typename Arg, typename EnableIf = void>
  35.153 +        struct as_zero_base;
  35.154 +        template<typename Arg, typename EnableIf = void>
  35.155 +        struct as_one_base;
  35.156 +
  35.157 +        template<typename To, typename From, typename ToTag = typename tag<To>::type, typename FromTag = typename tag<From>::type>
  35.158 +        struct promote;
  35.159 +        template<typename Left, typename Right, typename LeftTag = typename tag<Left>::type, typename RightTag = typename tag<Right>::type>
  35.160 +        struct min_assign;
  35.161 +        template<typename Left, typename Right, typename LeftTag = typename tag<Left>::type, typename RightTag = typename tag<Right>::type>
  35.162 +        struct max_assign;
  35.163 +        template<typename Left, typename Right, typename LeftTag = typename tag<Left>::type, typename RightTag = typename tag<Right>::type>
  35.164 +        struct average;
  35.165 +        template<typename Arg, typename Tag = typename tag<Arg>::type>
  35.166 +        struct as_min;
  35.167 +        template<typename Arg, typename Tag = typename tag<Arg>::type>
  35.168 +        struct as_max;
  35.169 +        template<typename Arg, typename Tag = typename tag<Arg>::type>
  35.170 +        struct as_zero;
  35.171 +        template<typename Arg, typename Tag = typename tag<Arg>::type>
  35.172 +        struct as_one;
  35.173 +    }
  35.174 +
  35.175 +    namespace op
  35.176 +    {
  35.177 +        template<typename To>
  35.178 +        struct promote;
  35.179 +        struct min_assign;
  35.180 +        struct max_assign;
  35.181 +        struct average;
  35.182 +        struct as_min;
  35.183 +        struct as_max;
  35.184 +        struct as_zero;
  35.185 +        struct as_one;
  35.186 +    }
  35.187 +
  35.188 +    namespace
  35.189 +    {
  35.190 +        extern op::min_assign const &min_assign;
  35.191 +        extern op::max_assign const &max_assign;
  35.192 +        extern op::average const &average;
  35.193 +        extern op::as_min const &as_min;
  35.194 +        extern op::as_max const &as_max;
  35.195 +        extern op::as_zero const &as_zero;
  35.196 +        extern op::as_one const &as_one;
  35.197 +    }
  35.198 +
  35.199 +    template<typename To, typename From>
  35.200 +    typename lazy_disable_if<is_const<From>, mpl::if_<is_same<To, From>, To &, To> >::type
  35.201 +    promote(From &from);
  35.202 +
  35.203 +    template<typename To, typename From>
  35.204 +    typename mpl::if_<is_same<To const, From const>, To const &, To const>::type
  35.205 +    promote(From const &from);
  35.206 +
  35.207 +    template<typename T>
  35.208 +    struct default_;
  35.209 +
  35.210 +    template<typename T>
  35.211 +    struct one;
  35.212 +
  35.213 +    template<typename T>
  35.214 +    struct zero;
  35.215 +
  35.216 +    template<typename T>
  35.217 +    struct one_or_default;
  35.218 +
  35.219 +    template<typename T>
  35.220 +    struct zero_or_default;
  35.221 +
  35.222 +}} // namespace boost::numeric
  35.223 +
  35.224 +#endif
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/boost_1_45_0/boost/accumulators/statistics.hpp	Fri Mar 04 12:48:37 2011 -0800
    36.3 @@ -0,0 +1,59 @@
    36.4 +///////////////////////////////////////////////////////////////////////////////
    36.5 +/// \file statistics.hpp
    36.6 +/// Includes all of the Statistical Accumulators Library
    36.7 +//
    36.8 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    36.9 +//  Software License, Version 1.0. (See accompanying file
   36.10 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   36.11 +
   36.12 +#ifndef BOOST_ACCUMULATORS_STATISTICS_HPP_EAN_01_17_2006
   36.13 +#define BOOST_ACCUMULATORS_STATISTICS_HPP_EAN_01_17_2006
   36.14 +
   36.15 +#include <boost/accumulators/statistics/count.hpp>
   36.16 +#include <boost/accumulators/statistics/covariance.hpp>
   36.17 +#include <boost/accumulators/statistics/density.hpp>
   36.18 +#include <boost/accumulators/statistics/error_of.hpp>
   36.19 +#include <boost/accumulators/statistics/error_of_mean.hpp>
   36.20 +#include <boost/accumulators/statistics/extended_p_square.hpp>
   36.21 +#include <boost/accumulators/statistics/extended_p_square_quantile.hpp>
   36.22 +#include <boost/accumulators/statistics/kurtosis.hpp>
   36.23 +#include <boost/accumulators/statistics/max.hpp>
   36.24 +#include <boost/accumulators/statistics/mean.hpp>
   36.25 +#include <boost/accumulators/statistics/median.hpp>
   36.26 +#include <boost/accumulators/statistics/min.hpp>
   36.27 +#include <boost/accumulators/statistics/moment.hpp>
   36.28 +#include <boost/accumulators/statistics/peaks_over_threshold.hpp>
   36.29 +#include <boost/accumulators/statistics/pot_tail_mean.hpp>
   36.30 +#include <boost/accumulators/statistics/pot_quantile.hpp>
   36.31 +#include <boost/accumulators/statistics/p_square_cumulative_distribution.hpp>
   36.32 +#include <boost/accumulators/statistics/p_square_quantile.hpp>
   36.33 +#include <boost/accumulators/statistics/skewness.hpp>
   36.34 +#include <boost/accumulators/statistics/stats.hpp>
   36.35 +#include <boost/accumulators/statistics/sum.hpp>
   36.36 +#include <boost/accumulators/statistics/tail.hpp>
   36.37 +#include <boost/accumulators/statistics/tail_quantile.hpp>
   36.38 +#include <boost/accumulators/statistics/tail_mean.hpp>
   36.39 +#include <boost/accumulators/statistics/tail_variate.hpp>
   36.40 +#include <boost/accumulators/statistics/tail_variate_means.hpp>
   36.41 +#include <boost/accumulators/statistics/variance.hpp>
   36.42 +#include <boost/accumulators/statistics/weighted_covariance.hpp>
   36.43 +#include <boost/accumulators/statistics/weighted_density.hpp>
   36.44 +#include <boost/accumulators/statistics/weighted_kurtosis.hpp>
   36.45 +#include <boost/accumulators/statistics/weighted_extended_p_square.hpp>
   36.46 +#include <boost/accumulators/statistics/weighted_mean.hpp>
   36.47 +#include <boost/accumulators/statistics/weighted_median.hpp>
   36.48 +#include <boost/accumulators/statistics/weighted_moment.hpp>
   36.49 +#include <boost/accumulators/statistics/weighted_peaks_over_threshold.hpp>
   36.50 +#include <boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp>
   36.51 +#include <boost/accumulators/statistics/weighted_p_square_quantile.hpp>
   36.52 +#include <boost/accumulators/statistics/weighted_skewness.hpp>
   36.53 +#include <boost/accumulators/statistics/weighted_sum.hpp>
   36.54 +#include <boost/accumulators/statistics/weighted_tail_quantile.hpp>
   36.55 +#include <boost/accumulators/statistics/weighted_tail_mean.hpp>
   36.56 +#include <boost/accumulators/statistics/weighted_tail_variate_means.hpp>
   36.57 +#include <boost/accumulators/statistics/weighted_variance.hpp>
   36.58 +#include <boost/accumulators/statistics/with_error.hpp>
   36.59 +#include <boost/accumulators/statistics/parameters/quantile_probability.hpp>
   36.60 +#include <boost/accumulators/statistics/variates/covariate.hpp>
   36.61 +
   36.62 +#endif
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/boost_1_45_0/boost/accumulators/statistics/count.hpp	Fri Mar 04 12:48:37 2011 -0800
    37.3 @@ -0,0 +1,80 @@
    37.4 +///////////////////////////////////////////////////////////////////////////////
    37.5 +// count.hpp
    37.6 +//
    37.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    37.8 +//  Software License, Version 1.0. (See accompanying file
    37.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   37.10 +
   37.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_COUNT_HPP_EAN_28_10_2005
   37.12 +#define BOOST_ACCUMULATORS_STATISTICS_COUNT_HPP_EAN_28_10_2005
   37.13 +
   37.14 +#include <boost/mpl/always.hpp>
   37.15 +#include <boost/accumulators/framework/accumulator_base.hpp>
   37.16 +#include <boost/accumulators/framework/extractor.hpp>
   37.17 +#include <boost/accumulators/framework/depends_on.hpp>
   37.18 +#include <boost/accumulators/statistics_fwd.hpp>
   37.19 +
   37.20 +namespace boost { namespace accumulators
   37.21 +{
   37.22 +
   37.23 +namespace impl
   37.24 +{
   37.25 +
   37.26 +    ///////////////////////////////////////////////////////////////////////////////
   37.27 +    // count_impl
   37.28 +    struct count_impl
   37.29 +      : accumulator_base
   37.30 +    {
   37.31 +        // for boost::result_of
   37.32 +        typedef std::size_t result_type;
   37.33 +
   37.34 +        count_impl(dont_care)
   37.35 +          : cnt(0)
   37.36 +        {
   37.37 +        }
   37.38 +
   37.39 +        void operator ()(dont_care)
   37.40 +        {
   37.41 +            ++this->cnt;
   37.42 +        }
   37.43 +
   37.44 +        result_type result(dont_care) const
   37.45 +        {
   37.46 +            return this->cnt;
   37.47 +        }
   37.48 +
   37.49 +    private:
   37.50 +        std::size_t cnt;
   37.51 +    };
   37.52 +
   37.53 +} // namespace impl
   37.54 +
   37.55 +///////////////////////////////////////////////////////////////////////////////
   37.56 +// tag::count
   37.57 +//
   37.58 +namespace tag
   37.59 +{
   37.60 +    struct count
   37.61 +      : depends_on<>
   37.62 +    {
   37.63 +        /// INTERNAL ONLY
   37.64 +        ///
   37.65 +        typedef mpl::always<accumulators::impl::count_impl> impl;
   37.66 +    };
   37.67 +}
   37.68 +
   37.69 +///////////////////////////////////////////////////////////////////////////////
   37.70 +// extract::count
   37.71 +//
   37.72 +namespace extract
   37.73 +{
   37.74 +    extractor<tag::count> const count = {};
   37.75 +
   37.76 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(count)
   37.77 +}
   37.78 +
   37.79 +using extract::count;
   37.80 +
   37.81 +}} // namespace boost::accumulators
   37.82 +
   37.83 +#endif
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/boost_1_45_0/boost/accumulators/statistics/covariance.hpp	Fri Mar 04 12:48:37 2011 -0800
    38.3 @@ -0,0 +1,220 @@
    38.4 +///////////////////////////////////////////////////////////////////////////////
    38.5 +// covariance.hpp
    38.6 +//
    38.7 +//  Copyright 2006 Daniel Egloff, Olivier Gygi. Distributed under the Boost
    38.8 +//  Software License, Version 1.0. (See accompanying file
    38.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   38.10 +
   38.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_COVARIANCE_HPP_DE_01_01_2006
   38.12 +#define BOOST_ACCUMULATORS_STATISTICS_COVARIANCE_HPP_DE_01_01_2006
   38.13 +
   38.14 +#include <vector>
   38.15 +#include <limits>
   38.16 +#include <numeric>
   38.17 +#include <functional>
   38.18 +#include <complex>
   38.19 +#include <boost/mpl/assert.hpp>
   38.20 +#include <boost/mpl/bool.hpp>
   38.21 +#include <boost/range.hpp>
   38.22 +#include <boost/parameter/keyword.hpp>
   38.23 +#include <boost/mpl/placeholders.hpp>
   38.24 +#include <boost/numeric/ublas/io.hpp>
   38.25 +#include <boost/numeric/ublas/matrix.hpp>
   38.26 +#include <boost/type_traits/is_scalar.hpp>
   38.27 +#include <boost/type_traits/is_same.hpp>
   38.28 +#include <boost/accumulators/framework/accumulator_base.hpp>
   38.29 +#include <boost/accumulators/framework/extractor.hpp>
   38.30 +#include <boost/accumulators/numeric/functional.hpp>
   38.31 +#include <boost/accumulators/framework/parameters/sample.hpp>
   38.32 +#include <boost/accumulators/statistics_fwd.hpp>
   38.33 +#include <boost/accumulators/statistics/count.hpp>
   38.34 +#include <boost/accumulators/statistics/mean.hpp>
   38.35 +
   38.36 +namespace boost { namespace numeric
   38.37 +{
   38.38 +    namespace functional
   38.39 +    {
   38.40 +        struct std_vector_tag;
   38.41 +
   38.42 +        ///////////////////////////////////////////////////////////////////////////////
   38.43 +        // functional::outer_product
   38.44 +        template<typename Left, typename Right, typename EnableIf = void>
   38.45 +        struct outer_product_base
   38.46 +          : functional::multiplies<Left, Right>
   38.47 +        {};
   38.48 +
   38.49 +        template<typename Left, typename Right, typename LeftTag = typename tag<Left>::type, typename RightTag = typename tag<Right>::type>
   38.50 +        struct outer_product
   38.51 +          : outer_product_base<Left, Right, void>
   38.52 +        {};
   38.53 +
   38.54 +        template<typename Left, typename Right>
   38.55 +        struct outer_product<Left, Right, std_vector_tag, std_vector_tag>
   38.56 +          : std::binary_function<
   38.57 +                Left
   38.58 +              , Right
   38.59 +              , ublas::matrix<
   38.60 +                    typename functional::multiplies<
   38.61 +                        typename Left::value_type
   38.62 +                      , typename Right::value_type
   38.63 +                    >::result_type
   38.64 +                >
   38.65 +            >
   38.66 +        {
   38.67 +            typedef
   38.68 +                ublas::matrix<
   38.69 +                    typename functional::multiplies<
   38.70 +                        typename Left::value_type
   38.71 +                      , typename Right::value_type
   38.72 +                    >::result_type
   38.73 +                >
   38.74 +            result_type;
   38.75 +
   38.76 +            result_type
   38.77 +            operator ()(Left & left, Right & right) const
   38.78 +            {
   38.79 +                std::size_t left_size = left.size();
   38.80 +                std::size_t right_size = right.size();
   38.81 +                result_type result(left_size, right_size);
   38.82 +                for (std::size_t i = 0; i < left_size; ++i)
   38.83 +                    for (std::size_t j = 0; j < right_size; ++j)
   38.84 +                        result(i,j) = numeric::multiplies(left[i], right[j]);
   38.85 +                return result;
   38.86 +            }
   38.87 +        };
   38.88 +    }
   38.89 +
   38.90 +    namespace op
   38.91 +    {
   38.92 +        struct outer_product
   38.93 +          : boost::detail::function2<functional::outer_product<_1, _2, functional::tag<_1>, functional::tag<_2> > >
   38.94 +        {};
   38.95 +    }
   38.96 +
   38.97 +    namespace
   38.98 +    {
   38.99 +        op::outer_product const &outer_product = boost::detail::pod_singleton<op::outer_product>::instance;
  38.100 +    }
  38.101 +
  38.102 +}}
  38.103 +
  38.104 +namespace boost { namespace accumulators
  38.105 +{
  38.106 +
  38.107 +namespace impl
  38.108 +{
  38.109 +    ///////////////////////////////////////////////////////////////////////////////
  38.110 +    // covariance_impl
  38.111 +    //
  38.112 +    /**
  38.113 +        @brief Covariance Estimator
  38.114 +
  38.115 +        An iterative Monte Carlo estimator for the covariance \f$\mathrm{Cov}(X,X')\f$, where \f$X\f$ is a sample
  38.116 +        and \f$X'\f$ is a variate, is given by:
  38.117 +
  38.118 +        \f[
  38.119 +            \hat{c}_n = \frac{n-1}{n} \hat{c}_{n-1} + \frac{1}{n-1}(X_n - \hat{\mu}_n)(X_n' - \hat{\mu}_n'),\quad n\ge2,\quad\hat{c}_1 = 0,
  38.120 +        \f]
  38.121 +
  38.122 +        \f$\hat{\mu}_n\f$ and \f$\hat{\mu}_n'\f$ being the means of the samples and variates.
  38.123 +    */
  38.124 +    template<typename Sample, typename VariateType, typename VariateTag>
  38.125 +    struct covariance_impl
  38.126 +      : accumulator_base
  38.127 +    {
  38.128 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type sample_type;
  38.129 +        typedef typename numeric::functional::average<VariateType, std::size_t>::result_type variate_type;
  38.130 +        // for boost::result_of
  38.131 +        typedef typename numeric::functional::outer_product<sample_type, variate_type>::result_type result_type;
  38.132 +
  38.133 +        template<typename Args>
  38.134 +        covariance_impl(Args const &args)
  38.135 +          : cov_(
  38.136 +                numeric::outer_product(
  38.137 +                    numeric::average(args[sample | Sample()], (std::size_t)1)
  38.138 +                  , numeric::average(args[parameter::keyword<VariateTag>::get() | VariateType()], (std::size_t)1)
  38.139 +                )
  38.140 +            )
  38.141 +        {
  38.142 +        }
  38.143 +
  38.144 +        template<typename Args>
  38.145 +        void operator ()(Args const &args)
  38.146 +        {
  38.147 +            std::size_t cnt = count(args);
  38.148 +
  38.149 +            if (cnt > 1)
  38.150 +            {
  38.151 +                extractor<tag::mean_of_variates<VariateType, VariateTag> > const some_mean_of_variates = {};
  38.152 +
  38.153 +                this->cov_ = this->cov_*(cnt-1.)/cnt
  38.154 +                           + numeric::outer_product(
  38.155 +                                 some_mean_of_variates(args) - args[parameter::keyword<VariateTag>::get()]
  38.156 +                               , mean(args) - args[sample]
  38.157 +                             ) / (cnt-1.);
  38.158 +            }
  38.159 +        }
  38.160 +
  38.161 +        result_type result(dont_care) const
  38.162 +        {
  38.163 +            return this->cov_;
  38.164 +        }
  38.165 +
  38.166 +    private:
  38.167 +        result_type cov_;
  38.168 +    };
  38.169 +
  38.170 +} // namespace impl
  38.171 +
  38.172 +///////////////////////////////////////////////////////////////////////////////
  38.173 +// tag::covariance
  38.174 +//
  38.175 +namespace tag
  38.176 +{
  38.177 +    template<typename VariateType, typename VariateTag>
  38.178 +    struct covariance
  38.179 +      : depends_on<count, mean, mean_of_variates<VariateType, VariateTag> >
  38.180 +    {
  38.181 +        typedef accumulators::impl::covariance_impl<mpl::_1, VariateType, VariateTag> impl;
  38.182 +    };
  38.183 +
  38.184 +    struct abstract_covariance
  38.185 +      : depends_on<>
  38.186 +    {
  38.187 +    };
  38.188 +}
  38.189 +
  38.190 +///////////////////////////////////////////////////////////////////////////////
  38.191 +// extract::covariance
  38.192 +//
  38.193 +namespace extract
  38.194 +{
  38.195 +    extractor<tag::abstract_covariance> const covariance = {};
  38.196 +
  38.197 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(covariance)
  38.198 +}
  38.199 +
  38.200 +using extract::covariance;
  38.201 +
  38.202 +template<typename VariateType, typename VariateTag>
  38.203 +struct feature_of<tag::covariance<VariateType, VariateTag> >
  38.204 +  : feature_of<tag::abstract_covariance>
  38.205 +{
  38.206 +};
  38.207 +
  38.208 +// So that covariance can be automatically substituted with
  38.209 +// weighted_covariance when the weight parameter is non-void.
  38.210 +template<typename VariateType, typename VariateTag>
  38.211 +struct as_weighted_feature<tag::covariance<VariateType, VariateTag> >
  38.212 +{
  38.213 +    typedef tag::weighted_covariance<VariateType, VariateTag> type;
  38.214 +};
  38.215 +
  38.216 +template<typename VariateType, typename VariateTag>
  38.217 +struct feature_of<tag::weighted_covariance<VariateType, VariateTag> >
  38.218 +  : feature_of<tag::covariance<VariateType, VariateTag> >
  38.219 +{};
  38.220 +
  38.221 +}} // namespace boost::accumulators
  38.222 +
  38.223 +#endif
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/boost_1_45_0/boost/accumulators/statistics/density.hpp	Fri Mar 04 12:48:37 2011 -0800
    39.3 @@ -0,0 +1,246 @@
    39.4 +
    39.5 +///////////////////////////////////////////////////////////////////////////////
    39.6 +// density.hpp
    39.7 +//
    39.8 +//  Copyright 2006 Daniel Egloff, Olivier Gygi. Distributed under the Boost
    39.9 +//  Software License, Version 1.0. (See accompanying file
   39.10 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   39.11 +
   39.12 +#ifndef BOOST_ACCUMULATORS_STATISTICS_DENSITY_HPP_DE_01_01_2006
   39.13 +#define BOOST_ACCUMULATORS_STATISTICS_DENSITY_HPP_DE_01_01_2006
   39.14 +
   39.15 +#include <vector>
   39.16 +#include <limits>
   39.17 +#include <functional>
   39.18 +#include <boost/range.hpp>
   39.19 +#include <boost/parameter/keyword.hpp>
   39.20 +#include <boost/mpl/placeholders.hpp>
   39.21 +#include <boost/accumulators/framework/accumulator_base.hpp>
   39.22 +#include <boost/accumulators/framework/extractor.hpp>
   39.23 +#include <boost/accumulators/numeric/functional.hpp>
   39.24 +#include <boost/accumulators/framework/parameters/sample.hpp>
   39.25 +#include <boost/accumulators/framework/depends_on.hpp>
   39.26 +#include <boost/accumulators/statistics_fwd.hpp>
   39.27 +#include <boost/accumulators/statistics/count.hpp>
   39.28 +#include <boost/accumulators/statistics/max.hpp>
   39.29 +#include <boost/accumulators/statistics/min.hpp>
   39.30 +
   39.31 +namespace boost { namespace accumulators
   39.32 +{
   39.33 +
   39.34 +///////////////////////////////////////////////////////////////////////////////
   39.35 +// cache_size and num_bins named parameters
   39.36 +//
   39.37 +BOOST_PARAMETER_NESTED_KEYWORD(tag, density_cache_size, cache_size)
   39.38 +BOOST_PARAMETER_NESTED_KEYWORD(tag, density_num_bins, num_bins)
   39.39 +
   39.40 +namespace impl
   39.41 +{
   39.42 +    ///////////////////////////////////////////////////////////////////////////////
   39.43 +    // density_impl
   39.44 +    //  density histogram
   39.45 +    /**
   39.46 +        @brief Histogram density estimator
   39.47 +
   39.48 +        The histogram density estimator returns a histogram of the sample distribution. The positions and sizes of the bins
   39.49 +        are determined using a specifiable number of cached samples (cache_size). The range between the minimum and the
   39.50 +        maximum of the cached samples is subdivided into a specifiable number of bins (num_bins) of same size. Additionally,
   39.51 +        an under- and an overflow bin is added to capture future under- and overflow samples. Once the bins are determined,
   39.52 +        the cached samples and all subsequent samples are added to the correct bins. At the end, a range of std::pair is
   39.53 +        return, where each pair contains the position of the bin (lower bound) and the samples count (normalized with the
   39.54 +        total number of samples).
   39.55 +
   39.56 +        @param  density_cache_size Number of first samples used to determine min and max.
   39.57 +        @param  density_num_bins Number of bins (two additional bins collect under- and overflow samples).
   39.58 +    */
   39.59 +    template<typename Sample>
   39.60 +    struct density_impl
   39.61 +      : accumulator_base
   39.62 +    {
   39.63 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
   39.64 +        typedef std::vector<std::pair<float_type, float_type> > histogram_type;
   39.65 +        typedef std::vector<float_type> array_type;
   39.66 +        // for boost::result_of
   39.67 +        typedef iterator_range<typename histogram_type::iterator> result_type;
   39.68 +
   39.69 +        template<typename Args>
   39.70 +        density_impl(Args const &args)
   39.71 +            : cache_size(args[density_cache_size])
   39.72 +            , cache(cache_size)
   39.73 +            , num_bins(args[density_num_bins])
   39.74 +            , samples_in_bin(num_bins + 2, 0.)
   39.75 +            , bin_positions(num_bins + 2)
   39.76 +            , histogram(
   39.77 +                num_bins + 2
   39.78 +              , std::make_pair(
   39.79 +                    numeric::average(args[sample | Sample()],(std::size_t)1)
   39.80 +                  , numeric::average(args[sample | Sample()],(std::size_t)1)
   39.81 +                )
   39.82 +              )
   39.83 +            , is_dirty(true)
   39.84 +        {
   39.85 +        }
   39.86 +
   39.87 +        template<typename Args>
   39.88 +        void operator ()(Args const &args)
   39.89 +        {
   39.90 +            this->is_dirty = true;
   39.91 +
   39.92 +            std::size_t cnt = count(args);
   39.93 +
   39.94 +            // Fill up cache with cache_size first samples
   39.95 +            if (cnt <= this->cache_size)
   39.96 +            {
   39.97 +                this->cache[cnt - 1] = args[sample];
   39.98 +            }
   39.99 +
  39.100 +            // Once cache_size samples have been accumulated, create num_bins bins of same size between
  39.101 +            // the minimum and maximum of the cached samples as well as an under- and and an overflow bin.
  39.102 +            // Store their lower bounds (bin_positions) and fill the bins with the cached samples (samples_in_bin).
  39.103 +            if (cnt == this->cache_size)
  39.104 +            {
  39.105 +                float_type minimum = numeric::average((min)(args), (std::size_t)1);
  39.106 +                float_type maximum = numeric::average((max)(args), (std::size_t)1);
  39.107 +                float_type bin_size = numeric::average(maximum - minimum, this->num_bins );
  39.108 +
  39.109 +                // determine bin positions (their lower bounds)
  39.110 +                for (std::size_t i = 0; i < this->num_bins + 2; ++i)
  39.111 +                {
  39.112 +                    this->bin_positions[i] = minimum + (i - 1.) * bin_size;
  39.113 +                }
  39.114 +
  39.115 +                for (typename array_type::const_iterator iter = this->cache.begin(); iter != this->cache.end(); ++iter)
  39.116 +                {
  39.117 +                    if (*iter < this->bin_positions[1])
  39.118 +                    {
  39.119 +                        ++(this->samples_in_bin[0]);
  39.120 +                    }
  39.121 +                    else if (*iter >= this->bin_positions[this->num_bins + 1])
  39.122 +                    {
  39.123 +                        ++(this->samples_in_bin[this->num_bins + 1]);
  39.124 +                    }
  39.125 +                    else
  39.126 +                    {
  39.127 +                        typename array_type::iterator it = std::upper_bound(
  39.128 +                            this->bin_positions.begin()
  39.129 +                          , this->bin_positions.end()
  39.130 +                          , *iter
  39.131 +                        );
  39.132 +
  39.133 +                        std::size_t d = std::distance(this->bin_positions.begin(), it);
  39.134 +                        ++(this->samples_in_bin[d - 1]);
  39.135 +                    }
  39.136 +                }
  39.137 +            }
  39.138 +            // Add each subsequent sample to the correct bin
  39.139 +            else if (cnt > this->cache_size)
  39.140 +            {
  39.141 +                if (args[sample] < this->bin_positions[1])
  39.142 +                {
  39.143 +                    ++(this->samples_in_bin[0]);
  39.144 +                }
  39.145 +                else if (args[sample] >= this->bin_positions[this->num_bins + 1])
  39.146 +                {
  39.147 +                    ++(this->samples_in_bin[this->num_bins + 1]);
  39.148 +                }
  39.149 +                else
  39.150 +                {
  39.151 +                    typename array_type::iterator it = std::upper_bound(
  39.152 +                        this->bin_positions.begin()
  39.153 +                      , this->bin_positions.end()
  39.154 +                      , args[sample]
  39.155 +                    );
  39.156 +
  39.157 +                    std::size_t d = std::distance(this->bin_positions.begin(), it);
  39.158 +                    ++(this->samples_in_bin[d - 1]);
  39.159 +                }
  39.160 +            }
  39.161 +        }
  39.162 +
  39.163 +        /**
  39.164 +            @pre The number of samples must meet or exceed the cache size
  39.165 +        */
  39.166 +        template<typename Args>
  39.167 +        result_type result(Args const &args) const
  39.168 +        {
  39.169 +            if (this->is_dirty)
  39.170 +            {
  39.171 +                this->is_dirty = false;
  39.172 +
  39.173 +                // creates a vector of std::pair where each pair i holds
  39.174 +                // the values bin_positions[i] (x-axis of histogram) and
  39.175 +                // samples_in_bin[i] / cnt (y-axis of histogram).
  39.176 +
  39.177 +                for (std::size_t i = 0; i < this->num_bins + 2; ++i)
  39.178 +                {
  39.179 +                    this->histogram[i] = std::make_pair(this->bin_positions[i], numeric::average(this->samples_in_bin[i], count(args)));
  39.180 +                }
  39.181 +            }
  39.182 +            // returns a range of pairs
  39.183 +            return make_iterator_range(this->histogram);
  39.184 +        }
  39.185 +
  39.186 +    private:
  39.187 +        std::size_t            cache_size;      // number of cached samples
  39.188 +        array_type             cache;           // cache to store the first cache_size samples
  39.189 +        std::size_t            num_bins;        // number of bins
  39.190 +        array_type             samples_in_bin;  // number of samples in each bin
  39.191 +        array_type             bin_positions;   // lower bounds of bins
  39.192 +        mutable histogram_type histogram;       // histogram
  39.193 +        mutable bool is_dirty;
  39.194 +    };
  39.195 +
  39.196 +} // namespace impl
  39.197 +
  39.198 +///////////////////////////////////////////////////////////////////////////////
  39.199 +// tag::density
  39.200 +//
  39.201 +namespace tag
  39.202 +{
  39.203 +    struct density
  39.204 +      : depends_on<count, min, max>
  39.205 +      , density_cache_size
  39.206 +      , density_num_bins
  39.207 +    {
  39.208 +        /// INTERNAL ONLY
  39.209 +        ///
  39.210 +        typedef accumulators::impl::density_impl<mpl::_1> impl;
  39.211 +
  39.212 +        #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
  39.213 +        /// tag::density::cache_size named parameter
  39.214 +        /// tag::density::num_bins named parameter
  39.215 +        static boost::parameter::keyword<density_cache_size> const cache_size;
  39.216 +        static boost::parameter::keyword<density_num_bins> const num_bins;
  39.217 +        #endif
  39.218 +    };
  39.219 +}
  39.220 +
  39.221 +///////////////////////////////////////////////////////////////////////////////
  39.222 +// extract::density
  39.223 +//
  39.224 +namespace extract
  39.225 +{
  39.226 +    extractor<tag::density> const density = {};
  39.227 +
  39.228 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(density)
  39.229 +}
  39.230 +
  39.231 +using extract::density;
  39.232 +
  39.233 +// So that density can be automatically substituted
  39.234 +// with weighted_density when the weight parameter is non-void.
  39.235 +template<>
  39.236 +struct as_weighted_feature<tag::density>
  39.237 +{
  39.238 +    typedef tag::weighted_density type;
  39.239 +};
  39.240 +
  39.241 +template<>
  39.242 +struct feature_of<tag::weighted_density>
  39.243 +  : feature_of<tag::density>
  39.244 +{
  39.245 +};
  39.246 +
  39.247 +}} // namespace boost::accumulators
  39.248 +
  39.249 +#endif
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/boost_1_45_0/boost/accumulators/statistics/error_of.hpp	Fri Mar 04 12:48:37 2011 -0800
    40.3 @@ -0,0 +1,99 @@
    40.4 +///////////////////////////////////////////////////////////////////////////////
    40.5 +// error_of.hpp
    40.6 +//
    40.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    40.8 +//  Software License, Version 1.0. (See accompanying file
    40.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   40.10 +
   40.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
   40.12 +#define BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
   40.13 +
   40.14 +#include <boost/mpl/placeholders.hpp>
   40.15 +#include <boost/accumulators/framework/accumulator_base.hpp>
   40.16 +#include <boost/accumulators/framework/extractor.hpp>
   40.17 +#include <boost/accumulators/framework/depends_on.hpp>
   40.18 +#include <boost/accumulators/statistics_fwd.hpp>
   40.19 +
   40.20 +namespace boost { namespace accumulators
   40.21 +{
   40.22 +
   40.23 +namespace impl
   40.24 +{
   40.25 +    /// INTERNAL ONLY
   40.26 +    ///
   40.27 +    template<typename Feature>
   40.28 +    struct this_feature_has_no_error_calculation
   40.29 +      : mpl::false_
   40.30 +    {
   40.31 +    };
   40.32 +
   40.33 +    ///////////////////////////////////////////////////////////////////////////////
   40.34 +    // error_of_impl
   40.35 +    /// INTERNAL ONLY
   40.36 +    ///
   40.37 +    template<typename Sample, typename Feature>
   40.38 +    struct error_of_impl
   40.39 +      : accumulator_base
   40.40 +    {
   40.41 +        // TODO: specialize this on the specific features that have errors we're
   40.42 +        // interested in.
   40.43 +        BOOST_MPL_ASSERT((this_feature_has_no_error_calculation<Feature>));
   40.44 +
   40.45 +        // for boost::result_of
   40.46 +        typedef int result_type;
   40.47 +
   40.48 +        error_of_impl(dont_care)
   40.49 +        {
   40.50 +        }
   40.51 +
   40.52 +        result_type result(dont_care) const
   40.53 +        {
   40.54 +            return 0;
   40.55 +        }
   40.56 +    };
   40.57 +
   40.58 +} // namespace impl
   40.59 +
   40.60 +///////////////////////////////////////////////////////////////////////////////
   40.61 +// tag::error_of
   40.62 +//
   40.63 +namespace tag
   40.64 +{
   40.65 +    template<typename Feature>
   40.66 +    struct error_of
   40.67 +      : depends_on<Feature>
   40.68 +    {
   40.69 +        /// INTERNAL ONLY
   40.70 +        ///
   40.71 +        typedef accumulators::impl::error_of_impl<mpl::_1, Feature> impl;
   40.72 +    };
   40.73 +}
   40.74 +
   40.75 +///////////////////////////////////////////////////////////////////////////////
   40.76 +// extract::error_of
   40.77 +//
   40.78 +namespace extract
   40.79 +{
   40.80 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, error_of, (typename))
   40.81 +}
   40.82 +
   40.83 +using extract::error_of;
   40.84 +
   40.85 +// make tag::error_of<tag::feature(modifier)> work
   40.86 +template<typename Feature>
   40.87 +struct as_feature<tag::error_of<Feature> >
   40.88 +{
   40.89 +    typedef tag::error_of<typename as_feature<Feature>::type> type;
   40.90 +};
   40.91 +
   40.92 +// make error_of<tag::mean> work with non-void weights (should become
   40.93 +// error_of<tag::weighted_mean>
   40.94 +template<typename Feature>
   40.95 +struct as_weighted_feature<tag::error_of<Feature> >
   40.96 +{
   40.97 +    typedef tag::error_of<typename as_weighted_feature<Feature>::type> type;
   40.98 +};
   40.99 +
  40.100 +}} // namespace boost::accumulators
  40.101 +
  40.102 +#endif
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/boost_1_45_0/boost/accumulators/statistics/error_of_mean.hpp	Fri Mar 04 12:48:37 2011 -0800
    41.3 @@ -0,0 +1,73 @@
    41.4 +///////////////////////////////////////////////////////////////////////////////
    41.5 +// error_of.hpp
    41.6 +//
    41.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    41.8 +//  Software License, Version 1.0. (See accompanying file
    41.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   41.10 +
   41.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_MEAN_HPP_EAN_27_03_2006
   41.12 +#define BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_MEAN_HPP_EAN_27_03_2006
   41.13 +
   41.14 +#include <boost/mpl/placeholders.hpp>
   41.15 +#include <boost/accumulators/framework/accumulator_base.hpp>
   41.16 +#include <boost/accumulators/framework/extractor.hpp>
   41.17 +#include <boost/accumulators/framework/depends_on.hpp>
   41.18 +#include <boost/accumulators/statistics_fwd.hpp>
   41.19 +#include <boost/accumulators/statistics/error_of.hpp>
   41.20 +#include <boost/accumulators/statistics/variance.hpp>
   41.21 +#include <boost/accumulators/statistics/count.hpp>
   41.22 +
   41.23 +namespace boost { namespace accumulators
   41.24 +{
   41.25 +
   41.26 +namespace impl
   41.27 +{
   41.28 +    ///////////////////////////////////////////////////////////////////////////////
   41.29 +    // error_of_mean_impl
   41.30 +    template<typename Sample, typename Variance>
   41.31 +    struct error_of_mean_impl
   41.32 +      : accumulator_base
   41.33 +    {
   41.34 +        // for boost::result_of
   41.35 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type;
   41.36 +
   41.37 +        error_of_mean_impl(dont_care) {}
   41.38 +
   41.39 +        template<typename Args>
   41.40 +        result_type result(Args const &args) const
   41.41 +        {
   41.42 +            using namespace std;
   41.43 +            extractor<Variance> const variance = {};
   41.44 +            return sqrt(numeric::average(variance(args), count(args) - 1));
   41.45 +        }
   41.46 +    };
   41.47 +
   41.48 +} // namespace impl
   41.49 +
   41.50 +///////////////////////////////////////////////////////////////////////////////
   41.51 +// tag::error_of
   41.52 +//
   41.53 +namespace tag
   41.54 +{
   41.55 +    template<>
   41.56 +    struct error_of<mean>
   41.57 +      : depends_on<lazy_variance, count>
   41.58 +    {
   41.59 +        /// INTERNAL ONLY
   41.60 +        ///
   41.61 +        typedef accumulators::impl::error_of_mean_impl<mpl::_1, lazy_variance> impl;
   41.62 +    };
   41.63 +
   41.64 +    template<>
   41.65 +    struct error_of<immediate_mean>
   41.66 +      : depends_on<variance, count>
   41.67 +    {
   41.68 +        /// INTERNAL ONLY
   41.69 +        ///
   41.70 +        typedef accumulators::impl::error_of_mean_impl<mpl::_1, variance> impl;
   41.71 +    };
   41.72 +}
   41.73 +
   41.74 +}} // namespace boost::accumulators
   41.75 +
   41.76 +#endif
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/boost_1_45_0/boost/accumulators/statistics/extended_p_square.hpp	Fri Mar 04 12:48:37 2011 -0800
    42.3 @@ -0,0 +1,293 @@
    42.4 +///////////////////////////////////////////////////////////////////////////////
    42.5 +// extended_p_square.hpp
    42.6 +//
    42.7 +//  Copyright 2005 Daniel Egloff. Distributed under the Boost
    42.8 +//  Software License, Version 1.0. (See accompanying file
    42.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   42.10 +
   42.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_EXTENDED_SINGLE_HPP_DE_01_01_2006
   42.12 +#define BOOST_ACCUMULATORS_STATISTICS_EXTENDED_SINGLE_HPP_DE_01_01_2006
   42.13 +
   42.14 +#include <vector>
   42.15 +#include <functional>
   42.16 +#include <boost/range/begin.hpp>
   42.17 +#include <boost/range/end.hpp>
   42.18 +#include <boost/range/iterator_range.hpp>
   42.19 +#include <boost/iterator/transform_iterator.hpp>
   42.20 +#include <boost/iterator/counting_iterator.hpp>
   42.21 +#include <boost/iterator/permutation_iterator.hpp>
   42.22 +#include <boost/parameter/keyword.hpp>
   42.23 +#include <boost/mpl/placeholders.hpp>
   42.24 +#include <boost/accumulators/framework/accumulator_base.hpp>
   42.25 +#include <boost/accumulators/framework/extractor.hpp>
   42.26 +#include <boost/accumulators/numeric/functional.hpp>
   42.27 +#include <boost/accumulators/framework/parameters/sample.hpp>
   42.28 +#include <boost/accumulators/framework/depends_on.hpp>
   42.29 +#include <boost/accumulators/statistics_fwd.hpp>
   42.30 +#include <boost/accumulators/statistics/count.hpp>
   42.31 +#include <boost/accumulators/statistics/times2_iterator.hpp>
   42.32 +
   42.33 +namespace boost { namespace accumulators
   42.34 +{
   42.35 +///////////////////////////////////////////////////////////////////////////////
   42.36 +// probabilities named parameter
   42.37 +//
   42.38 +BOOST_PARAMETER_NESTED_KEYWORD(tag, extended_p_square_probabilities, probabilities)
   42.39 +
   42.40 +namespace impl
   42.41 +{
   42.42 +    ///////////////////////////////////////////////////////////////////////////////
   42.43 +    // extended_p_square_impl
   42.44 +    //  multiple quantile estimation
   42.45 +    /**
   42.46 +        @brief Multiple quantile estimation with the extended \f$P^2\f$ algorithm
   42.47 +
   42.48 +        Extended \f$P^2\f$ algorithm for estimation of several quantiles without storing samples.
   42.49 +        Assume that \f$m\f$ quantiles \f$\xi_{p_1}, \ldots, \xi_{p_m}\f$ are to be estimated.
   42.50 +        Instead of storing the whole sample cumulative distribution, the algorithm maintains only
   42.51 +        \f$m+2\f$ principal markers and \f$m+1\f$ middle markers, whose positions are updated
   42.52 +        with each sample and whose heights are adjusted (if necessary) using a piecewise-parablic
   42.53 +        formula. The heights of these central markers are the current estimates of the quantiles
   42.54 +        and returned as an iterator range.
   42.55 +
   42.56 +        For further details, see
   42.57 +
   42.58 +        K. E. E. Raatikainen, Simultaneous estimation of several quantiles, Simulation, Volume 49,
   42.59 +        Number 4 (October), 1986, p. 159-164.
   42.60 +
   42.61 +        The extended \f$ P^2 \f$ algorithm generalizess the \f$ P^2 \f$ algorithm of
   42.62 +
   42.63 +        R. Jain and I. Chlamtac, The P^2 algorithmus for dynamic calculation of quantiles and
   42.64 +        histograms without storing observations, Communications of the ACM,
   42.65 +        Volume 28 (October), Number 10, 1985, p. 1076-1085.
   42.66 +
   42.67 +        @param extended_p_square_probabilities A vector of quantile probabilities.
   42.68 +    */
   42.69 +    template<typename Sample>
   42.70 +    struct extended_p_square_impl
   42.71 +      : accumulator_base
   42.72 +    {
   42.73 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
   42.74 +        typedef std::vector<float_type> array_type;
   42.75 +        // for boost::result_of
   42.76 +        typedef iterator_range<
   42.77 +            detail::lvalue_index_iterator<
   42.78 +                permutation_iterator<
   42.79 +                    typename array_type::const_iterator
   42.80 +                  , detail::times2_iterator
   42.81 +                >
   42.82 +            >
   42.83 +        > result_type;
   42.84 +
   42.85 +        template<typename Args>
   42.86 +        extended_p_square_impl(Args const &args)
   42.87 +          : probabilities(
   42.88 +                boost::begin(args[extended_p_square_probabilities])
   42.89 +              , boost::end(args[extended_p_square_probabilities])
   42.90 +            )
   42.91 +          , heights(2 * probabilities.size() + 3)
   42.92 +          , actual_positions(heights.size())
   42.93 +          , desired_positions(heights.size())
   42.94 +          , positions_increments(heights.size())
   42.95 +        {
   42.96 +            std::size_t num_quantiles = this->probabilities.size();
   42.97 +            std::size_t num_markers = this->heights.size();
   42.98 +
   42.99 +            for(std::size_t i = 0; i < num_markers; ++i)
  42.100 +            {
  42.101 +                this->actual_positions[i] = i + 1;
  42.102 +            }
  42.103 +
  42.104 +            this->positions_increments[0] = 0.;
  42.105 +            this->positions_increments[num_markers - 1] = 1.;
  42.106 +
  42.107 +            for(std::size_t i = 0; i < num_quantiles; ++i)
  42.108 +            {
  42.109 +                this->positions_increments[2 * i + 2] = probabilities[i];
  42.110 +            }
  42.111 +
  42.112 +            for(std::size_t i = 0; i <= num_quantiles; ++i)
  42.113 +            {
  42.114 +                this->positions_increments[2 * i + 1] =
  42.115 +                    0.5 * (this->positions_increments[2 * i] + this->positions_increments[2 * i + 2]);
  42.116 +            }
  42.117 +
  42.118 +            for(std::size_t i = 0; i < num_markers; ++i)
  42.119 +            {
  42.120 +                this->desired_positions[i] = 1. + 2. * (num_quantiles + 1.) * this->positions_increments[i];
  42.121 +            }
  42.122 +        }
  42.123 +
  42.124 +        template<typename Args>
  42.125 +        void operator ()(Args const &args)
  42.126 +        {
  42.127 +            std::size_t cnt = count(args);
  42.128 +
  42.129 +            // m+2 principal markers and m+1 middle markers
  42.130 +            std::size_t num_markers = 2 * this->probabilities.size() + 3;
  42.131 +
  42.132 +            // first accumulate num_markers samples
  42.133 +            if(cnt <= num_markers)
  42.134 +            {
  42.135 +                this->heights[cnt - 1] = args[sample];
  42.136 +
  42.137 +                // complete the initialization of heights by sorting
  42.138 +                if(cnt == num_markers)
  42.139 +                {
  42.140 +                    std::sort(this->heights.begin(), this->heights.end());
  42.141 +                }
  42.142 +            }
  42.143 +            else
  42.144 +            {
  42.145 +                std::size_t sample_cell = 1;
  42.146 +
  42.147 +                // find cell k = sample_cell such that heights[k-1] <= sample < heights[k]
  42.148 +                if(args[sample] < this->heights[0])
  42.149 +                {
  42.150 +                    this->heights[0] = args[sample];
  42.151 +                    sample_cell = 1;
  42.152 +                }
  42.153 +                else if(args[sample] >= this->heights[num_markers - 1])
  42.154 +                {
  42.155 +                    this->heights[num_markers - 1] = args[sample];
  42.156 +                    sample_cell = num_markers - 1;
  42.157 +                }
  42.158 +                else
  42.159 +                {
  42.160 +                    typedef typename array_type::iterator iterator;
  42.161 +                    iterator it = std::upper_bound(
  42.162 +                        this->heights.begin()
  42.163 +                      , this->heights.end()
  42.164 +                      , args[sample]
  42.165 +                    );
  42.166 +
  42.167 +                    sample_cell = std::distance(this->heights.begin(), it);
  42.168 +                }
  42.169 +
  42.170 +                // update actual positions of all markers above sample_cell index
  42.171 +                for(std::size_t i = sample_cell; i < num_markers; ++i)
  42.172 +                {
  42.173 +                    ++this->actual_positions[i];
  42.174 +                }
  42.175 +
  42.176 +                // update desired positions of all markers
  42.177 +                for(std::size_t i = 0; i < num_markers; ++i)
  42.178 +                {
  42.179 +                    this->desired_positions[i] += this->positions_increments[i];
  42.180 +                }
  42.181 +
  42.182 +                // adjust heights and actual positions of markers 1 to num_markers-2 if necessary
  42.183 +                for(std::size_t i = 1; i <= num_markers - 2; ++i)
  42.184 +                {
  42.185 +                    // offset to desired position
  42.186 +                    float_type d = this->desired_positions[i] - this->actual_positions[i];
  42.187 +
  42.188 +                    // offset to next position
  42.189 +                    float_type dp = this->actual_positions[i+1] - this->actual_positions[i];
  42.190 +
  42.191 +                    // offset to previous position
  42.192 +                    float_type dm = this->actual_positions[i-1] - this->actual_positions[i];
  42.193 +
  42.194 +                    // height ds
  42.195 +                    float_type hp = (this->heights[i+1] - this->heights[i]) / dp;
  42.196 +                    float_type hm = (this->heights[i-1] - this->heights[i]) / dm;
  42.197 +
  42.198 +                    if((d >= 1 && dp > 1) || (d <= -1 && dm < -1))
  42.199 +                    {
  42.200 +                        short sign_d = static_cast<short>(d / std::abs(d));
  42.201 +
  42.202 +                        float_type h = this->heights[i] + sign_d / (dp - dm) * ((sign_d - dm)*hp
  42.203 +                                     + (dp - sign_d) * hm);
  42.204 +
  42.205 +                        // try adjusting heights[i] using p-squared formula
  42.206 +                        if(this->heights[i - 1] < h && h < this->heights[i + 1])
  42.207 +                        {
  42.208 +                            this->heights[i] = h;
  42.209 +                        }
  42.210 +                        else
  42.211 +                        {
  42.212 +                            // use linear formula
  42.213 +                            if(d > 0)
  42.214 +                            {
  42.215 +                                this->heights[i] += hp;
  42.216 +                            }
  42.217 +                            if(d < 0)
  42.218 +                            {
  42.219 +                                this->heights[i] -= hm;
  42.220 +                            }
  42.221 +                        }
  42.222 +                        this->actual_positions[i] += sign_d;
  42.223 +                    }
  42.224 +                }
  42.225 +            }
  42.226 +        }
  42.227 +
  42.228 +        result_type result(dont_care) const
  42.229 +        {
  42.230 +            // for i in [1,probabilities.size()], return heights[i * 2]
  42.231 +            detail::times2_iterator idx_begin = detail::make_times2_iterator(1);
  42.232 +            detail::times2_iterator idx_end = detail::make_times2_iterator(this->probabilities.size() + 1);
  42.233 +
  42.234 +            return result_type(
  42.235 +                make_permutation_iterator(this->heights.begin(), idx_begin)
  42.236 +              , make_permutation_iterator(this->heights.begin(), idx_end)
  42.237 +            );
  42.238 +        }
  42.239 +
  42.240 +    private:
  42.241 +        array_type probabilities;         // the quantile probabilities
  42.242 +        array_type heights;               // q_i
  42.243 +        array_type actual_positions;      // n_i
  42.244 +        array_type desired_positions;     // d_i
  42.245 +        array_type positions_increments;  // f_i
  42.246 +    };
  42.247 +
  42.248 +} // namespace impl
  42.249 +
  42.250 +///////////////////////////////////////////////////////////////////////////////
  42.251 +// tag::extended_p_square
  42.252 +//
  42.253 +namespace tag
  42.254 +{
  42.255 +    struct extended_p_square
  42.256 +      : depends_on<count>
  42.257 +      , extended_p_square_probabilities
  42.258 +    {
  42.259 +        typedef accumulators::impl::extended_p_square_impl<mpl::_1> impl;
  42.260 +
  42.261 +        #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
  42.262 +        /// tag::extended_p_square::probabilities named paramter
  42.263 +        static boost::parameter::keyword<tag::probabilities> const probabilities;
  42.264 +        #endif
  42.265 +    };
  42.266 +}
  42.267 +
  42.268 +///////////////////////////////////////////////////////////////////////////////
  42.269 +// extract::extended_p_square
  42.270 +//
  42.271 +namespace extract
  42.272 +{
  42.273 +    extractor<tag::extended_p_square> const extended_p_square = {};
  42.274 +
  42.275 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(extended_p_square)
  42.276 +}
  42.277 +
  42.278 +using extract::extended_p_square;
  42.279 +
  42.280 +// So that extended_p_square can be automatically substituted with
  42.281 +// weighted_extended_p_square when the weight parameter is non-void
  42.282 +template<>
  42.283 +struct as_weighted_feature<tag::extended_p_square>
  42.284 +{
  42.285 +    typedef tag::weighted_extended_p_square type;
  42.286 +};
  42.287 +
  42.288 +template<>
  42.289 +struct feature_of<tag::weighted_extended_p_square>
  42.290 +  : feature_of<tag::extended_p_square>
  42.291 +{
  42.292 +};
  42.293 +
  42.294 +}} // namespace boost::accumulators
  42.295 +
  42.296 +#endif
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/boost_1_45_0/boost/accumulators/statistics/extended_p_square_quantile.hpp	Fri Mar 04 12:48:37 2011 -0800
    43.3 @@ -0,0 +1,319 @@
    43.4 +///////////////////////////////////////////////////////////////////////////////
    43.5 +// extended_p_square_quantile.hpp
    43.6 +//
    43.7 +//  Copyright 2005 Daniel Egloff. Distributed under the Boost
    43.8 +//  Software License, Version 1.0. (See accompanying file
    43.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   43.10 +
   43.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_EXTENDED_SINGLE_QUANTILE_HPP_DE_01_01_2006
   43.12 +#define BOOST_ACCUMULATORS_STATISTICS_EXTENDED_SINGLE_QUANTILE_HPP_DE_01_01_2006
   43.13 +
   43.14 +#include <vector>
   43.15 +#include <functional>
   43.16 +#include <boost/range/begin.hpp>
   43.17 +#include <boost/range/end.hpp>
   43.18 +#include <boost/range/iterator_range.hpp>
   43.19 +#include <boost/iterator/transform_iterator.hpp>
   43.20 +#include <boost/iterator/counting_iterator.hpp>
   43.21 +#include <boost/iterator/permutation_iterator.hpp>
   43.22 +#include <boost/parameter/keyword.hpp>
   43.23 +#include <boost/mpl/placeholders.hpp>
   43.24 +#include <boost/type_traits/is_same.hpp>
   43.25 +#include <boost/accumulators/framework/accumulator_base.hpp>
   43.26 +#include <boost/accumulators/framework/extractor.hpp>
   43.27 +#include <boost/accumulators/numeric/functional.hpp>
   43.28 +#include <boost/accumulators/framework/parameters/sample.hpp>
   43.29 +#include <boost/accumulators/framework/depends_on.hpp>
   43.30 +#include <boost/accumulators/statistics_fwd.hpp>
   43.31 +#include <boost/accumulators/statistics/count.hpp>
   43.32 +#include <boost/accumulators/statistics/parameters/quantile_probability.hpp>
   43.33 +#include <boost/accumulators/statistics/extended_p_square.hpp>
   43.34 +#include <boost/accumulators/statistics/weighted_extended_p_square.hpp>
   43.35 +#include <boost/accumulators/statistics/times2_iterator.hpp>
   43.36 +
   43.37 +#ifdef _MSC_VER
   43.38 +# pragma warning(push)
   43.39 +# pragma warning(disable: 4127) // conditional expression is constant
   43.40 +#endif
   43.41 +
   43.42 +namespace boost { namespace accumulators
   43.43 +{
   43.44 +
   43.45 +namespace impl
   43.46 +{
   43.47 +    ///////////////////////////////////////////////////////////////////////////////
   43.48 +    // extended_p_square_quantile_impl
   43.49 +    //  single quantile estimation
   43.50 +    /**
   43.51 +        @brief Quantile estimation using the extended \f$P^2\f$ algorithm for weighted and unweighted samples
   43.52 +
   43.53 +        Uses the quantile estimates calculated by the extended \f$P^2\f$ algorithm to compute
   43.54 +        intermediate quantile estimates by means of quadratic interpolation.
   43.55 +
   43.56 +        @param quantile_probability The probability of the quantile to be estimated.
   43.57 +    */
   43.58 +    template<typename Sample, typename Impl1, typename Impl2> // Impl1: weighted/unweighted // Impl2: linear/quadratic
   43.59 +    struct extended_p_square_quantile_impl
   43.60 +      : accumulator_base
   43.61 +    {
   43.62 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
   43.63 +        typedef std::vector<float_type> array_type;
   43.64 +        typedef iterator_range<
   43.65 +            detail::lvalue_index_iterator<
   43.66 +                permutation_iterator<
   43.67 +                    typename array_type::const_iterator
   43.68 +                  , detail::times2_iterator
   43.69 +                >
   43.70 +            >
   43.71 +        > range_type;
   43.72 +        // for boost::result_of
   43.73 +        typedef float_type result_type;
   43.74 +
   43.75 +        template<typename Args>
   43.76 +        extended_p_square_quantile_impl(Args const &args)
   43.77 +          : probabilities(
   43.78 +                boost::begin(args[extended_p_square_probabilities])
   43.79 +              , boost::end(args[extended_p_square_probabilities])
   43.80 +            )
   43.81 +        {
   43.82 +        }
   43.83 +
   43.84 +        template<typename Args>
   43.85 +        result_type result(Args const &args) const
   43.86 +        {
   43.87 +            typedef
   43.88 +                typename mpl::if_<
   43.89 +                    is_same<Impl1, weighted>
   43.90 +                  , tag::weighted_extended_p_square
   43.91 +                  , tag::extended_p_square
   43.92 +                >::type
   43.93 +            extended_p_square_tag;
   43.94 +
   43.95 +            extractor<extended_p_square_tag> const some_extended_p_square = {};
   43.96 +
   43.97 +            array_type heights(some_extended_p_square(args).size());
   43.98 +            std::copy(some_extended_p_square(args).begin(), some_extended_p_square(args).end(), heights.begin());
   43.99 +
  43.100 +            this->probability = args[quantile_probability];
  43.101 +
  43.102 +            typename array_type::const_iterator iter_probs = std::lower_bound(this->probabilities.begin(), this->probabilities.end(), this->probability);
  43.103 +            std::size_t dist = std::distance(this->probabilities.begin(), iter_probs);
  43.104 +            typename array_type::const_iterator iter_heights = heights.begin() + dist;
  43.105 +
  43.106 +            // If this->probability is not in a valid range return NaN or throw exception
  43.107 +            if (this->probability < *this->probabilities.begin() || this->probability > *(this->probabilities.end() - 1))
  43.108 +            {
  43.109 +                if (std::numeric_limits<result_type>::has_quiet_NaN)
  43.110 +                {
  43.111 +                    return std::numeric_limits<result_type>::quiet_NaN();
  43.112 +                }
  43.113 +                else
  43.114 +                {
  43.115 +                    std::ostringstream msg;
  43.116 +                    msg << "probability = " << this->probability << " is not in valid range (";
  43.117 +                    msg << *this->probabilities.begin() << ", " << *(this->probabilities.end() - 1) << ")";
  43.118 +                    boost::throw_exception(std::runtime_error(msg.str()));
  43.119 +                    return Sample(0);
  43.120 +                }
  43.121 +
  43.122 +            }
  43.123 +
  43.124 +            if (*iter_probs == this->probability)
  43.125 +            {
  43.126 +                return heights[dist];
  43.127 +            }
  43.128 +            else
  43.129 +            {
  43.130 +                result_type res;
  43.131 +
  43.132 +                if (is_same<Impl2, linear>::value)
  43.133 +                {
  43.134 +                    /////////////////////////////////////////////////////////////////////////////////
  43.135 +                    // LINEAR INTERPOLATION
  43.136 +                    //
  43.137 +                    float_type p1 = *iter_probs;
  43.138 +                    float_type p0 = *(iter_probs - 1);
  43.139 +                    float_type h1 = *iter_heights;
  43.140 +                    float_type h0 = *(iter_heights - 1);
  43.141 +
  43.142 +                    float_type a = numeric::average(h1 - h0, p1 - p0);
  43.143 +                    float_type b = h1 - p1 * a;
  43.144 +
  43.145 +                    res = a * this->probability + b;
  43.146 +                }
  43.147 +                else
  43.148 +                {
  43.149 +                    /////////////////////////////////////////////////////////////////////////////////
  43.150 +                    // QUADRATIC INTERPOLATION
  43.151 +                    //
  43.152 +                    float_type p0, p1, p2;
  43.153 +                    float_type h0, h1, h2;
  43.154 +
  43.155 +                    if ( (dist == 1 || *iter_probs - this->probability <= this->probability - *(iter_probs - 1) ) && dist != this->probabilities.size() - 1 )
  43.156 +                    {
  43.157 +                        p0 = *(iter_probs - 1);
  43.158 +                        p1 = *iter_probs;
  43.159 +                        p2 = *(iter_probs + 1);
  43.160 +                        h0 = *(iter_heights - 1);
  43.161 +                        h1 = *iter_heights;
  43.162 +                        h2 = *(iter_heights + 1);
  43.163 +                    }
  43.164 +                    else
  43.165 +                    {
  43.166 +                        p0 = *(iter_probs - 2);
  43.167 +                        p1 = *(iter_probs - 1);
  43.168 +                        p2 = *iter_probs;
  43.169 +                        h0 = *(iter_heights - 2);
  43.170 +                        h1 = *(iter_heights - 1);
  43.171 +                        h2 = *iter_heights;
  43.172 +                    }
  43.173 +
  43.174 +                    float_type hp21 = numeric::average(h2 - h1, p2 - p1);
  43.175 +                    float_type hp10 = numeric::average(h1 - h0, p1 - p0);
  43.176 +                    float_type p21  = numeric::average(p2 * p2 - p1 * p1, p2 - p1);
  43.177 +                    float_type p10  = numeric::average(p1 * p1 - p0 * p0, p1 - p0);
  43.178 +
  43.179 +                    float_type a = numeric::average(hp21 - hp10, p21 - p10);
  43.180 +                    float_type b = hp21 - a * p21;
  43.181 +                    float_type c = h2 - a * p2 * p2 - b * p2;
  43.182 +
  43.183 +                    res = a * this->probability * this-> probability + b * this->probability + c;
  43.184 +                }
  43.185 +
  43.186 +                return res;
  43.187 +            }
  43.188 +
  43.189 +        }
  43.190 +    private:
  43.191 +
  43.192 +        array_type probabilities;
  43.193 +        mutable float_type probability;
  43.194 +
  43.195 +    };
  43.196 +
  43.197 +} // namespace impl
  43.198 +
  43.199 +///////////////////////////////////////////////////////////////////////////////
  43.200 +// tag::extended_p_square_quantile
  43.201 +//
  43.202 +namespace tag
  43.203 +{
  43.204 +    struct extended_p_square_quantile
  43.205 +      : depends_on<extended_p_square>
  43.206 +    {
  43.207 +        typedef accumulators::impl::extended_p_square_quantile_impl<mpl::_1, unweighted, linear> impl;
  43.208 +    };
  43.209 +    struct extended_p_square_quantile_quadratic
  43.210 +      : depends_on<extended_p_square>
  43.211 +    {
  43.212 +        typedef accumulators::impl::extended_p_square_quantile_impl<mpl::_1, unweighted, quadratic> impl;
  43.213 +    };
  43.214 +    struct weighted_extended_p_square_quantile
  43.215 +      : depends_on<weighted_extended_p_square>
  43.216 +    {
  43.217 +        typedef accumulators::impl::extended_p_square_quantile_impl<mpl::_1, weighted, linear> impl;
  43.218 +    };
  43.219 +    struct weighted_extended_p_square_quantile_quadratic
  43.220 +      : depends_on<weighted_extended_p_square>
  43.221 +    {
  43.222 +        typedef accumulators::impl::extended_p_square_quantile_impl<mpl::_1, weighted, quadratic> impl;
  43.223 +    };
  43.224 +}
  43.225 +
  43.226 +///////////////////////////////////////////////////////////////////////////////
  43.227 +// extract::extended_p_square_quantile
  43.228 +// extract::weighted_extended_p_square_quantile
  43.229 +//
  43.230 +namespace extract
  43.231 +{
  43.232 +    extractor<tag::extended_p_square_quantile> const extended_p_square_quantile = {};
  43.233 +    extractor<tag::extended_p_square_quantile_quadratic> const extended_p_square_quantile_quadratic = {};
  43.234 +    extractor<tag::weighted_extended_p_square_quantile> const weighted_extended_p_square_quantile = {};
  43.235 +    extractor<tag::weighted_extended_p_square_quantile_quadratic> const weighted_extended_p_square_quantile_quadratic = {};
  43.236 +
  43.237 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(extended_p_square_quantile)
  43.238 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(extended_p_square_quantile_quadratic)
  43.239 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(weighted_extended_p_square_quantile)
  43.240 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(weighted_extended_p_square_quantile_quadratic)
  43.241 +}
  43.242 +
  43.243 +using extract::extended_p_square_quantile;
  43.244 +using extract::extended_p_square_quantile_quadratic;
  43.245 +using extract::weighted_extended_p_square_quantile;
  43.246 +using extract::weighted_extended_p_square_quantile_quadratic;
  43.247 +
  43.248 +// extended_p_square_quantile(linear) -> extended_p_square_quantile
  43.249 +template<>
  43.250 +struct as_feature<tag::extended_p_square_quantile(linear)>
  43.251 +{
  43.252 +    typedef tag::extended_p_square_quantile type;
  43.253 +};
  43.254 +
  43.255 +// extended_p_square_quantile(quadratic) -> extended_p_square_quantile_quadratic
  43.256 +template<>
  43.257 +struct as_feature<tag::extended_p_square_quantile(quadratic)>
  43.258 +{
  43.259 +    typedef tag::extended_p_square_quantile_quadratic type;
  43.260 +};
  43.261 +
  43.262 +// weighted_extended_p_square_quantile(linear) -> weighted_extended_p_square_quantile
  43.263 +template<>
  43.264 +struct as_feature<tag::weighted_extended_p_square_quantile(linear)>
  43.265 +{
  43.266 +    typedef tag::weighted_extended_p_square_quantile type;
  43.267 +};
  43.268 +
  43.269 +// weighted_extended_p_square_quantile(quadratic) -> weighted_extended_p_square_quantile_quadratic
  43.270 +template<>
  43.271 +struct as_feature<tag::weighted_extended_p_square_quantile(quadratic)>
  43.272 +{
  43.273 +    typedef tag::weighted_extended_p_square_quantile_quadratic type;
  43.274 +};
  43.275 +
  43.276 +// for the purposes of feature-based dependency resolution,
  43.277 +// extended_p_square_quantile and weighted_extended_p_square_quantile
  43.278 +// provide the same feature as quantile
  43.279 +template<>
  43.280 +struct feature_of<tag::extended_p_square_quantile>
  43.281 +  : feature_of<tag::quantile>
  43.282 +{
  43.283 +};
  43.284 +template<>
  43.285 +struct feature_of<tag::extended_p_square_quantile_quadratic>
  43.286 +  : feature_of<tag::quantile>
  43.287 +{
  43.288 +};
  43.289 +// So that extended_p_square_quantile can be automatically substituted with
  43.290 +// weighted_extended_p_square_quantile when the weight parameter is non-void
  43.291 +template<>
  43.292 +struct as_weighted_feature<tag::extended_p_square_quantile>
  43.293 +{
  43.294 +    typedef tag::weighted_extended_p_square_quantile type;
  43.295 +};
  43.296 +
  43.297 +template<>
  43.298 +struct feature_of<tag::weighted_extended_p_square_quantile>
  43.299 +  : feature_of<tag::extended_p_square_quantile>
  43.300 +{
  43.301 +};
  43.302 +
  43.303 +// So that extended_p_square_quantile_quadratic can be automatically substituted with
  43.304 +// weighted_extended_p_square_quantile_quadratic when the weight parameter is non-void
  43.305 +template<>
  43.306 +struct as_weighted_feature<tag::extended_p_square_quantile_quadratic>
  43.307 +{
  43.308 +    typedef tag::weighted_extended_p_square_quantile_quadratic type;
  43.309 +};
  43.310 +template<>
  43.311 +struct feature_of<tag::weighted_extended_p_square_quantile_quadratic>
  43.312 +  : feature_of<tag::extended_p_square_quantile_quadratic>
  43.313 +{
  43.314 +};
  43.315 +
  43.316 +}} // namespace boost::accumulators
  43.317 +
  43.318 +#ifdef _MSC_VER
  43.319 +# pragma warning(pop)
  43.320 +#endif
  43.321 +
  43.322 +#endif
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/boost_1_45_0/boost/accumulators/statistics/kurtosis.hpp	Fri Mar 04 12:48:37 2011 -0800
    44.3 @@ -0,0 +1,112 @@
    44.4 +///////////////////////////////////////////////////////////////////////////////
    44.5 +// kurtosis.hpp
    44.6 +//
    44.7 +//  Copyright 2006 Olivier Gygi, Daniel Egloff. Distributed under the Boost
    44.8 +//  Software License, Version 1.0. (See accompanying file
    44.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   44.10 +
   44.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_KURTOSIS_HPP_EAN_28_10_2005
   44.12 +#define BOOST_ACCUMULATORS_STATISTICS_KURTOSIS_HPP_EAN_28_10_2005
   44.13 +
   44.14 +#include <limits>
   44.15 +#include <boost/mpl/placeholders.hpp>
   44.16 +#include <boost/accumulators/framework/accumulator_base.hpp>
   44.17 +#include <boost/accumulators/framework/extractor.hpp>
   44.18 +#include <boost/accumulators/framework/parameters/sample.hpp>
   44.19 +#include <boost/accumulators/numeric/functional.hpp>
   44.20 +#include <boost/accumulators/framework/depends_on.hpp>
   44.21 +#include <boost/accumulators/statistics/mean.hpp>
   44.22 +#include <boost/accumulators/statistics/moment.hpp>
   44.23 +
   44.24 +namespace boost { namespace accumulators
   44.25 +{
   44.26 +
   44.27 +namespace impl
   44.28 +{
   44.29 +    ///////////////////////////////////////////////////////////////////////////////
   44.30 +    // kurtosis_impl
   44.31 +    /**
   44.32 +        @brief Kurtosis estimation
   44.33 +
   44.34 +        The kurtosis of a sample distribution is defined as the ratio of the 4th central moment and the square of the 2nd central
   44.35 +        moment (the variance) of the samples, minus 3. The term \f$ -3 \f$ is added in order to ensure that the normal distribution
   44.36 +        has zero kurtosis. The kurtosis can also be expressed by the simple moments:
   44.37 +
   44.38 +        \f[
   44.39 +            \hat{g}_2 =
   44.40 +                \frac
   44.41 +                {\widehat{m}_n^{(4)}-4\widehat{m}_n^{(3)}\hat{\mu}_n+6\widehat{m}_n^{(2)}\hat{\mu}_n^2-3\hat{\mu}_n^4}
   44.42 +                {\left(\widehat{m}_n^{(2)} - \hat{\mu}_n^{2}\right)^2} - 3,
   44.43 +        \f]
   44.44 +
   44.45 +        where \f$ \widehat{m}_n^{(i)} \f$ are the \f$ i \f$-th moment and \f$ \hat{\mu}_n \f$ the mean (first moment) of the
   44.46 +        \f$ n \f$ samples.
   44.47 +    */
   44.48 +    template<typename Sample>
   44.49 +    struct kurtosis_impl
   44.50 +      : accumulator_base
   44.51 +    {
   44.52 +        // for boost::result_of
   44.53 +        typedef typename numeric::functional::average<Sample, Sample>::result_type result_type;
   44.54 +
   44.55 +        kurtosis_impl(dont_care) {}
   44.56 +
   44.57 +        template<typename Args>
   44.58 +        result_type result(Args const &args) const
   44.59 +        {
   44.60 +            return numeric::average(
   44.61 +                        accumulators::moment<4>(args)
   44.62 +                        - 4. * accumulators::moment<3>(args) * mean(args)
   44.63 +                        + 6. * accumulators::moment<2>(args) * mean(args) * mean(args)
   44.64 +                        - 3. * mean(args) * mean(args) * mean(args) * mean(args)
   44.65 +                      , ( accumulators::moment<2>(args) - mean(args) * mean(args) )
   44.66 +                        * ( accumulators::moment<2>(args) - mean(args) * mean(args) )
   44.67 +                    ) - 3.;
   44.68 +        }
   44.69 +    };
   44.70 +
   44.71 +} // namespace impl
   44.72 +
   44.73 +///////////////////////////////////////////////////////////////////////////////
   44.74 +// tag::kurtosis
   44.75 +//
   44.76 +namespace tag
   44.77 +{
   44.78 +    struct kurtosis
   44.79 +      : depends_on<mean, moment<2>, moment<3>, moment<4> >
   44.80 +    {
   44.81 +        /// INTERNAL ONLY
   44.82 +        ///
   44.83 +        typedef accumulators::impl::kurtosis_impl<mpl::_1> impl;
   44.84 +    };
   44.85 +}
   44.86 +
   44.87 +///////////////////////////////////////////////////////////////////////////////
   44.88 +// extract::kurtosis
   44.89 +//
   44.90 +namespace extract
   44.91 +{
   44.92 +    extractor<tag::kurtosis> const kurtosis = {};
   44.93 +
   44.94 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(kurtosis)
   44.95 +}
   44.96 +
   44.97 +using extract::kurtosis;
   44.98 +
   44.99 +// So that kurtosis can be automatically substituted with
  44.100 +// weighted_kurtosis when the weight parameter is non-void
  44.101 +template<>
  44.102 +struct as_weighted_feature<tag::kurtosis>
  44.103 +{
  44.104 +    typedef tag::weighted_kurtosis type;
  44.105 +};
  44.106 +
  44.107 +template<>
  44.108 +struct feature_of<tag::weighted_kurtosis>
  44.109 +  : feature_of<tag::kurtosis>
  44.110 +{
  44.111 +};
  44.112 +
  44.113 +}} // namespace boost::accumulators
  44.114 +
  44.115 +#endif
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/boost_1_45_0/boost/accumulators/statistics/max.hpp	Fri Mar 04 12:48:37 2011 -0800
    45.3 @@ -0,0 +1,85 @@
    45.4 +///////////////////////////////////////////////////////////////////////////////
    45.5 +// max.hpp
    45.6 +//
    45.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    45.8 +//  Software License, Version 1.0. (See accompanying file
    45.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   45.10 +
   45.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_MAX_HPP_EAN_28_10_2005
   45.12 +#define BOOST_ACCUMULATORS_STATISTICS_MAX_HPP_EAN_28_10_2005
   45.13 +
   45.14 +#include <limits>
   45.15 +#include <boost/mpl/placeholders.hpp>
   45.16 +#include <boost/accumulators/framework/accumulator_base.hpp>
   45.17 +#include <boost/accumulators/framework/extractor.hpp>
   45.18 +#include <boost/accumulators/framework/parameters/sample.hpp>
   45.19 +#include <boost/accumulators/numeric/functional.hpp>
   45.20 +#include <boost/accumulators/framework/depends_on.hpp>
   45.21 +#include <boost/accumulators/statistics_fwd.hpp>
   45.22 +
   45.23 +namespace boost { namespace accumulators
   45.24 +{
   45.25 +
   45.26 +namespace impl
   45.27 +{
   45.28 +    ///////////////////////////////////////////////////////////////////////////////
   45.29 +    // max_impl
   45.30 +    template<typename Sample>
   45.31 +    struct max_impl
   45.32 +      : accumulator_base
   45.33 +    {
   45.34 +        // for boost::result_of
   45.35 +        typedef Sample result_type;
   45.36 +
   45.37 +        template<typename Args>
   45.38 +        max_impl(Args const &args)
   45.39 +          : max_(numeric::as_min(args[sample | Sample()]))
   45.40 +        {
   45.41 +        }
   45.42 +
   45.43 +        template<typename Args>
   45.44 +        void operator ()(Args const &args)
   45.45 +        {
   45.46 +            numeric::max_assign(this->max_, args[sample]);
   45.47 +        }
   45.48 +
   45.49 +        result_type result(dont_care) const
   45.50 +        {
   45.51 +            return this->max_;
   45.52 +        }
   45.53 +
   45.54 +    private:
   45.55 +        Sample max_;
   45.56 +    };
   45.57 +
   45.58 +} // namespace impl
   45.59 +
   45.60 +///////////////////////////////////////////////////////////////////////////////
   45.61 +// tag::max
   45.62 +//
   45.63 +namespace tag
   45.64 +{
   45.65 +    struct max
   45.66 +      : depends_on<>
   45.67 +    {
   45.68 +        /// INTERNAL ONLY
   45.69 +        ///
   45.70 +        typedef accumulators::impl::max_impl<mpl::_1> impl;
   45.71 +    };
   45.72 +}
   45.73 +
   45.74 +///////////////////////////////////////////////////////////////////////////////
   45.75 +// extract::max
   45.76 +//
   45.77 +namespace extract
   45.78 +{
   45.79 +    extractor<tag::max> const max = {};
   45.80 +
   45.81 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(max)
   45.82 +}
   45.83 +
   45.84 +using extract::max;
   45.85 +
   45.86 +}} // namespace boost::accumulators
   45.87 +
   45.88 +#endif
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/boost_1_45_0/boost/accumulators/statistics/mean.hpp	Fri Mar 04 12:48:37 2011 -0800
    46.3 @@ -0,0 +1,298 @@
    46.4 +///////////////////////////////////////////////////////////////////////////////
    46.5 +// mean.hpp
    46.6 +//
    46.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    46.8 +//  Software License, Version 1.0. (See accompanying file
    46.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   46.10 +
   46.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_MEAN_HPP_EAN_28_10_2005
   46.12 +#define BOOST_ACCUMULATORS_STATISTICS_MEAN_HPP_EAN_28_10_2005
   46.13 +
   46.14 +#include <boost/mpl/placeholders.hpp>
   46.15 +#include <boost/accumulators/framework/accumulator_base.hpp>
   46.16 +#include <boost/accumulators/framework/extractor.hpp>
   46.17 +#include <boost/accumulators/numeric/functional.hpp>
   46.18 +#include <boost/accumulators/framework/parameters/sample.hpp>
   46.19 +#include <boost/accumulators/framework/depends_on.hpp>
   46.20 +#include <boost/accumulators/statistics_fwd.hpp>
   46.21 +#include <boost/accumulators/statistics/count.hpp>
   46.22 +#include <boost/accumulators/statistics/sum.hpp>
   46.23 +
   46.24 +namespace boost { namespace accumulators
   46.25 +{
   46.26 +
   46.27 +namespace impl
   46.28 +{
   46.29 +    ///////////////////////////////////////////////////////////////////////////////
   46.30 +    // mean_impl
   46.31 +    //      lazy, by default
   46.32 +    template<typename Sample, typename SumFeature>
   46.33 +    struct mean_impl
   46.34 +      : accumulator_base
   46.35 +    {
   46.36 +        // for boost::result_of
   46.37 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type;
   46.38 +
   46.39 +        mean_impl(dont_care) {}
   46.40 +
   46.41 +        template<typename Args>
   46.42 +        result_type result(Args const &args) const
   46.43 +        {
   46.44 +            extractor<SumFeature> sum;
   46.45 +            return numeric::average(sum(args), count(args));
   46.46 +        }
   46.47 +    };
   46.48 +
   46.49 +    template<typename Sample, typename Tag>
   46.50 +    struct immediate_mean_impl
   46.51 +      : accumulator_base
   46.52 +    {
   46.53 +        // for boost::result_of
   46.54 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type;
   46.55 +
   46.56 +        template<typename Args>
   46.57 +        immediate_mean_impl(Args const &args)
   46.58 +          : mean(numeric::average(args[sample | Sample()], numeric::one<std::size_t>::value))
   46.59 +        {
   46.60 +        }
   46.61 +
   46.62 +        template<typename Args>
   46.63 +        void operator ()(Args const &args)
   46.64 +        {
   46.65 +            std::size_t cnt = count(args);
   46.66 +            this->mean = numeric::average(
   46.67 +                (this->mean * (cnt - 1)) + args[parameter::keyword<Tag>::get()]
   46.68 +              , cnt
   46.69 +            );
   46.70 +        }
   46.71 +
   46.72 +        result_type result(dont_care) const
   46.73 +        {
   46.74 +            return this->mean;
   46.75 +        }
   46.76 +
   46.77 +    private:
   46.78 +        result_type mean;
   46.79 +    };
   46.80 +
   46.81 +} // namespace impl
   46.82 +
   46.83 +///////////////////////////////////////////////////////////////////////////////
   46.84 +// tag::mean
   46.85 +// tag::immediate_mean
   46.86 +// tag::mean_of_weights
   46.87 +// tag::immediate_mean_of_weights
   46.88 +// tag::mean_of_variates
   46.89 +// tag::immediate_mean_of_variates
   46.90 +//
   46.91 +namespace tag
   46.92 +{
   46.93 +    struct mean
   46.94 +      : depends_on<count, sum>
   46.95 +    {
   46.96 +        /// INTERNAL ONLY
   46.97 +        ///
   46.98 +        typedef accumulators::impl::mean_impl<mpl::_1, sum> impl;
   46.99 +    };
  46.100 +    struct immediate_mean
  46.101 +      : depends_on<count>
  46.102 +    {
  46.103 +        /// INTERNAL ONLY
  46.104 +        ///
  46.105 +        typedef accumulators::impl::immediate_mean_impl<mpl::_1, tag::sample> impl;
  46.106 +    };
  46.107 +    struct mean_of_weights
  46.108 +      : depends_on<count, sum_of_weights>
  46.109 +    {
  46.110 +        typedef mpl::true_ is_weight_accumulator;
  46.111 +        /// INTERNAL ONLY
  46.112 +        ///
  46.113 +        typedef accumulators::impl::mean_impl<mpl::_2, sum_of_weights> impl;
  46.114 +    };
  46.115 +    struct immediate_mean_of_weights
  46.116 +      : depends_on<count>
  46.117 +    {
  46.118 +        typedef mpl::true_ is_weight_accumulator;
  46.119 +        /// INTERNAL ONLY
  46.120 +        ///
  46.121 +        typedef accumulators::impl::immediate_mean_impl<mpl::_2, tag::weight> impl;
  46.122 +    };
  46.123 +    template<typename VariateType, typename VariateTag>
  46.124 +    struct mean_of_variates
  46.125 +      : depends_on<count, sum_of_variates<VariateType, VariateTag> >
  46.126 +    {
  46.127 +        /// INTERNAL ONLY
  46.128 +        ///
  46.129 +        typedef mpl::always<accumulators::impl::mean_impl<VariateType, sum_of_variates<VariateType, VariateTag> > > impl;
  46.130 +    };
  46.131 +    template<typename VariateType, typename VariateTag>
  46.132 +    struct immediate_mean_of_variates
  46.133 +      : depends_on<count>
  46.134 +    {
  46.135 +        /// INTERNAL ONLY
  46.136 +        ///
  46.137 +        typedef mpl::always<accumulators::impl::immediate_mean_impl<VariateType, VariateTag> > impl;
  46.138 +    };
  46.139 +}
  46.140 +
  46.141 +///////////////////////////////////////////////////////////////////////////////
  46.142 +// extract::mean
  46.143 +// extract::mean_of_weights
  46.144 +// extract::mean_of_variates
  46.145 +//
  46.146 +namespace extract
  46.147 +{
  46.148 +    extractor<tag::mean> const mean = {};
  46.149 +    extractor<tag::mean_of_weights> const mean_of_weights = {};
  46.150 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, mean_of_variates, (typename)(typename))
  46.151 +
  46.152 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(mean)
  46.153 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(mean_of_weights)
  46.154 +}
  46.155 +
  46.156 +using extract::mean;
  46.157 +using extract::mean_of_weights;
  46.158 +using extract::mean_of_variates;
  46.159 +
  46.160 +// mean(lazy) -> mean
  46.161 +template<>
  46.162 +struct as_feature<tag::mean(lazy)>
  46.163 +{
  46.164 +    typedef tag::mean type;
  46.165 +};
  46.166 +
  46.167 +// mean(immediate) -> immediate_mean
  46.168 +template<>
  46.169 +struct as_feature<tag::mean(immediate)>
  46.170 +{
  46.171 +    typedef tag::immediate_mean type;
  46.172 +};
  46.173 +
  46.174 +// mean_of_weights(lazy) -> mean_of_weights
  46.175 +template<>
  46.176 +struct as_feature<tag::mean_of_weights(lazy)>
  46.177 +{
  46.178 +    typedef tag::mean_of_weights type;
  46.179 +};
  46.180 +
  46.181 +// mean_of_weights(immediate) -> immediate_mean_of_weights
  46.182 +template<>
  46.183 +struct as_feature<tag::mean_of_weights(immediate)>
  46.184 +{
  46.185 +    typedef tag::immediate_mean_of_weights type;
  46.186 +};
  46.187 +
  46.188 +// mean_of_variates<VariateType, VariateTag>(lazy) -> mean_of_variates<VariateType, VariateTag>
  46.189 +template<typename VariateType, typename VariateTag>
  46.190 +struct as_feature<tag::mean_of_variates<VariateType, VariateTag>(lazy)>
  46.191 +{
  46.192 +    typedef tag::mean_of_variates<VariateType, VariateTag> type;
  46.193 +};
  46.194 +
  46.195 +// mean_of_variates<VariateType, VariateTag>(immediate) -> immediate_mean_of_variates<VariateType, VariateTag>
  46.196 +template<typename VariateType, typename VariateTag>
  46.197 +struct as_feature<tag::mean_of_variates<VariateType, VariateTag>(immediate)>
  46.198 +{
  46.199 +    typedef tag::immediate_mean_of_variates<VariateType, VariateTag> type;
  46.200 +};
  46.201 +
  46.202 +// for the purposes of feature-based dependency resolution,
  46.203 +// immediate_mean provides the same feature as mean
  46.204 +template<>
  46.205 +struct feature_of<tag::immediate_mean>
  46.206 +  : feature_of<tag::mean>
  46.207 +{
  46.208 +};
  46.209 +
  46.210 +// for the purposes of feature-based dependency resolution,
  46.211 +// immediate_mean provides the same feature as mean
  46.212 +template<>
  46.213 +struct feature_of<tag::immediate_mean_of_weights>
  46.214 +  : feature_of<tag::mean_of_weights>
  46.215 +{
  46.216 +};
  46.217 +
  46.218 +// for the purposes of feature-based dependency resolution,
  46.219 +// immediate_mean provides the same feature as mean
  46.220 +template<typename VariateType, typename VariateTag>
  46.221 +struct feature_of<tag::immediate_mean_of_variates<VariateType, VariateTag> >
  46.222 +  : feature_of<tag::mean_of_variates<VariateType, VariateTag> >
  46.223 +{
  46.224 +};
  46.225 +
  46.226 +// So that mean can be automatically substituted with
  46.227 +// weighted_mean when the weight parameter is non-void.
  46.228 +template<>
  46.229 +struct as_weighted_feature<tag::mean>
  46.230 +{
  46.231 +    typedef tag::weighted_mean type;
  46.232 +};
  46.233 +
  46.234 +template<>
  46.235 +struct feature_of<tag::weighted_mean>
  46.236 +  : feature_of<tag::mean>
  46.237 +{};
  46.238 +
  46.239 +// So that immediate_mean can be automatically substituted with
  46.240 +// immediate_weighted_mean when the weight parameter is non-void.
  46.241 +template<>
  46.242 +struct as_weighted_feature<tag::immediate_mean>
  46.243 +{
  46.244 +    typedef tag::immediate_weighted_mean type;
  46.245 +};
  46.246 +
  46.247 +template<>
  46.248 +struct feature_of<tag::immediate_weighted_mean>
  46.249 +  : feature_of<tag::immediate_mean>
  46.250 +{};
  46.251 +
  46.252 +// So that mean_of_weights<> can be automatically substituted with
  46.253 +// weighted_mean_of_variates<> when the weight parameter is non-void.
  46.254 +template<typename VariateType, typename VariateTag>
  46.255 +struct as_weighted_feature<tag::mean_of_variates<VariateType, VariateTag> >
  46.256 +{
  46.257 +    typedef tag::weighted_mean_of_variates<VariateType, VariateTag> type;
  46.258 +};
  46.259 +
  46.260 +template<typename VariateType, typename VariateTag>
  46.261 +struct feature_of<tag::weighted_mean_of_variates<VariateType, VariateTag> >
  46.262 +  : feature_of<tag::mean_of_variates<VariateType, VariateTag> >
  46.263 +{
  46.264 +};
  46.265 +
  46.266 +// So that immediate_mean_of_weights<> can be automatically substituted with
  46.267 +// immediate_weighted_mean_of_variates<> when the weight parameter is non-void.
  46.268 +template<typename VariateType, typename VariateTag>
  46.269 +struct as_weighted_feature<tag::immediate_mean_of_variates<VariateType, VariateTag> >
  46.270 +{
  46.271 +    typedef tag::immediate_weighted_mean_of_variates<VariateType, VariateTag> type;
  46.272 +};
  46.273 +
  46.274 +template<typename VariateType, typename VariateTag>
  46.275 +struct feature_of<tag::immediate_weighted_mean_of_variates<VariateType, VariateTag> >
  46.276 +  : feature_of<tag::immediate_mean_of_variates<VariateType, VariateTag> >
  46.277 +{
  46.278 +};
  46.279 +
  46.280 +////////////////////////////////////////////////////////////////////////////
  46.281 +//// droppable_accumulator<mean_impl>
  46.282 +////  need to specialize droppable lazy mean to cache the result at the
  46.283 +////  point the accumulator is dropped.
  46.284 +///// INTERNAL ONLY
  46.285 +/////
  46.286 +//template<typename Sample, typename SumFeature>
  46.287 +//struct droppable_accumulator<impl::mean_impl<Sample, SumFeature> >
  46.288 +//  : droppable_accumulator_base<
  46.289 +//        with_cached_result<impl::mean_impl<Sample, SumFeature> >
  46.290 +//    >
  46.291 +//{
  46.292 +//    template<typename Args>
  46.293 +//    droppable_accumulator(Args const &args)
  46.294 +//      : droppable_accumulator::base(args)
  46.295 +//    {
  46.296 +//    }
  46.297 +//};
  46.298 +
  46.299 +}} // namespace boost::accumulators
  46.300 +
  46.301 +#endif
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/boost_1_45_0/boost/accumulators/statistics/median.hpp	Fri Mar 04 12:48:37 2011 -0800
    47.3 @@ -0,0 +1,301 @@
    47.4 +///////////////////////////////////////////////////////////////////////////////
    47.5 +// median.hpp
    47.6 +//
    47.7 +//  Copyright 2006 Eric Niebler, Olivier Gygi. Distributed under the Boost
    47.8 +//  Software License, Version 1.0. (See accompanying file
    47.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   47.10 +
   47.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_MEDIAN_HPP_EAN_28_10_2005
   47.12 +#define BOOST_ACCUMULATORS_STATISTICS_MEDIAN_HPP_EAN_28_10_2005
   47.13 +
   47.14 +#include <boost/mpl/placeholders.hpp>
   47.15 +#include <boost/range/iterator_range.hpp>
   47.16 +#include <boost/accumulators/framework/accumulator_base.hpp>
   47.17 +#include <boost/accumulators/framework/extractor.hpp>
   47.18 +#include <boost/accumulators/numeric/functional.hpp>
   47.19 +#include <boost/accumulators/framework/parameters/sample.hpp>
   47.20 +#include <boost/accumulators/framework/depends_on.hpp>
   47.21 +#include <boost/accumulators/statistics_fwd.hpp>
   47.22 +#include <boost/accumulators/statistics/count.hpp>
   47.23 +#include <boost/accumulators/statistics/p_square_quantile.hpp>
   47.24 +#include <boost/accumulators/statistics/density.hpp>
   47.25 +#include <boost/accumulators/statistics/p_square_cumulative_distribution.hpp>
   47.26 +
   47.27 +namespace boost { namespace accumulators
   47.28 +{
   47.29 +
   47.30 +namespace impl
   47.31 +{
   47.32 +    ///////////////////////////////////////////////////////////////////////////////
   47.33 +    // median_impl
   47.34 +    //
   47.35 +    /**
   47.36 +        @brief Median estimation based on the \f$P^2\f$ quantile estimator
   47.37 +
   47.38 +        The \f$P^2\f$ algorithm is invoked with a quantile probability of 0.5.
   47.39 +    */
   47.40 +    template<typename Sample>
   47.41 +    struct median_impl
   47.42 +      : accumulator_base
   47.43 +    {
   47.44 +        // for boost::result_of
   47.45 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type;
   47.46 +
   47.47 +        median_impl(dont_care) {}
   47.48 +
   47.49 +        template<typename Args>
   47.50 +        result_type result(Args const &args) const
   47.51 +        {
   47.52 +            return p_square_quantile_for_median(args);
   47.53 +        }
   47.54 +    };
   47.55 +    ///////////////////////////////////////////////////////////////////////////////
   47.56 +    // with_density_median_impl
   47.57 +    //
   47.58 +    /**
   47.59 +        @brief Median estimation based on the density estimator
   47.60 +
   47.61 +        The algorithm determines the bin in which the \f$0.5*cnt\f$-th sample lies, \f$cnt\f$ being
   47.62 +        the total number of samples. It returns the approximate horizontal position of this sample,
   47.63 +        based on a linear interpolation inside the bin.
   47.64 +    */
   47.65 +    template<typename Sample>
   47.66 +    struct with_density_median_impl
   47.67 +      : accumulator_base
   47.68 +    {
   47.69 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
   47.70 +        typedef std::vector<std::pair<float_type, float_type> > histogram_type;
   47.71 +        typedef iterator_range<typename histogram_type::iterator> range_type;
   47.72 +        // for boost::result_of
   47.73 +        typedef float_type result_type;
   47.74 +
   47.75 +        template<typename Args>
   47.76 +        with_density_median_impl(Args const &args)
   47.77 +          : sum(numeric::average(args[sample | Sample()], (std::size_t)1))
   47.78 +          , is_dirty(true)
   47.79 +        {
   47.80 +        }
   47.81 +
   47.82 +        void operator ()(dont_care)
   47.83 +        {
   47.84 +            this->is_dirty = true;
   47.85 +        }
   47.86 +
   47.87 +
   47.88 +        template<typename Args>
   47.89 +        result_type result(Args const &args) const
   47.90 +        {
   47.91 +            if (this->is_dirty)
   47.92 +            {
   47.93 +                this->is_dirty = false;
   47.94 +
   47.95 +                std::size_t cnt = count(args);
   47.96 +                range_type histogram = density(args);
   47.97 +                typename range_type::iterator it = histogram.begin();
   47.98 +                while (this->sum < 0.5 * cnt)
   47.99 +                {
  47.100 +                    this->sum += it->second * cnt;
  47.101 +                    ++it;
  47.102 +                }
  47.103 +                --it;
  47.104 +                float_type over = numeric::average(this->sum - 0.5 * cnt, it->second * cnt);
  47.105 +                this->median = it->first * over + (it + 1)->first * (1. - over);
  47.106 +            }
  47.107 +
  47.108 +            return this->median;
  47.109 +        }
  47.110 +
  47.111 +    private:
  47.112 +        mutable float_type sum;
  47.113 +        mutable bool is_dirty;
  47.114 +        mutable float_type median;
  47.115 +    };
  47.116 +
  47.117 +    ///////////////////////////////////////////////////////////////////////////////
  47.118 +    // with_p_square_cumulative_distribution_median_impl
  47.119 +    //
  47.120 +    /**
  47.121 +        @brief Median estimation based on the \f$P^2\f$ cumulative distribution estimator
  47.122 +
  47.123 +        The algorithm determines the first (leftmost) bin with a height exceeding 0.5. It
  47.124 +        returns the approximate horizontal position of where the cumulative distribution
  47.125 +        equals 0.5, based on a linear interpolation inside the bin.
  47.126 +    */
  47.127 +    template<typename Sample>
  47.128 +    struct with_p_square_cumulative_distribution_median_impl
  47.129 +      : accumulator_base
  47.130 +    {
  47.131 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
  47.132 +        typedef std::vector<std::pair<float_type, float_type> > histogram_type;
  47.133 +        typedef iterator_range<typename histogram_type::iterator> range_type;
  47.134 +        // for boost::result_of
  47.135 +        typedef float_type result_type;
  47.136 +
  47.137 +        with_p_square_cumulative_distribution_median_impl(dont_care)
  47.138 +          : is_dirty(true)
  47.139 +        {
  47.140 +        }
  47.141 +
  47.142 +        void operator ()(dont_care)
  47.143 +        {
  47.144 +            this->is_dirty = true;
  47.145 +        }
  47.146 +
  47.147 +        template<typename Args>
  47.148 +        result_type result(Args const &args) const
  47.149 +        {
  47.150 +            if (this->is_dirty)
  47.151 +            {
  47.152 +                this->is_dirty = false;
  47.153 +
  47.154 +                range_type histogram = p_square_cumulative_distribution(args);
  47.155 +                typename range_type::iterator it = histogram.begin();
  47.156 +                while (it->second < 0.5)
  47.157 +                {
  47.158 +                    ++it;
  47.159 +                }
  47.160 +                float_type over = numeric::average(it->second - 0.5, it->second - (it - 1)->second);
  47.161 +                this->median = it->first * over + (it + 1)->first * ( 1. - over );
  47.162 +            }
  47.163 +
  47.164 +            return this->median;
  47.165 +        }
  47.166 +    private:
  47.167 +
  47.168 +        mutable bool is_dirty;
  47.169 +        mutable float_type median;
  47.170 +    };
  47.171 +
  47.172 +} // namespace impl
  47.173 +
  47.174 +///////////////////////////////////////////////////////////////////////////////
  47.175 +// tag::median
  47.176 +// tag::with_densisty_median
  47.177 +// tag::with_p_square_cumulative_distribution_median
  47.178 +//
  47.179 +namespace tag
  47.180 +{
  47.181 +    struct median
  47.182 +      : depends_on<p_square_quantile_for_median>
  47.183 +    {
  47.184 +        /// INTERNAL ONLY
  47.185 +        ///
  47.186 +        typedef accumulators::impl::median_impl<mpl::_1> impl;
  47.187 +    };
  47.188 +    struct with_density_median
  47.189 +      : depends_on<count, density>
  47.190 +    {
  47.191 +        /// INTERNAL ONLY
  47.192 +        ///
  47.193 +        typedef accumulators::impl::with_density_median_impl<mpl::_1> impl;
  47.194 +    };
  47.195 +    struct with_p_square_cumulative_distribution_median
  47.196 +      : depends_on<p_square_cumulative_distribution>
  47.197 +    {
  47.198 +        /// INTERNAL ONLY
  47.199 +        ///
  47.200 +        typedef accumulators::impl::with_p_square_cumulative_distribution_median_impl<mpl::_1> impl;
  47.201 +    };
  47.202 +}
  47.203 +
  47.204 +///////////////////////////////////////////////////////////////////////////////
  47.205 +// extract::median
  47.206 +// extract::with_density_median
  47.207 +// extract::with_p_square_cumulative_distribution_median
  47.208 +//
  47.209 +namespace extract
  47.210 +{
  47.211 +    extractor<tag::median> const median = {};
  47.212 +    extractor<tag::with_density_median> const with_density_median = {};
  47.213 +    extractor<tag::with_p_square_cumulative_distribution_median> const with_p_square_cumulative_distribution_median = {};
  47.214 +
  47.215 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(median)
  47.216 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(with_density_median)
  47.217 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(with_p_square_cumulative_distribution_median)
  47.218 +}
  47.219 +
  47.220 +using extract::median;
  47.221 +using extract::with_density_median;
  47.222 +using extract::with_p_square_cumulative_distribution_median;
  47.223 +
  47.224 +// median(with_p_square_quantile) -> median
  47.225 +template<>
  47.226 +struct as_feature<tag::median(with_p_square_quantile)>
  47.227 +{
  47.228 +    typedef tag::median type;
  47.229 +};
  47.230 +
  47.231 +// median(with_density) -> with_density_median
  47.232 +template<>
  47.233 +struct as_feature<tag::median(with_density)>
  47.234 +{
  47.235 +    typedef tag::with_density_median type;
  47.236 +};
  47.237 +
  47.238 +// median(with_p_square_cumulative_distribution) -> with_p_square_cumulative_distribution_median
  47.239 +template<>
  47.240 +struct as_feature<tag::median(with_p_square_cumulative_distribution)>
  47.241 +{
  47.242 +    typedef tag::with_p_square_cumulative_distribution_median type;
  47.243 +};
  47.244 +
  47.245 +// for the purposes of feature-based dependency resolution,
  47.246 +// with_density_median and with_p_square_cumulative_distribution_median
  47.247 +// provide the same feature as median
  47.248 +template<>
  47.249 +struct feature_of<tag::with_density_median>
  47.250 +  : feature_of<tag::median>
  47.251 +{
  47.252 +};
  47.253 +
  47.254 +template<>
  47.255 +struct feature_of<tag::with_p_square_cumulative_distribution_median>
  47.256 +  : feature_of<tag::median>
  47.257 +{
  47.258 +};
  47.259 +
  47.260 +// So that median can be automatically substituted with
  47.261 +// weighted_median when the weight parameter is non-void.
  47.262 +template<>
  47.263 +struct as_weighted_feature<tag::median>
  47.264 +{
  47.265 +    typedef tag::weighted_median type;
  47.266 +};
  47.267 +
  47.268 +template<>
  47.269 +struct feature_of<tag::weighted_median>
  47.270 +  : feature_of<tag::median>
  47.271 +{
  47.272 +};
  47.273 +
  47.274 +// So that with_density_median can be automatically substituted with
  47.275 +// with_density_weighted_median when the weight parameter is non-void.
  47.276 +template<>
  47.277 +struct as_weighted_feature<tag::with_density_median>
  47.278 +{
  47.279 +    typedef tag::with_density_weighted_median type;
  47.280 +};
  47.281 +
  47.282 +template<>
  47.283 +struct feature_of<tag::with_density_weighted_median>
  47.284 +  : feature_of<tag::with_density_median>
  47.285 +{
  47.286 +};
  47.287 +
  47.288 +// So that with_p_square_cumulative_distribution_median can be automatically substituted with
  47.289 +// with_p_square_cumulative_distribution_weighted_median when the weight parameter is non-void.
  47.290 +template<>
  47.291 +struct as_weighted_feature<tag::with_p_square_cumulative_distribution_median>
  47.292 +{
  47.293 +    typedef tag::with_p_square_cumulative_distribution_weighted_median type;
  47.294 +};
  47.295 +
  47.296 +template<>
  47.297 +struct feature_of<tag::with_p_square_cumulative_distribution_weighted_median>
  47.298 +  : feature_of<tag::with_p_square_cumulative_distribution_median>
  47.299 +{
  47.300 +};
  47.301 +
  47.302 +}} // namespace boost::accumulators
  47.303 +
  47.304 +#endif
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/boost_1_45_0/boost/accumulators/statistics/min.hpp	Fri Mar 04 12:48:37 2011 -0800
    48.3 @@ -0,0 +1,85 @@
    48.4 +///////////////////////////////////////////////////////////////////////////////
    48.5 +// min.hpp
    48.6 +//
    48.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    48.8 +//  Software License, Version 1.0. (See accompanying file
    48.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   48.10 +
   48.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_MIN_HPP_EAN_28_10_2005
   48.12 +#define BOOST_ACCUMULATORS_STATISTICS_MIN_HPP_EAN_28_10_2005
   48.13 +
   48.14 +#include <limits>
   48.15 +#include <boost/mpl/placeholders.hpp>
   48.16 +#include <boost/accumulators/framework/accumulator_base.hpp>
   48.17 +#include <boost/accumulators/framework/extractor.hpp>
   48.18 +#include <boost/accumulators/framework/parameters/sample.hpp>
   48.19 +#include <boost/accumulators/numeric/functional.hpp>
   48.20 +#include <boost/accumulators/framework/depends_on.hpp>
   48.21 +#include <boost/accumulators/statistics_fwd.hpp>
   48.22 +
   48.23 +namespace boost { namespace accumulators
   48.24 +{
   48.25 +
   48.26 +namespace impl
   48.27 +{
   48.28 +    ///////////////////////////////////////////////////////////////////////////////
   48.29 +    // min_impl
   48.30 +    template<typename Sample>
   48.31 +    struct min_impl
   48.32 +      : accumulator_base
   48.33 +    {
   48.34 +        // for boost::result_of
   48.35 +        typedef Sample result_type;
   48.36 +
   48.37 +        template<typename Args>
   48.38 +        min_impl(Args const &args)
   48.39 +          : min_(numeric::as_max(args[sample | Sample()]))
   48.40 +        {
   48.41 +        }
   48.42 +
   48.43 +        template<typename Args>
   48.44 +        void operator ()(Args const &args)
   48.45 +        {
   48.46 +            numeric::min_assign(this->min_, args[sample]);
   48.47 +        }
   48.48 +
   48.49 +        result_type result(dont_care) const
   48.50 +        {
   48.51 +            return this->min_;
   48.52 +        }
   48.53 +
   48.54 +    private:
   48.55 +        Sample min_;
   48.56 +    };
   48.57 +
   48.58 +} // namespace impl
   48.59 +
   48.60 +///////////////////////////////////////////////////////////////////////////////
   48.61 +// tag::min
   48.62 +//
   48.63 +namespace tag
   48.64 +{
   48.65 +    struct min
   48.66 +      : depends_on<>
   48.67 +    {
   48.68 +        /// INTERNAL ONLY
   48.69 +        ///
   48.70 +        typedef accumulators::impl::min_impl<mpl::_1> impl;
   48.71 +    };
   48.72 +}
   48.73 +
   48.74 +///////////////////////////////////////////////////////////////////////////////
   48.75 +// extract::min
   48.76 +//
   48.77 +namespace extract
   48.78 +{
   48.79 +    extractor<tag::min> const min = {};
   48.80 +
   48.81 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(min)
   48.82 +}
   48.83 +
   48.84 +using extract::min;
   48.85 +
   48.86 +}} // namespace boost::accumulators
   48.87 +
   48.88 +#endif
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/boost_1_45_0/boost/accumulators/statistics/moment.hpp	Fri Mar 04 12:48:37 2011 -0800
    49.3 @@ -0,0 +1,125 @@
    49.4 +///////////////////////////////////////////////////////////////////////////////
    49.5 +// moment.hpp
    49.6 +//
    49.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    49.8 +//  Software License, Version 1.0. (See accompanying file
    49.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   49.10 +
   49.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_MOMENT_HPP_EAN_15_11_2005
   49.12 +#define BOOST_ACCUMULATORS_STATISTICS_MOMENT_HPP_EAN_15_11_2005
   49.13 +
   49.14 +#include <boost/config/no_tr1/cmath.hpp>
   49.15 +#include <boost/mpl/int.hpp>
   49.16 +#include <boost/mpl/assert.hpp>
   49.17 +#include <boost/mpl/placeholders.hpp>
   49.18 +#include <boost/accumulators/framework/accumulator_base.hpp>
   49.19 +#include <boost/accumulators/framework/extractor.hpp>
   49.20 +#include <boost/accumulators/numeric/functional.hpp>
   49.21 +#include <boost/accumulators/framework/parameters/sample.hpp>
   49.22 +#include <boost/accumulators/framework/depends_on.hpp>
   49.23 +#include <boost/accumulators/statistics_fwd.hpp>
   49.24 +#include <boost/accumulators/statistics/count.hpp>
   49.25 +
   49.26 +namespace boost { namespace numeric
   49.27 +{
   49.28 +    /// INTERNAL ONLY
   49.29 +    ///
   49.30 +    template<typename T>
   49.31 +    T const &pow(T const &x, mpl::int_<1>)
   49.32 +    {
   49.33 +        return x;
   49.34 +    }
   49.35 +
   49.36 +    /// INTERNAL ONLY
   49.37 +    ///
   49.38 +    template<typename T, int N>
   49.39 +    T pow(T const &x, mpl::int_<N>)
   49.40 +    {
   49.41 +        using namespace operators;
   49.42 +        T y = numeric::pow(x, mpl::int_<N/2>());
   49.43 +        T z = y * y;
   49.44 +        return (N % 2) ? (z * x) : z;
   49.45 +    }
   49.46 +}}
   49.47 +
   49.48 +namespace boost { namespace accumulators
   49.49 +{
   49.50 +
   49.51 +namespace impl
   49.52 +{
   49.53 +    ///////////////////////////////////////////////////////////////////////////////
   49.54 +    // moment_impl
   49.55 +    template<typename N, typename Sample>
   49.56 +    struct moment_impl
   49.57 +      : accumulator_base // TODO: also depends_on sum of powers
   49.58 +    {
   49.59 +        BOOST_MPL_ASSERT_RELATION(N::value, >, 0);
   49.60 +        // for boost::result_of
   49.61 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type;
   49.62 +
   49.63 +        template<typename Args>
   49.64 +        moment_impl(Args const &args)
   49.65 +          : sum(args[sample | Sample()])
   49.66 +        {
   49.67 +        }
   49.68 +
   49.69 +        template<typename Args>
   49.70 +        void operator ()(Args const &args)
   49.71 +        {
   49.72 +            this->sum += numeric::pow(args[sample], N());
   49.73 +        }
   49.74 +
   49.75 +        template<typename Args>
   49.76 +        result_type result(Args const &args) const
   49.77 +        {
   49.78 +            return numeric::average(this->sum, count(args));
   49.79 +        }
   49.80 +
   49.81 +    private:
   49.82 +        Sample sum;
   49.83 +    };
   49.84 +
   49.85 +} // namespace impl
   49.86 +
   49.87 +///////////////////////////////////////////////////////////////////////////////
   49.88 +// tag::moment
   49.89 +//
   49.90 +namespace tag
   49.91 +{
   49.92 +    template<int N>
   49.93 +    struct moment
   49.94 +      : depends_on<count>
   49.95 +    {
   49.96 +        /// INTERNAL ONLY
   49.97 +        ///
   49.98 +        typedef accumulators::impl::moment_impl<mpl::int_<N>, mpl::_1> impl;
   49.99 +    };
  49.100 +}
  49.101 +
  49.102 +///////////////////////////////////////////////////////////////////////////////
  49.103 +// extract::moment
  49.104 +//
  49.105 +namespace extract
  49.106 +{
  49.107 +    BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, moment, (int))
  49.108 +}
  49.109 +
  49.110 +using extract::moment;
  49.111 +
  49.112 +// So that moment<N> can be automatically substituted with
  49.113 +// weighted_moment<N> when the weight parameter is non-void
  49.114 +template<int N>
  49.115 +struct as_weighted_feature<tag::moment<N> >
  49.116 +{
  49.117 +    typedef tag::weighted_moment<N> type;
  49.118 +};
  49.119 +
  49.120 +template<int N>
  49.121 +struct feature_of<tag::weighted_moment<N> >
  49.122 +  : feature_of<tag::moment<N> >
  49.123 +{
  49.124 +};
  49.125 +
  49.126 +}} // namespace boost::accumulators
  49.127 +
  49.128 +#endif
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/boost_1_45_0/boost/accumulators/statistics/p_square_cumulative_distribution.hpp	Fri Mar 04 12:48:37 2011 -0800
    50.3 @@ -0,0 +1,260 @@
    50.4 +///////////////////////////////////////////////////////////////////////////////
    50.5 +// p_square_cumulative_distribution.hpp
    50.6 +//
    50.7 +//  Copyright 2005 Daniel Egloff, Olivier Gygi. Distributed under the Boost
    50.8 +//  Software License, Version 1.0. (See accompanying file
    50.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   50.10 +
   50.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_DE_01_01_2006
   50.12 +#define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_DE_01_01_2006
   50.13 +
   50.14 +#include <vector>
   50.15 +#include <functional>
   50.16 +#include <boost/parameter/keyword.hpp>
   50.17 +#include <boost/range.hpp>
   50.18 +#include <boost/mpl/placeholders.hpp>
   50.19 +#include <boost/accumulators/framework/accumulator_base.hpp>
   50.20 +#include <boost/accumulators/framework/extractor.hpp>
   50.21 +#include <boost/accumulators/numeric/functional.hpp>
   50.22 +#include <boost/accumulators/framework/parameters/sample.hpp>
   50.23 +#include <boost/accumulators/statistics_fwd.hpp>
   50.24 +#include <boost/accumulators/statistics/count.hpp>
   50.25 +
   50.26 +namespace boost { namespace accumulators
   50.27 +{
   50.28 +///////////////////////////////////////////////////////////////////////////////
   50.29 +// num_cells named parameter
   50.30 +//
   50.31 +BOOST_PARAMETER_NESTED_KEYWORD(tag, p_square_cumulative_distribution_num_cells, num_cells)
   50.32 +
   50.33 +namespace impl
   50.34 +{
   50.35 +    ///////////////////////////////////////////////////////////////////////////////
   50.36 +    // p_square_cumulative_distribution_impl
   50.37 +    //  cumulative_distribution calculation (as histogram)
   50.38 +    /**
   50.39 +        @brief Histogram calculation of the cumulative distribution with the \f$P^2\f$ algorithm
   50.40 +
   50.41 +        A histogram of the sample cumulative distribution is computed dynamically without storing samples
   50.42 +        based on the \f$ P^2 \f$ algorithm. The returned histogram has a specifiable amount (num_cells)
   50.43 +        equiprobable (and not equal-sized) cells.
   50.44 +
   50.45 +        For further details, see
   50.46 +
   50.47 +        R. Jain and I. Chlamtac, The P^2 algorithmus for dynamic calculation of quantiles and
   50.48 +        histograms without storing observations, Communications of the ACM,
   50.49 +        Volume 28 (October), Number 10, 1985, p. 1076-1085.
   50.50 +
   50.51 +        @param p_square_cumulative_distribution_num_cells.
   50.52 +    */
   50.53 +    template<typename Sample>
   50.54 +    struct p_square_cumulative_distribution_impl
   50.55 +      : accumulator_base
   50.56 +    {
   50.57 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
   50.58 +        typedef std::vector<float_type> array_type;
   50.59 +        typedef std::vector<std::pair<float_type, float_type> > histogram_type;
   50.60 +        // for boost::result_of
   50.61 +        typedef iterator_range<typename histogram_type::iterator> result_type;
   50.62 +
   50.63 +        template<typename Args>
   50.64 +        p_square_cumulative_distribution_impl(Args const &args)
   50.65 +          : num_cells(args[p_square_cumulative_distribution_num_cells])
   50.66 +          , heights(num_cells + 1)
   50.67 +          , actual_positions(num_cells + 1)
   50.68 +          , desired_positions(num_cells + 1)
   50.69 +          , positions_increments(num_cells + 1)
   50.70 +          , histogram(num_cells + 1)
   50.71 +          , is_dirty(true)
   50.72 +        {
   50.73 +            std::size_t b = this->num_cells;
   50.74 +
   50.75 +            for (std::size_t i = 0; i < b + 1; ++i)
   50.76 +            {
   50.77 +                this->actual_positions[i] = i + 1.;
   50.78 +                this->desired_positions[i] = i + 1.;
   50.79 +                this->positions_increments[i] = numeric::average(i, b);
   50.80 +            }
   50.81 +        }
   50.82 +
   50.83 +        template<typename Args>
   50.84 +        void operator ()(Args const &args)
   50.85 +        {
   50.86 +            this->is_dirty = true;
   50.87 +
   50.88 +            std::size_t cnt = count(args);
   50.89 +            std::size_t sample_cell = 1; // k
   50.90 +            std::size_t b = this->num_cells;
   50.91 +
   50.92 +            // accumulate num_cells + 1 first samples
   50.93 +            if (cnt <= b + 1)
   50.94 +            {
   50.95 +                this->heights[cnt - 1] = args[sample];
   50.96 +
   50.97 +                // complete the initialization of heights by sorting
   50.98 +                if (cnt == b + 1)
   50.99 +                {
  50.100 +                    std::sort(this->heights.begin(), this->heights.end());
  50.101 +                }
  50.102 +            }
  50.103 +            else
  50.104 +            {
  50.105 +                // find cell k such that heights[k-1] <= args[sample] < heights[k] and adjust extreme values
  50.106 +                if (args[sample] < this->heights[0])
  50.107 +                {
  50.108 +                    this->heights[0] = args[sample];
  50.109 +                    sample_cell = 1;
  50.110 +                }
  50.111 +                else if (this->heights[b] <= args[sample])
  50.112 +                {
  50.113 +                    this->heights[b] = args[sample];
  50.114 +                    sample_cell = b;
  50.115 +                }
  50.116 +                else
  50.117 +                {
  50.118 +                    typename array_type::iterator it;
  50.119 +                    it = std::upper_bound(
  50.120 +                        this->heights.begin()
  50.121 +                      , this->heights.end()
  50.122 +                      , args[sample]
  50.123 +                    );
  50.124 +
  50.125 +                    sample_cell = std::distance(this->heights.begin(), it);
  50.126 +                }
  50.127 +
  50.128 +                // increment positions of markers above sample_cell
  50.129 +                for (std::size_t i = sample_cell; i < b + 1; ++i)
  50.130 +                {
  50.131 +                    ++this->actual_positions[i];
  50.132 +                }
  50.133 +
  50.134 +                // update desired position of markers 2 to num_cells + 1
  50.135 +                // (desired position of first marker is always 1)
  50.136 +                for (std::size_t i = 1; i < b + 1; ++i)
  50.137 +                {
  50.138 +                    this->desired_positions[i] += this->positions_increments[i];
  50.139 +                }
  50.140 +
  50.141 +                // adjust heights of markers 2 to num_cells if necessary
  50.142 +                for (std::size_t i = 1; i < b; ++i)
  50.143 +                {
  50.144 +                    // offset to desire position
  50.145 +                    float_type d = this->desired_positions[i] - this->actual_positions[i];
  50.146 +
  50.147 +                    // offset to next position
  50.148 +                    float_type dp = this->actual_positions[i + 1] - this->actual_positions[i];
  50.149 +
  50.150 +                    // offset to previous position
  50.151 +                    float_type dm = this->actual_positions[i - 1] - this->actual_positions[i];
  50.152 +
  50.153 +                    // height ds
  50.154 +                    float_type hp = (this->heights[i + 1] - this->heights[i]) / dp;
  50.155 +                    float_type hm = (this->heights[i - 1] - this->heights[i]) / dm;
  50.156 +
  50.157 +                    if ( ( d >= 1. && dp > 1. ) || ( d <= -1. && dm < -1. ) )
  50.158 +                    {
  50.159 +                        short sign_d = static_cast<short>(d / std::abs(d));
  50.160 +
  50.161 +                        // try adjusting heights[i] using p-squared formula
  50.162 +                        float_type h = this->heights[i] + sign_d / (dp - dm) * ( (sign_d - dm) * hp + (dp - sign_d) * hm );
  50.163 +
  50.164 +                        if ( this->heights[i - 1] < h && h < this->heights[i + 1] )
  50.165 +                        {
  50.166 +                            this->heights[i] = h;
  50.167 +                        }
  50.168 +                        else
  50.169 +                        {
  50.170 +                            // use linear formula
  50.171 +                            if (d>0)
  50.172 +                            {
  50.173 +                                this->heights[i] += hp;
  50.174 +                            }
  50.175 +                            if (d<0)
  50.176 +                            {
  50.177 +                                this->heights[i] -= hm;
  50.178 +                            }
  50.179 +                        }
  50.180 +                        this->actual_positions[i] += sign_d;
  50.181 +                    }
  50.182 +                }
  50.183 +            }
  50.184 +        }
  50.185 +
  50.186 +        template<typename Args>
  50.187 +        result_type result(Args const &args) const
  50.188 +        {
  50.189 +            if (this->is_dirty)
  50.190 +            {
  50.191 +                this->is_dirty = false;
  50.192 +
  50.193 +                // creates a vector of std::pair where each pair i holds
  50.194 +                // the values heights[i] (x-axis of histogram) and
  50.195 +                // actual_positions[i] / cnt (y-axis of histogram)
  50.196 +
  50.197 +                std::size_t cnt = count(args);
  50.198 +
  50.199 +                for (std::size_t i = 0; i < this->histogram.size(); ++i)
  50.200 +                {
  50.201 +                    this->histogram[i] = std::make_pair(this->heights[i], numeric::average(this->actual_positions[i], cnt));
  50.202 +                }
  50.203 +            }
  50.204 +            //return histogram;
  50.205 +            return make_iterator_range(this->histogram);
  50.206 +        }
  50.207 +
  50.208 +    private:
  50.209 +        std::size_t num_cells;            // number of cells b
  50.210 +        array_type  heights;              // q_i
  50.211 +        array_type  actual_positions;     // n_i
  50.212 +        array_type  desired_positions;    // n'_i
  50.213 +        array_type  positions_increments; // dn'_i
  50.214 +        mutable histogram_type histogram; // histogram
  50.215 +        mutable bool is_dirty;
  50.216 +    };
  50.217 +
  50.218 +} // namespace detail
  50.219 +
  50.220 +///////////////////////////////////////////////////////////////////////////////
  50.221 +// tag::p_square_cumulative_distribution
  50.222 +//
  50.223 +namespace tag
  50.224 +{
  50.225 +    struct p_square_cumulative_distribution
  50.226 +      : depends_on<count>
  50.227 +      , p_square_cumulative_distribution_num_cells
  50.228 +    {
  50.229 +        /// INTERNAL ONLY
  50.230 +        ///
  50.231 +        typedef accumulators::impl::p_square_cumulative_distribution_impl<mpl::_1> impl;
  50.232 +    };
  50.233 +}
  50.234 +
  50.235 +///////////////////////////////////////////////////////////////////////////////
  50.236 +// extract::p_square_cumulative_distribution
  50.237 +//
  50.238 +namespace extract
  50.239 +{
  50.240 +    extractor<tag::p_square_cumulative_distribution> const p_square_cumulative_distribution = {};
  50.241 +
  50.242 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(p_square_cumulative_distribution)
  50.243 +}
  50.244 +
  50.245 +using extract::p_square_cumulative_distribution;
  50.246 +
  50.247 +// So that p_square_cumulative_distribution can be automatically substituted with
  50.248 +// weighted_p_square_cumulative_distribution when the weight parameter is non-void
  50.249 +template<>
  50.250 +struct as_weighted_feature<tag::p_square_cumulative_distribution>
  50.251 +{
  50.252 +    typedef tag::weighted_p_square_cumulative_distribution type;
  50.253 +};
  50.254 +
  50.255 +template<>
  50.256 +struct feature_of<tag::weighted_p_square_cumulative_distribution>
  50.257 +  : feature_of<tag::p_square_cumulative_distribution>
  50.258 +{
  50.259 +};
  50.260 +
  50.261 +}} // namespace boost::accumulators
  50.262 +
  50.263 +#endif
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/boost_1_45_0/boost/accumulators/statistics/p_square_quantile.hpp	Fri Mar 04 12:48:37 2011 -0800
    51.3 @@ -0,0 +1,257 @@
    51.4 +///////////////////////////////////////////////////////////////////////////////
    51.5 +// p_square_quantile.hpp
    51.6 +//
    51.7 +//  Copyright 2005 Daniel Egloff. Distributed under the Boost
    51.8 +//  Software License, Version 1.0. (See accompanying file
    51.9 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
   51.10 +
   51.11 +#ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_QUANTILE_HPP_DE_01_01_2006
   51.12 +#define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_QUANTILE_HPP_DE_01_01_2006
   51.13 +
   51.14 +#include <cmath>
   51.15 +#include <functional>
   51.16 +#include <boost/array.hpp>
   51.17 +#include <boost/mpl/placeholders.hpp>
   51.18 +#include <boost/type_traits/is_same.hpp>
   51.19 +#include <boost/parameter/keyword.hpp>
   51.20 +#include <boost/accumulators/framework/accumulator_base.hpp>
   51.21 +#include <boost/accumulators/framework/extractor.hpp>
   51.22 +#include <boost/accumulators/numeric/functional.hpp>
   51.23 +#include <boost/accumulators/framework/parameters/sample.hpp>
   51.24 +#include <boost/accumulators/framework/depends_on.hpp>
   51.25 +#include <boost/accumulators/statistics_fwd.hpp>
   51.26 +#include <boost/accumulators/statistics/count.hpp>
   51.27 +#include <boost/accumulators/statistics/parameters/quantile_probability.hpp>
   51.28 +
   51.29 +namespace boost { namespace accumulators
   51.30 +{
   51.31 +
   51.32 +namespace impl
   51.33 +{
   51.34 +    ///////////////////////////////////////////////////////////////////////////////
   51.35 +    // p_square_quantile_impl
   51.36 +    //  single quantile estimation
   51.37 +    /**
   51.38 +        @brief Single quantile estimation with the \f$P^2\f$ algorithm
   51.39 +
   51.40 +        The \f$P^2\f$ algorithm estimates a quantile dynamically without storing samples. Instead of
   51.41 +        storing the whole sample cumulative distribution, only five points (markers) are stored. The heights
   51.42 +        of these markers are the minimum and the maximum of the samples and the current estimates of the
   51.43 +        \f$(p/2)\f$-, \f$p\f$- and \f$(1+p)/2\f$-quantiles. Their positions are equal to the number
   51.44 +        of samples that are smaller or equal to the markers. Each time a new samples is recorded, the
   51.45 +        positions of the markers are updated and if necessary their heights are adjusted using a piecewise-
   51.46 +        parabolic formula.
   51.47 +
   51.48 +        For further details, see
   51.49 +
   51.50 +        R. Jain and I. Chlamtac, The P^2 algorithmus fordynamic calculation of quantiles and
   51.51 +        histograms without storing observations, Communications of the ACM,
   51.52 +        Volume 28 (October), Number 10, 1985, p. 1076-1085.
   51.53 +
   51.54 +        @param quantile_probability
   51.55 +    */
   51.56 +    template<typename Sample, typename Impl>
   51.57 +    struct p_square_quantile_impl
   51.58 +      : accumulator_base
   51.59 +    {
   51.60 +        typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
   51.61 +        typedef array<float_type, 5> array_type;
   51.62 +        // for boost::result_of
   51.63 +        typedef float_type result_type;
   51.64 +
   51.65 +        template<typename Args>
   51.66 +        p_square_quantile_impl(Args const &args)
   51.67 +          : p(is_same<Impl, for_median>::value ? 0.5 : args[quantile_probability | 0.5])
   51.68 +          , heights()
   51.69 +          , actual_positions()
   51.70 +          , desired_positions()
   51.71 +          , positions_increments()
   51.72 +        {
   51.73 +            for(std::size_t i = 0; i < 5; ++i)
   51.74 +            {
   51.75 +                this->actual_positions[i] = i + 1;
   51.76 +            }
   51.77 +
   51.78 +            this->desired_positions[0] = 1.;
   51.79 +            this->desired_positions[1] = 1. + 2. * this->p;
   51.80 +            this->desired_positions[2] = 1. + 4. * this->p;
   51.81 +            this->desired_positions[3] = 3. + 2. * this->p;
   51.82 +            this->desired_positions[4] = 5.;
   51.83 +
   51.84 +            this->positions_increments[0] = 0.;
   51.85 +            this->positions_increments[1] = this->p / 2.;
   51.86 +            this->positions_increments[2] = this->p;
   51.87 +            this->positions_increments[3] = (1. + this->p) / 2.;
   51.88 +            this->positions_increments[4] = 1.;
   51.89 +        }
   51.90 +
   51.91 +        template<typename Args>
   51.92 +        void operator ()(Args const &args)
   51.93 +        {
   51.94 +            std::size_t cnt = count(args);
   51.95 +
   51.96 +            // accumulate 5 first samples
   51.97 +            if(cnt <= 5)
   51.98 +            {
   51.99 +                this->heights[cnt - 1] = args[sample];
  51.100 +
  51.101 +                // complete the initialization of heights by sorting
  51.102 +                if(cnt == 5)
  51.103 +                {
  51.104 +                    std::sort(this->heights.begin(), this->heights.end());
  51.105 +                }
  51.106 +            }
  51.107 +            else
  51.108 +            {
  51.109 +                std::size_t sample_cell = 1; // k
  51.110 +
  51.111 +                // find cell k such that heights[k-1] <= args[sample] < heights[k] and ajust extreme values
  51.112 +                if (args[sample] < this->heights[0])
  51.113 +                {
  51.114 +                    this->heights[0] = args[sample];
  51.115 +                    sample_cell = 1;
  51.116 +                }
  51.117 +                else if (this->heights[4] <= args[sample])
  51.118 +                {
  51.119 +                    this->heights[4] = args[sample];
  51.120 +                    sample_cell = 4;
  51.121 +                }
  51.122 +                else
  51.123 +                {
  51.124 +                    typedef typename array_type::iterator iterator;
  51.125 +                    iterator it = std::upper_bound(
  51.126 +                        this->heights.begin()
  51.127 +                      , this->heights.end()
  51.128 +                      , args[sample]
  51.129 +                    );
  51.130 +
  51.131 +                    sample_cell = std::distance(this->heights.begin(), it);
  51.132 +                }
  51.133 +
  51.134 +                // update positions of markers above sample_cell
  51.135 +                for(std::size_t i = sample_cell; i < 5; ++i)
  51.136 +                {
  51.137 +                    ++this->actual_positions[i];
  51.138 +                }
  51.139 +
  51.140 +                // update desired positions of all markers
  51.141 +                for(std::size_t i = 0; i < 5; ++i)
  51.142 +                {
  51.143 +                    this->desired_positions[i] += this->positions_increments[i];
  51.144 +                }
  51.145 +
  51.146 +                // adjust heights and actual positions of markers 1 to 3 if necessary
  51.147 +                for(std::size_t i = 1; i <= 3; ++i)
  51.148 +                {
  51.149 +                    // offset to desired positions
  51.150 +                    float_type d = this->desired_positions[i] - this->actual_positions[i];
  51.151 +
  51.152 +                    // offset to next position
  51.153 +                    float_type dp = this->actual_positions[i + 1] - this->actual_positions[i];
  51.154 +
  51.155 +                    // offset to previous position
  51.156 +                    float_type dm = this->actual_positions[i - 1] - this->actual_positions[i];
  51.157 +
  51.158 +                    // height ds
  51.159 +                    float_type hp = (this->heights[i + 1] - this->heights[i]) / dp;
  51.160 +                    float_type hm = (this->heights[i - 1] - this->heights[i]) / dm;
  51.161 +
  51.162 +                    if((d >= 1. && dp > 1.) || (d <= -1. && dm < -1.))
  51.163 +                    {
  51.164 +                        short sign_d = static_cast<short>(d / std::abs(d));
  51.165 +
  51.166 +                        // try adjusting heights[i] using p-squared formula
  51.167 +                        float_type h = this->heights[i] + sign_d / (dp - dm) * ((sign_d - dm) * hp
  51.168 +                                     + (dp - sign_d) * hm);
  51.169 +
  51.170 +                        if(this->heights[i - 1] < h && h < this->heights[i + 1])
  51.171 +                        {
  51.172 +                            this->heights[i] = h;
  51.173 +                        }
  51.174 +                        else
  51.175 +                        {
  51.176 +                            // use linear formula
  51.177 +                            if(d > 0)
  51.178 +                            {
  51.179 +                                this->heights[i] += hp;
  51.180 +                            }
  51.181 +                            if(d < 0)
  51.182 +                            {
  51.183 +                                this->heights[i] -= hm;
  51.184 +                            }
  51.185 +                        }
  51.186 +                        this->actual_positions[i] += sign_d;
  51.187 +                    }
  51.188 +                }
  51.189 +            }
  51.190 +        }
  51.191 +
  51.192 +        result_type result(dont_care) const
  51.193 +        {
  51.194 +            return this->heights[2];
  51.195 +        }
  51.196 +
  51.197 +    private:
  51.198 +        float_type p;                    // the quantile probability p
  51.199 +        array_type heights;              // q_i
  51.200 +        array_type actual_positions;     // n_i
  51.201 +        array_type desired_positions;    // n'_i
  51.202 +        array_type positions_increments; // dn'_i
  51.203 +    };
  51.204 +
  51.205 +} // namespace detail
  51.206 +
  51.207 +///////////////////////////////////////////////////////////////////////////////
  51.208 +// tag::p_square_quantile
  51.209 +//
  51.210 +namespace tag
  51.211 +{
  51.212 +    struct p_square_quantile
  51.213 +      : depends_on<count>
  51.214 +    {
  51.215 +        /// INTERNAL ONLY
  51.216 +        ///
  51.217 +        typedef accumulators::impl::p_square_quantile_impl<mpl::_1, regular> impl;
  51.218 +    };
  51.219 +    struct p_square_quantile_for_median
  51.220 +      : depends_on<count>
  51.221 +    {
  51.222 +        /// INTERNAL ONLY
  51.223 +        ///
  51.224 +        typedef accumulators::impl::p_square_quantile_impl<mpl::_1, for_median> impl;
  51.225 +    };
  51.226 +}
  51.227 +
  51.228 +///////////////////////////////////////////////////////////////////////////////
  51.229 +// extract::p_square_quantile
  51.230 +// extract::p_square_quantile_for_median
  51.231 +//
  51.232 +namespace extract
  51.233 +{
  51.234 +    extractor<tag::p_square_quantile> const p_square_quantile = {};
  51.235 +    extractor<tag::p_square_quantile_for_median> const p_square_quantile_for_median = {};
  51.236 +
  51.237 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(p_square_quantile)
  51.238 +    BOOST_ACCUMULATORS_IGNORE_GLOBAL(p_square_quantile_for_median)
  51.239 +}
  51.240 +
  51.241 +using extract::p_square_quantile;
  51.242 +using extract::p_square_quantile_for_median;
  51.243 +
  51.244 +// So that p_square_quantile can be automatically substituted with
  51.245 +// weighted_p_square_quantile when the weight parameter is non-void
  51.246 +template<>
  51.247 +struct as_weighted_feature<tag::p_square_quantile>
  51.248 +{
  51.249 +    typedef tag::weighted_p_square_quantile type;
  51.250 +};
  51.251 +
  51.252 +template<>
  51.253 +struct feature_of<tag::weighted_p_square_quantile>
  51.254 +  : feature_of<tag::p_square_quantile>
  51.255 +{
  51.256 +};
  51.257 +
  51.258 +}} // namespace boost::accumulators
  51.259 +
  51.260 +#endif
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/boost_1_45_0/boost/accumulators/statistics/parameters/quantile_probability.hpp	Fri Mar 04 12:48:37 2011 -0800
    52.3 @@ -0,0 +1,20 @@
    52.4 +///////////////////////////////////////////////////////////////////////////////
    52.5 +// quantile_probability.hpp
    52.6 +//
    52.7 +//  Copyright 2005 Eric Niebler. Distributed under the Boost
    52.8 +//  Software License, Version 1.0. (See accompanying file