Merge pull request #40 from ivanpanch/patch-1

Fix documentation mistakes
This commit is contained in:
Andrey Semashev
2026-02-06 13:48:58 +03:00
committed by GitHub
7 changed files with 39 additions and 39 deletions

View File

@@ -58,7 +58,7 @@ containers. It specifies operations for accessing elements,
traversing containers, and creating views
of array data.
MultiArray defines
a flexible memory model that accomodates
a flexible memory model that accommodates
a variety of data layouts.
</p><p>
At each level (or dimension) of a MultiArray's
@@ -145,7 +145,7 @@ base. Note that since positive index bases are
possible, the origin need not exist in order to determine the location
in memory of the MultiArray's elements.
The strides determine how index values are mapped to memory offsets.
They accomodate a
They accommodate a
number of possible element layouts. For example, the elements of a 2
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
@@ -303,7 +303,7 @@ This returns the number of values contained in
<code class="literal">const element&amp;</code> otherwise.
</td><td>
This expression accesses a specific element of
<code class="literal">a</code>.<code class="literal">index_list</code> is the unique set
<code class="literal">a</code>. <code class="literal">index_list</code> is the unique set
of indices that address the element returned. It is
equivalent to the following code (disregarding intermediate temporaries):
<pre class="programlisting">
@@ -427,16 +427,16 @@ with unspecified start and finish values.</td></tr><tr><td><code class="literal"
value, this is equivalent to <code class="literal">i.start()</code>. Otherwise it
returns <code class="literal">idx</code>.</td></tr><tr><td><code class="literal">i.get_finish(idx)</code></td><td><code class="literal">index</code></td><td>If <code class="literal">i</code> specifies a finish
value, this is equivalent to <code class="literal">i.finish()</code>. Otherwise it
returns <code class="literal">idx</code>.</td></tr><tr><td><code class="literal">i.size(idx)</code></td><td><code class="literal">size_type</code></td><td>If <code class="literal">i</code> specifies a both finish and
start values, this is equivalent to
returns <code class="literal">idx</code>.</td></tr><tr><td><code class="literal">i.size(idx)</code></td><td><code class="literal">size_type</code></td><td>If <code class="literal">i</code> specifies both a finish and a
start value, this is equivalent to
<code class="literal">(i.finish()-i.start())/i.stride()</code>. Otherwise it
returns <code class="literal">idx</code>.</td></tr><tr><td><code class="literal">i &lt; idx</code></td><td><code class="literal">index</code></td><td>This is another syntax for specifying the finish
value. This notation does not include
<code class="literal">idx</code> in the range of valid indices. It is equivalent to
<code class="literal">index_range(r.start(), idx, r.stride())</code></td></tr><tr><td><code class="literal">i &lt;= idx</code></td><td><code class="literal">index</code></td><td>This is another syntax for specifying the finish
<code class="literal">index_range(r.start(), idx, r.stride())</code>.</td></tr><tr><td><code class="literal">i &lt;= idx</code></td><td><code class="literal">index</code></td><td>This is another syntax for specifying the finish
value. This notation includes
<code class="literal">idx</code> in the range of valid indices. It is equivalent to
<code class="literal">index_range(r.start(), idx + 1, r.stride())</code></td></tr><tr><td><code class="literal">idx &lt; i</code></td><td><code class="literal">index</code></td><td>This is another syntax for specifying the start
<code class="literal">index_range(r.start(), idx + 1, r.stride())</code>.</td></tr><tr><td><code class="literal">idx &lt; i</code></td><td><code class="literal">index</code></td><td>This is another syntax for specifying the start
value. This notation does not include
<code class="literal">idx</code> in the range of valid indices. It is equivalent to
<code class="literal">index_range(idx + 1, i.finish(), i.stride())</code>.</td></tr><tr><td><code class="literal">idx &lt;= i</code></td><td><code class="literal">index</code></td><td>This is another syntax for specifying the start
@@ -444,9 +444,9 @@ value. This notation includes
<code class="literal">idx1</code> in the range of valid indices. It is equivalent to
<code class="literal">index_range(idx, i.finish(), i.stride())</code>.</td></tr><tr><td><code class="literal">i + idx</code></td><td><code class="literal">index</code></td><td>This expression shifts the start and finish values
of <code class="literal">i</code> up by <code class="literal">idx</code>. It is equivalent to
<code class="literal">index_range(r.start()+idx1, r.finish()+idx, r.stride())</code></td></tr><tr><td><code class="literal">i - idx</code></td><td><code class="literal">index</code></td><td>This expression shifts the start and finish values
<code class="literal">index_range(r.start()+idx1, r.finish()+idx, r.stride())</code>.</td></tr><tr><td><code class="literal">i - idx</code></td><td><code class="literal">index</code></td><td>This expression shifts the start and finish values
of <code class="literal">i</code> up by <code class="literal">idx</code>. It is equivalent to
<code class="literal">index_range(r.start()-idx1, r.finish()-idx, r.stride())</code></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect3" title="index_gen"><div class="titlepage"><div><div><h4 class="title"><a name="index_gen"></a><code class="literal">index_gen</code></h4></div></div></div><p> <code class="literal">index_gen</code> aggregates
<code class="literal">index_range(r.start()-idx1, r.finish()-idx, r.stride())</code>.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect3" title="index_gen"><div class="titlepage"><div><div><h4 class="title"><a name="index_gen"></a><code class="literal">index_gen</code></h4></div></div></div><p> <code class="literal">index_gen</code> aggregates
<code class="literal">index_range</code> objects in order to specify view
parameters. Chained calls to <code class="literal">operator[]</code> store
range and dimension information used to
@@ -560,7 +560,7 @@ void reindex(const BaseList&amp; values);
</pre>
</span></dt><dd><p>This changes the index bases of the <code class="literal">multi_array</code> to
correspond to the the values in <code class="literal">values</code>.</p><p title="BaseList Requirements"><b><code class="literal">BaseList</code> Requirements. </b><code class="literal">BaseList</code> must model
correspond to the values in <code class="literal">values</code>.</p><p title="BaseList Requirements"><b><code class="literal">BaseList</code> Requirements. </b><code class="literal">BaseList</code> must model
<a class="ulink" href="../../utility/Collection.html" target="_top">Collection</a>.</p><p title="Preconditions"><b>Preconditions. </b><code class="literal">values.size() == NumDims;</code></p><p title="Postconditions"><b>Postconditions. </b><code class="literal">std::equal(values.begin(),values.end(),this-&gt;index_bases());
</code></p></dd><dt><span class="term">
<pre class="programlisting">
@@ -745,7 +745,7 @@ multi_array(const const_array_view&lt;NumDims&gt;::type&amp; x);
multi_array(const multi_array_ref&lt;ValueType,NumDims&gt;&amp; x);
multi_array(const subarray&lt;NumDims&gt;::type&amp; x);
multi_array(const array_view&lt;NumDims&gt;::type&amp; x);
</pre></span></dt><dd><p>These constructors all constructs a <code class="literal">multi_array</code> and
</pre></span></dt><dd><p>These constructors all construct a <code class="literal">multi_array</code> and
perform a deep copy of <code class="literal">x</code>.
</p><p title="Complexity"><b>Complexity. </b> This performs O(<code class="literal">x.num_elements()</code>) calls to
<code class="literal">element</code>'s copy
@@ -816,7 +816,7 @@ of the constructors.
</p><p title="Model Of."><b>Model Of. </b>
<code class="literal">multi_array_ref</code> models
<a class="link" href="#MultiArray" title="MultiArray Concept">MultiArray</a>,
<a class="ulink" href="../../../libs/utility/CopyConstructible.html" target="_top">CopyConstructible</a>.
<a class="ulink" href="../../../libs/utility/CopyConstructible.html" target="_top">CopyConstructible</a>
and depending on the element type, it may also model
<a class="ulink" href="https://www.boost.org/sgi/stl/EqualityComparable.html" target="_top">EqualityComparable</a> and <a class="ulink" href="https://www.boost.org/sgi/stl/LessThanComparable.html" target="_top">LessThanComparable</a>.
Detailed descriptions are provided here only for operations that are
@@ -954,7 +954,7 @@ dimensions.
multi_array_ref(const multi_array_ref&amp; x);
</pre></span></dt><dd><p>This constructs a shallow copy of <code class="literal">x</code>.
</p><p title="Complexity"><b>Complexity. </b> Constant time (for contrast, compare this to
the <code class="literal">multi_array</code> class copy constructor.
the <code class="literal">multi_array</code> class copy constructor).
</p></dd></dl></div><p title="Modifiers"><b>Modifiers. </b></p><div class="variablelist"><dl><dt><span class="term"><pre class="programlisting">
multi_array_ref&amp; operator=(const multi_array_ref&amp; x);
template &lt;class Array&gt; multi_array_ref&amp; operator=(const Array&amp; x);
@@ -976,7 +976,7 @@ of the constructors.
</p><p title="Model Of."><b>Model Of. </b>
<code class="literal">const_multi_array_ref</code> models
<a class="link" href="#MultiArray" title="MultiArray Concept">MultiArray</a>,
<a class="ulink" href="../../../libs/utility/CopyConstructible.html" target="_top">CopyConstructible</a>.
<a class="ulink" href="../../../libs/utility/CopyConstructible.html" target="_top">CopyConstructible</a>
and depending on the element type, it may also model
<a class="ulink" href="https://www.boost.org/sgi/stl/EqualityComparable.html" target="_top">EqualityComparable</a> and <a class="ulink" href="https://www.boost.org/sgi/stl/LessThanComparable.html" target="_top">LessThanComparable</a>.
@@ -1110,7 +1110,7 @@ associated with <code class="literal">multi_array</code>,
<code class="literal">multi_array_ref</code>, and
<code class="literal">const_multi_array_ref</code> that are not
dependent upon template parameters. These types find common use with
all Boost.Multiarray components. They are defined
all Boost.MultiArray components. They are defined
in a namespace from which they can be accessed conveniently.
With the exception of <code class="literal">extent_gen</code> and
<code class="literal">extent_range</code>, these types fulfill the roles of the
@@ -1144,7 +1144,7 @@ public:
<code class="literal">finish</code> must be greater than <code class="literal">start</code>.
</p></dd><dt><span class="term"><code class="function">extent_range(index finish)</code></span></dt><dd><p>This constructor defines the half open interval
<code class="literal">[0,finish)</code>. The value of <code class="literal">finish</code>
must be positive.</p></dd><dt><span class="term"><code class="function">index start()</code></span></dt><dd><p>This function returns the first index represented by the range</p></dd><dt><span class="term"><code class="function">index finish()</code></span></dt><dd><p>This function returns the upper boundary value of the half-open
must be positive.</p></dd><dt><span class="term"><code class="function">index start()</code></span></dt><dd><p>This function returns the first index represented by the range.</p></dd><dt><span class="term"><code class="function">index finish()</code></span></dt><dd><p>This function returns the upper boundary value of the half-open
interval. Note that the range does not include this value.</p></dd><dt><span class="term"><code class="function">size_type size()</code></span></dt><dd><p>This function returns the size of the specified range. It is
equivalent to <code class="literal">finish()-start()</code>.</p></dd></dl></div></div><div class="sect2" title="extent_gen"><div class="titlepage"><div><div><h3 class="title"><a name="extent_gen"></a><code class="classname">extent_gen</code></h3></div></div></div><p>The <code class="classname">extent_gen</code> class defines an
interface for aggregating array shape and indexing information to be
@@ -1205,7 +1205,7 @@ For example,
a 3 by 3 by 3 <code class="classname">multi_array</code> is constructed as follows:
</p><pre class="programlisting">multi_array&lt;int,3&gt; A(extents[3][3][3]);</pre><p>
The same array could also be created by explicitly declaring an <code class="literal">extent_gen</code>
object locally,, but the global object makes this declaration unnecessary.
object locally, but the global object makes this declaration unnecessary.
</p></div><div class="sect3" title="indices"><div class="titlepage"><div><div><h4 class="title"><a name="indices"></a><code class="literal">indices</code></h4></div></div></div><pre class="programlisting">
namespace boost {
multi_array_base::index_gen indices;
@@ -1284,7 +1284,7 @@ int a[] = { 0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11 };
int s[] = { 3, 1 };
</pre><p>
Notice that the strides here are different. As a result,
The expression given above to access values will work with this pair
the expression given above to access values will work with this pair
of data and strides as well.
</p><p>In addition to dimension order, it is also possible to
store any dimension in descending order. For example, returning to the

View File

@@ -198,7 +198,7 @@ provides a specialized set of constructors. For further information,
consult their reference pages.
<p>All of the non-const array types in this library provide assignment
operators<tt>operator=()</tt>. Each of the array types <tt>multi_array</tt>,
operators <tt>operator=()</tt>. Each of the array types <tt>multi_array</tt>,
<tt>multi_array_ref</tt>, <tt>subarray</tt>, and
<tt>array_view</tt> can be assigned from any
of the others, so long as their shapes match. The
@@ -476,7 +476,7 @@ stored in ascending or descending order.
// Store last dimension, then first, then middle
array_type::size_type ordering[] = {2,0,1};
// Store the first dimension(dimension 0) in descending order
// Store the first dimension (dimension 0) in descending order
bool ascending[] = {false,true,true};
array_type A(extents[3][4][2],storage(ordering,ascending));
@@ -488,7 +488,7 @@ stored in ascending or descending order.
<h2>Setting The Array Base</h2>
In some situations, it may be inconvenient or awkward to use an
array that is zero-based.
the Boost.MultiArray components provide two facilities for changing the
The Boost.MultiArray components provide two facilities for changing the
bases of an array. One may specify a pair of range values, with
the <tt>extent_range</tt> type, to
the <tt>extent_gen</tt> constructor in order to set the base value.

View File

@@ -7,7 +7,7 @@ containers. It specifies operations for accessing elements,
traversing containers, and creating views
of array data.
MultiArray defines
a flexible memory model that accomodates
a flexible memory model that accommodates
a variety of data layouts.
</para>
@@ -103,7 +103,7 @@ base. Note that since positive index bases are
possible, the origin need not exist in order to determine the location
in memory of the MultiArray's elements.
The strides determine how index values are mapped to memory offsets.
They accomodate a
They accommodate a
number of possible element layouts. For example, the elements of a 2
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
@@ -477,7 +477,7 @@ This returns the number of values contained in
</entry>
<entry>
This expression accesses a specific element of
<literal>a</literal>.<literal>index_list</literal> is the unique set
<literal>a</literal>. <literal>index_list</literal> is the unique set
of indices that address the element returned. It is
equivalent to the following code (disregarding intermediate temporaries):
<programlisting>
@@ -818,8 +818,8 @@ returns <literal>idx</literal>.</entry>
<row>
<entry><literal>i.size(idx)</literal></entry>
<entry><literal>size_type</literal></entry>
<entry>If <literal>i</literal> specifies a both finish and
start values, this is equivalent to
<entry>If <literal>i</literal> specifies both a finish and a
start value, this is equivalent to
<literal>(i.finish()-i.start())/i.stride()</literal>. Otherwise it
returns <literal>idx</literal>.</entry>
</row>
@@ -829,7 +829,7 @@ returns <literal>idx</literal>.</entry>
<entry>This is another syntax for specifying the finish
value. This notation does not include
<literal>idx</literal> in the range of valid indices. It is equivalent to
<literal>index_range(r.start(), idx, r.stride())</literal></entry>
<literal>index_range(r.start(), idx, r.stride())</literal>.</entry>
</row>
<row>
<entry><literal>i &lt;= idx</literal></entry>
@@ -837,7 +837,7 @@ value. This notation does not include
<entry>This is another syntax for specifying the finish
value. This notation includes
<literal>idx</literal> in the range of valid indices. It is equivalent to
<literal>index_range(r.start(), idx + 1, r.stride())</literal></entry>
<literal>index_range(r.start(), idx + 1, r.stride())</literal>.</entry>
</row>
<row>
<entry><literal>idx &lt; i</literal></entry>
@@ -860,14 +860,14 @@ value. This notation includes
<entry><literal>index</literal></entry>
<entry>This expression shifts the start and finish values
of <literal>i</literal> up by <literal>idx</literal>. It is equivalent to
<literal>index_range(r.start()+idx1, r.finish()+idx, r.stride())</literal></entry>
<literal>index_range(r.start()+idx1, r.finish()+idx, r.stride())</literal>.</entry>
</row>
<row>
<entry><literal>i - idx</literal></entry>
<entry><literal>index</literal></entry>
<entry>This expression shifts the start and finish values
of <literal>i</literal> up by <literal>idx</literal>. It is equivalent to
<literal>index_range(r.start()-idx1, r.finish()-idx, r.stride())</literal></entry>
<literal>index_range(r.start()-idx1, r.finish()-idx, r.stride())</literal>.</entry>
</row>
</tbody>
</tgroup>

View File

@@ -282,7 +282,7 @@ void reindex(const BaseList& values);
</term>
<listitem>
<para>This changes the index bases of the <literal>multi_array</literal> to
correspond to the the values in <literal>values</literal>.</para>
correspond to the values in <literal>values</literal>.</para>
<formalpara>
<title><literal>BaseList</literal> Requirements</title>
@@ -364,7 +364,7 @@ associated with <literal>multi_array</literal>,
<literal>multi_array_ref</literal>, and
<literal>const_multi_array_ref</literal> that are not
dependent upon template parameters. These types find common use with
all Boost.Multiarray components. They are defined
all Boost.MultiArray components. They are defined
in a namespace from which they can be accessed conveniently.
With the exception of <literal>extent_gen</literal> and
<literal>extent_range</literal>, these types fulfill the roles of the
@@ -434,7 +434,7 @@ must be positive.</para>
<varlistentry><term><function>index start()</function></term>
<listitem>
<para>This function returns the first index represented by the range</para>
<para>This function returns the first index represented by the range.</para>
</listitem>
</varlistentry>
@@ -562,7 +562,7 @@ For example,
a 3 by 3 by 3 <classname>multi_array</classname> is constructed as follows:
<programlisting>multi_array&lt;int,3&gt; A(extents[3][3][3]);</programlisting>
The same array could also be created by explicitly declaring an <literal>extent_gen</literal>
object locally,, but the global object makes this declaration unnecessary.
object locally, but the global object makes this declaration unnecessary.
</para>
</sect3>
@@ -666,7 +666,7 @@ int a[] = { 0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11 };
int s[] = { 3, 1 };
</programlisting>
Notice that the strides here are different. As a result,
The expression given above to access values will work with this pair
the expression given above to access values will work with this pair
of data and strides as well.
</para>

View File

@@ -15,7 +15,7 @@ of the constructors.
<para>
<literal>const_multi_array_ref</literal> models
<link linkend="MultiArray">MultiArray</link>,
<ulink url="../../../libs/utility/CopyConstructible.html">CopyConstructible</ulink>.
<ulink url="../../../libs/utility/CopyConstructible.html">CopyConstructible</ulink>
and depending on the element type, it may also model
<ulink url="https://www.boost.org/sgi/stl/EqualityComparable.html">EqualityComparable</ulink> and <ulink url="https://www.boost.org/sgi/stl/LessThanComparable.html">LessThanComparable</ulink>.

View File

@@ -227,7 +227,7 @@ multi_array(const array_view<NumDims>::type& x,
const Allocator& alloc = Allocator());]]>
</programlisting></term>
<listitem>
<para>These constructors all constructs a <literal>multi_array</literal> and
<para>These constructors all construct a <literal>multi_array</literal> and
perform a deep copy of <literal>x</literal>.
</para>

View File

@@ -15,7 +15,7 @@ of the constructors.
<para>
<literal>multi_array_ref</literal> models
<link linkend="MultiArray">MultiArray</link>,
<ulink url="../../../libs/utility/CopyConstructible.html">CopyConstructible</ulink>.
<ulink url="../../../libs/utility/CopyConstructible.html">CopyConstructible</ulink>
and depending on the element type, it may also model
<ulink url="https://www.boost.org/sgi/stl/EqualityComparable.html">EqualityComparable</ulink> and <ulink url="https://www.boost.org/sgi/stl/LessThanComparable.html">LessThanComparable</ulink>.
Detailed descriptions are provided here only for operations that are
@@ -198,7 +198,7 @@ dimensions.
<formalpara>
<title>Complexity</title>
<para> Constant time (for contrast, compare this to
the <literal>multi_array</literal> class copy constructor.
the <literal>multi_array</literal> class copy constructor).
</para></formalpara>
</listitem>
</varlistentry>