|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65771 - in branches/release: . boost boost/bimap boost/gil boost/graph boost/intrusive boost/msm boost/multi_array boost/numeric/ublas boost/property_tree boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/statechart boost/tr1 boost/uuid boost/variant boost/wave libs libs/array/test libs/bimap libs/graph_parallel libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/multi_array/doc libs/multi_array/doc/xml libs/multi_array/example libs/multi_array/test libs/numeric/ublas libs/numeric/ublas/doc libs/property_tree libs/serialization/test libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/static_assert libs/timer libs/tr1 libs/utility libs/utility/swap/test libs/uuid libs/wave more tools tools/bcp tools/regression tools/release tools/wave
From: jewillco_at_[hidden]
Date: 2010-10-05 14:25:38
Author: jewillco
Date: 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
New Revision: 65771
URL: http://svn.boost.org/trac/boost/changeset/65771
Log:
Merged r46508 (bug fixes), r53790 (added test case), r62605 (fix for #3581), r62606 (fix for #3820), r62607 (fix for #3989), r62609 (missing header), r62963 (non-Trac bug fixes) from trunk; refs #3581, #3820, #3989
Added:
branches/release/libs/multi_array/test/reverse_view.cpp
- copied unchanged from r53790, /trunk/libs/multi_array/test/reverse_view.cpp
Properties modified:
branches/release/ (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/bimap/ (props changed)
branches/release/boost/config.hpp (props changed)
branches/release/boost/gil/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/msm/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/signals2.hpp (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/statechart/ (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/index.htm (props changed)
branches/release/libs/ (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/msm/ (props changed)
branches/release/libs/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/serialization/test/ (props changed)
branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/uuid/ (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/rst.css (props changed)
branches/release/tools/ (props changed)
branches/release/tools/bcp/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
Text files modified:
branches/release/boost/multi_array/base.hpp | 50 ++++++++++++++++++++++++++++++++--------
branches/release/libs/multi_array/doc/reference.html | 36 ++++++++++++++--------------
branches/release/libs/multi_array/doc/user.html | 2
branches/release/libs/multi_array/doc/xml/MultiArray.xml | 2
branches/release/libs/multi_array/doc/xml/reference.xml | 2
branches/release/libs/multi_array/example/for_each.hpp | 2
branches/release/libs/multi_array/test/Jamfile.v2 | 2 +
branches/release/libs/multi_array/test/fail_cview2.cpp | 1
8 files changed, 65 insertions(+), 32 deletions(-)
Modified: branches/release/boost/multi_array/base.hpp
==============================================================================
--- branches/release/boost/multi_array/base.hpp (original)
+++ branches/release/boost/multi_array/base.hpp 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -431,22 +431,52 @@
index offset = 0;
size_type dim = 0;
for (size_type n = 0; n != NumDims; ++n) {
+
+ // Use array specs and input specs to produce real specs.
const index default_start = index_bases[n];
const index default_finish = default_start+extents[n];
const index_range& current_range = indices.ranges_[n];
index start = current_range.get_start(default_start);
index finish = current_range.get_finish(default_finish);
- index index_factor = current_range.stride();
+ index stride = current_range.stride();
+ BOOST_ASSERT(stride != 0);
- // integral trick for ceiling((finish-start) / index_factor)
- index shrinkage = index_factor > 0 ? 1 : -1;
- index len = (finish - start + (index_factor - shrinkage)) / index_factor;
+ // An index range indicates a half-open strided interval
+ // [start,finish) (with stride) which faces upward when stride
+ // is positive and downward when stride is negative,
+
+ // RG: The following code for calculating length suffers from
+ // some representation issues: if finish-start cannot be represented as
+ // by type index, then overflow may result.
+
+ index len;
+ if ((finish - start) / stride < 0) {
+ // [start,finish) is empty according to the direction imposed by
+ // the stride.
+ len = 0;
+ } else {
+ // integral trick for ceiling((finish-start) / stride)
+ // taking into account signs.
+ index shrinkage = stride > 0 ? 1 : -1;
+ len = (finish - start + (stride - shrinkage)) / stride;
+ }
+ // start marks the closed side of the range, so it must lie
+ // exactly in the set of legal indices
+ // with a special case for empty arrays
BOOST_ASSERT(index_bases[n] <= start &&
- start <= index_bases[n]+index(extents[n]));
- BOOST_ASSERT(index_bases[n] <= finish &&
- finish <= index_bases[n]+index(extents[n]));
- BOOST_ASSERT(index_factor != 0);
+ ((start <= index_bases[n]+index(extents[n])) ||
+ (start == index_bases[n] && extents[n] == 0)));
+
+#ifndef BOOST_DISABLE_ASSERTS
+ // finish marks the open side of the range, so it can go one past
+ // the "far side" of the range (the top if stride is positive, the bottom
+ // if stride is negative).
+ index bound_adjustment = stride < 0 ? 1 : 0;
+ BOOST_ASSERT(((index_bases[n] - bound_adjustment) <= finish) &&
+ (finish <= (index_bases[n] + index(extents[n]) - bound_adjustment)));
+#endif // BOOST_DISABLE_ASSERTS
+
// the array data pointer is modified to account for non-zero
// bases during slicing (see [Garcia] for the math involved)
@@ -454,9 +484,9 @@
if (!current_range.is_degenerate()) {
- // The index_factor for each dimension is included into the
+ // The stride for each dimension is included into the
// strides for the array_view (see [Garcia] for the math involved).
- new_strides[dim] = index_factor * strides[n];
+ new_strides[dim] = stride * strides[n];
// calculate new extents
new_extents[dim] = len;
Modified: branches/release/libs/multi_array/doc/reference.html
==============================================================================
--- branches/release/libs/multi_array/doc/reference.html (original)
+++ branches/release/libs/multi_array/doc/reference.html 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -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.71.1"></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="id823342"></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><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1">Library Synopsis</span></dt><dt><span class="sect1">MultiArray Concept</span></dt><dd><dl><dt
><span class="sect2">Notation</span></dt><dt><span class="sect2">Associated Types</span></dt><dt><span class="sect2">Valid expressions</span></dt><dt><span class="sect2">Complexity guarantees</span></dt><dt><span class="sect2">Invariants</span></dt><dt><span class="sect2">Associated Types for Views</span></dt><dt><span class="sect2">Models</span></dt></dl></dd><dt><span class="sect1">Array Components</span></dt><dd><dl><dt><span class="sect2">multi_array
</span></dt><dt><span class="sect2">multi_array_ref
</span></dt><dt><span class="sect2">const_multi_array_ref
</span></dt></dl></dd><dt><span class="sect1"><a href="#auxiliary">Auxiliary C
omponents</a></span></dt><dd><dl><dt><span class="sect2">multi_array_types
</span></dt><dt><span class="sect2">extent_range
</span></dt><dt><span class="sect2">extent_gen
</span></dt><dt><span class="sect2">Global Objects</span></dt><dt><span class="sect2">View and SubArray Generators</span></dt><dt><span class="sect2">Memory Layout Specifiers</span></dt><dt><span class="sect2">Range Checking</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.71.1"></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="id730554"></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><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1">Library Synopsis</span></dt><dt><span class="sect1">MultiArray Concept</span></dt><dd><dl><dt
><span class="sect2">Notation</span></dt><dt><span class="sect2">Associated Types</span></dt><dt><span class="sect2">Valid expressions</span></dt><dt><span class="sect2">Complexity guarantees</span></dt><dt><span class="sect2">Invariants</span></dt><dt><span class="sect2">Associated Types for Views</span></dt><dt><span class="sect2">Models</span></dt></dl></dd><dt><span class="sect1">Array Components</span></dt><dd><dl><dt><span class="sect2">multi_array
</span></dt><dt><span class="sect2">multi_array_ref
</span></dt><dt><span class="sect2">const_multi_array_ref
</span></dt></dl></dd><dt><span class="sect1"><a href="#auxiliary">Auxiliary C
omponents</a></span></dt><dd><dl><dt><span class="sect2">multi_array_types
</span></dt><dt><span class="sect2">extent_range
</span></dt><dt><span class="sect2">extent_gen
</span></dt><dt><span class="sect2">Global Objects</span></dt><dt><span class="sect2">View and SubArray Generators</span></dt><dt><span class="sect2">Memory Layout Specifiers</span></dt><dt><span class="sect2">Range Checking</span></dt></dl></dd></dl></div><p>Boost.MultiArray is composed of several components.
The MultiArray concept defines a generic interface to multidimensional
containers.
<code class="literal">multi_array</code> is a general purpose container class
@@ -150,8 +150,8 @@
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="id896773"></a>Notation</h3></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="id896782"></a><p class="title"><b>Table 1. Notation</b></p><div class="table-contents"><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><code class="literal">A</code></td><td>A type that is a model of MultiArray
+</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id835332"></a>Notation</h3></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="id835342"></a><p class="title"><b>Table 1. Notation</b></p><div class="table-contents"><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><code class="literal">A</code></td><td>A type that is a model of MultiArray
</td></tr><tr><td><code class="literal">a,b</code></td><td>Objects of type <code class="literal">A</code></td></tr><tr><td><code class="literal">NumDims</code></td><td>The numeric dimension parameter associated with
<code class="literal">A</code>.</td></tr><tr><td><code class="literal">Dims</code></td><td>Some numeric dimension parameter such that
<code class="literal">0<Dims<NumDims</code>.
@@ -159,8 +159,8 @@
to <code class="literal">index_gen::operator[](index_range)</code>.</td></tr><tr><td><code class="literal">index_list</code></td><td>An object whose type models
<a href="../../utility/Collection.html" target="_top">Collection</a>
</td></tr><tr><td><code class="literal">idx</code></td><td>A signed integral value.</td></tr><tr><td><code class="literal">tmp</code></td><td>An object of type
- <code class="literal">boost::array<index,NumDims></code></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id896941"></a>Associated Types</h3></div></div></div><p>
-</p><div class="table"><a name="id896949"></a><p class="title"><b>Table 2. Associated Types</b></p><div class="table-contents"><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">value_type</code></td><td>This is the value type of the container.
+ <code class="literal">boost::array<index,NumDims></code></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id835500"></a>Associated Types</h3></div></div></div><p>
+</p><div class="table"><a name="id835508"></a><p class="title"><b>Table 2. Associated Types</b></p><div class="table-contents"><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">value_type</code></td><td>This is the value type of the container.
If <code class="literal">NumDims == 1</code>, then this is
<code class="literal">element</code>. Otherwise, this is the value type of the
immediately nested containers.
@@ -260,7 +260,7 @@
const_array_view<Dims>::type</code>
</td><td>
This is the const view type with <code class="literal">Dims</code> dimensions.
-</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id897451"></a>Valid expressions</h3></div></div></div><div class="table"><a name="id897455"></a><p class="title"><b>Table 3. Valid Expressions</b></p><div class="table-contents"><table summary="Valid Expressions" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Expression</th><th>Return type</th><th>Semantics</th></tr></thead><tbody><tr><td><code class="literal">A::dimensionality</code></td><td><code class="literal">size_type</code></td><td>This compile-time constant represents the number of
+</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id836010"></a>Valid expressions</h3></div></div></div><div class="table"><a name="id836014"></a><p class="title"><b>Table 3. Valid Expressions</b></p><div class="table-contents"><table summary="Valid Expressions" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Expression</th><th>Return type</th><th>Semantics</th></tr></thead><tbody><tr><td><code class="literal">A::dimensionality</code></td><td><code class="literal">size_type</code></td><td>This compile-time constant represents the number of
dimensions of the array (note that
<code class="literal">A::dimensionality == NumDims</code>).</td></tr><tr><td><code class="literal">a.shape()</code></td><td><code class="literal">const size_type*</code></td><td>
This returns a list of <code class="literal">NumDims</code> elements specifying the
@@ -360,11 +360,11 @@
expression to be valid.</td></tr><tr><td><code class="literal">a >= b</code></td><td>bool</td><td>This performs a lexicographical comparison of the
values of <code class="literal">a</code> and <code class="literal">b</code>. The element
type must model LessThanComparable for this
-expression to be valid.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id898268"></a>Complexity guarantees</h3></div></div></div><code class="literal">begin()</code> and <code class="literal">end()</code> execute in amortized
+expression to be valid.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id836828"></a>Complexity guarantees</h3></div></div></div><code class="literal">begin()</code> and <code class="literal">end()</code> execute in amortized
constant time.
<code class="literal">size()</code> 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="id898293"></a>Invariants</h3></div></div></div><div class="table"><a name="id898298"></a><p class="title"><b>Table 4. Invariants</b></p><div class="table-contents"><table summary="Invariants" border="1"><colgroup><col><col></colgroup><tbody><tr><td>Valid range</td><td><code class="literal">[a.begin(),a.end())</code> is a valid range.
+</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id836852"></a>Invariants</h3></div></div></div><div class="table"><a name="id836858"></a><p class="title"><b>Table 4. Invariants</b></p><div class="table-contents"><table summary="Invariants" border="1"><colgroup><col><col></colgroup><tbody><tr><td>Valid range</td><td><code class="literal">[a.begin(),a.end())</code> is a valid range.
</td></tr><tr><td>Range size</td><td>
<code class="literal">a.size() == std::distance(a.begin(),a.end());</code>.
</td></tr><tr><td>Completeness</td><td>
@@ -403,10 +403,10 @@
The following describes the
<code class="literal">index_range</code> interface.
-</p><div class="table"><a name="id898526"></a><p class="title"><b>Table 5. Notation</b></p><div class="table-contents"><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><code class="literal">i</code></td><td>An object of type <code class="literal">index_range</code>.</td></tr><tr><td><code class="literal">idx,idx1,idx2,idx3</code></td><td>Objects of type <code class="literal">index</code>.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id898580"></a><p class="title"><b>Table 6. Associated Types</b></p><div class="table-contents"><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">index</code></td><td>This is a signed integral type. It is used to
+</p><div class="table"><a name="id837086"></a><p class="title"><b>Table 5. Notation</b></p><div class="table-contents"><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><code class="literal">i</code></td><td>An object of type <code class="literal">index_range</code>.</td></tr><tr><td><code class="literal">idx,idx1,idx2,idx3</code></td><td>Objects of type <code class="literal">index</code>.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id837139"></a><p class="title"><b>Table 6. Associated Types</b></p><div class="table-contents"><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">index</code></td><td>This is a signed integral type. It is used to
specify the start, finish, and stride values.</td></tr><tr><td><code class="literal">size_type</code></td><td>This is an unsigned integral type. It is used to
report the size of the range an <code class="literal">index_range</code>
-represents.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id898642"></a><p class="title"><b>Table 7. Valid Expressions</b></p><div class="table-contents"><table summary="Valid Expressions" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Expression</th><th>Return type</th><th>Semantics</th></tr></thead><tbody><tr><td><code class="literal">index_range(idx1,idx2,idx3)</code></td><td><code class="literal">index_range</code></td><td>This constructs an <code class="literal">index_range</code>
+represents.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id837202"></a><p class="title"><b>Table 7. Valid Expressions</b></p><div class="table-contents"><table summary="Valid Expressions" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Expression</th><th>Return type</th><th>Semantics</th></tr></thead><tbody><tr><td><code class="literal">index_range(idx1,idx2,idx3)</code></td><td><code class="literal">index_range</code></td><td>This constructs an <code class="literal">index_range</code>
representing the interval <code class="literal">[idx1,idx2)</code>
with stride <code class="literal">idx3</code>.</td></tr><tr><td><code class="literal">index_range(idx1,idx2)</code></td><td><code class="literal">index_range</code></td><td>This constructs an <code class="literal">index_range</code>
representing the interval <code class="literal">[idx1,idx2)</code>
@@ -443,9 +443,9 @@
parameters. Chained calls to <code class="literal">operator[]</code> store
range and dimension information used to
instantiate a new view into a MultiArray.
-</p><div class="table"><a name="id899309"></a><p class="title"><b>Table 8. Notation</b></p><div class="table-contents"><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><code class="literal">Dims,Ranges</code></td><td>Unsigned integral values.</td></tr><tr><td><code class="literal">x</code></td><td>An object of type
+</p><div class="table"><a name="id837868"></a><p class="title"><b>Table 8. Notation</b></p><div class="table-contents"><table summary="Notation" border="1"><colgroup><col><col></colgroup><tbody><tr><td><code class="literal">Dims,Ranges</code></td><td>Unsigned integral values.</td></tr><tr><td><code class="literal">x</code></td><td>An object of type
<code class="literal">template gen_type<Dims,Ranges>::type</code>.</td></tr><tr><td><code class="literal">i</code></td><td>An object of type
-<code class="literal">index_range</code>.</td></tr><tr><td><code class="literal">idx</code></td><td>Objects of type <code class="literal">index</code>.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id899395"></a><p class="title"><b>Table 9. Associated Types</b></p><div class="table-contents"><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">index</code></td><td>This is a signed integral type. It is used to
+<code class="literal">index_range</code>.</td></tr><tr><td><code class="literal">idx</code></td><td>Objects of type <code class="literal">index</code>.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id837954"></a><p class="title"><b>Table 9. Associated Types</b></p><div class="table-contents"><table summary="Associated Types" border="1"><colgroup><col><col></colgroup><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">index</code></td><td>This is a signed integral type. It is used to
specify degenerate dimensions.</td></tr><tr><td><code class="literal">size_type</code></td><td>This is an unsigned integral type. It is used to
report the size of the range an <code class="literal">index_range</code>
represents.</td></tr><tr><td>
@@ -456,21 +456,21 @@
degenerate ranges specified (i.e. calls to
<code class="literal">operator[](index)</code>). Note that
<code class="classname">index_gen</code> and
-<code class="classname">gen_type<0,0>::type</code> are the same type.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id899506"></a><p class="title"><b>Table 10. Valid Expressions</b></p><div class="table-contents"><table summary="Valid Expressions" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Expression</th><th>Return type</th><th>Semantics</th></tr></thead><tbody><tr><td><code class="literal">index_gen()</code></td><td><code class="literal">gen_type<0,0>::type</code></td><td>This constructs an <code class="literal">index_gen</code>
+<code class="classname">gen_type<0,0>::type</code> are the same type.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="id838066"></a><p class="title"><b>Table 10. Valid Expressions</b></p><div class="table-contents"><table summary="Valid Expressions" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Expression</th><th>Return type</th><th>Semantics</th></tr></thead><tbody><tr><td><code class="literal">index_gen()</code></td><td><code class="literal">gen_type<0,0>::type</code></td><td>This constructs an <code class="literal">index_gen</code>
object. This object can then be used to generate tuples of
<code class="literal">index_range</code> values.</td></tr><tr><td><code class="literal">x[i]</code></td><td><code class="literal">gen_type<Dims+1,Ranges+1>::type</code>
</td><td>Returns a new object containing all previous
<code class="classname">index_range</code> objects in addition to
<code class="literal">i.</code> Chained calls to
<code class="function">operator[]</code> are the means by which
-<code class="classname">index_range</code> objects are aggregated.</td></tr><tr><td><code class="literal">x[idx]</code></td><td><code class="literal">gen_type<Dims,Ranges>::type</code>
+<code class="classname">index_range</code> objects are aggregated.</td></tr><tr><td><code class="literal">x[idx]</code></td><td><code class="literal">gen_type<Dims,Ranges+1>::type</code>
</td><td>Returns a new object containing all previous
<code class="classname">index_range</code> objects in addition to a degenerate
range, <code class="literal">index_range(idx,idx).</code> Note that this is NOT
equivalent to <code class="literal">x[index_range(idx,idx)].</code>, which will
return an object of type
<code class="literal">gen_type<Dims+1,Ranges+1>::type</code>.
-</td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id899663"></a>Models</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><code class="literal">multi_array</code></li><li><code class="literal">multi_array_ref</code></li><li><code class="literal">const_multi_array_ref</code></li><li><code class="literal">template array_view<Dims>::type</code></li><li><code class="literal">template const_array_view<Dims>::type</code></li><li><code class="literal">template subarray<Dims>::type</code></li><li><code class="literal">template const_subarray<Dims>::type</code></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><p>
+</td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id838222"></a>Models</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><code class="literal">multi_array</code></li><li><code class="literal">multi_array_ref</code></li><li><code class="literal">const_multi_array_ref</code></li><li><code class="literal">template array_view<Dims>::type</code></li><li><code class="literal">template const_array_view<Dims>::type</code></li><li><code class="literal">template subarray<Dims>::type</code></li><li><code class="literal">template const_subarray<Dims>::type</code></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><p>
Boost.MultiArray defines an array class,
<code class="literal">multi_array</code>, and two adapter classes,
<code class="literal">multi_array_ref</code> and
@@ -540,7 +540,7 @@
change.</p><p><b><code class="literal">SizeList</code> Requirements. </b><code class="literal">SizeList</code> must model
<a href="../../utility/Collection.html" target="_top">Collection</a>.</p><p><b>Preconditions. </b>
</p><pre class="programlisting">
-std::accumulate(sizes.begin(),sizes.end(),size_type(1),std::times<size_type>()) == this->num_elements();
+std::accumulate(sizes.begin(),sizes.end(),size_type(1),std::multiplies<size_type>()) == this->num_elements();
sizes.size() == NumDims;
</pre><p><b>Postconditions. </b>
<code class="literal">std::equal(sizes.begin(),sizes.end(),this->shape) == true;</code>
@@ -1158,7 +1158,7 @@
};
typedef *implementation_defined*<0> extent_gen;
-</pre><p><b>Methods and Types. </b></p><div class="variablelist"><dl><dt><span class="term"><code class="function">template gen_type::<Ranges>::type</code></span></dt><dd><p>This type generator is used to specify the result of
+</pre><p><b>Methods and Types. </b></p><div class="variablelist"><dl><dt><span class="term"><code class="function">template gen_type<Ranges>::type</code></span></dt><dd><p>This type generator is used to specify the result of
<code class="literal">Ranges</code> chained calls to
<code class="literal">extent_gen::operator[].</code> The types
<code class="classname">extent_gen</code> and
@@ -1172,7 +1172,7 @@
<code class="classname">extent_range</code> objects in addition to
<code class="literal">extent_range(0,idx).</code> This function gives the array
constructors a similar syntax to traditional C multidimensional array
-declaration.</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id906792"></a>Global Objects</h3></div></div></div><p>For syntactic convenience, Boost.MultiArray defines two
+declaration.</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id862830"></a>Global Objects</h3></div></div></div><p>For syntactic convenience, Boost.MultiArray defines two
global objects as part of its
interface. These objects play the role of object generators;
expressions involving them create other objects of interest.
Modified: branches/release/libs/multi_array/doc/user.html
==============================================================================
--- branches/release/libs/multi_array/doc/user.html (original)
+++ branches/release/libs/multi_array/doc/user.html 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -459,7 +459,7 @@
<blockquote>
<pre>
typedef boost::multi_array<double,3> array_type;
- array_type A(boost::extents[3][4][2],boost::fortran_storage_order);
+ array_type A(boost::extents[3][4][2],boost::fortran_storage_order());
call_fortran_function(A.data());
</pre>
</blockquote>
Modified: branches/release/libs/multi_array/doc/xml/MultiArray.xml
==============================================================================
--- branches/release/libs/multi_array/doc/xml/MultiArray.xml (original)
+++ branches/release/libs/multi_array/doc/xml/MultiArray.xml 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -975,7 +975,7 @@
</row>
<row>
<entry><literal>x[idx]</literal></entry>
- <entry><literal>gen_type<Dims,Ranges>::type</literal>
+ <entry><literal>gen_type<Dims,Ranges+1>::type</literal>
</entry>
<entry>Returns a new object containing all previous
<classname>index_range</classname> objects in addition to a degenerate
Modified: branches/release/libs/multi_array/doc/xml/reference.xml
==============================================================================
--- branches/release/libs/multi_array/doc/xml/reference.xml (original)
+++ branches/release/libs/multi_array/doc/xml/reference.xml 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -488,7 +488,7 @@
<formalpara><title>Methods and Types</title>
<variablelist>
<varlistentry>
-<term><function>template gen_type::<Ranges>::type</function></term>
+<term><function>template gen_type<Ranges>::type</function></term>
<listitem>
<para>This type generator is used to specify the result of
<literal>Ranges</literal> chained calls to
Modified: branches/release/libs/multi_array/example/for_each.hpp
==============================================================================
--- branches/release/libs/multi_array/example/for_each.hpp (original)
+++ branches/release/libs/multi_array/example/for_each.hpp 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -45,7 +45,7 @@
template <typename Array, typename Functor>
void for_each (Array& A, Functor xform) {
// Dispatch to the proper function
- for_each(boost::type<Array::element>(),A.begin(),A.end(),xform);
+ for_each(boost::type<typename Array::element>(),A.begin(),A.end(),xform);
}
Modified: branches/release/libs/multi_array/test/Jamfile.v2
==============================================================================
--- branches/release/libs/multi_array/test/Jamfile.v2 (original)
+++ branches/release/libs/multi_array/test/Jamfile.v2 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -45,5 +45,7 @@
[ run stl_interaction.cpp ../../test/build//boost_test_exec_monitor ]
[ run resize.cpp ../../test/build//boost_test_exec_monitor ]
[ run assert.cpp ../../test/build//boost_test_exec_monitor ]
+ [ run reverse_view.cpp ../../test/build//boost_test_exec_monitor ]
+
[ compile concept_checks.cpp ]
;
Modified: branches/release/libs/multi_array/test/fail_cview2.cpp
==============================================================================
--- branches/release/libs/multi_array/test/fail_cview2.cpp (original)
+++ branches/release/libs/multi_array/test/fail_cview2.cpp 2010-10-05 14:25:35 EDT (Tue, 05 Oct 2010)
@@ -22,6 +22,7 @@
#include "boost/array.hpp"
#include "boost/type.hpp"
+#include "boost/cstdlib.hpp"
int
test_main(int,char*[])
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