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

ADD define the vector/matrix_container classes

CHANGE drop the template parameters of models, they are often incorrect, missleading and impossible to maintain
FIX Vector/ Matrix concepts have array_type and data() as special properties


[SVN r30110]
This commit is contained in:
Michael Stevens
2005-07-15 15:45:34 +00:00
parent ad2a5ec642
commit 989a576e91
5 changed files with 158 additions and 78 deletions

View File

@@ -33,8 +33,9 @@ vectors.</p>
<tr>
<td>Storage array</td>
<td>V::array_type</td>
<td>The type of underlying storage array used to store the elements. The array_type must model
the <a href="storage_concept.htm"><b>Storage</b></a> concept.</td>
<td>
Dense Vector ONLY. The type of underlying storage array used to store the elements. The array_type must model the
<a href="storage_concept.htm"><b>Storage</b></a> concept.</td>
</tr>
</tbody>
</table>
@@ -182,8 +183,8 @@ When <code>p == false</code> then existing elements are not preserved and elemen
<tr>
<td>Storage</td>
<td><code>v.data()</code></td>
<td><code>v</code></td>
<td>Returns a reference to the underlying storage</td>
<td></td>
<td>Dense Vector ONLY. Returns a reference to the underlying storage</td>
<td>&nbsp;</td>
</tr>
</table>
@@ -197,9 +198,9 @@ size.</p>
<h4>Invariants</h4>
<h4>Models</h4>
<ul>
<li><code>vector&lt;T&gt;</code>, <code>bounded_vector&lt;T, N&gt;</code>, <code>c_vector&lt;T, N&gt;</code></li>
<li><code>unit_vector&lt;T&gt;</code>, <code>zero_vector&lt;T&gt;</code>, <code>scalar_vector&lt;T&gt;</code></li>
<li><code>mapped_vector&lt;T&gt;</code>, <code>compressed_vector</code>, <code>coordinate_vector</code></li>
<li><code>vector</code>, <code>bounded_vector</code>, <code>c_vector</code></li>
<li><code>unit_vector</code>, <code>zero_vector</code>, <code>scalar_vector</code></li>
<li><code>mapped_vector;</code>, <code>compressed_vector</code>, <code>coordinate_vector</code></li>
</ul>
<h4>Notes</h4>
<p><a name="vector_expression_note">[1]</a>
@@ -230,7 +231,7 @@ matrices.</p>
<tr>
<td>Storage array</td>
<td>M::array_type</td>
<td>The type of underlying storage array used to store the elements. The array_type must model
<td>Dense Matrix ONLY. The type of underlying storage array used to store the elements. The array_type must model
the <a href="storage_concept.htm"><b>Storage</b></a> concept.</td>
</tr>
</tbody>
@@ -380,9 +381,9 @@ When <code>p == false</code> then existing elements are not preserved and elemen
</tr>
<tr>
<td>Storage</td>
<td><code>v.data()</code></td>
<td><code>v</code></td>
<td>Returns a reference to the underlying storage</td>
<td><code>m.data()</code></td>
<td></td>
<td>Dense Matrix ONLY. Returns a reference to the underlying storage</td>
<td>&nbsp;</td>
</tbody>
</table>
@@ -396,10 +397,10 @@ size.</p>
<h4>Invariants</h4>
<h4>Models</h4>
<ul>
<li><code>matrix&lt;T&gt;</code>, <code>bounded_matrix&lt;T, M, N&gt;</code>, <code>c_matrix&lt;T, M, N&gt;</code></li>
<li><code>identity_matrix&lt;T&gt;</code> , <code>zero_matrix&lt;T&gt;</code> , <code>scalar_matrix&lt;T&gt;</code></li>
<li><code>triangular_matrix&lt;T&gt;</code> , <code>symmetric_matrix&lt;T&gt;</code> , <code>banded_matrix&lt;T&gt;</code></li>
<li><code>mapped_matrix&lt;T&gt;</code> , <code>compressed_matrix</code> , <code>coordinate_matrix</code></li>
<li><code>matrix</code>, <code>bounded_matrix</code>, <code>c_matrix</code></li>
<li><code>identity_matrix</code> , <code>zero_matrix</code> , <code>scalar_matrix</code></li>
<li><code>triangular_matrix</code> , <code>symmetric_matrix</code> , <code>banded_matrix</code></li>
<li><code>mapped_matrix</code> , <code>compressed_matrix</code> , <code>coordinate_matrix</code></li>
</ul>
<h4>Notes</h4>
<p><a name="matrix_expression_note">[1]</a>

View File

@@ -87,8 +87,8 @@ evaluated scalar expression.</p>
<h4>Invariants</h4>
<h4>Models</h4>
<ul>
<li><code>vector_scalar_unary&lt;E, F&gt;</code></li>
<li><code>vector_scalar_binary&lt;E1, E2, F&gt;</code></li>
<li><code>vector_scalar_unary</code></li>
<li><code>vector_scalar_binary</code></li>
</ul>
<h2><a name="vector_expression" id="vector_expression"></a> Vector
Expression</h2>
@@ -487,20 +487,20 @@ to <code>v.rend ()</code>.</td>
</table>
<h4>Models</h4>
<ul>
<li><code>vector_range&lt;V&gt;</code></li>
<li><code>vector_slice&lt;V&gt;</code></li>
<li><code>matrix_row&lt;M&gt;</code></li>
<li><code>matrix_column&lt;M&gt;</code></li>
<li><code>matrix_vector_range&lt;M&gt;</code></li>
<li><code>matrix_vector_slice&lt;M&gt;</code></li>
<li><code>vector_unary&lt;E, F&gt;</code></li>
<li><code>vector_binary&lt;E1, E2, F&gt;</code></li>
<li><code>vector_binary_scalar1&lt;E1, E2, F&gt;</code></li>
<li><code>vector_binary_scalar2&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_vector_unary1&lt;E&gt;</code></li>
<li><code>matrix_vector_unary2&lt;E&gt;</code></li>
<li><code>matrix_vector_binary1&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_vector_binary2&lt;E1, E2, F&gt;</code></li>
<li><code>vector_range;</code></li>
<li><code>vector_slice</code></li>
<li><code>matrix_row</code></li>
<li><code>matrix_column</code></li>
<li><code>matrix_vector_range</code></li>
<li><code>matrix_vector_slice</code></li>
<li><code>vector_unary</code></li>
<li><code>vector_binary</code></li>
<li><code>vector_binary_scalar1</code></li>
<li><code>vector_binary_scalar2</code></li>
<li><code>matrix_vector_unary1</code></li>
<li><code>matrix_vector_unary2</code></li>
<li><code>matrix_vector_binary1</code></li>
<li><code>matrix_vector_binary2</code></li>
</ul>
<h2><a name="matrix_expression" id="matrix_expression"></a> Matrix
@@ -1017,18 +1017,18 @@ the distance from <code>m.rbegin2 ()</code> to <code>m.rend2
</table>
<h4>Models</h4>
<ul>
<li><code>matrix_range&lt;M&gt;</code></li>
<li><code>matrix_slice&lt;M&gt;</code></li>
<li><code>triangular_adaptor&lt;M, F&gt;</code></li>
<li><code>symmetric_adaptor&lt;M, F&gt;</code></li>
<li><code>banded_adaptor&lt;M&gt;</code></li>
<li><code>vector_matrix_binary&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_unary1&lt;E, F&gt;</code></li>
<li><code>matrix_unary2&lt;E, F&gt;</code></li>
<li><code>matrix_binary&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_binary_scalar1&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_binary_scalar2&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_matrix_binary&lt;E1, E2, F&gt;</code></li>
<li><code>matrix_range</code></li>
<li><code>matrix_slice;</code></li>
<li><code>triangular_adaptor</code></li>
<li><code>symmetric_adaptor</code></li>
<li><code>banded_adaptor</code></li>
<li><code>vector_matrix_binary</code></li>
<li><code>matrix_unary1</code></li>
<li><code>matrix_unary2</code></li>
<li><code>matrix_binary</code></li>
<li><code>matrix_binary_scalar1</code></li>
<li><code>matrix_binary_scalar2</code></li>
<li><code>matrix_matrix_binary</code></li>
</ul>
<hr />
<p>Copyright (&copy;) 2000-2002 Joerg Walter, Mathias Koch<br />

View File

@@ -292,7 +292,7 @@ operator</td>
</table>
<h4>Models</h4>
<ul>
<li><code>sparse_vector&lt;T&gt;::iterator</code></li>
<li><code>sparse_vector::iterator</code></li>
</ul>
<h2><a name="indexed_random_access_iterator" id=
"indexed_random_access_iterator"></a> Indexed Random Access
@@ -523,7 +523,7 @@ it2 + (it1 - it2)</code>.</td>
</table>
<h4>Models</h4>
<ul>
<li><code>vector&lt;T&gt;::iterator</code></li>
<li><code>vector::iterator</code></li>
</ul>
<h2><a name="indexed_bidirectional_cr_iterator" id=
"indexed_bidirectional_cr_iterator"></a> Indexed Bidirectional
@@ -920,8 +920,8 @@ it2t.index1 ()</code> for all <code>it2t</code> with <code>it2t ()
</table>
<h4>Models</h4>
<ul>
<li><code>sparse_matrix&lt;T&gt;::iterator1</code></li>
<li><code>sparse_matrix&lt;T&gt;::iterator2</code></li>
<li><code>sparse_matrix::iterator1</code></li>
<li><code>sparse_matrix::iterator2</code></li>
</ul>
<h2><a name="indexed_random_access_cr_iterator" id=
"indexed_random_access_cr_iterator"></a> Indexed Random Access
@@ -1148,8 +1148,8 @@ it2 + (it1 - it2)</code>.</td>
</table>
<h4>Models</h4>
<ul>
<li><code>matrix&lt;T&gt;::iterator1</code></li>
<li><code>matrix&lt;T&gt;::iterator2</code></li>
<li><code>matrix::iterator1</code></li>
<li><code>matrix::iterator2</code></li>
</ul>
<hr />
<p>Copyright (&copy;) 2000-2002 Joerg Walter, Mathias Koch<br />

View File

@@ -12,14 +12,12 @@
<body>
<h1><img src="../../../../boost.png" align="middle" />
Matrix Expressions</h1>
<h2><a name="matrix_expression" id="matrix_expression"></a> Matrix
Expression</h2>
<h2><a name="matrix_expression" id="matrix_expression"></a>Matrix Expression</h2>
<h4>Description</h4>
<p>The templated class <code>matrix_expression&lt;E&gt;</code>
forms the base for all static derived matrix expression classes
including class <code>matrix</code> itself.</p>
is required to be a public base of all classes which model the Matrix Expression concept.</p>
<h4>Definition</h4>
<p>Defined in the header matrix_expression.hpp.</p>
<p>Defined in the header expression_types.hpp.</p>
<h4>Template parameters</h4>
<table border="1" summary="parameters">
<tbody>
@@ -62,8 +60,54 @@ const</code></td>
</table>
<h4>Notes</h4>
<p>The <code>operator[]</code>, <code>row</code>, <code>column</code>, <code>range</code>, <code>slice</code> and <code>project</code> functions have been removed. Use the free functions defined in <a href="matrix_proxy.htm">matrix proxy</a> instead.</p>
<h2><a name="matrix_references" id="matrix_references"></a> Matrix
References</h2>
<h2><a name="matrix_container" id="matrix_container"></a>Matrix Container</h2>
<h4>Description</h4>
<p>The templated class <code>matrix_container&lt;C&gt;</code>
is required to be a public base of all classes which model the Matrix concept.
This includes the class <code>matrix</code> itself.</p>
<h4>Definition</h4>
<p>Defined in the header expression_types.hpp.</p>
<h4>Template parameters</h4>
<table border="1" summary="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><code>E</code></td>
<td>The type of the matrix expression.</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<h4>Model of</h4>
<p>None. <u>Not a Matrix Expression OR Matrix</u>!
</p>
<h4>Type requirements</h4>
<p>None.</p>
<h4>Public base classes</h4>
<p><code>matrix_expression&lt;C&gt;</code></p>
<h4>Members</h4>
<table border="1" summary="members">
<tbody>
<tr>
<th>Member</th>
<th>Description</th>
</tr>
<tr>
<td><code>const container_type &amp;operator () ()
const</code></td>
<td>Returns a <code>const</code> reference of the container.</td>
</tr>
<tr>
<td><code>container_type &amp;operator () ()</code></td>
<td>Returns a reference of the container.</td>
</tr>
</tbody>
</table>
<h2><a name="matrix_references" id="matrix_references"></a>Matrix References</h2>
<h3>Reference</h3>
<h4>Description</h4>
<p>The templated class <code>matrix_reference&lt;E&gt;</code>
@@ -212,8 +256,7 @@ the reversed expression.</td>
</tr>
</tbody>
</table>
<h2><a name="matrix_operations" id="matrix_operations"></a> Matrix
Operations</h2>
<h2><a name="matrix_operations" id="matrix_operations"></a>Matrix Operations</h2>
<h3>Unary Operation Description</h3>
<h4>Description</h4>
<p>The templated classes <code>matrix_unary1&lt;E, F&gt;</code> and
@@ -759,8 +802,7 @@ int main () {
std::cout &lt;&lt; m * 2.0 &lt;&lt; std::endl;
}
</pre>
<h2><a name="matrix_vector_operations" id=
"matrix_vector_operations"></a> Matrix Vector Operations</h2>
<h2><a name="matrix_vector_operations" id="matrix_vector_operations"></a>Matrix Vector Operations</h2>
<h3>Binary Operation Description</h3>
<h4>Description</h4>
<p>The templated classes <code>matrix_vector_binary1&lt;E1, E2,
@@ -1101,8 +1143,7 @@ int main () {
std::cout &lt;&lt; solve (v, m, lower_tag ()) &lt;&lt; std::endl;
}
</pre>
<h2><a name="matrix_matrix_operations" id=
"matrix_matrix_operations"></a> Matrix Matrix Operations</h2>
<h2><a name="matrix_matrix_operations" id="matrix_matrix_operations"></a>Matrix Matrix Operations</h2>
<h3>Binary Operation Description</h3>
<h4>Description</h4>
<p>The templated class <code>matrix_matrix_binary&lt;E1, E2,

View File

@@ -12,14 +12,12 @@
<body>
<h1><img src="../../../../boost.png" align="middle" />
Vector Expressions</h1>
<h2><a name="vector_expression" id="vector_expression"></a> Vector
Expression</h2>
<h2><a name="vector_expression" id="vector_expression"></a>Vector Expression</h2>
<h4>Description</h4>
<p>The templated class <code>vector_expression&lt;E&gt;</code>
forms the base for all static derived vector expression classes
including class <code>vector</code> itself.</p>
is required to be a public base of all classes which model the Vector Expression concept.</p>
<h4>Definition</h4>
<p>Defined in the header vector_expression.hpp.</p>
<p>Defined in the header expression_types.hpp.</p>
<h4>Template parameters</h4>
<table border="1" summary="parameters">
<tbody>
@@ -33,11 +31,6 @@ including class <code>vector</code> itself.</p>
<td>The type of the vector expression.</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>A</code></td>
<td>Base type of an indirect_array.</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<h4>Model of</h4>
@@ -68,8 +61,55 @@ const</code></td>
<h4>Notes</h4>
<p>The <code>range</code>, <code>slice</code> and <code>project</code> functions have been removed. Use the free functions defined in <a href="vector_proxy.htm">vector proxy</a> instead.</p>
<h2><a name="vector_references" id="vector_references"></a> Vector
References</h2>
<h2><a name="vector_container" id="vector_container"></a>Vector Container</h2>
<h4>Description</h4>
<p>The templated class <code>vector_container&lt;C&gt;</code>
is required to be a public base of all classes which model the Vector concept.
This includes the class <code>vector</code> itself.</p>
<h4>Definition</h4>
<p>Defined in the header expression_types.hpp.</p>
<h4>Template parameters</h4>
<table border="1" summary="parameters">
<tbody>
<tr>
<th>Parameter</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><code>C</code></td>
<td>The type of the vector container.</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<h4>Model of</h4>
<p>None. <u>Not a Vector Expression OR Vector</u>!
</p>
<h4>Type requirements</h4>
<p>None.</p>
<h4>Public base classes</h4>
<p><code>vector_expression&lt;C&gt;</code></p>
<h4>Members</h4>
<table border="1" summary="members">
<tbody>
<tr>
<th>Member</th>
<th>Description</th>
</tr>
<tr>
<td><code>const container_type &amp;operator () ()
const</code></td>
<td>Returns a <code>const</code> reference of the container.</td>
</tr>
<tr>
<td><code>container_type &amp;operator () ()</code></td>
<td>Returns a reference of the container.</td>
</tr>
</tbody>
</table>
<h2><a name="vector_references" id="vector_references"></a>Vector References</h2>
<h3>Reference</h3>
<h4>Description</h4>
<p>The templated class <code>vector_reference&lt;E&gt;</code>
@@ -171,8 +211,7 @@ the reversed expression.</td>
</tr>
</tbody>
</table>
<h2><a name="vector_operations" id="vector_operations"></a> Vector
Operations</h2>
<h2><a name="vector_operations" id="vector_operations"></a>Vector Operations</h2>
<h3>Unary Operation Description</h3>
<h4>Description</h4>
<p>The templated class <code>vector_unary&lt;E, F&gt;</code>
@@ -781,8 +820,7 @@ int main () {
std::cout &lt;&lt; v * 2.0 &lt;&lt; std::endl;
}
</pre>
<h2><a name="vector_reductions" id="vector_reductions"></a> Vector
Reductions</h2>
<h2><a name="vector_reductions" id="vector_reductions"></a>Vector Reductions</h2>
<h3>Unary Reductions</h3>
<h4>Prototypes</h4>
<pre>