Added mention of BOOST_DISABLE_ASSERT and range checking.

[SVN r32898]
This commit is contained in:
Ronald Garcia 2006-02-13 17:53:13 +00:00
parent 9ddbd961ec
commit 4d01fb2637
2 changed files with 28 additions and 6 deletions

View File

@ -1,4 +1,4 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Boost.MultiArray Reference Manual</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.4"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id727825"></a>Boost.MultiArray Reference Manual</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Ronald</span> <span class="surname">Garcia</span></h3><div class="affiliation"><span class="orgname">Indiana University<br></span><span class="orgdiv">Open Systems Lab<br></span></div></div></div><div><p class="copyright">Copyright © 2002 The Trustees of Indiana University</p></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#synopsis">Library Synopsis</a></span></dt><dt><span class="sect1"><a href="#MultiArray">MultiArray Concept</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id832486">Notation</a></span></dt><dt><span class="sect2"><a href="#id832654">Associated Types</a></span></dt><dt><span class="sect2"><a href="#id833164">Valid expressions</a></span></dt><dt><span class="sect2"><a href="#id833954">Complexity guarantees</a></span></dt><dt><span class="sect2"><a href="#id833978">Invariants</a></span></dt><dt><span class="sect2"><a href="#view_types">Associated Types for Views</a></span></dt><dt><span class="sect2"><a href="#id835348">Models</a></span></dt></dl></dd><dt><span class="sect1"><a href="#array_types">Array Components</a></span></dt><dd><dl><dt><span class="sect2"><a href="#multi_array">multi_array</a></span></dt><dt><span class="sect2"><a href="#multi_array_ref">multi_array_ref</a></span></dt><dt><span class="sect2"><a href="#const_multi_array_ref">const_multi_array_ref</a></span></dt></dl></dd><dt><span class="sect1"><a href="#auxiliary">Auxiliary Components</a></span></dt><dd><dl><dt><span class="sect2"><a href="#multi_array_types">multi_array_types</a></span></dt><dt><span class="sect2"><a href="#extent_range">extent_range</a></span></dt><dt><span class="sect2"><a href="#extent_gen">extent_gen</a></span></dt><dt><span class="sect2"><a href="#id860298">Global Objects</a></span></dt><dt><span class="sect2"><a href="#generators">View and SubArray Generators</a></span></dt><dt><span class="sect2"><a href="#memory_layout">Memory Layout Specifiers</a></span></dt></dl></dd></dl></div><p>Boost.MultiArray is composed of several components.
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Boost.MultiArray Reference Manual</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.4"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id727825"></a>Boost.MultiArray Reference Manual</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Ronald</span> <span class="surname">Garcia</span></h3><div class="affiliation"><span class="orgname">Indiana University<br></span><span class="orgdiv">Open Systems Lab<br></span></div></div></div><div><p class="copyright">Copyright © 2002 The Trustees of Indiana University</p></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#synopsis">Library Synopsis</a></span></dt><dt><span class="sect1"><a href="#MultiArray">MultiArray Concept</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id832486">Notation</a></span></dt><dt><span class="sect2"><a href="#id832654">Associated Types</a></span></dt><dt><span class="sect2"><a href="#id833164">Valid expressions</a></span></dt><dt><span class="sect2"><a href="#id833954">Complexity guarantees</a></span></dt><dt><span class="sect2"><a href="#id833979">Invariants</a></span></dt><dt><span class="sect2"><a href="#view_types">Associated Types for Views</a></span></dt><dt><span class="sect2"><a href="#id835349">Models</a></span></dt></dl></dd><dt><span class="sect1"><a href="#array_types">Array Components</a></span></dt><dd><dl><dt><span class="sect2"><a href="#multi_array">multi_array</a></span></dt><dt><span class="sect2"><a href="#multi_array_ref">multi_array_ref</a></span></dt><dt><span class="sect2"><a href="#const_multi_array_ref">const_multi_array_ref</a></span></dt></dl></dd><dt><span class="sect1"><a href="#auxiliary">Auxiliary Components</a></span></dt><dd><dl><dt><span class="sect2"><a href="#multi_array_types">multi_array_types</a></span></dt><dt><span class="sect2"><a href="#extent_range">extent_range</a></span></dt><dt><span class="sect2"><a href="#extent_gen">extent_gen</a></span></dt><dt><span class="sect2"><a href="#id860298">Global Objects</a></span></dt><dt><span class="sect2"><a href="#generators">View and SubArray Generators</a></span></dt><dt><span class="sect2"><a href="#memory_layout">Memory Layout Specifiers</a></span></dt><dt><span class="sect2"><a href="#range_checking">Range Checking</a></span></dt></dl></dd></dl></div><p>Boost.MultiArray is composed of several components.
The MultiArray concept defines a generic interface to multidimensional
containers.
<tt class="literal">multi_array</tt> is a general purpose container class
@ -151,7 +151,7 @@ dimensional array can be stored by row (i.e., the elements of each row
are stored contiguously) or by column (i.e., the elements of each
column are stored contiguously).
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id832486"></a>Notation</h3></div></div><div></div></div><p>What follows are the descriptions of symbols that will be used
to describe the MultiArray interface.</p><div class="table"><a name="id832495"></a><p class="title"><b>Table 1. Notation</b></p><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><tt class="literal">A</tt></td><td>A type that is a model of MultiArray
to describe the MultiArray interface.</p><div class="table"><a name="id832496"></a><p class="title"><b>Table 1. Notation</b></p><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><tt class="literal">A</tt></td><td>A type that is a model of MultiArray
</td></tr><tr><td><tt class="literal">a</tt></td><td>An object of type <tt class="literal">A</tt></td></tr><tr><td><tt class="literal">NumDims</tt></td><td>The numeric dimension parameter associated with
<tt class="literal">A</tt>.</td></tr><tr><td><tt class="literal">Dims</tt></td><td>Some numeric dimension parameter such that
<tt class="literal">0&lt;Dims&lt;NumDims</tt>.
@ -319,7 +319,7 @@ expression to be valid.</td></tr></tbody></table></div></div><div class="sect2"
constant time.
<tt class="literal">size()</tt> executes in at most linear time in the
MultiArray's size.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id833978"></a>Invariants</h3></div></div><div></div></div><div class="table"><a name="id833984"></a><p class="title"><b>Table 4. Invariants</b></p><table summary="Invariants" border="1"><colgroup><col><col></colgroup><tbody><tr><td>Valid range</td><td><tt class="literal">[a.begin(),a.end())</tt> is a valid range.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id833979"></a>Invariants</h3></div></div><div></div></div><div class="table"><a name="id833984"></a><p class="title"><b>Table 4. Invariants</b></p><table summary="Invariants" border="1"><colgroup><col><col></colgroup><tbody><tr><td>Valid range</td><td><tt class="literal">[a.begin(),a.end())</tt> is a valid range.
</td></tr><tr><td>Range size</td><td><tt class="literal">a.size() == std::distance(a.begin(),a.end());</tt>.
</td></tr><tr><td>Completeness</td><td>
Iteration through the range
@ -399,7 +399,7 @@ range and dimension information used to
instantiate a new view into a MultiArray.
</p><div class="table"><a name="id834994"></a><p class="title"><b>Table 8. Notation</b></p><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><tt class="literal">Dims,Ranges</tt></td><td>Unsigned integral values.</td></tr><tr><td><tt class="literal">x</tt></td><td>An object of type
<tt class="literal">template gen_type&lt;Dims,Ranges&gt;::type</tt>.</td></tr><tr><td><tt class="literal">i</tt></td><td>An object of type
<tt class="literal">index_range</tt>.</td></tr><tr><td><tt class="literal">idx</tt></td><td>Objects of type <tt class="literal">index</tt>.</td></tr></tbody></table></div><div class="table"><a name="id835080"></a><p class="title"><b>Table 9. Associated Types</b></p><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><tt class="literal">index</tt></td><td>This is a signed integral type. It is used to
<tt class="literal">index_range</tt>.</td></tr><tr><td><tt class="literal">idx</tt></td><td>Objects of type <tt class="literal">index</tt>.</td></tr></tbody></table></div><div class="table"><a name="id835081"></a><p class="title"><b>Table 9. Associated Types</b></p><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><tt class="literal">index</tt></td><td>This is a signed integral type. It is used to
specify degenerate dimensions.</td></tr><tr><td><tt class="literal">size_type</tt></td><td>This is an unsigned integral type. It is used to
report the size of the range an <tt class="literal">index_range</tt>
represents.</td></tr><tr><td><tt class="literal">template gen_type::&lt;Dims,Ranges&gt;::type</tt></td><td>This type generator names the result of
@ -421,7 +421,7 @@ range, <tt class="literal">index_range(idx,idx).</tt> Note that this is NOT
equivalent to <tt class="literal">x[index_range(idx,idx)].</tt>, which will
return an object of type
<tt class="literal">gen_type&lt;Dims+1,Ranges+1&gt;::type</tt>.
</td></tr></tbody></table></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id835348"></a>Models</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><tt class="literal">multi_array</tt></li><li><tt class="literal">multi_array_ref</tt></li><li><tt class="literal">const_multi_array_ref</tt></li><li><tt class="literal">template array_view&lt;Dims&gt;::type</tt></li><li><tt class="literal">template const_array_view&lt;Dims&gt;::type</tt></li><li><tt class="literal">template subarray&lt;Dims&gt;::type</tt></li><li><tt class="literal">template const_subarray&lt;Dims&gt;::type</tt></li></ul></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="array_types"></a>Array Components</h2></div></div><div></div></div><p>
</td></tr></tbody></table></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id835349"></a>Models</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><tt class="literal">multi_array</tt></li><li><tt class="literal">multi_array_ref</tt></li><li><tt class="literal">const_multi_array_ref</tt></li><li><tt class="literal">template array_view&lt;Dims&gt;::type</tt></li><li><tt class="literal">template const_array_view&lt;Dims&gt;::type</tt></li><li><tt class="literal">template subarray&lt;Dims&gt;::type</tt></li><li><tt class="literal">template const_subarray&lt;Dims&gt;::type</tt></li></ul></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="array_types"></a>Array Components</h2></div></div><div></div></div><p>
Boost.MultiArray defines an array class,
<tt class="literal">multi_array</tt>, and two adapter classes,
<tt class="literal">multi_array_ref</tt> and
@ -1301,4 +1301,12 @@ convertible to <tt class="literal">bool</tt>. A value of
order while <tt class="literal">false</tt> means that a dimension is stored
in descending order. <tt class="literal">OrderingIter</tt> specifies the
order in which dimensions are stored.
</p></div></div></div></div></body></html>
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="range_checking"></a>Range Checking</h3></div></div><div></div></div><p>
By default, the array access methods <tt class="literal">operator()</tt> and
<tt class="literal">operator[]</tt> perform range
checking. If a supplied index is out of the range defined for an
array, an assertion will abort the program. To disable range
checking (for performance reasons in production releases), define
the <tt class="literal">BOOST_DISABLE_ASSERTS</tt> preprocessor macro prior to
including multi_array.hpp in an application.
</p></div></div></div></body></html>

View File

@ -779,6 +779,20 @@ order in which dimensions are stored.
</para>
</sect3>
</sect2>
<sect2 id="range_checking">
<title>Range Checking</title>
<para>
By default, the array access methods <literal>operator()</literal> and
<literal>operator[]</literal> perform range
checking. If a supplied index is out of the range defined for an
array, an assertion will abort the program. To disable range
checking (for performance reasons in production releases), define
the <literal>BOOST_DISABLE_ASSERTS</literal> preprocessor macro prior to
including multi_array.hpp in an application.
</para>
</sect2>
</sect1>