1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Policy Overview</title> 5<link rel="stylesheet" href="../math.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Math Toolkit 2.12.0"> 8<link rel="up" href="../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc"> 9<link rel="prev" href="../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc"> 10<link rel="next" href="pol_tutorial.html" title="Policy Tutorial"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="../policy.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../policy.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="pol_tutorial.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="math_toolkit.pol_overview"></a><a class="link" href="pol_overview.html" title="Policy Overview">Policy Overview</a> 28</h2></div></div></div> 29<p> 30 Policies are a powerful fine-grain mechanism that allow you to customise the 31 behaviour of this library according to your needs. There is more information 32 available in the <a class="link" href="pol_tutorial.html" title="Policy Tutorial">policy tutorial</a> 33 and the <a class="link" href="pol_ref.html" title="Policy Reference">policy reference</a>. 34 </p> 35<p> 36 Generally speaking, unless you find that the <a class="link" href="pol_tutorial/policy_tut_defaults.html" title="Policies Have Sensible Defaults">default 37 policy behaviour</a> when encountering 'bad' argument values does not meet 38 your needs, you should not need to worry about policies. 39 </p> 40<p> 41 Policies are a compile-time mechanism that allow you to change error-handling 42 or calculation precision either program wide, or at the call site. 43 </p> 44<p> 45 Although the policy mechanism itself is rather complicated, in practice it 46 is easy to use, and very flexible. 47 </p> 48<p> 49 Using policies you can control: 50 </p> 51<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 52<li class="listitem"> 53 <a class="link" href="pol_ref/error_handling_policies.html" title="Error Handling Policies">How results 54 from 'bad' arguments are handled</a>, including those that cannot be 55 fully evaluated. 56 </li> 57<li class="listitem"> 58 How <a class="link" href="pol_ref/internal_promotion.html" title="Internal Floating-point Promotion Policies">accuracy is 59 controlled by internal promotion</a> to use more precise types. 60 </li> 61<li class="listitem"> 62 What working <a class="link" href="pol_ref/precision_pol.html" title="Precision Policies">precision</a> 63 should be used to calculate results. 64 </li> 65<li class="listitem"> 66 What to do when a <a class="link" href="pol_ref/assert_undefined.html" title="Mathematically Undefined Function Policies">mathematically 67 undefined function</a> is used: Should this raise a run-time or compile-time 68 error? 69 </li> 70<li class="listitem"> 71 Whether <a class="link" href="pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">discrete 72 functions</a>, like the binomial, should return real or only integral 73 values, and how they are rounded. 74 </li> 75<li class="listitem"> 76 How many iterations a special function is permitted to perform in a series 77 evaluation or root finding algorithm before it gives up and raises an 78 <a class="link" href="error_handling.html#math_toolkit.error_handling.evaluation_error">evaluation_error</a>. 79 </li> 80</ul></div> 81<p> 82 You can control policies: 83 </p> 84<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 85<li class="listitem"> 86 Using <a class="link" href="pol_ref/policy_defaults.html" title="Using Macros to Change the Policy Defaults">macros</a> 87 to change any default policy: the is the preferred method for installation 88 wide policies. 89 </li> 90<li class="listitem"> 91 At your chosen <a class="link" href="pol_ref/namespace_pol.html" title="Setting Polices at Namespace Scope">namespace 92 scope</a> for distributions and/or functions: this is the preferred 93 method for project, namespace, or translation unit scope policies. 94 </li> 95<li class="listitem"> 96 In an ad-hoc manner <a class="link" href="pol_tutorial/ad_hoc_sf_policies.html" title="Changing the Policy on an Ad Hoc Basis for the Special Functions">by 97 passing a specific policy to a special function</a>, or to a <a class="link" href="pol_tutorial/ad_hoc_dist_policies.html" title="Setting Policies for Distributions on an Ad Hoc Basis">statistical 98 distribution</a>. 99 </li> 100</ul></div> 101</div> 102<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 103<td align="left"></td> 104<td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar 105 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, 106 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan 107 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, 108 Daryle Walker and Xiaogang Zhang<p> 109 Distributed under the Boost Software License, Version 1.0. (See accompanying 110 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 111 </p> 112</div></td> 113</tr></table> 114<hr> 115<div class="spirit-nav"> 116<a accesskey="p" href="../policy.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../policy.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="pol_tutorial.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 117</div> 118</body> 119</html> 120