Skip to content

Commit

Permalink
Merge branch 'develop' into issue1169
Browse files Browse the repository at this point in the history
  • Loading branch information
jzmaddock committed Sep 7, 2024
2 parents 282feed + 1e9b2cc commit ba364f9
Show file tree
Hide file tree
Showing 728 changed files with 59,407 additions and 4,966 deletions.
48 changes: 48 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

require-b2 5.2 ;

constant boost_dependencies :
/boost/assert//boost_assert
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/core//boost_core
/boost/integer//boost_integer
/boost/lexical_cast//boost_lexical_cast
/boost/predef//boost_predef
/boost/random//boost_random
/boost/static_assert//boost_static_assert
/boost/throw_exception//boost_throw_exception ;

project /boost/math
: common-requirements
<include>include
;

explicit
[ alias boost_math : : : : <library>$(boost_dependencies) ]
[ alias boost_math_c99 : build//boost_math_c99 ]
[ alias boost_math_c99f : build//boost_math_c99f ]
[ alias boost_math_c99l : build//boost_math_c99l ]
[ alias boost_math_tr1 : build//boost_math_tr1 ]
[ alias boost_math_tr1f : build//boost_math_tr1f ]
[ alias boost_math_tr1l : build//boost_math_tr1l ]
[ alias all :
boost_math
boost_math_c99 boost_math_c99f boost_math_c99l
boost_math_tr1 boost_math_tr1f boost_math_tr1l
example test ]
[ alias testing : : : :
<include>test
<include>include_private ]
;

call-if : boost-library math
: install boost_math
boost_math_c99 boost_math_c99f boost_math_c99l
boost_math_tr1 boost_math_tr1f boost_math_tr1l
;

38 changes: 20 additions & 18 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# copyright John Maddock 2008
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt.

import testing ;
import pch ;
import ../../config/checks/config : requires ;
import-search /boost/config/checks ;
import config : requires ;

project
: requirements
<toolset>intel-win:<cxxflags>-nologo
<toolset>intel-win:<linkflags>-nologo
project
: common-requirements <library>$(boost_dependencies)
: requirements
<toolset>intel-win:<cxxflags>-nologo
<toolset>intel-win:<linkflags>-nologo
#<toolset>intel-linux:<pch>off
<toolset>intel-darwin:<pch>off
<toolset>gcc,<target-os>windows:<pch>off
Expand All @@ -20,9 +22,11 @@ project
[ check-target-builds ../config//has_gcc_visibility "gcc visibility" : <toolset>gcc:<cxxflags>-fvisibility=hidden : ]
[ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ]
[ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction ]
: usage-requirements
<define>BOOST_MATH_TR1_NO_LIB=1
;

cpp-pch pch : ../src/tr1/pch.hpp : <include>../src/tr1 <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1 ;
cpp-pch pch : ../src/tr1/pch.hpp : <include>../src/tr1 <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1 ;

C99_SOURCES = acosh
asinh
Expand All @@ -46,7 +50,7 @@ round
tgamma
trunc ;

TR1_SOURCES =
TR1_SOURCES =
assoc_laguerre
assoc_legendre
beta
Expand Down Expand Up @@ -80,46 +84,44 @@ import targets ;

obj long_double_check : ../config/has_long_double_support.cpp ;
explicit long_double_check ;

# Library targets
lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp pch
:
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
<include>../src/tr1
;

lib boost_math_tr1f : ../src/tr1/$(TR1_SOURCES)f.cpp pch
:
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
<include>../src/tr1
;

lib boost_math_tr1l : ../src/tr1/$(TR1_SOURCES)l.cpp pch
:
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
<dependency>../config//has_long_double_support
<include>../src/tr1
[ check-target-builds ../config//has_long_double_support "long double support" : : <build>no ]
;

lib boost_math_c99 : ../src/tr1/$(C99_SOURCES).cpp pch
:
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
<include>../src/tr1
;

lib boost_math_c99f : ../src/tr1/$(C99_SOURCES)f.cpp pch
:
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
<include>../src/tr1
;

lib boost_math_c99l : ../src/tr1/$(C99_SOURCES)l.cpp pch
:
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
<dependency>../config//has_long_double_support
<include>../src/tr1
[ check-target-builds ../config//has_long_double_support "long double support" : : <build>no ]
;

boost-install boost_math_c99 boost_math_c99f boost_math_c99l boost_math_tr1 boost_math_tr1f boost_math_tr1l ;
10 changes: 5 additions & 5 deletions config/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import path ;
local ntl-path = [ modules.peek : NTL_PATH ] ;
local gmp_path = [ modules.peek : GMP_PATH ] ;

lib quadmath ;
lib fftw3 ;
lib fftw3f ;
lib fftw3l ;
lib fftw3q ;
searched-lib quadmath ;
searched-lib fftw3 ;
searched-lib fftw3f ;
searched-lib fftw3l ;
searched-lib fftw3q ;

obj has_long_double_support : has_long_double_support.cpp ;
obj has_mpfr_class : has_mpfr_class.cpp :
Expand Down
14 changes: 7 additions & 7 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ path-constant here : . ;
constant here-url : [ regex.replace $(here) "\\\\" "/" ] ;

xml math : math.qbk :
<quickbook-define>enable_index
<quickbook-define>enable_index
<quickbook-define>__base_path__=$(here-url)
<format>pdf:<quickbook-define>__build_pdf
<format>html:<quickbook-define>__build_html
Expand All @@ -25,7 +25,7 @@ boostbook standalone
# Path for links to Boost:
<xsl:param>boost.root=../../../..
<xsl:param>html.stylesheet=math.css

# Some general style settings:
<xsl:param>table.footnote.number.format=1
<xsl:param>footnote.number.format=1
Expand All @@ -46,11 +46,11 @@ boostbook standalone
# Index on type:
<xsl:param>index.on.type=1
<xsl:param>boost.noexpand.chapter.toc=1

#<xsl:param>root.filename="sf_dist_and_tools"
#<xsl:param>graphicsize.extension=1
#<xsl:param>use.extensions=1

# PDF Options:
# TOC Generation: this is needed for FOP-0.9 and later:
<xsl:param>fop1.extensions=0
Expand All @@ -74,23 +74,23 @@ boostbook standalone
# better use SVG's instead:
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
<format>pdf:<xsl:param>admon.graphics.path=$(here)/../../../doc/src/images/
<format>pdf:<xsl:param>use.role.for.mediaobject=1
<format>pdf:<xsl:param>use.role.for.mediaobject=1
<format>pdf:<xsl:param>preferred.mediaobject.role=print
<format>pdf:<xsl:param>img.src.path=$(images_location)/
<format>pdf:<xsl:param>draft.mode="no"
<format>pdf:<xsl:param>boost.url.prefix=http\://www.boost.org/doc/libs/release/libs/math/doc/html
<auto-index>on <format>pdf:<auto-index-internal>off
<format>html:<auto-index-internal>on
<auto-index-script>$(here)/index.idx
<auto-index-prefix>$(here)/../../..
<auto-index-prefix>$(here)/../include
#<auto-index-verbose>on
<format>pdf:<xsl:param>index.on.type=1
;

install pdfinstall : standalone/<format>pdf : <location>. <install-type>PDF <name>math.pdf ;
explicit pdfinstall ; # b2 pdf pdfinstall to do this pdf file copy.

install css_install : math.css : <location>$(here)/html ;
install css_install : math.css : <location>$(here)/html ;

###############################################################################
alias boostdoc ;
Expand Down
5 changes: 5 additions & 0 deletions doc/constants/constants.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ either construct from a decimal digit string or calculate on the fly depending u
[[Any other value ['N]][Sets the compile time precision to ['N] bits.]]
]

[h5 GPU Support]

All Boost.Math constants are marked with `BOOST_MATH_GPU_ENABLED` and can be used on both host and device.
Note that when running on device you are limited to using only `float` and `double` types.

[h5 Custom Specializing a constant]

In addition, for user-defined types that need special handling, it's possible to partially-specialize
Expand Down
12 changes: 7 additions & 5 deletions doc/distributions/arcsine.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
typedef Policy policy_type;

// Constructor from two range parameters, x_min and x_max:
arcsine_distribution(RealType x_min = 0, RealType x_max = 1);
BOOST_MATH_GPU_ENABLED arcsine_distribution(RealType x_min = 0, RealType x_max = 1);

// Range Parameter accessors:
RealType x_min() const;
RealType x_max() const;
BOOST_MATH_GPU_ENABLED RealType x_min() const;
BOOST_MATH_GPU_ENABLED RealType x_max() const;
};
}} // namespaces

Expand Down Expand Up @@ -103,8 +103,8 @@ constructs a 'Standard 01' arcsine distribution.

[h5 Parameter Accessors]

RealType x_min() const;
RealType x_max() const;
BOOST_MATH_GPU_ENABLED RealType x_min() const;
BOOST_MATH_GPU_ENABLED RealType x_max() const;

Return the parameter ['x_min] or ['x_max] from which this distribution was constructed.

Expand All @@ -116,6 +116,8 @@ So, for example:

All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.

The formulae for calculating these are shown in the table below, and at
[@http://mathworld.wolfram.com/arcsineDistribution.html Wolfram Mathworld].
Expand Down
10 changes: 6 additions & 4 deletions doc/distributions/bernoulli.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
typedef RealType value_type;
typedef Policy policy_type;

bernoulli_distribution(RealType p); // Constructor.
BOOST_MATH_GPU_ENABLED bernoulli_distribution(RealType p); // Constructor.
// Accessor function.
RealType success_fraction() const
BOOST_MATH_GPU_ENABLED RealType success_fraction() const
// Probability of success (as a fraction).
};
}} // namespaces
Expand Down Expand Up @@ -51,19 +51,21 @@ and the [@http://en.wikipedia.org/wiki/Cumulative_Distribution_Function Cumulati

[h4 Member Functions]

bernoulli_distribution(RealType p);
BOOST_MATH_GPU_ENABLED bernoulli_distribution(RealType p);

Constructs a [@http://en.wikipedia.org/wiki/bernoulli_distribution
bernoulli distribution] with success_fraction /p/.

RealType success_fraction() const
BOOST_MATH_GPU_ENABLED RealType success_fraction() const

Returns the /success_fraction/ parameter of this distribution.

[h4 Non-member Accessors]

All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.

The domain of the random variable is 0 and 1,
and the useful supported range is only 0 or 1.
Expand Down
22 changes: 12 additions & 10 deletions doc/distributions/beta.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@
typedef RealType value_type;
typedef Policy policy_type;
// Constructor from two shape parameters, alpha & beta:
beta_distribution(RealType a, RealType b);
BOOST_MATH_GPU_ENABLED beta_distribution(RealType a, RealType b);

// Parameter accessors:
RealType alpha() const;
RealType beta() const;
BOOST_MATH_GPU_ENABLED RealType alpha() const;
BOOST_MATH_GPU_ENABLED RealType beta() const;

// Parameter estimators of alpha or beta from mean and variance.
static RealType find_alpha(
BOOST_MATH_GPU_ENABLED static RealType find_alpha(
RealType mean, // Expected value of mean.
RealType variance); // Expected value of variance.

static RealType find_beta(
BOOST_MATH_GPU_ENABLED static RealType find_beta(
RealType mean, // Expected value of mean.
RealType variance); // Expected value of variance.

// Parameter estimators from
// either alpha or beta, and x and probability.

static RealType find_alpha(
BOOST_MATH_GPU_ENABLED static RealType find_alpha(
RealType beta, // from beta.
RealType x, // x.
RealType probability); // cdf

static RealType find_beta(
BOOST_MATH_GPU_ENABLED static RealType find_beta(
RealType alpha, // alpha.
RealType x, // probability x.
RealType probability); // probability cdf.
Expand Down Expand Up @@ -98,7 +98,7 @@ whose apex is away from the centre (where x = half).

[h5 Constructor]

beta_distribution(RealType alpha, RealType beta);
BOOST_MATH_GPU_ENABLED beta_distribution(RealType alpha, RealType beta);

Constructs a beta distribution with shape parameters /alpha/ and /beta/.

Expand All @@ -117,11 +117,11 @@ in the graph above).

[h5 Parameter Accessors]

RealType alpha() const;
BOOST_MATH_GPU_ENABLED RealType alpha() const;

Returns the parameter /alpha/ from which this distribution was constructed.

RealType beta() const;
BOOST_MATH_GPU_ENABLED RealType beta() const;

Returns the parameter /beta/ from which this distribution was constructed.

Expand Down Expand Up @@ -182,6 +182,8 @@ Returns the value of [beta] that gives:

All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.

The formulae for calculating these are shown in the table below, and at
[@http://mathworld.wolfram.com/BetaDistribution.html Wolfram Mathworld].
Expand Down
Loading

0 comments on commit ba364f9

Please sign in to comment.