2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-22 03:42:19 +00:00

Resize consistency

sparse resize must have preserve parameter first
This commit is contained in:
Michael Stevens
2004-09-20 15:05:57 +00:00
parent bfa5e0c9b9
commit 026eefc428
3 changed files with 27 additions and 35 deletions

View File

@@ -111,7 +111,7 @@ from, or is not defined in <a href=
<td>Sizing constructor</td>
<td><code>V v (n)</code></td>
<td><code>n &gt;= 0</code></td>
<td>Creates a vector of <code>n</code> elements.</td>
<td>Allocates an unitialized vector of <code>n</code> elements.</td>
<td><code>v.size () == n</code>.</td>
</tr>
<tr>
@@ -145,14 +145,11 @@ from, or is not defined in <a href=
<td><code>v.resize (n)
<br />v.resize (n, p)</code></td>
<td>&nbsp;</td>
<td>Modifies the vector so that it can hold <code>n</code>
<td>Reallocates the vector so that it can hold <code>n</code>
elements.<br />
Erases or appends elements in order to bring the vector to the
prescribed size. Appended elements are <code>value_type()</code>
copies. When <code>p == false</code> then exisiting elements may no
be preserved and elements will not appended as normal. That is with
<code>p == false</code> the elements values after resize are
undefined.</td>
Erases or appends elements in order to bring the vector to the prescribed size. Appended elements copies of<code>value_type()</code>.
<br />
When <code>p == false</code> then exisiting elements are not preserved and elements will not appended as normal. Instead the vector is in the same state as that after an equivilent sizing constructor.</td>
<td><code>v.size () == n</code>.</td>
</tr>
</tbody>
@@ -270,7 +267,7 @@ from, or is not defined in <a href=
<td>Sizing constructor</td>
<td><code>M m (n1, n2)</code></td>
<td><code>n1 &gt;= 0</code> and <code>n2 &gt;= 0</code></td>
<td>Creates a matrix of <code>n1</code> rows and <code>n2</code>
<td>Allocates an uninitialized matrix of <code>n1</code> rows and <code>n2</code>
columns.</td>
<td><code>m.size1 () == n1</code> and <code>m.size2 () ==
n2</code>.</td>
@@ -311,14 +308,12 @@ m (i, j)</code> is a copy of <code>value_type ()</code>.</td>
m.resize (n1, n2, p)
</code></td>
<td>&nbsp;</td>
<td>Modifies the matrix so that it can hold <code>n1</code> rows
<td>Reallocate the matrix so that it can hold <code>n1</code> rows
and <code>n2</code> columns.<br />
Erases or appends elements in order to bring the matrix to the
prescribed size. Appended elements are <code>value_type()</code>
copies. When <code>p == false</code> then exisiting elements may no
be preserved and elements will not appended as normal. That is with
<code>p == false</code> the elements values after resize are
undefined.</td>
copies.<br />
When <code>p == false</code> then exisiting elements are not preserved and elements will not appended as normal. Instead the matrix is in the same state as that after an equivilent sizing constructor.</td>
<td><code>m.size1 () == n1</code> and <code>m.size2 () ==
n2</code>.</td>
</tr>

View File

@@ -15,7 +15,7 @@ Sparse Matrix</h1>
<h2><a name="sparse_matrix" id="sparse_matrix"></a> Sparse
Matrix</h2>
<h4>Description</h4>
<!-- TODO: replace nested sub/sup -->
<!---->
<p>The templated class <code>sparse_matrix&lt;T, F, A&gt;</code> is
the base container adaptor for sparse matrices. For a <em>(m x
n</em>)-dimensional sparse matrix and <em>0 &lt;= i &lt; m</em>,
@@ -103,8 +103,7 @@ int main () {
rows of zero elements.</td>
</tr>
<tr>
<td><code>sparse_matrix (size_type size1, size_type2, size_type
non_zeros)</code></td>
<td><code>sparse_matrix (size_type size1, size_type2, size_type non_zeros = 0)</code></td>
<td>Allocates a <code>sparse_matrix</code> that holds at most
<code>size1</code> rows of <code>size2</code> elements.</td>
</tr>
@@ -119,8 +118,8 @@ matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size1, size_type size2, size_type
non_zeros)</code></td>
<td><code>void resize (size_type size1, size_type size2, bool preserve = true, size_type
non_zeros = 0)</code></td>
<td>Reallocates a <code>sparse_matrix</code> to hold at most
<code>size1</code> rows of <code>size2</code> elements. The
existing elements of the <code>sparse_matrix</code> are preseved
@@ -422,8 +421,7 @@ TA&gt; &gt;</code></p>
zero rows of zero elements.</td>
</tr>
<tr>
<td><code>compressed_matrix (size_type size1, size_type2, size_type
non_zeros)</code></td>
<td><code>compressed_matrix (size_type size1, size_type2, size_type non_zeros = 0)</code></td>
<td>Allocates a <code>compressed_matrix</code> that holds at most
<code>size1</code> rows of <code>size2</code> elements.</td>
</tr>
@@ -439,8 +437,8 @@ matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size1, size_type size2, size_type
non_zeros)</code></td>
<td><code>void resize (size_type size1, size_type size2, bool preserve = true, size_type
non_zeros = 0)</code></td>
<td>Reallocates a <code>compressed_matrix</code> to hold at most
<code>size1</code> rows of <code>size2</code> elements. The
existing elements of the <code>compressed_matrix</code> are
@@ -745,8 +743,7 @@ TA&gt; &gt;</code></p>
zero rows of zero elements.</td>
</tr>
<tr>
<td><code>coordinate_matrix (size_type size1, size_type2, size_type
non_zeros)</code></td>
<td><code>coordinate_matrix (size_type size1, size_type2, size_type non_zeros = 0)</code></td>
<td>Allocates a <code>coordinate_matrix</code> that holds at most
<code>size1</code> rows of <code>size2</code> elements.</td>
</tr>
@@ -762,8 +759,8 @@ matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size1, size_type size2, size_type
non_zeros)</code></td>
<td><code>void resize (size_type size1, size_type size2, bool preserve = true, size_type
non_zeros = 0)</code></td>
<td>Reallocates a <code>coordinate_matrix</code> to hold at most
<code>size1</code> rows of <code>size2</code> elements. The
existing elements of the <code>coordinate_matrix</code> are

View File

@@ -15,7 +15,7 @@ Sparse Vector</h1>
<h2><a name="sparse_vector" id="sparse_vector"></a> Sparse
Vector</h2>
<h4>Description</h4>
<!-- TODO: replace nested sub/sup -->
<!---->
<p>The templated class <code>sparse_vector&lt;T, A&gt;</code> is
the base container adaptor for sparse vectors. For a
<em>n</em>-dimensional sparse vector and <em>0 &lt;= i &lt; n</em>
@@ -85,7 +85,7 @@ elements.</td>
</tr>
<tr>
<td><code>sparse_vector (size_type size, size_type
non_zeros)</code></td>
non_zeros = 0)</code></td>
<td>Allocates a <code>sparse_vector</code> that holds at most
<code>size</code> elements.</td>
</tr>
@@ -100,8 +100,8 @@ vector_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size, size_type non_zeros, bool
preserve = true)</code></td>
<td><code>void resize (size_type size, bool
preserve = true, size_type non_zeros = 0)</code></td>
<td>Reallocates a <code>sparse_vector</code> to hold at most
<code>size</code> elements. The existing elements of the
<code>sparse_vector</code> are preseved when specified.</td>
@@ -357,8 +357,8 @@ vector_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size, size_type non_zeros, bool
preserve = true)</code></td>
<td><code>void resize (size_type size, bool
preserve = true, size_type non_zeros = 0)</code></td>
<td>Reallocates a <code>compressed_vector</code> to hold at most
<code>size</code> elements. The existing elements of the
<code>compress_vector</code> are preseved when specified.</td>
@@ -617,8 +617,8 @@ vector_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size, size_type
non_zeros)</code></td>
<td><code>void resize (size_type size, bool
preserve = true, size_type non_zeros = 0)</code></td>
<td>Reallocates a <code>coordinate_vector</code> to hold at most
<code>size</code> elements. The existing elements of the
<code>coordinate_vector</code> are preseved when specified.</td>