Boost logo

Boost-Commit :

From: pbristow_at_[hidden]
Date: 2007-08-13 17:39:23


Author: pbristow
Date: 2007-08-13 17:39:22 EDT (Mon, 13 Aug 2007)
New Revision: 38634
URL: http://svn.boost.org/trac/boost/changeset/38634

Log:
update for polices
Text files modified:
   sandbox/math_toolkit/libs/math/doc/policy.qbk | 24 ++++++++++--------------
   sandbox/math_toolkit/libs/math/doc/policy_tutorial.qbk | 27 +++++++++++++--------------
   2 files changed, 23 insertions(+), 28 deletions(-)

Modified: sandbox/math_toolkit/libs/math/doc/policy.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/policy.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/policy.qbk 2007-08-13 17:39:22 EDT (Mon, 13 Aug 2007)
@@ -7,7 +7,8 @@
 available in the [link math_toolkit.policy.pol_tutorial policy tutorial]
 and the [link math_toolkit.policy.pol_ref policy reference].
 
-Unless you find that the default policy behaviour
+Unless you find that the [link math_toolkit.policy.pol_tutorial.policy_tut_defaults
+ default policy behaviour]
 when encountering 'bad' argument values does not meet your needs,
 you should not need to worry about policies.
 
@@ -233,7 +234,7 @@
 
 [policy_ref_snip2]
 
-[endsect][/section:error_handling_policies Error Handling Policies]
+[endsect] [/section:error_handling_policies Error Handling Policies]
 
 [section:internal_promotion Internal Promotion Policies]
 
@@ -258,17 +259,15 @@
 `long double`, then we could use:
 
 [import ../example/policy_ref_snip3.cpp]
-
 [policy_ref_snip3]
    
 Alternatively, suppose we want a distribution to perform calculations
 without promoting `float` to `double`, then we could use:
 
 [import ../example/policy_ref_snip4.cpp]
-
 [policy_ref_snip4]
    
-[endsect][/section:internal_promotion Internal Promotion Policies]
+[endsect] [/section:internal_promotion Internal Promotion Policies]
 
 [section:assert_undefined Mathematically Undefined Function Policies]
 
@@ -327,11 +326,11 @@
    enum discrete_quantile_policy_type
    {
       real,
- integer_round_outwards,
- integer_round_inwards,
- integer_round_down,
- integer_round_up,
- integer_round_nearest
+ integer_outside, // default
+ integer_inside,
+ integer_below,
+ integer_above,
+ integer_nearest
    };
    
    template <discrete_quantile_policy_type>
@@ -345,7 +344,6 @@
 result. For example:
 
 [import ../example/policy_ref_snip5.cpp]
-
 [policy_ref_snip5]
    
 Results in `x = 27.3898` and `y = 68.1584`.
@@ -363,7 +361,6 @@
 the requested coverage. For example:
 
 [import ../example/policy_ref_snip6.cpp]
-
 [policy_ref_snip6]
    
 Results in `x = 27` (rounded down from 27.3898) and `y = 69` (rounded up from 68.1584).
@@ -474,7 +471,7 @@
 
 [endsect][/section:precision_pol Precision Policies]
 
-[section:policy_defaults Changing the Policy Defaults]
+[section:policy_defaults Using macros to Change the Policy Defaults]
 
 You can use the various macros below to change any (or all) of the policies.
 
@@ -593,7 +590,6 @@
      using boost::math::normal_distribution;
 
 in a source .cpp file.
-[/ TODO could use a normal example here?]
 
 [endsect][/section:policy_defaults Changing the Policy Defaults]
 

Modified: sandbox/math_toolkit/libs/math/doc/policy_tutorial.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/policy_tutorial.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/policy_tutorial.qbk 2007-08-13 17:39:22 EDT (Mon, 13 Aug 2007)
@@ -30,7 +30,7 @@
    //
    typedef policy<domain_error<errno_on_error>, promote_double<false> > mypolicy;
 
-[endsect]
+[endsect][/section:what_is_a_policy So Just What is a Policy Anyway?]
 
 [section:policy_tut_defaults Policies Have Sensible Defaults]
 
@@ -51,9 +51,8 @@
 [[Precision of Approximation Used][By default uses an approximation that
    will result in the lowest level of error for the type of the result.]]
 [[Behaviour of Discrete Quantiles][Returns an integer result that is rounded
- down for lower quantiles and rounded up for upper quantiles - see
- [link math_toolkit.policy.pol_tutorial.understand_dis_quant the tutorial
- on discrete distribution quantiles.]]]
+ down for lower quantiles and rounded up for upper quantiles by default
+ but see - __math_discrete on other policies.]]
 ]
 
 What's more, if you define your own policy type, then it automatically
@@ -69,7 +68,7 @@
 then `mypolicy` defines a policy where only the overflow error handling and
 `double`-promotion policies differ from the defaults.
 
-[endsect]
+[endsect][/section:policy_tut_defaults Policies Have Sensible Defaults]
 
 [section:policy_usage So How are Policies Used Anyway?]
 
@@ -88,7 +87,7 @@
 
 The following sections introduce these methods in more detail.
 
-[endsect]
+[endsect][/section:policy_usage So How are Policies Used Anyway?]
 
 [section:changing_policy_defaults Changing the Policy Defaults]
 
@@ -110,12 +109,13 @@
 That means there are only two safe ways to use these macros:
 
 * Edit them in [@../../../../boost/math/tools/user.hpp boost/math/tools/user.hpp],
-so that the defaults are set on an installation-wide basis. Unfortunately this may not be convenient if
+so that the defaults are set on an installation-wide basis.
+Unfortunately this may not be convenient if
 you are using a pre-installed Boost distribution (on Linux for example).
 * Set the defines in your project's Makefile or build environment, so that they
 are set uniformly across all translation units.
 
-What you should not do is:
+What you should *not* do is:
 
 * Set the defines in the source file using `#define` as doing so
 almost certainly will break your program, unless you're absolutely
@@ -126,10 +126,9 @@
 translation unit only: ['don't say that you weren't warned!]
 
 [import ../example/error_handling_example.cpp]
-
 [error_handling_example]
 
-[endsect]
+[endsect][/section:changing_policy_defaults Changing the Policy Defaults]
 
 [section:ad_hoc_dist_policies Setting Policies for Distributions on an Ad Hoc Basis]
 
@@ -164,7 +163,7 @@
 
 [pre quantile is: 40]
 
-[endsect]
+[endsect][/section:ad_hoc_dist_policies Setting Policies for Distributions on an Ad Hoc Basis]
 
 [section:ad_hoc_sf_policies Changing the Policy on an Ad Hoc Basis for the Special Functions]
 
@@ -219,7 +218,7 @@
 
 [policy_eg_2]
 
-[endsect]
+[endsect][/section:ad_hoc_sf_policies Changing the Policy on an Ad Hoc Basis for the Special Functions]
 
 [section:namespace_policies Setting Policies at Namespace or Translation Unit Scope]
 
@@ -280,7 +279,7 @@
 
 [policy_eg_7]
 
-[endsect]
+[endsect][/section:namespace_policies Setting Policies at Namespace or Translation Unit Scope]
 
 [section:user_defined_error_policies Calling User Defined Error Handlers]
 
@@ -292,7 +291,7 @@
 
 [policy_eg_9]
 
-[endsect]
+[endsect][/section:user_defined_error_policies Calling User Defined Error Handlers]
 
 [section:understand_dis_quant Understanding Quantiles of Discrete Distributions]
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk