2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-23 16:12:09 +00:00
Files
ublas/doc/hermitian.htm
Jörg Walter 09ae5e3598 Merge.
2002-09-14 09:48:41 +00:00

1209 lines
45 KiB
HTML
Raw Blame History

<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Hermitian Matrix</title>
</head>
<body bgcolor="#FFFFFF">
<h1><img src="c++boost.gif" alt="c++boost.gif" align="center"
width="277" height="86">Hermitian Matrix</h1>
<h2><a name="hermitian_matrix"></a>Hermitian Matrix</h2>
<h4>Description</h4>
<p>The templated class <code>hermitian_matrix&lt;T, F1, F2, A&gt;
</code>is the base container adaptor for hermitian matrices. For
a <em>(n x n</em>)-dimensional hermitian matrix and <em>0 &lt;= i
&lt; n</em>,<em> 0 &lt;= j &lt; n</em> holds <em>h</em><sub><em>i,
j</em></sub><em> = h</em><sub><em>j, i</em></sub><sup><em>-</em></sup>.
The storage of hermitian matrices is packed.</p>
<h4>Example</h4>
<pre>int main () {
using namespace boost::numeric::ublas;
hermitian_matrix&lt;std::complex&lt;double&gt;, lower&gt; ml (3, 3);
for (int i = 0; i &lt; ml.size1 (); ++ i)
for (int j = 0; j &lt;= i; ++ j)
ml (i, j) = std::complex&lt;double&gt; (3 * i + j, 3 * i + j);
std::cout &lt;&lt; ml &lt;&lt; std::endl;
hermitian_matrix&lt;std::complex&lt;double&gt;, upper&gt; mu (3, 3);
for (int i = 0; i &lt; m.size1 (); ++ i)
for (int j = i; j &lt; m.size2 (); ++ j)
mu (i, j) = std::complex&lt;double&gt; (3 * i + j, 3 * i + j);
std::cout &lt;&lt; mu &lt;&lt; std::endl;
}</pre>
<h4>Definition</h4>
<p>Defined in the header hermitian.hpp.</p>
<h4>Template parameters</h4>
<table border="1">
<tr>
<th>Parameter </th>
<th>Description </th>
<th>Default </th>
</tr>
<tr>
<td><code>T</code> </td>
<td>The type of object stored in the matrix. </td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>F1</code></td>
<td>Functor describing the type of the hermitian matrix. <a
href="#hermitian_matrix_1">[1]</a></td>
<td><code>lower</code></td>
</tr>
<tr>
<td><code>F2</code></td>
<td>Functor describing the storage organization. <a
href="#hermitian_matrix_2">[2]</a></td>
<td><code>row_major</code></td>
</tr>
<tr>
<td><code>A</code></td>
<td>The type of the adapted array. <a
href="#hermitian_matrix_3">[3]</a></td>
<td><code>unbounded_array&lt;T&gt;</code></td>
</tr>
</table>
<h4>Model of</h4>
<p><a href="container.htm#matrix">Matrix</a>. </p>
<h4>Type requirements</h4>
<p>None, except for those imposed by the requirements of <a
href="container.htm#matrix">Matrix</a>.</p>
<h4>Public base classes</h4>
<p><code>matrix_expression&lt;hermitian_matrix&lt;T, F1, F2,
A&gt; &gt;</code> </p>
<h4>Members</h4>
<table border="1">
<tr>
<th>Member </th>
<th>Description </th>
</tr>
<tr>
<td><code>hermitian_matrix ()</code> </td>
<td>Allocates an uninitialized <code>hermitian_matrix</code>
that holds zero rows of zero elements.</td>
</tr>
<tr>
<td><code>hermitian_matrix (size_type size)</code></td>
<td>Allocates an uninitialized <code>hermitian_matrix</code>
that holds <code>size</code> rows of <code>size</code>
elements.</td>
</tr>
<tr>
<td><code>hermitian_matrix (const hermitian_matrix
&amp;m)</code></td>
<td>The copy constructor.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix (const matrix_expression&lt;AE&gt;
&amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>void resize (size_type size)</code></td>
<td>Reallocates a <code>hermitian_matrix </code>to hold <code>size</code>
rows of <code>size</code> elements. The content of the <code>hermitian_matrix</code>
is not preserved.</td>
</tr>
<tr>
<td><code>size_type size1 () const</code></td>
<td>Returns the number of rows. </td>
</tr>
<tr>
<td><code>size_type size2 () const</code></td>
<td>Returns the number of columns. </td>
</tr>
<tr>
<td><code>const_reference operator () (size_type i,
size_type j) const</code></td>
<td>Returns a <code>const</code> reference of the <code>j</code>-th
element in the <code>i</code>-th row. </td>
</tr>
<tr>
<td><code>reference operator () (size_type i, size_type
j)</code></td>
<td>Returns a reference of the <code>j</code>-th element
in the <code>i</code>-th row. </td>
</tr>
<tr>
<td><code>hermitian_matrix &amp;operator = (const
hermitian_matrix &amp;m)</code></td>
<td>The assignment operator.</td>
</tr>
<tr>
<td><code>hermitian_matrix &amp;assign_temporary
(hermitian_matrix &amp;m)</code></td>
<td>Assigns a temporary. May change the hermitian matrix <code>m</code>.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix &amp;operator = (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended assignment operator.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix &amp;assign (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>Assigns a matrix expression to the hermitian matrix.
Left and right hand side of the assignment should be
independent.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix &amp;operator += (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>A computed assignment operator. Adds the matrix
expression to the hermitian matrix.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix &amp;plus_assign (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>Adds a matrix expression to the hermitian matrix.
Left and right hand side of the assignment should be
independent.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix &amp;operator -= (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>A computed assignment operator. Subtracts the matrix
expression from the hermitian matrix.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_matrix &amp;minus_assign (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>Subtracts a matrix expression from the hermitian
matrix. Left and right hand side of the assignment should
be independent.</td>
</tr>
<tr>
<td><code>template&lt;class AT&gt;<br>
hermitian_matrix &amp;operator *= (const AT &amp;at)</code></td>
<td>A computed assignment operator. Multiplies the
hermitian matrix with a scalar.</td>
</tr>
<tr>
<td><code>template&lt;class AT&gt;<br>
hermitian_matrix &amp;operator /= (const AT &amp;at)</code></td>
<td>A computed assignment operator. Divides the hermitian
matrix through a scalar.</td>
</tr>
<tr>
<td><code>void swap (hermitian_matrix &amp;m)</code></td>
<td>Swaps the contents of the hermitian matrices. </td>
</tr>
<tr>
<td><code>void insert (size_type i, size_type j,
const_reference t)</code></td>
<td>Inserts the value <code>t</code> at the <code>j</code>-th
element of the <code>i</code>-th row.</td>
</tr>
<tr>
<td><code>void erase (size_type i, size_type j)</code></td>
<td>Erases the value at the <code>j</code>-th elemenst of
the <code>i</code>-th row.</td>
</tr>
<tr>
<td><code>void clear ()</code></td>
<td>Clears the matrix.</td>
</tr>
<tr>
<td><code>const_iterator1 begin1 () const</code></td>
<td>Returns a <code>const_iterator1</code> pointing to
the beginning of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>const_iterator1 end1 () const</code></td>
<td>Returns a <code>const_iterator1</code> pointing to
the end of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>iterator1 begin1 () </code></td>
<td>Returns a <code>iterator1</code> pointing to the
beginning of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>iterator1 end1 () </code></td>
<td>Returns a <code>iterator1</code> pointing to the end
of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>const_iterator2 begin2 () const</code></td>
<td>Returns a <code>const_iterator2</code> pointing to
the beginning of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>const_iterator2 end2 () const</code></td>
<td>Returns a <code>const_iterator2</code> pointing to
the end of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>iterator2 begin2 () </code></td>
<td>Returns a <code>iterator2</code> pointing to the
beginning of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>iterator2 end2 () </code></td>
<td>Returns a <code>iterator2</code> pointing to the end
of the <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>const_reverse_iterator1 rbegin1 () const</code></td>
<td>Returns a <code>const_reverse_iterator1</code>
pointing to the beginning of the reversed <code>hermitian_matrix</code>.
</td>
</tr>
<tr>
<td><code>const_reverse_iterator1 rend1 () const</code></td>
<td>Returns a <code>const_reverse_iterator1</code>
pointing to the end of the reversed <code>hermitian_matrix</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator1 rbegin1 () </code></td>
<td>Returns a <code>reverse_iterator1</code> pointing to
the beginning of the reversed <code>hermitian_matrix</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator1 rend1 () </code></td>
<td>Returns a <code>reverse_iterator1</code> pointing to
the end of the reversed <code>hermitian_matrix</code>. </td>
</tr>
<tr>
<td><code>const_reverse_iterator2 rbegin2 () const</code></td>
<td>Returns a <code>const_reverse_iterator2</code>
pointing to the beginning of the reversed <code>hermitian_matrix</code>.
</td>
</tr>
<tr>
<td><code>const_reverse_iterator2 rend2 () const</code></td>
<td>Returns a <code>const_reverse_iterator2</code>
pointing to the end of the reversed <code>hermitian_matrix</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator2 rbegin2 () </code></td>
<td>Returns a <code>reverse_iterator2</code> pointing to
the beginning of the reversed <code>hermitian_matrix</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator2 rend2 () </code></td>
<td>Returns a <code>reverse_iterator2</code> pointing to
the end of the reversed <code>hermitian_matrix</code>. </td>
</tr>
</table>
<h4>Notes</h4>
<p><a name="#hermitian_matrix_1">[1]</a> Supported parameters for
the type of the hermitian matrix are <code>lower</code> and <code>upper</code>.</p>
<p><a name="#hermitian_matrix_2">[2]</a> Supported parameters for
the storage organization are <code>row_major</code> and <code>column_major</code>.</p>
<p><a name="#hermitian_matrix_3">[3]</a> Supported parameters for
the adapted array are <code>unbounded_array&lt;T&gt;</code>, <code>bounded_array&lt;T&gt;</code>
and <code>std::vector&lt;T&gt;</code>. </p>
<h4>Interface</h4>
<pre><code> // Array based hermitian matrix class
template&lt;class T, class F1, class F2, class A&gt;
class hermitian_matrix:
public matrix_expression&lt;hermitian_matrix&lt;T, F1, F2, A&gt; &gt; {
public:
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T value_type;
typedef const T const_reference;
typedef T &amp;reference;
typedef const T *const_pointer;
typedef T *pointer;
typedef F1 functor1_type;
typedef F2 functor2_type;
typedef A array_type;
typedef const A const_array_type;
typedef const hermitian_matrix&lt;T, F1, F2, A&gt; const_self_type;
typedef hermitian_matrix&lt;T, F1, F2, A&gt; self_type;
typedef const matrix_const_reference&lt;const_self_type&gt; const_closure_type;
typedef matrix_reference&lt;self_type&gt; closure_type;
typedef packed_tag storage_category;
typedef typename F1::packed_category packed_category;
typedef typename F2::orientation_category orientation_category;
// Construction and destruction
hermitian_matrix ();
hermitian_matrix (size_type size);
hermitian_matrix (size_type size1, size_type size2);
hermitian_matrix (const hermitian_matrix &amp;m);
template&lt;class AE&gt;
hermitian_matrix (const matrix_expression&lt;AE&gt; &amp;ae);
// Accessors
size_type size1 () const;
size_type size2 () const;
const_array_type &amp;data () const;
array_type &amp;data ();
// Resizing
void resize (size_type size);
void resize (size_type size1, size_type size2);
// Element access
const_reference operator () (size_type i, size_type j) const;
reference operator () (size_type i, size_type j);
// Assignment
hermitian_matrix &amp;operator = (const hermitian_matrix &amp;m);
hermitian_matrix &amp;assign_temporary (hermitian_matrix &amp;m);
template&lt;class AE&gt;
hermitian_matrix &amp;operator = (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_matrix &amp;reset (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_matrix &amp;assign (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_matrix&amp; operator += (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_matrix &amp;plus_assign (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_matrix&amp; operator -= (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_matrix &amp;minus_assign (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AT&gt;
hermitian_matrix&amp; operator *= (const AT &amp;at);
template&lt;class AT&gt;
hermitian_matrix&amp; operator /= (const AT &amp;at);
// Swapping
void swap (hermitian_matrix &amp;m);
friend void swap (hermitian_matrix &amp;m1, hermitian_matrix &amp;m2);
// Element insertion and erasure
void insert (size_type i, size_type j, const_reference t);
void erase (size_type i, size_type j);
void clear ();
class const_iterator1;
class iterator1;
class const_iterator2;
class iterator2;
typedef reverse_iterator_base1&lt;const_iterator1&gt; const_reverse_iterator1;
typedef reverse_iterator_base1&lt;iterator1&gt; reverse_iterator1;
typedef reverse_iterator_base2&lt;const_iterator2&gt; const_reverse_iterator2;
typedef reverse_iterator_base2&lt;iterator2&gt; reverse_iterator2;
// Element lookup
const_iterator1 find_first1 (int rank, size_type i, size_type j) const;
iterator1 find_first1 (int rank, size_type i, size_type j);
const_iterator1 find_last1 (int rank, size_type i, size_type j) const;
iterator1 find_last1 (int rank, size_type i, size_type j);
const_iterator2 find_first2 (int rank, size_type i, size_type j) const;
iterator2 find_first2 (int rank, size_type i, size_type j);
const_iterator2 find_last2 (int rank, size_type i, size_type j) const;
iterator2 find_last2 (int rank, size_type i, size_type j);
// Iterators simply are indices.
class const_iterator1:
public container_const_reference&lt;hermitian_matrix&gt;,
public random_access_iterator_base&lt;const_iterator1, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_matrix::difference_type difference_type;
typedef typename hermitian_matrix::value_type value_type;
typedef typename hermitian_matrix::const_reference reference;
typedef typename hermitian_matrix::const_pointer pointer;
typedef const_iterator2 dual_iterator_type;
typedef const_reverse_iterator2 dual_reverse_iterator_type;
// Construction and destruction
const_iterator1 ();
const_iterator1 (const hermitian_matrix &amp;m, size_type it1, size_type it2);
const_iterator1 (const iterator1 &amp;it);
// Arithmetic
const_iterator1 &amp;operator ++ ();
const_iterator1 &amp;operator -- ();
const_iterator1 &amp;operator += (difference_type n);
const_iterator1 &amp;operator -= (difference_type n);
difference_type operator - (const const_iterator1 &amp;it) const;
// Dereference
reference operator * () const;
const_iterator2 begin () const;
const_iterator2 end () const;
const_reverse_iterator2 rbegin () const;
const_reverse_iterator2 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
const_iterator1 &amp;operator = (const const_iterator1 &amp;it);
// Comparison
bool operator == (const const_iterator1 &amp;it) const;
bool operator &lt; (const const_iterator1 &amp;it) const;
};
const_iterator1 begin1 () const;
const_iterator1 end1 () const;
class iterator1:
public container_reference&lt;hermitian_matrix&gt;,
public random_access_iterator_base&lt;iterator1, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_matrix::difference_type difference_type;
typedef typename hermitian_matrix::value_type value_type;
typedef typename hermitian_matrix::reference reference;
typedef typename hermitian_matrix::pointer pointer;
typedef iterator2 dual_iterator_type;
typedef reverse_iterator2 dual_reverse_iterator_type;
// Construction and destruction
iterator1 ();
iterator1 (hermitian_matrix &amp;m, size_type it1, size_type it2);
// Arithmetic
iterator1 &amp;operator ++ ();
iterator1 &amp;operator -- ();
iterator1 &amp;operator += (difference_type n);
iterator1 &amp;operator -= (difference_type n);
difference_type operator - (const iterator1 &amp;it) const;
// Dereference
reference operator * () const;
iterator2 begin () const;
iterator2 end () const;
reverse_iterator2 rbegin () const;
reverse_iterator2 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
iterator1 &amp;operator = (const iterator1 &amp;it);
// Comparison
bool operator == (const iterator1 &amp;it) const;
bool operator &lt; (const iterator1 &amp;it) const;
};
iterator1 begin1 ();
iterator1 end1 ();
class const_iterator2:
public container_const_reference&lt;hermitian_matrix&gt;,
public random_access_iterator_base&lt;const_iterator2, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_matrix::difference_type difference_type;
typedef typename hermitian_matrix::value_type value_type;
typedef typename hermitian_matrix::const_reference reference;
typedef typename hermitian_matrix::const_pointer pointer;
typedef const_iterator1 dual_iterator_type;
typedef const_reverse_iterator1 dual_reverse_iterator_type;
// Construction and destruction
const_iterator2 ();
const_iterator2 (const hermitian_matrix &amp;m, size_type it1, size_type it2);
const_iterator2 (const iterator2 &amp;it);
// Arithmetic
const_iterator2 &amp;operator ++ ();
const_iterator2 &amp;operator -- ();
const_iterator2 &amp;operator += (difference_type n);
const_iterator2 &amp;operator -= (difference_type n);
difference_type operator - (const const_iterator2 &amp;it) const;
// Dereference
reference operator * () const;
const_iterator1 begin () const;
const_iterator1 end () const;
const_reverse_iterator1 rbegin () const;
const_reverse_iterator1 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
const_iterator2 &amp;operator = (const const_iterator2 &amp;it);
// Comparison
bool operator == (const const_iterator2 &amp;it) const;
bool operator &lt; (const const_iterator2 &amp;it) const;
};
const_iterator2 begin2 () const;
const_iterator2 end2 () const;
class iterator2:
public container_reference&lt;hermitian_matrix&gt;,
public random_access_iterator_base&lt;iterator2, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_matrix::difference_type difference_type;
typedef typename hermitian_matrix::value_type value_type;
typedef typename hermitian_matrix::reference reference;
typedef typename hermitian_matrix::pointer pointer;
typedef iterator1 dual_iterator_type;
typedef reverse_iterator1 dual_reverse_iterator_type;
// Construction and destruction
iterator2 ();
iterator2 (hermitian_matrix &amp;m, size_type it1, size_type it2);
// Arithmetic
iterator2 &amp;operator ++ ();
iterator2 &amp;operator -- ();
iterator2 &amp;operator += (difference_type n);
iterator2 &amp;operator -= (difference_type n);
difference_type operator - (const iterator2 &amp;it) const;
// Dereference
reference operator * () const;
iterator1 begin () const;
iterator1 end () const;
reverse_iterator1 rbegin () const;
reverse_iterator1 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
iterator2 &amp;operator = (const iterator2 &amp;it);
// Comparison
bool operator == (const iterator2 &amp;it) const;
bool operator &lt; (const iterator2 &amp;it) const;
};
iterator2 begin2 ();
iterator2 end2 ();
// Reverse iterators
const_reverse_iterator1 rbegin1 () const;
const_reverse_iterator1 rend1 () const;
reverse_iterator1 rbegin1 ();
reverse_iterator1 rend1 ();
const_reverse_iterator2 rbegin2 () const;
const_reverse_iterator2 rend2 () const;
reverse_iterator2 rbegin2 ();
reverse_iterator2 rend2 ();
};</code></pre>
<h2><a name="hermitian_adaptor"></a>Hermitian Adaptor</h2>
<h4>Description</h4>
<p>The templated class <code>hermitian_adaptor&lt;M, F&gt; </code>is
a hermitian matrix adaptor for other matrices.</p>
<h4>Example</h4>
<pre>int main () {
using namespace boost::numeric::ublas;
matrix&lt;std::complex&lt;double&gt; &gt; m (3, 3);
hermitian_adaptor&lt;matrix&lt;std::complex&lt;double&gt; &gt;, lower&gt; hal (m);
for (int i = 0; i &lt; hal.size1 (); ++ i)
for (int j = 0; j &lt;= i; ++ j)
hal (i, j) = std::complex&lt;double&gt; (3 * i + j, 3 * i + j);
std::cout &lt;&lt; hal &lt;&lt; std::endl;
hermitian_adaptor&lt;matrix&lt;std::complex&lt;double&gt; &gt;, upper&gt; hau (m);
for (int i = 0; i &lt; hau.size1 (); ++ i)
for (int j = i; j &lt; hau.size2 (); ++ j)
hau (i, j) = std::complex&lt;double&gt; (3 * i + j, 3 * i + j);
std::cout &lt;&lt; sau &lt;&lt; std::endl;
}</pre>
<h4>Definition</h4>
<p>Defined in the header hermitian.hpp.</p>
<h4>Template parameters</h4>
<table border="1">
<tr>
<th>Parameter </th>
<th>Description </th>
<th>Default </th>
</tr>
<tr>
<td><code>M</code></td>
<td>The type of the adapted matrix.</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>F</code></td>
<td>Functor describing the type of the hermitian adaptor.
<a href="#hermitian_adaptor_1">[1]</a></td>
<td><code>lower</code></td>
</tr>
</table>
<h4>Model of</h4>
<p><a href="expression.htm#matrix_expression">Matrix Expression</a>.
</p>
<h4>Type requirements</h4>
<p>None, except for those imposed by the requirements of <a
href="expression.htm#matrix_expression">Matrix Expression</a>.</p>
<h4>Public base classes</h4>
<p><code>matrix_expression&lt;hermitian_adaptor&lt;M, F&gt; &gt;</code>
</p>
<h4>Members</h4>
<table border="1">
<tr>
<th>Member </th>
<th>Description </th>
</tr>
<tr>
<td><code>hermitian_adaptor ()</code> </td>
<td>Constructs a <code>hermitian_adaptor</code> that
holds zero rows of zero elements.</td>
</tr>
<tr>
<td><code>hermitian_adaptor (matrix_type &amp;data)</code></td>
<td>Constructs a <code>hermitian_adaptor</code> of a
matrix.</td>
</tr>
<tr>
<td><code>hermitian_adaptor (const hermitian_adaptor
&amp;m)</code></td>
<td>The copy constructor.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor (const matrix_expression&lt;AE&gt;
&amp;ae)</code></td>
<td>The extended copy constructor.</td>
</tr>
<tr>
<td><code>size_type size1 () const</code></td>
<td>Returns the number of rows. </td>
</tr>
<tr>
<td><code>size_type size2 () const</code></td>
<td>Returns the number of columns. </td>
</tr>
<tr>
<td><code>const_reference operator () (size_type i,
size_type j) const</code></td>
<td>Returns a <code>const</code> reference of the <code>j</code>-th
element in the <code>i</code>-th row. </td>
</tr>
<tr>
<td><code>reference operator () (size_type i, size_type
j)</code></td>
<td>Returns a reference of the <code>j</code>-th element
in the <code>i</code>-th row. </td>
</tr>
<tr>
<td><code>hermitian_adaptor &amp;operator = (const
hermitian_adaptor &amp;m)</code></td>
<td>The assignment operator.</td>
</tr>
<tr>
<td><code>hermitian_adaptor &amp;assign_temporary
(hermitian_adaptor &amp;m)</code></td>
<td>Assigns a temporary. May change the hermitian adaptor
<code>m</code>.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor &amp;operator = (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>The extended assignment operator.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor &amp;assign (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>Assigns a matrix expression to the hermitian adaptor.
Left and right hand side of the assignment should be
independent.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor &amp;operator += (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>A computed assignment operator. Adds the matrix
expression to the hermitian adaptor.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor &amp;plus_assign (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>Adds a matrix expression to the hermitian adaptor.
Left and right hand side of the assignment should be
independent.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor &amp;operator -= (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>A computed assignment operator. Subtracts the matrix
expression from the hermitian adaptor.</td>
</tr>
<tr>
<td><code>template&lt;class AE&gt;<br>
hermitian_adaptor &amp;minus_assign (const
matrix_expression&lt;AE&gt; &amp;ae)</code></td>
<td>Subtracts a matrix expression from the hermitian
adaptor. Left and right hand side of the assignment
should be independent.</td>
</tr>
<tr>
<td><code>template&lt;class AT&gt;<br>
hermitian_adaptor &amp;operator *= (const AT &amp;at)</code></td>
<td>A computed assignment operator. Multiplies the
hermitian adaptor with a scalar.</td>
</tr>
<tr>
<td><code>template&lt;class AT&gt;<br>
hermitian_adaptor &amp;operator /= (const AT &amp;at)</code></td>
<td>A computed assignment operator. Divides the hermitian
adaptor through a scalar.</td>
</tr>
<tr>
<td><code>void swap (hermitian_adaptor &amp;m)</code></td>
<td>Swaps the contents of the hermitian adaptors. </td>
</tr>
<tr>
<td><code>const_iterator1 begin1 () const</code></td>
<td>Returns a <code>const_iterator1</code> pointing to
the beginning of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>const_iterator1 end1 () const</code></td>
<td>Returns a <code>const_iterator1</code> pointing to
the end of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>iterator1 begin1 () </code></td>
<td>Returns a <code>iterator1</code> pointing to the
beginning of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>iterator1 end1 () </code></td>
<td>Returns a <code>iterator1</code> pointing to the end
of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>const_iterator2 begin2 () const</code></td>
<td>Returns a <code>const_iterator2</code> pointing to
the beginning of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>const_iterator2 end2 () const</code></td>
<td>Returns a <code>const_iterator2</code> pointing to
the end of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>iterator2 begin2 () </code></td>
<td>Returns a <code>iterator2</code> pointing to the
beginning of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>iterator2 end2 () </code></td>
<td>Returns a <code>iterator2</code> pointing to the end
of the <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>const_reverse_iterator1 rbegin1 () const</code></td>
<td>Returns a <code>const_reverse_iterator1</code>
pointing to the beginning of the reversed <code>hermitian_adaptor</code>.
</td>
</tr>
<tr>
<td><code>const_reverse_iterator1 rend1 () const</code></td>
<td>Returns a <code>const_reverse_iterator1</code>
pointing to the end of the reversed <code>hermitian_adaptor</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator1 rbegin1 () </code></td>
<td>Returns a <code>reverse_iterator1</code> pointing to
the beginning of the reversed <code>hermitian_adaptor</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator1 rend1 () </code></td>
<td>Returns a <code>reverse_iterator1</code> pointing to
the end of the reversed <code>hermitian_adaptor</code>. </td>
</tr>
<tr>
<td><code>const_reverse_iterator2 rbegin2 () const</code></td>
<td>Returns a <code>const_reverse_iterator2</code>
pointing to the beginning of the reversed <code>hermitian_adaptor</code>.
</td>
</tr>
<tr>
<td><code>const_reverse_iterator2 rend2 () const</code></td>
<td>Returns a <code>const_reverse_iterator2</code>
pointing to the end of the reversed <code>hermitian_adaptor</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator2 rbegin2 () </code></td>
<td>Returns a <code>reverse_iterator2</code> pointing to
the beginning of the reversed <code>hermitian_adaptor</code>.
</td>
</tr>
<tr>
<td><code>reverse_iterator2 rend2 () </code></td>
<td>Returns a <code>reverse_iterator2</code> pointing to
the end of the reversed <code>hermitian_adaptor</code>. </td>
</tr>
</table>
<h4>Notes</h4>
<p><a name="#hermitian_adaptor_1">[1]</a> Supported parameters
for the type of the hermitian adaptor are <code>lower</code> and <code>upper</code>.</p>
<h4>Interface</h4>
<pre><code> // Hermitian matrix adaptor class
template&lt;class M, class F&gt;
class hermitian_adaptor:
public matrix_expression&lt;hermitian_adaptor&lt;M, F&gt; &gt; {
public:
typedef const M const_matrix_type;
typedef M matrix_type;
typedef F functor_type;
typedef typename M::size_type size_type;
typedef typename M::difference_type difference_type;
typedef typename M::value_type value_type;
typedef typename M::value_type const_reference;
typedef typename M::reference reference;
typedef typename M::const_pointer const_pointer;
typedef typename M::pointer pointer;
typedef const hermitian_adaptor&lt;M, F&gt; const_self_type;
typedef hermitian_adaptor&lt;M, F&gt; self_type;
typedef const matrix_const_reference&lt;const_self_type&gt; const_closure_type;
typedef matrix_reference&lt;self_type&gt; closure_type;
typedef typename storage_restrict_traits&lt;typename M::storage_category,
packed_proxy_tag&gt;::storage_category storage_category;
typedef typename F::packed_category packed_category;
typedef typename M::orientation_category orientation_category;
// Construction and destruction
hermitian_adaptor ();
hermitian_adaptor (matrix_type &amp;data);
hermitian_adaptor (const hermitian_adaptor &amp;m);
// Accessors
size_type size1 () const;
size_type size2 () const;
const_matrix_type &amp;data () const;
matrix_type &amp;data ();
// Element access
const_reference operator () (size_type i, size_type j) const;
reference operator () (size_type i, size_type j);
// Assignment
hermitian_adaptor &amp;operator = (const hermitian_adaptor &amp;m);
hermitian_adaptor &amp;assign_temporary (hermitian_adaptor &amp;m);
template&lt;class AE&gt;
hermitian_adaptor &amp;operator = (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_adaptor &amp;assign (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_adaptor&amp; operator += (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_adaptor &amp;plus_assign (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_adaptor&amp; operator -= (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AE&gt;
hermitian_adaptor &amp;minus_assign (const matrix_expression&lt;AE&gt; &amp;ae);
template&lt;class AT&gt;
hermitian_adaptor&amp; operator *= (const AT &amp;at);
template&lt;class AT&gt;
hermitian_adaptor&amp; operator /= (const AT &amp;at);
// Swapping
void swap (hermitian_adaptor &amp;m);
friend void swap (hermitian_adaptor &amp;m1, hermitian_adaptor &amp;m2);
class const_iterator1;
class iterator1;
class const_iterator2;
class iterator2;
typedef reverse_iterator_base1&lt;const_iterator1&gt; const_reverse_iterator1;
typedef reverse_iterator_base1&lt;iterator1&gt; reverse_iterator1;
typedef reverse_iterator_base2&lt;const_iterator2&gt; const_reverse_iterator2;
typedef reverse_iterator_base2&lt;iterator2&gt; reverse_iterator2;
// Element lookup
const_iterator1 find_first1 (int rank, size_type i, size_type j) const;
iterator1 find_first1 (int rank, size_type i, size_type j);
const_iterator1 find_last1 (int rank, size_type i, size_type j) const;
iterator1 find_last1 (int rank, size_type i, size_type j);
const_iterator2 find_first2 (int rank, size_type i, size_type j) const;
iterator2 find_first2 (int rank, size_type i, size_type j);
const_iterator2 find_last2 (int rank, size_type i, size_type j) const;
iterator2 find_last2 (int rank, size_type i, size_type j);
// Iterators simply are indices.
class const_iterator1:
public container_const_reference&lt;hermitian_adaptor&gt;,
public random_access_iterator_base&lt;const_iterator1, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_adaptor::difference_type difference_type;
typedef typename hermitian_adaptor::value_type value_type;
typedef typename hermitian_adaptor::const_reference reference;
typedef typename hermitian_adaptor::const_pointer pointer;
typedef const_iterator2 dual_iterator_type;
typedef const_reverse_iterator2 dual_reverse_iterator_type;
// Construction and destruction
const_iterator1 ();
const_iterator1 (const hermitian_adaptor &amp;m, size_type it1, size_type it2);
const_iterator1 (const iterator1 &amp;it);
// Arithmetic
const_iterator1 &amp;operator ++ ();
const_iterator1 &amp;operator -- ();
const_iterator1 &amp;operator += (difference_type n);
const_iterator1 &amp;operator -= (difference_type n);
difference_type operator - (const const_iterator1 &amp;it) const;
// Dereference
reference operator * () const;
const_iterator2 begin () const;
const_iterator2 end () const;
const_reverse_iterator2 rbegin () const;
const_reverse_iterator2 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
const_iterator1 &amp;operator = (const const_iterator1 &amp;it);
// Comparison
bool operator == (const const_iterator1 &amp;it) const;
bool operator &lt; (const const_iterator1 &amp;it) const;
};
const_iterator1 begin1 () const;
const_iterator1 end1 () const;
class iterator1:
public container_reference&lt;hermitian_adaptor&gt;,
public random_access_iterator_base&lt;iterator1, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_adaptor::difference_type difference_type;
typedef typename hermitian_adaptor::value_type value_type;
typedef typename hermitian_adaptor::reference reference;
typedef typename hermitian_adaptor::pointer pointer;
typedef iterator2 dual_iterator_type;
typedef reverse_iterator2 dual_reverse_iterator_type;
// Construction and destruction
iterator1 ();
iterator1 (hermitian_adaptor &amp;m, size_type it1, size_type it2);
// Arithmetic
iterator1 &amp;operator ++ ();
iterator1 &amp;operator -- ();
iterator1 &amp;operator += (difference_type n);
iterator1 &amp;operator -= (difference_type n);
difference_type operator - (const iterator1 &amp;it) const;
// Dereference
reference operator * () const;
iterator2 begin () const;
iterator2 end () const;
reverse_iterator2 rbegin () const;
reverse_iterator2 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
iterator1 &amp;operator = (const iterator1 &amp;it);
// Comparison
bool operator == (const iterator1 &amp;it) const;
bool operator &lt; (const iterator1 &amp;it) const;
};
iterator1 begin1 ();
iterator1 end1 ();
class const_iterator2:
public container_const_reference&lt;hermitian_adaptor&gt;,
public random_access_iterator_base&lt;const_iterator2, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_adaptor::difference_type difference_type;
typedef typename hermitian_adaptor::value_type value_type;
typedef typename hermitian_adaptor::const_reference reference;
typedef typename hermitian_adaptor::const_pointer pointer;
typedef const_iterator1 dual_iterator_type;
typedef const_reverse_iterator1 dual_reverse_iterator_type;
// Construction and destruction
const_iterator2 ();
const_iterator2 (const hermitian_adaptor &amp;m, size_type it1, size_type it2);
const_iterator2 (const iterator2 &amp;it);
// Arithmetic
const_iterator2 &amp;operator ++ ();
const_iterator2 &amp;operator -- ();
const_iterator2 &amp;operator += (difference_type n);
const_iterator2 &amp;operator -= (difference_type n);
difference_type operator - (const const_iterator2 &amp;it) const;
// Dereference
reference operator * () const;
const_iterator1 begin () const;
const_iterator1 end () const;
const_reverse_iterator1 rbegin () const;
const_reverse_iterator1 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
const_iterator2 &amp;operator = (const const_iterator2 &amp;it);
// Comparison
bool operator == (const const_iterator2 &amp;it) const;
bool operator &lt; (const const_iterator2 &amp;it) const;
};
const_iterator2 begin2 () const;
const_iterator2 end2 () const;
class iterator2:
public container_reference&lt;hermitian_adaptor&gt;,
public random_access_iterator_base&lt;iterator2, value_type&gt; {
public:
typedef packed_random_access_iterator_tag iterator_category;
typedef typename hermitian_adaptor::difference_type difference_type;
typedef typename hermitian_adaptor::value_type value_type;
typedef typename hermitian_adaptor::reference reference;
typedef typename hermitian_adaptor::pointer pointer;
typedef iterator1 dual_iterator_type;
typedef reverse_iterator1 dual_reverse_iterator_type;
// Construction and destruction
iterator2 ();
iterator2 (hermitian_adaptor &amp;m, size_type it1, size_type it2);
// Arithmetic
iterator2 &amp;operator ++ ();
iterator2 &amp;operator -- ();
iterator2 &amp;operator += (difference_type n);
iterator2 &amp;operator -= (difference_type n);
difference_type operator - (const iterator2 &amp;it) const;
// Dereference
reference operator * () const;
iterator1 begin () const;
iterator1 end () const;
reverse_iterator1 rbegin () const;
reverse_iterator1 rend () const;
// Indices
size_type index1 () const;
size_type index2 () const;
// Assignment
iterator2 &amp;operator = (const iterator2 &amp;it);
// Comparison
bool operator == (const iterator2 &amp;it) const;
bool operator &lt;(const iterator2 &amp;it) const;
};
iterator2 begin2 ();
iterator2 end2 ();
// Reverse iterators
const_reverse_iterator1 rbegin1 () const;
const_reverse_iterator1 rend1 () const;
reverse_iterator1 rbegin1 ();
reverse_iterator1 rend1 ();
const_reverse_iterator2 rbegin2 () const;
const_reverse_iterator2 rend2 () const;
reverse_iterator2 rbegin2 ();
reverse_iterator2 rend2 ();
};</code></pre>
<hr>
<p>Copyright (<28>) 2000-2002 Joerg Walter, Mathias Koch <br>
Permission to copy, use, modify, sell and distribute this
document is granted provided this copyright notice appears in all
copies. This document is provided ``as is'' without express or
implied warranty, and with no claim as to its suitability for any
purpose.</p>
<p>Last revised: 8/3/2002</p>
</body>
</html>