| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta name="generator" content= |
| "HTML Tidy for Linux/x86 (vers 1st March 2004), see www.w3.org" /> |
| <meta http-equiv="Content-Type" content= |
| "text/html; charset=us-ascii" /> |
| <link rel="stylesheet" href="../../../../boost.css" type="text/css"/> |
| <link rel="stylesheet" href="ublas.css" type="text/css" /> |
| <script type="text/javascript" src="js/jquery-1.3.2.min.js" async="async" ></script> |
| <script type="text/javascript" src="js/jquery.toc-gw.js" async="async" ></script> |
| <title>Matrix</title> |
| </head> |
| <body> |
| <h1><img src="../../../../boost.png" align="middle" />Matrix</h1> |
| <div class="toc" id="toc"></div> |
| <h2><a name="matrix"></a>Matrix</h2> |
| <h4>Description</h4> |
| <p>The templated class <code>matrix<T, F, A></code> is the |
| base container adaptor for dense matrices. For a <em>(m x |
| n</em>)-dimensional matrix and <em>0 <= i < m</em>, <em>0 |
| <= j < n</em> every element <em>m</em><sub><em>i, |
| j</em></sub> is mapped to the <em>(i x n + j)-</em>th element of |
| the container for row major orientation or the <em>(i + j x |
| m)-</em>th element of the container for column major |
| orientation.</p> |
| <h4>Example</h4> |
| <pre> |
| #include <boost/numeric/ublas/matrix.hpp> |
| #include <boost/numeric/ublas/io.hpp> |
| |
| int main () { |
| using namespace boost::numeric::ublas; |
| matrix<double> m (3, 3); |
| for (unsigned i = 0; i < m.size1 (); ++ i) |
| for (unsigned j = 0; j < m.size2 (); ++ j) |
| m (i, j) = 3 * i + j; |
| std::cout << m << std::endl; |
| } |
| </pre> |
| <h4>Definition</h4> |
| <p>Defined in the header matrix.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>T</code></td> |
| <td>The type of object stored in the matrix.</td> |
| <td></td> |
| </tr> |
| <tr> |
| <td><code>F</code></td> |
| <td>Functor describing the storage organization. <a href= |
| "#matrix_1">[1]</a></td> |
| <td><code>row_major</code></td> |
| </tr> |
| <tr> |
| <td><code>A</code></td> |
| <td>The type of the <a href="storage_concept.htm">Storage</a> array. <a href="#matrix_2">[2]</a></td> |
| <td><code>unbounded_array<T></code></td> |
| </tr> |
| </tbody> |
| </table> |
| <h4>Model of</h4> |
| <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Type requirements</h4> |
| <p>None, except for those imposed by the requirements of <a href= |
| "container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Public base classes</h4> |
| <p><code>matrix_container<matrix<T, F, A> ></code></p> |
| <h4>Members</h4> |
| <table border="1" summary="members"> |
| <tbody> |
| <tr> |
| <th>Member</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td><code>matrix ()</code></td> |
| <td>Allocates an uninitialized <code>matrix</code> that holds zero |
| rows of zero elements.</td> |
| </tr> |
| <tr> |
| <td><code>matrix (size_type size1, size_type size2)</code></td> |
| <td>Allocates an uninitialized <code>matrix</code> that holds |
| <code>size1</code> rows of <code>size2</code> elements.</td> |
| </tr> |
| <tr> |
| <td><code>matrix (const matrix &m)</code></td> |
| <td>The copy constructor.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix (const matrix_expression<AE> &ae)</code></td> |
| <td>The extended copy constructor.</td> |
| </tr> |
| <tr> |
| <td><code>void resize (size_type size1, size_type size2, bool |
| preserve = true)</code></td> |
| <td>Reallocates a <code>matrix</code> to hold <code>size1</code> |
| rows of <code>size2</code> elements. The existing elements of the |
| <code>matrix</code> are preseved when specified.</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 array_type& data () const</code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td><code>array_type& data ()</code></td> |
| <td></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>matrix &operator = (const matrix &m)</code></td> |
| <td>The assignment operator.</td> |
| </tr> |
| <tr> |
| <td><code>matrix &assign_temporary (matrix &m)</code></td> |
| <td>Assigns a temporary. May change the matrix <code>m</code>.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix &operator = (const matrix_expression<AE> |
| &ae)</code></td> |
| <td>The extended assignment operator.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix &assign (const matrix_expression<AE> |
| &ae)</code></td> |
| <td>Assigns a matrix expression to the matrix. Left and right hand |
| side of the assignment should be independent.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix &operator += (const matrix_expression<AE> |
| &ae)</code></td> |
| <td>A computed assignment operator. Adds the matrix expression to |
| the matrix.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix &plus_assign (const matrix_expression<AE> |
| &ae)</code></td> |
| <td>Adds a matrix expression to the matrix. Left and right hand |
| side of the assignment should be independent.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix &operator -= (const matrix_expression<AE> |
| &ae)</code></td> |
| <td>A computed assignment operator. Subtracts the matrix expression |
| from the matrix.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AE><br /> |
| matrix &minus_assign (const matrix_expression<AE> |
| &ae)</code></td> |
| <td>Subtracts a matrix expression from the matrix. Left and right |
| hand side of the assignment should be independent.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AT><br /> |
| matrix &operator *= (const AT &at)</code></td> |
| <td>A computed assignment operator. Multiplies the matrix with a |
| scalar.</td> |
| </tr> |
| <tr> |
| <td><code>template<class AT><br /> |
| matrix &operator /= (const AT &at)</code></td> |
| <td>A computed assignment operator. Divides the matrix through a |
| scalar.</td> |
| </tr> |
| <tr> |
| <td><code>void swap (matrix &m)</code></td> |
| <td>Swaps the contents of the matrices.</td> |
| </tr> |
| <tr> |
| <td><code>void insert_element (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_element (size_type i, size_type j)</code></td> |
| <td>Erases the value at the <code>j</code>-th element 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>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>matrix</code>.</td> |
| </tr> |
| <tr> |
| <td><code>iterator1 begin1 ()</code></td> |
| <td>Returns a <code>iterator1</code> pointing to the beginning of |
| the <code>matrix</code>.</td> |
| </tr> |
| <tr> |
| <td><code>iterator1 end1 ()</code></td> |
| <td>Returns a <code>iterator1</code> pointing to the end of the |
| <code>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>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>matrix</code>.</td> |
| </tr> |
| <tr> |
| <td><code>iterator2 begin2 ()</code></td> |
| <td>Returns a <code>iterator2</code> pointing to the beginning of |
| the <code>matrix</code>.</td> |
| </tr> |
| <tr> |
| <td><code>iterator2 end2 ()</code></td> |
| <td>Returns a <code>iterator2</code> pointing to the end of the |
| <code>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>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>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>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>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>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>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>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>matrix</code>.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h4>Notes</h4> |
| <p><a name="matrix_1">[1]</a> Supported parameters |
| for the storage organization are <code>row_major</code> and |
| <code>column_major</code>.</p> |
| <p><a name="matrix_2">[2]</a> Common parameters |
| for the storage array are <code>unbounded_array<T></code> , |
| <code>bounded_array<T></code> and |
| <code>std::vector<T></code> .</p> |
| <h2><a name="identity_matrix"></a>Identity Matrix</h2> |
| <h4>Description</h4> |
| <p>The templated class <code>identity_matrix<T, ALLOC></code> |
| represents identity matrices. For a <em>(m x n</em>)-dimensional |
| identity matrix and <em>0 <= i < m</em>, <em>0 <= j < |
| n</em> holds <em>id</em><sub><em>i, j</em></sub> <em>= 0</em>, if |
| <em>i <> j</em>, and <em>id</em><sub><em>i, i</em></sub><em>= |
| 1</em>.</p> |
| <h4>Example</h4> |
| <pre> |
| #include <boost/numeric/ublas/matrix.hpp> |
| #include <boost/numeric/ublas/io.hpp> |
| |
| int main () { |
| using namespace boost::numeric::ublas; |
| identity_matrix<double> m (3); |
| std::cout << m << std::endl; |
| } |
| </pre> |
| <h4>Definition</h4> |
| <p>Defined in the header matrix.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>T</code></td> |
| <td>The type of object stored in the matrix.</td> |
| <td><code>int</code></td> |
| </tr> |
| <tr> |
| <td><code>ALLOC</code></td> |
| <td>An STL Allocator for size_type and difference_type.</td> |
| <td>std::allocator</td> |
| </tr> |
| </tbody> |
| </table> |
| <h4>Model of</h4> |
| <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Type requirements</h4> |
| <p>None, except for those imposed by the requirements of |
| <a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Public base classes</h4> |
| <p><code>matrix_container<identity_matrix<T> |
| ></code></p> |
| <h4>Members</h4> |
| <table border="1" summary="members"> |
| <tbody> |
| <tr> |
| <th>Member</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td><code>identity_matrix ()</code></td> |
| <td>Constructs an <code>identity_matrix</code> that holds zero rows |
| of zero elements.</td> |
| </tr> |
| <tr> |
| <td><code>identity_matrix (size_type size)</code></td> |
| <td>Constructs an <code>identity_matrix</code> that holds |
| <code>size</code> rows of <code>size</code> elements.</td> |
| </tr> |
| <tr> |
| <td><code>identity_matrix (const identity_matrix |
| &m)</code></td> |
| <td>The copy constructor.</td> |
| </tr> |
| <tr> |
| <td><code>void resize (size_type size, bool preserve = |
| true)</code></td> |
| <td>Resizes a <code>identity_matrix</code> to hold |
| <code>size</code> rows of <code>size</code> elements. Therefore the |
| existing elements of the <code>itendity_matrix</code> are always |
| preseved.</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 the value of the <code>j</code>-th element in the |
| <code>i</code>-th row.</td> |
| </tr> |
| <tr> |
| <td><code>identity_matrix &operator = (const identity_matrix |
| &m)</code></td> |
| <td>The assignment operator.</td> |
| </tr> |
| <tr> |
| <td><code>identity_matrix &assign_temporary (identity_matrix |
| &m)</code></td> |
| <td>Assigns a temporary. May change the identity matrix |
| <code>m</code> .</td> |
| </tr> |
| <tr> |
| <td><code>void swap (identity_matrix &m)</code></td> |
| <td>Swaps the contents of the identity matrices.</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>identity_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>identity_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>identity_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>identity_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>identity_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>identity_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>identity_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>identity_matrix</code>.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h2><a name="zero_matrix"></a>Zero Matrix</h2> |
| <h4>Description</h4> |
| <p>The templated class <code>zero_matrix<T, ALLOC></code> represents |
| zero matrices. For a <em>(m x n</em>)-dimensional zero matrix and |
| <em>0 <= i < m</em>, <em>0 <= j < n</em> holds |
| <em>z</em><sub><em>i, j</em></sub> <em>= 0</em>.</p> |
| <h4>Example</h4> |
| <pre> |
| #include <boost/numeric/ublas/matrix.hpp> |
| #include <boost/numeric/ublas/io.hpp> |
| |
| int main () { |
| using namespace boost::numeric::ublas; |
| zero_matrix<double> m (3, 3); |
| std::cout << m << std::endl; |
| } |
| </pre> |
| <h4>Definition</h4> |
| <p>Defined in the header matrix.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>T</code></td> |
| <td>The type of object stored in the matrix.</td> |
| <td><code>int</code></td> |
| </tr> |
| <tr> |
| <td><code>ALLOC</code></td> |
| <td>An STL Allocator for size_type and difference_type.</td> |
| <td>std::allocator</td> |
| </tr> |
| </tbody> |
| </table> |
| <h4>Model of</h4> |
| <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Type requirements</h4> |
| <p>None, except for those imposed by the requirements of |
| <a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Public base classes</h4> |
| <p><code>matrix_container<zero_matrix<T> ></code></p> |
| <h4>Members</h4> |
| <table border="1" summary="members"> |
| <tbody> |
| <tr> |
| <th>Member</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td><code>zero_matrix ()</code></td> |
| <td>Constructs a <code>zero_matrix</code> that holds zero rows of |
| zero elements.</td> |
| </tr> |
| <tr> |
| <td><code>zero_matrix (size_type size1, size_type |
| size2)</code></td> |
| <td>Constructs a <code>zero_matrix</code> that holds |
| <code>size1</code> rows of <code>size2</code> elements.</td> |
| </tr> |
| <tr> |
| <td><code>zero_matrix (const zero_matrix &m)</code></td> |
| <td>The copy constructor.</td> |
| </tr> |
| <tr> |
| <td><code>void resize (size_type size1, size_type size2, bool |
| preserve = true)</code></td> |
| <td>Resizes a <code>zero_matrix</code> to hold <code>size1</code> |
| rows of <code>size2</code> elements. Therefore the existing |
| elements of the <code>zero_matrix</code> are always preseved.</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 the value of the <code>j</code>-th element in the |
| <code>i</code>-th row.</td> |
| </tr> |
| <tr> |
| <td><code>zero_matrix &operator = (const zero_matrix |
| &m)</code></td> |
| <td>The assignment operator.</td> |
| </tr> |
| <tr> |
| <td><code>zero_matrix &assign_temporary (zero_matrix |
| &m)</code></td> |
| <td>Assigns a temporary. May change the zero matrix <code>m</code> |
| .</td> |
| </tr> |
| <tr> |
| <td><code>void swap (zero_matrix &m)</code></td> |
| <td>Swaps the contents of the zero matrices.</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>zero_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>zero_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>zero_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>zero_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>zero_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>zero_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>zero_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>zero_matrix</code>.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h2><a name="scalar_matrix"></a>Scalar Matrix</h2> |
| <h4>Description</h4> |
| <p>The templated class <code>scalar_matrix<T, ALLOC></code> |
| represents scalar matrices. For a <em>(m x n</em>)-dimensional |
| scalar matrix and <em>0 <= i < m</em>, <em>0 <= j < |
| n</em> holds <em>z</em><sub><em>i, j</em></sub> <em>= s</em>.</p> |
| <h4>Example</h4> |
| <pre> |
| #include <boost/numeric/ublas/matrix.hpp> |
| #include <boost/numeric/ublas/io.hpp> |
| |
| int main () { |
| using namespace boost::numeric::ublas; |
| scalar_matrix<double> m (3, 3); |
| std::cout << m << std::endl; |
| } |
| </pre> |
| <h4>Definition</h4> |
| <p>Defined in the header matrix.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>T</code></td> |
| <td>The type of object stored in the matrix.</td> |
| <td><code>int</code></td> |
| </tr> |
| <tr> |
| <td><code>ALLOC</code></td> |
| <td>An STL Allocator for size_type and difference_type.</td> |
| <td>std::allocator</td> |
| </tr> |
| </tbody> |
| </table> |
| <h4>Model of</h4> |
| <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Type requirements</h4> |
| <p>None, except for those imposed by the requirements of |
| <a href="container_concept.htm#matrix">Matrix</a> .</p> |
| <h4>Public base classes</h4> |
| <p><code>matrix_container<scalar_matrix<T> |
| ></code></p> |
| <h4>Members</h4> |
| <table border="1" summary="members"> |
| <tbody> |
| <tr> |
| <th>Member</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td><code>scalar_matrix ()</code></td> |
| <td>Constructs a <code>scalar_matrix</code> that holds scalar rows |
| of zero elements.</td> |
| </tr> |
| <tr> |
| <td><code>scalar_matrix (size_type size1, size_type size2, const |
| value_type &value)</code></td> |
| <td>Constructs a <code>scalar_matrix</code> that holds |
| <code>size1</code> rows of <code>size2</code> elements each of the |
| specified value.</td> |
| </tr> |
| <tr> |
| <td><code>scalar_matrix (const scalar_matrix &m)</code></td> |
| <td>The copy constructor.</td> |
| </tr> |
| <tr> |
| <td><code>void resize (size_type size1, size_type size2, bool |
| preserve = true)</code></td> |
| <td>Resizes a <code>scalar_matrix</code> to hold <code>size1</code> |
| rows of <code>size2</code> elements. Therefore the existing |
| elements of the <code>scalar_matrix</code> are always |
| preseved.</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 the value of the <code>j</code>-th element in the |
| <code>i</code>-th row.</td> |
| </tr> |
| <tr> |
| <td><code>scalar_matrix &operator = (const scalar_matrix |
| &m)</code></td> |
| <td>The assignment operator.</td> |
| </tr> |
| <tr> |
| <td><code>scalar_matrix &assign_temporary (scalar_matrix |
| &m)</code></td> |
| <td>Assigns a temporary. May change the scalar matrix |
| <code>m</code> .</td> |
| </tr> |
| <tr> |
| <td><code>void swap (scalar_matrix &m)</code></td> |
| <td>Swaps the contents of the scalar matrices.</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>scalar_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>scalar_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>scalar_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>scalar_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>scalar_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>scalar_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>scalar_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>scalar_matrix</code>.</td> |
| </tr> |
| </tbody> |
| </table> |
| <hr /> |
| <p>Copyright (©) 2000-2002 Joerg Walter, Mathias Koch<br /> |
| Use, modification and distribution are subject to the |
| Boost Software License, Version 1.0. |
| (See accompanying file LICENSE_1_0.txt |
| or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"> |
| http://www.boost.org/LICENSE_1_0.txt |
| </a>). |
| </p> |
| <script type="text/javascript"> |
| (function($) { |
| $('#toc').toc(); |
| })(jQuery); |
| </script> |
| </body> |
| </html> |