| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|---|
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 4 | <head> |
|---|
| 5 | <meta name="generator" content= |
|---|
| 6 | "HTML Tidy for Linux/x86 (vers 1st March 2004), see www.w3.org" /> |
|---|
| 7 | <meta http-equiv="Content-Type" content= |
|---|
| 8 | "text/html; charset=us-ascii" /> |
|---|
| 9 | <link href="ublas.css" type="text/css" /> |
|---|
| 10 | <title>Sparse Matrix</title> |
|---|
| 11 | </head> |
|---|
| 12 | <body> |
|---|
| 13 | <h1><img src="../../../../boost.png" align="middle" /> |
|---|
| 14 | Sparse Matricies</h1> |
|---|
| 15 | <h2><a name="mapped_matrix" id="mapped_matrix"></a>Mapped Matrix</h2> |
|---|
| 16 | <h4>Description</h4> |
|---|
| 17 | <p>The templated class <code>mapped_matrix<T, F, A></code> is |
|---|
| 18 | the base container adaptor for sparse matricies using element maps. |
|---|
| 19 | For a <em>(m xn</em>)-dimensional sparse matrix and <em>0 <= i < m</em>, |
|---|
| 20 | <em>0 <= j < n</em> the non-zero elements |
|---|
| 21 | <em>m</em><sub><em>i, j</em></sub> are mapped via <em>(i x n + |
|---|
| 22 | j)</em> for row major orientation or via <em>(i + j x m)</em> for |
|---|
| 23 | column major orientation to consecutive elements of the associative |
|---|
| 24 | container, i.e. for elements <em>k</em> = |
|---|
| 25 | <em>m</em><sub><em>i</em></sub><sub><sub><em>1</em></sub></sub><sub> |
|---|
| 26 | <em>,j</em></sub><sub><sub><em>1</em></sub></sub>and <em>k + 1 = |
|---|
| 27 | m</em><sub><em>i</em></sub><sub><sub><em>2</em></sub></sub><sub><em> |
|---|
| 28 | ,j</em></sub><sub><sub><em>2</em></sub></sub>of the container holds |
|---|
| 29 | <em>i</em><sub><em>1</em></sub> <em>< |
|---|
| 30 | i</em><sub><em>2</em></sub> or <em>(i</em><sub><em>1</em></sub> |
|---|
| 31 | <em>= i</em><sub><em>2</em></sub> and |
|---|
| 32 | <em>j</em><sub><em>1</em></sub> <em>< |
|---|
| 33 | j</em><sub><em>2</em></sub><em>)</em> with row major orientation or |
|---|
| 34 | <em>j</em><sub><em>1</em></sub> <em>< |
|---|
| 35 | j</em><sub><em>2</em></sub> or <em>(j</em><sub><em>1</em></sub> |
|---|
| 36 | <em>= j</em><sub><em>2</em></sub> and |
|---|
| 37 | <em>i</em><sub><em>1</em></sub> <em>< |
|---|
| 38 | i</em><sub><em>2</em></sub><em>)</em> with column major |
|---|
| 39 | orientation.</p> |
|---|
| 40 | <h4>Example</h4> |
|---|
| 41 | <pre> |
|---|
| 42 | #include <boost/numeric/ublas/matrix_sparse.hpp> |
|---|
| 43 | #include <boost/numeric/ublas/io.hpp> |
|---|
| 44 | |
|---|
| 45 | int main () { |
|---|
| 46 | using namespace boost::numeric::ublas; |
|---|
| 47 | mapped_matrix<double> m (3, 3, 3 * 3); |
|---|
| 48 | for (unsigned i = 0; i < m.size1 (); ++ i) |
|---|
| 49 | for (unsigned j = 0; j < m.size2 (); ++ j) |
|---|
| 50 | m (i, j) = 3 * i + j; |
|---|
| 51 | std::cout << m << std::endl; |
|---|
| 52 | } |
|---|
| 53 | </pre> |
|---|
| 54 | <h4>Definition</h4> |
|---|
| 55 | <p>Defined in the header matrix_sparse.hpp.</p> |
|---|
| 56 | <h4>Template parameters</h4> |
|---|
| 57 | <table border="1" summary="parameters"> |
|---|
| 58 | <tbody> |
|---|
| 59 | <tr> |
|---|
| 60 | <th>Parameter</th> |
|---|
| 61 | <th>Description</th> |
|---|
| 62 | <th>Default</th> |
|---|
| 63 | </tr> |
|---|
| 64 | <tr> |
|---|
| 65 | <td><code>T</code></td> |
|---|
| 66 | <td>The type of object stored in the mapped matrix.</td> |
|---|
| 67 | <td></td> |
|---|
| 68 | </tr> |
|---|
| 69 | <tr> |
|---|
| 70 | <td><code>F</code></td> |
|---|
| 71 | <td>Functor describing the storage organization. <a href= |
|---|
| 72 | "#mapped_matrix_1">[1]</a></td> |
|---|
| 73 | <td><code>row_major</code></td> |
|---|
| 74 | </tr> |
|---|
| 75 | <tr> |
|---|
| 76 | <td><code>A</code></td> |
|---|
| 77 | <td>The type of the adapted array. <a href= |
|---|
| 78 | "#mapped_matrix_2">[2]</a></td> |
|---|
| 79 | <td><code>map_std<std::size_t, T></code></td> |
|---|
| 80 | </tr> |
|---|
| 81 | </tbody> |
|---|
| 82 | </table> |
|---|
| 83 | <h4>Model of</h4> |
|---|
| 84 | <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
|---|
| 85 | <h4>Type requirements</h4> |
|---|
| 86 | <p>None, except for those imposed by the requirements of <a href= |
|---|
| 87 | "container_concept.htm#matrix">Matrix</a> .</p> |
|---|
| 88 | <h4>Public base classes</h4> |
|---|
| 89 | <p><code>matrix_container<mapped_matrix<T, F, A> |
|---|
| 90 | ></code></p> |
|---|
| 91 | <h4>Members</h4> |
|---|
| 92 | <table border="1" summary="members"> |
|---|
| 93 | <tbody> |
|---|
| 94 | <tr> |
|---|
| 95 | <th>Member</th> |
|---|
| 96 | <th>Description</th> |
|---|
| 97 | </tr> |
|---|
| 98 | <tr> |
|---|
| 99 | <td><code>mapped_matrix ()</code></td> |
|---|
| 100 | <td>Allocates a <code>mapped_matrix</code> that holds at most zero |
|---|
| 101 | rows of zero elements.</td> |
|---|
| 102 | </tr> |
|---|
| 103 | <tr> |
|---|
| 104 | <td><code>mapped_matrix (size_type size1, size_type2, size_type non_zeros = 0)</code></td> |
|---|
| 105 | <td>Allocates a <code>mapped_matrix</code> that holds at most |
|---|
| 106 | <code>size1</code> rows of <code>size2</code> elements.</td> |
|---|
| 107 | </tr> |
|---|
| 108 | <tr> |
|---|
| 109 | <td><code>mapped_matrix (const mapped_matrix &m)</code></td> |
|---|
| 110 | <td>The copy constructor.</td> |
|---|
| 111 | </tr> |
|---|
| 112 | <tr> |
|---|
| 113 | <td><code>template<class AE><br /> |
|---|
| 114 | mapped_matrix (size_type non_zeros, const |
|---|
| 115 | matrix_expression<AE> &ae)</code></td> |
|---|
| 116 | <td>The extended copy constructor.</td> |
|---|
| 117 | </tr> |
|---|
| 118 | <tr> |
|---|
| 119 | <td><code>void resize (size_type size1, size_type size2, bool preserve = true)</code></td> |
|---|
| 120 | <td>Reallocates a <code>mapped_matrix</code> to hold at most |
|---|
| 121 | <code>size1</code> rows of <code>size2</code> elements. The |
|---|
| 122 | existing elements of the <code>mapped_matrix</code> are preseved |
|---|
| 123 | when specified.</td> |
|---|
| 124 | </tr> |
|---|
| 125 | <tr> |
|---|
| 126 | <td><code>size_type size1 () const</code></td> |
|---|
| 127 | <td>Returns the number of rows.</td> |
|---|
| 128 | </tr> |
|---|
| 129 | <tr> |
|---|
| 130 | <td><code>size_type size2 () const</code></td> |
|---|
| 131 | <td>Returns the number of columns.</td> |
|---|
| 132 | </tr> |
|---|
| 133 | <tr> |
|---|
| 134 | <td><code>const_reference operator () (size_type i, size_type j) |
|---|
| 135 | const</code></td> |
|---|
| 136 | <td>Returns the value of the <code>j</code>-th element in the |
|---|
| 137 | <code>i</code>-th row.</td> |
|---|
| 138 | </tr> |
|---|
| 139 | <tr> |
|---|
| 140 | <td><code>reference operator () (size_type i, size_type |
|---|
| 141 | j)</code></td> |
|---|
| 142 | <td>Returns a reference of the <code>j</code>-th element in the |
|---|
| 143 | <code>i</code>-th row.</td> |
|---|
| 144 | </tr> |
|---|
| 145 | <tr> |
|---|
| 146 | <td><code>mapped_matrix &operator = (const mapped_matrix |
|---|
| 147 | &m)</code></td> |
|---|
| 148 | <td>The assignment operator.</td> |
|---|
| 149 | </tr> |
|---|
| 150 | <tr> |
|---|
| 151 | <td><code>mapped_matrix &assign_temporary (mapped_matrix |
|---|
| 152 | &m)</code></td> |
|---|
| 153 | <td>Assigns a temporary. May change the mapped matrix |
|---|
| 154 | <code>m</code> .</td> |
|---|
| 155 | </tr> |
|---|
| 156 | <tr> |
|---|
| 157 | <td><code>template<class AE><br /> |
|---|
| 158 | mapped_matrix &operator = (const matrix_expression<AE> |
|---|
| 159 | &ae)</code></td> |
|---|
| 160 | <td>The extended assignment operator.</td> |
|---|
| 161 | </tr> |
|---|
| 162 | <tr> |
|---|
| 163 | <td><code>template<class AE><br /> |
|---|
| 164 | mapped_matrix &assign (const matrix_expression<AE> |
|---|
| 165 | &ae)</code></td> |
|---|
| 166 | <td>Assigns a matrix expression to the mapped matrix. Left and |
|---|
| 167 | right hand side of the assignment should be independent.</td> |
|---|
| 168 | </tr> |
|---|
| 169 | <tr> |
|---|
| 170 | <td><code>template<class AE><br /> |
|---|
| 171 | mapped_matrix &operator += (const matrix_expression<AE> |
|---|
| 172 | &ae)</code></td> |
|---|
| 173 | <td>A computed assignment operator. Adds the matrix expression to |
|---|
| 174 | the mapped matrix.</td> |
|---|
| 175 | </tr> |
|---|
| 176 | <tr> |
|---|
| 177 | <td><code>template<class AE><br /> |
|---|
| 178 | mapped_matrix &plus_assign (const matrix_expression<AE> |
|---|
| 179 | &ae)</code></td> |
|---|
| 180 | <td>Adds a matrix expression to the mapped matrix. Left and right |
|---|
| 181 | hand side of the assignment should be independent.</td> |
|---|
| 182 | </tr> |
|---|
| 183 | <tr> |
|---|
| 184 | <td><code>template<class AE><br /> |
|---|
| 185 | mapped_matrix &operator -= (const matrix_expression<AE> |
|---|
| 186 | &ae)</code></td> |
|---|
| 187 | <td>A computed assignment operator. Subtracts the matrix expression |
|---|
| 188 | from the mapped matrix.</td> |
|---|
| 189 | </tr> |
|---|
| 190 | <tr> |
|---|
| 191 | <td><code>template<class AE><br /> |
|---|
| 192 | mapped_matrix &minus_assign (const matrix_expression<AE> |
|---|
| 193 | &ae)</code></td> |
|---|
| 194 | <td>Subtracts a matrix expression from the mapped matrix. Left and |
|---|
| 195 | right hand side of the assignment should be independent.</td> |
|---|
| 196 | </tr> |
|---|
| 197 | <tr> |
|---|
| 198 | <td><code>template<class AT><br /> |
|---|
| 199 | mapped_matrix &operator *= (const AT &at)</code></td> |
|---|
| 200 | <td>A computed assignment operator. Multiplies the mapped matrix |
|---|
| 201 | with a scalar.</td> |
|---|
| 202 | </tr> |
|---|
| 203 | <tr> |
|---|
| 204 | <td><code>template<class AT><br /> |
|---|
| 205 | mapped_matrix &operator /= (const AT &at)</code></td> |
|---|
| 206 | <td>A computed assignment operator. Divides the mapped matrix |
|---|
| 207 | through a scalar.</td> |
|---|
| 208 | </tr> |
|---|
| 209 | <tr> |
|---|
| 210 | <td><code>void swap (mapped_matrix &m)</code></td> |
|---|
| 211 | <td>Swaps the contents of the mapped matrices.</td> |
|---|
| 212 | </tr> |
|---|
| 213 | <tr> |
|---|
| 214 | <td><code>true_refrence insert_element (size_type i, size_type j, const_reference |
|---|
| 215 | t)</code></td> |
|---|
| 216 | <td>Inserts the value <code>t</code> at the <code>j</code>-th |
|---|
| 217 | element of the <code>i</code>-th row. Duplicates elements are not allowed.</td> |
|---|
| 218 | </tr> |
|---|
| 219 | <tr> |
|---|
| 220 | <td><code>void erase_element (size_type i, size_type j)</code></td> |
|---|
| 221 | <td>Erases the value at the <code>j</code>-th element of the |
|---|
| 222 | <code>i</code>-th row.</td> |
|---|
| 223 | </tr> |
|---|
| 224 | <tr> |
|---|
| 225 | <td><code>void clear ()</code></td> |
|---|
| 226 | <td>Clears the mapped matrix.</td> |
|---|
| 227 | </tr> |
|---|
| 228 | <tr> |
|---|
| 229 | <td><code>const_iterator1 begin1 () const</code></td> |
|---|
| 230 | <td>Returns a <code>const_iterator1</code> pointing to the |
|---|
| 231 | beginning of the <code>mapped_matrix</code>.</td> |
|---|
| 232 | </tr> |
|---|
| 233 | <tr> |
|---|
| 234 | <td><code>const_iterator1 end1 () const</code></td> |
|---|
| 235 | <td>Returns a <code>const_iterator1</code> pointing to the end of |
|---|
| 236 | the <code>mapped_matrix</code>.</td> |
|---|
| 237 | </tr> |
|---|
| 238 | <tr> |
|---|
| 239 | <td><code>iterator1 begin1 ()</code></td> |
|---|
| 240 | <td>Returns a <code>iterator1</code> pointing to the beginning of |
|---|
| 241 | the <code>mapped_matrix</code>.</td> |
|---|
| 242 | </tr> |
|---|
| 243 | <tr> |
|---|
| 244 | <td><code>iterator1 end1 ()</code></td> |
|---|
| 245 | <td>Returns a <code>iterator1</code> pointing to the end of the |
|---|
| 246 | <code>mapped_matrix</code>.</td> |
|---|
| 247 | </tr> |
|---|
| 248 | <tr> |
|---|
| 249 | <td><code>const_iterator2 begin2 () const</code></td> |
|---|
| 250 | <td>Returns a <code>const_iterator2</code> pointing to the |
|---|
| 251 | beginning of the <code>mapped_matrix</code>.</td> |
|---|
| 252 | </tr> |
|---|
| 253 | <tr> |
|---|
| 254 | <td><code>const_iterator2 end2 () const</code></td> |
|---|
| 255 | <td>Returns a <code>const_iterator2</code> pointing to the end of |
|---|
| 256 | the <code>mapped_matrix</code>.</td> |
|---|
| 257 | </tr> |
|---|
| 258 | <tr> |
|---|
| 259 | <td><code>iterator2 begin2 ()</code></td> |
|---|
| 260 | <td>Returns a <code>iterator2</code> pointing to the beginning of |
|---|
| 261 | the <code>mapped_matrix</code>.</td> |
|---|
| 262 | </tr> |
|---|
| 263 | <tr> |
|---|
| 264 | <td><code>iterator2 end2 ()</code></td> |
|---|
| 265 | <td>Returns a <code>iterator2</code> pointing to the end of the |
|---|
| 266 | <code>mapped_matrix</code>.</td> |
|---|
| 267 | </tr> |
|---|
| 268 | <tr> |
|---|
| 269 | <td><code>const_reverse_iterator1 rbegin1 () const</code></td> |
|---|
| 270 | <td>Returns a <code>const_reverse_iterator1</code> pointing to the |
|---|
| 271 | beginning of the reversed <code>mapped_matrix</code>.</td> |
|---|
| 272 | </tr> |
|---|
| 273 | <tr> |
|---|
| 274 | <td><code>const_reverse_iterator1 rend1 () const</code></td> |
|---|
| 275 | <td>Returns a <code>const_reverse_iterator1</code> pointing to the |
|---|
| 276 | end of the reversed <code>mapped_matrix</code>.</td> |
|---|
| 277 | </tr> |
|---|
| 278 | <tr> |
|---|
| 279 | <td><code>reverse_iterator1 rbegin1 ()</code></td> |
|---|
| 280 | <td>Returns a <code>reverse_iterator1</code> pointing to the |
|---|
| 281 | beginning of the reversed <code>mapped_matrix</code>.</td> |
|---|
| 282 | </tr> |
|---|
| 283 | <tr> |
|---|
| 284 | <td><code>reverse_iterator1 rend1 ()</code></td> |
|---|
| 285 | <td>Returns a <code>reverse_iterator1</code> pointing to the end of |
|---|
| 286 | the reversed <code>mapped_matrix</code>.</td> |
|---|
| 287 | </tr> |
|---|
| 288 | <tr> |
|---|
| 289 | <td><code>const_reverse_iterator2 rbegin2 () const</code></td> |
|---|
| 290 | <td>Returns a <code>const_reverse_iterator2</code> pointing to the |
|---|
| 291 | beginning of the reversed <code>mapped_matrix</code>.</td> |
|---|
| 292 | </tr> |
|---|
| 293 | <tr> |
|---|
| 294 | <td><code>const_reverse_iterator2 rend2 () const</code></td> |
|---|
| 295 | <td>Returns a <code>const_reverse_iterator2</code> pointing to the |
|---|
| 296 | end of the reversed <code>mapped_matrix</code>.</td> |
|---|
| 297 | </tr> |
|---|
| 298 | <tr> |
|---|
| 299 | <td><code>reverse_iterator2 rbegin2 ()</code></td> |
|---|
| 300 | <td>Returns a <code>reverse_iterator2</code> pointing to the |
|---|
| 301 | beginning of the reversed <code>mapped_matrix</code>.</td> |
|---|
| 302 | </tr> |
|---|
| 303 | <tr> |
|---|
| 304 | <td><code>reverse_iterator2 rend2 ()</code></td> |
|---|
| 305 | <td>Returns a <code>reverse_iterator2</code> pointing to the end of |
|---|
| 306 | the reversed <code>mapped_matrix</code>.</td> |
|---|
| 307 | </tr> |
|---|
| 308 | </tbody> |
|---|
| 309 | </table> |
|---|
| 310 | <h4>Notes</h4> |
|---|
| 311 | <p><a name="mapped_matrix_1" id="mapped_matrix_1">[1]</a> Supported |
|---|
| 312 | parameters for the storage organization are <code>row_major</code> |
|---|
| 313 | and <code>column_major</code>.</p> |
|---|
| 314 | <p><a name="mapped_matrix_2" id="mapped_matrix_2">[2]</a> Supported |
|---|
| 315 | parameters for the adapted array are |
|---|
| 316 | <code>map_array<std::size_t, T></code> and |
|---|
| 317 | <code>map_std<std::size_t, T></code>. The latter is |
|---|
| 318 | equivalent to <code>std::map<std::size_t, T></code>.</p> |
|---|
| 319 | <h2><a name="compressed_matrix" id="compressed_matrix"></a>Compressed Matrix</h2> |
|---|
| 320 | <h4>Description</h4> |
|---|
| 321 | <p>The templated class <code>compressed_matrix<T, F, IB, IA, |
|---|
| 322 | TA></code> is the base container adaptor for compressed |
|---|
| 323 | matrices. For a <em>(m x n</em> )-dimensional compressed matrix and |
|---|
| 324 | <em>0 <= i < m</em>, <em>0 <= j < n</em> the non-zero |
|---|
| 325 | elements <em>m</em><sub><em>i, j</em></sub> are mapped via <em>(i x |
|---|
| 326 | n + j)</em> for row major orientation or via <em>(i + j x m)</em> |
|---|
| 327 | for column major orientation to consecutive elements of the index |
|---|
| 328 | and value containers, i.e. for elements <em>k</em> = |
|---|
| 329 | <em>m</em><sub><em>i</em></sub><sub><sub><em>1</em></sub></sub><sub> |
|---|
| 330 | <em>,j</em></sub><sub><sub><em>1</em></sub></sub>and <em>k + 1 = |
|---|
| 331 | m</em><sub><em>i</em></sub><sub><sub><em>2</em></sub></sub><sub><em> |
|---|
| 332 | ,j</em></sub><sub><sub><em>2</em></sub></sub>of the container holds |
|---|
| 333 | <em>i</em><sub><em>1</em></sub> <em>< |
|---|
| 334 | i</em><sub><em>2</em></sub> or <em>(i</em><sub><em>1</em></sub> |
|---|
| 335 | <em>= i</em><sub><em>2</em></sub> and |
|---|
| 336 | <em>j</em><sub><em>1</em></sub> <em>< |
|---|
| 337 | j</em><sub><em>2</em></sub><em>)</em> with row major orientation or |
|---|
| 338 | <em>j</em><sub><em>1</em></sub> <em>< |
|---|
| 339 | j</em><sub><em>2</em></sub> or <em>(j</em><sub><em>1</em></sub> |
|---|
| 340 | <em>= j</em><sub><em>2</em></sub> and |
|---|
| 341 | <em>i</em><sub><em>1</em></sub> <em>< |
|---|
| 342 | i</em><sub><em>2</em></sub><em>)</em> with column major |
|---|
| 343 | orientation.</p> |
|---|
| 344 | <h4>Example</h4> |
|---|
| 345 | <pre> |
|---|
| 346 | #include <boost/numeric/ublas/matrix_sparse.hpp> |
|---|
| 347 | #include <boost/numeric/ublas/io.hpp> |
|---|
| 348 | |
|---|
| 349 | int main () { |
|---|
| 350 | using namespace boost::numeric::ublas; |
|---|
| 351 | compressed_matrix<double> m (3, 3, 3 * 3); |
|---|
| 352 | for (unsigned i = 0; i < m.size1 (); ++ i) |
|---|
| 353 | for (unsigned j = 0; j < m.size2 (); ++ j) |
|---|
| 354 | m (i, j) = 3 * i + j; |
|---|
| 355 | std::cout << m << std::endl; |
|---|
| 356 | } |
|---|
| 357 | </pre> |
|---|
| 358 | <h4>Definition</h4> |
|---|
| 359 | <p>Defined in the header matrix_sparse.hpp.</p> |
|---|
| 360 | <h4>Template parameters</h4> |
|---|
| 361 | <table border="1" summary="parameters"> |
|---|
| 362 | <tbody> |
|---|
| 363 | <tr> |
|---|
| 364 | <th>Parameter</th> |
|---|
| 365 | <th>Description</th> |
|---|
| 366 | <th>Default</th> |
|---|
| 367 | </tr> |
|---|
| 368 | <tr> |
|---|
| 369 | <td><code>T</code></td> |
|---|
| 370 | <td>The type of object stored in the compressed matrix.</td> |
|---|
| 371 | <td></td> |
|---|
| 372 | </tr> |
|---|
| 373 | <tr> |
|---|
| 374 | <td><code>F</code></td> |
|---|
| 375 | <td>Functor describing the storage organization. <a href= |
|---|
| 376 | "#compressed_matrix_1">[1]</a></td> |
|---|
| 377 | <td><code>row_major</code></td> |
|---|
| 378 | </tr> |
|---|
| 379 | <tr> |
|---|
| 380 | <td><code>IB</code></td> |
|---|
| 381 | <td>The index base of the compressed vector. <a href= |
|---|
| 382 | "#compressed_matrix_2">[2]</a></td> |
|---|
| 383 | <td><code>0</code></td> |
|---|
| 384 | </tr> |
|---|
| 385 | <tr> |
|---|
| 386 | <td><code>IA</code></td> |
|---|
| 387 | <td>The type of the adapted array for indices. <a href= |
|---|
| 388 | "#compressed_matrix_3">[3]</a></td> |
|---|
| 389 | <td><code>unbounded_array<std::size_t></code></td> |
|---|
| 390 | </tr> |
|---|
| 391 | <tr> |
|---|
| 392 | <td><code>TA</code></td> |
|---|
| 393 | <td>The type of the adapted array for values. <a href= |
|---|
| 394 | "#compressed_matrix_3">[3]</a></td> |
|---|
| 395 | <td><code>unbounded_array<T></code></td> |
|---|
| 396 | </tr> |
|---|
| 397 | </tbody> |
|---|
| 398 | </table> |
|---|
| 399 | <h4>Model of</h4> |
|---|
| 400 | <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
|---|
| 401 | <h4>Type requirements</h4> |
|---|
| 402 | <p>None, except for those imposed by the requirements of <a href= |
|---|
| 403 | "container_concept.htm#matrix">Matrix</a> .</p> |
|---|
| 404 | <h4>Public base classes</h4> |
|---|
| 405 | <p><code>matrix_container<compressed_matrix<T, F, IB, IA, |
|---|
| 406 | TA> ></code></p> |
|---|
| 407 | <h4>Members</h4> |
|---|
| 408 | <table border="1" summary="members"> |
|---|
| 409 | <tbody> |
|---|
| 410 | <tr> |
|---|
| 411 | <th>Member</th> |
|---|
| 412 | <th>Description</th> |
|---|
| 413 | </tr> |
|---|
| 414 | <tr> |
|---|
| 415 | <td><code>compressed_matrix ()</code></td> |
|---|
| 416 | <td>Allocates a <code>compressed_matrix</code> that holds at most |
|---|
| 417 | zero rows of zero elements.</td> |
|---|
| 418 | </tr> |
|---|
| 419 | <tr> |
|---|
| 420 | <td><code>compressed_matrix (size_type size1, size_type2, size_type non_zeros = 0)</code></td> |
|---|
| 421 | <td>Allocates a <code>compressed_matrix</code> that holds at most |
|---|
| 422 | <code>size1</code> rows of <code>size2</code> elements.</td> |
|---|
| 423 | </tr> |
|---|
| 424 | <tr> |
|---|
| 425 | <td><code>compressed_matrix (const compressed_matrix |
|---|
| 426 | &m)</code></td> |
|---|
| 427 | <td>The copy constructor.</td> |
|---|
| 428 | </tr> |
|---|
| 429 | <tr> |
|---|
| 430 | <td><code>template<class AE><br /> |
|---|
| 431 | compressed_matrix (size_type non_zeros, const |
|---|
| 432 | matrix_expression<AE> &ae)</code></td> |
|---|
| 433 | <td>The extended copy constructor.</td> |
|---|
| 434 | </tr> |
|---|
| 435 | <tr> |
|---|
| 436 | <td><code>void resize (size_type size1, size_type size2, bool preserve = true)</code></td> |
|---|
| 437 | <td>Reallocates a <code>compressed_matrix</code> to hold at most |
|---|
| 438 | <code>size1</code> rows of <code>size2</code> elements. The |
|---|
| 439 | existing elements of the <code>compressed_matrix</code> are |
|---|
| 440 | preseved when specified.</td> |
|---|
| 441 | </tr> |
|---|
| 442 | <tr> |
|---|
| 443 | <td><code>size_type size1 () const</code></td> |
|---|
| 444 | <td>Returns the number of rows.</td> |
|---|
| 445 | </tr> |
|---|
| 446 | <tr> |
|---|
| 447 | <td><code>size_type size2 () const</code></td> |
|---|
| 448 | <td>Returns the number of columns.</td> |
|---|
| 449 | </tr> |
|---|
| 450 | <tr> |
|---|
| 451 | <td><code>const_reference operator () (size_type i, size_type j) |
|---|
| 452 | const</code></td> |
|---|
| 453 | <td>Returns the value of the <code>j</code>-th element in the |
|---|
| 454 | <code>i</code>-th row.</td> |
|---|
| 455 | </tr> |
|---|
| 456 | <tr> |
|---|
| 457 | <td><code>reference operator () (size_type i, size_type |
|---|
| 458 | j)</code></td> |
|---|
| 459 | <td>Returns a reference of the <code>j</code>-th element in the |
|---|
| 460 | <code>i</code>-th row.</td> |
|---|
| 461 | </tr> |
|---|
| 462 | <tr> |
|---|
| 463 | <td><code>compressed_matrix &operator = (const |
|---|
| 464 | compressed_matrix &m)</code></td> |
|---|
| 465 | <td>The assignment operator.</td> |
|---|
| 466 | </tr> |
|---|
| 467 | <tr> |
|---|
| 468 | <td><code>compressed_matrix &assign_temporary |
|---|
| 469 | (compressed_matrix &m)</code></td> |
|---|
| 470 | <td>Assigns a temporary. May change the compressed matrix |
|---|
| 471 | <code>m</code>.</td> |
|---|
| 472 | </tr> |
|---|
| 473 | <tr> |
|---|
| 474 | <td><code>template<class AE><br /> |
|---|
| 475 | compressed_matrix &operator = (const |
|---|
| 476 | matrix_expression<AE> &ae)</code></td> |
|---|
| 477 | <td>The extended assignment operator.</td> |
|---|
| 478 | </tr> |
|---|
| 479 | <tr> |
|---|
| 480 | <td><code>template<class AE><br /> |
|---|
| 481 | compressed_matrix &assign (const matrix_expression<AE> |
|---|
| 482 | &ae)</code></td> |
|---|
| 483 | <td>Assigns a matrix expression to the compressed matrix. Left and |
|---|
| 484 | right hand side of the assignment should be independent.</td> |
|---|
| 485 | </tr> |
|---|
| 486 | <tr> |
|---|
| 487 | <td><code>template<class AE><br /> |
|---|
| 488 | compressed_matrix &operator += (const |
|---|
| 489 | matrix_expression<AE> &ae)</code></td> |
|---|
| 490 | <td>A computed assignment operator. Adds the matrix expression to |
|---|
| 491 | the compressed matrix.</td> |
|---|
| 492 | </tr> |
|---|
| 493 | <tr> |
|---|
| 494 | <td><code>template<class AE><br /> |
|---|
| 495 | compressed_matrix &plus_assign (const |
|---|
| 496 | matrix_expression<AE> &ae)</code></td> |
|---|
| 497 | <td>Adds a matrix expression to the compressed matrix. Left and |
|---|
| 498 | right hand side of the assignment should be independent.</td> |
|---|
| 499 | </tr> |
|---|
| 500 | <tr> |
|---|
| 501 | <td><code>template<class AE><br /> |
|---|
| 502 | compressed_matrix &operator -= (const |
|---|
| 503 | matrix_expression<AE> &ae)</code></td> |
|---|
| 504 | <td>A computed assignment operator. Subtracts the matrix expression |
|---|
| 505 | from the compressed matrix.</td> |
|---|
| 506 | </tr> |
|---|
| 507 | <tr> |
|---|
| 508 | <td><code>template<class AE><br /> |
|---|
| 509 | compressed_matrix &minus_assign (const |
|---|
| 510 | matrix_expression<AE> &ae)</code></td> |
|---|
| 511 | <td>Subtracts a matrix expression from the compressed matrix. Left |
|---|
| 512 | and right hand side of the assignment should be independent.</td> |
|---|
| 513 | </tr> |
|---|
| 514 | <tr> |
|---|
| 515 | <td><code>template<class AT><br /> |
|---|
| 516 | compressed_matrix &operator *= (const AT &at)</code></td> |
|---|
| 517 | <td>A computed assignment operator. Multiplies the compressed |
|---|
| 518 | matrix with a scalar.</td> |
|---|
| 519 | </tr> |
|---|
| 520 | <tr> |
|---|
| 521 | <td><code>template<class AT><br /> |
|---|
| 522 | compressed_matrix &operator /= (const AT &at)</code></td> |
|---|
| 523 | <td>A computed assignment operator. Divides the compressed matrix |
|---|
| 524 | through a scalar.</td> |
|---|
| 525 | </tr> |
|---|
| 526 | <tr> |
|---|
| 527 | <td><code>void swap (compressed_matrix &m)</code></td> |
|---|
| 528 | <td>Swaps the contents of the compressed matrices.</td> |
|---|
| 529 | </tr> |
|---|
| 530 | <tr> |
|---|
| 531 | <td><code>true_reference insert_element (size_type i, size_type j, const_reference |
|---|
| 532 | t)</code></td> |
|---|
| 533 | <td>Inserts the value <code>t</code> at the <code>j</code>-th |
|---|
| 534 | element of the <code>i</code>-th row. Duplicates elements are not allowed.</td> |
|---|
| 535 | </tr> |
|---|
| 536 | <tr> |
|---|
| 537 | <td><code>void erase_element (size_type i, size_type j)</code></td> |
|---|
| 538 | <td>Erases the value at the <code>j</code>-th element of the |
|---|
| 539 | <code>i</code>-th row.</td> |
|---|
| 540 | </tr> |
|---|
| 541 | <tr> |
|---|
| 542 | <td><code>void clear ()</code></td> |
|---|
| 543 | <td>Clears the compressed matrix.</td> |
|---|
| 544 | </tr> |
|---|
| 545 | <tr> |
|---|
| 546 | <td><code>const_iterator1 begin1 () const</code></td> |
|---|
| 547 | <td>Returns a <code>const_iterator1</code> pointing to the |
|---|
| 548 | beginning of the <code>compressed_matrix</code>.</td> |
|---|
| 549 | </tr> |
|---|
| 550 | <tr> |
|---|
| 551 | <td><code>const_iterator1 end1 () const</code></td> |
|---|
| 552 | <td>Returns a <code>const_iterator1</code> pointing to the end of |
|---|
| 553 | the <code>compressed_matrix</code>.</td> |
|---|
| 554 | </tr> |
|---|
| 555 | <tr> |
|---|
| 556 | <td><code>iterator1 begin1 ()</code></td> |
|---|
| 557 | <td>Returns a <code>iterator1</code> pointing to the beginning of |
|---|
| 558 | the <code>compressed_matrix</code>.</td> |
|---|
| 559 | </tr> |
|---|
| 560 | <tr> |
|---|
| 561 | <td><code>iterator1 end1 ()</code></td> |
|---|
| 562 | <td>Returns a <code>iterator1</code> pointing to the end of the |
|---|
| 563 | <code>compressed_matrix</code>.</td> |
|---|
| 564 | </tr> |
|---|
| 565 | <tr> |
|---|
| 566 | <td><code>const_iterator2 begin2 () const</code></td> |
|---|
| 567 | <td>Returns a <code>const_iterator2</code> pointing to the |
|---|
| 568 | beginning of the <code>compressed_matrix</code>.</td> |
|---|
| 569 | </tr> |
|---|
| 570 | <tr> |
|---|
| 571 | <td><code>const_iterator2 end2 () const</code></td> |
|---|
| 572 | <td>Returns a <code>const_iterator2</code> pointing to the end of |
|---|
| 573 | the <code>compressed_matrix</code>.</td> |
|---|
| 574 | </tr> |
|---|
| 575 | <tr> |
|---|
| 576 | <td><code>iterator2 begin2 ()</code></td> |
|---|
| 577 | <td>Returns a <code>iterator2</code> pointing to the beginning of |
|---|
| 578 | the <code>compressed_matrix</code>.</td> |
|---|
| 579 | </tr> |
|---|
| 580 | <tr> |
|---|
| 581 | <td><code>iterator2 end2 ()</code></td> |
|---|
| 582 | <td>Returns a <code>iterator2</code> pointing to the end of the |
|---|
| 583 | <code>compressed_matrix</code>.</td> |
|---|
| 584 | </tr> |
|---|
| 585 | <tr> |
|---|
| 586 | <td><code>const_reverse_iterator1 rbegin1 () const</code></td> |
|---|
| 587 | <td>Returns a <code>const_reverse_iterator1</code> pointing to the |
|---|
| 588 | beginning of the reversed <code>compressed_matrix</code>.</td> |
|---|
| 589 | </tr> |
|---|
| 590 | <tr> |
|---|
| 591 | <td><code>const_reverse_iterator1 rend1 () const</code></td> |
|---|
| 592 | <td>Returns a <code>const_reverse_iterator1</code> pointing to the |
|---|
| 593 | end of the reversed <code>compressed_matrix</code>.</td> |
|---|
| 594 | </tr> |
|---|
| 595 | <tr> |
|---|
| 596 | <td><code>reverse_iterator1 rbegin1 ()</code></td> |
|---|
| 597 | <td>Returns a <code>reverse_iterator1</code> pointing to the |
|---|
| 598 | beginning of the reversed <code>compressed_matrix</code>.</td> |
|---|
| 599 | </tr> |
|---|
| 600 | <tr> |
|---|
| 601 | <td><code>reverse_iterator1 rend1 ()</code></td> |
|---|
| 602 | <td>Returns a <code>reverse_iterator1</code> pointing to the end of |
|---|
| 603 | the reversed <code>compressed_matrix</code>.</td> |
|---|
| 604 | </tr> |
|---|
| 605 | <tr> |
|---|
| 606 | <td><code>const_reverse_iterator2 rbegin2 () const</code></td> |
|---|
| 607 | <td>Returns a <code>const_reverse_iterator2</code> pointing to the |
|---|
| 608 | beginning of the reversed <code>compressed_matrix</code>.</td> |
|---|
| 609 | </tr> |
|---|
| 610 | <tr> |
|---|
| 611 | <td><code>const_reverse_iterator2 rend2 () const</code></td> |
|---|
| 612 | <td>Returns a <code>const_reverse_iterator2</code> pointing to the |
|---|
| 613 | end of the reversed <code>compressed_matrix</code>.</td> |
|---|
| 614 | </tr> |
|---|
| 615 | <tr> |
|---|
| 616 | <td><code>reverse_iterator2 rbegin2 ()</code></td> |
|---|
| 617 | <td>Returns a <code>reverse_iterator2</code> pointing to the |
|---|
| 618 | beginning of the reversed <code>compressed_matrix</code>.</td> |
|---|
| 619 | </tr> |
|---|
| 620 | <tr> |
|---|
| 621 | <td><code>reverse_iterator2 rend2 ()</code></td> |
|---|
| 622 | <td>Returns a <code>reverse_iterator2</code> pointing to the end of |
|---|
| 623 | the reversed <code>compressed_matrix</code>.</td> |
|---|
| 624 | </tr> |
|---|
| 625 | </tbody> |
|---|
| 626 | </table> |
|---|
| 627 | <h4>Notes</h4> |
|---|
| 628 | <p><a name="compressed_matrix_1" id="compressed_matrix_1">[1]</a> |
|---|
| 629 | Supported parameters for the storage organization are |
|---|
| 630 | <code>row_major</code> and <code>column_major</code>.</p> |
|---|
| 631 | <p><a name="compressed_matrix_2" id="compressed_matrix_2">[2]</a> |
|---|
| 632 | Supported parameters for the index base are <code>0</code> and |
|---|
| 633 | <code>1</code> at least.</p> |
|---|
| 634 | <p><a name="compressed_matrix_3" id="compressed_matrix_3">[3]</a> |
|---|
| 635 | Supported parameters for the adapted array are |
|---|
| 636 | <code>unbounded_array<></code> , |
|---|
| 637 | <code>bounded_array<></code> and |
|---|
| 638 | <code>std::vector<></code> .</p> |
|---|
| 639 | <h2><a name="coordinate_matrix" id="coordinate_matrix"></a>Coordinate Matrix</h2> |
|---|
| 640 | <h4>Description</h4> |
|---|
| 641 | <p>The templated class <code>coordinate_matrix<T, F, IB, IA, |
|---|
| 642 | TA></code> is the base container adaptor for compressed |
|---|
| 643 | matrices. For a <em>(m x n</em> )-dimensional sorted coordinate |
|---|
| 644 | matrix and <em>0 <= i < m</em>, <em>0 <= j < n</em> the |
|---|
| 645 | non-zero elements <em>m</em><sub><em>i, j</em></sub> are mapped via |
|---|
| 646 | <em>(i x n + j)</em> for row major orientation or via <em>(i + j x |
|---|
| 647 | m)</em> for column major orientation to consecutive elements of the |
|---|
| 648 | index and value containers, i.e. for elements <em>k</em> = |
|---|
| 649 | <em>m</em><sub><em>i</em></sub><sub><sub><em>1</em></sub></sub><sub> |
|---|
| 650 | <em>,j</em></sub><sub><sub><em>1</em></sub></sub>and <em>k + 1 = |
|---|
| 651 | m</em><sub><em>i</em></sub><sub><sub><em>2</em></sub></sub><sub><em> |
|---|
| 652 | ,j</em></sub><sub><sub><em>2</em></sub></sub>of the container holds |
|---|
| 653 | <em>i</em><sub><em>1</em></sub> <em>< |
|---|
| 654 | i</em><sub><em>2</em></sub> or <em>(i</em><sub><em>1</em></sub> |
|---|
| 655 | <em>= i</em><sub><em>2</em></sub> and |
|---|
| 656 | <em>j</em><sub><em>1</em></sub> <em>< |
|---|
| 657 | j</em><sub><em>2</em></sub><em>)</em> with row major orientation or |
|---|
| 658 | <em>j</em><sub><em>1</em></sub> <em>< |
|---|
| 659 | j</em><sub><em>2</em></sub> or <em>(j</em><sub><em>1</em></sub> |
|---|
| 660 | <em>= j</em><sub><em>2</em></sub> and |
|---|
| 661 | <em>i</em><sub><em>1</em></sub> <em>< |
|---|
| 662 | i</em><sub><em>2</em></sub><em>)</em> with column major |
|---|
| 663 | orientation.</p> |
|---|
| 664 | <h4>Example</h4> |
|---|
| 665 | <pre> |
|---|
| 666 | #include <boost/numeric/ublas/matrix_sparse.hpp> |
|---|
| 667 | #include <boost/numeric/ublas/io.hpp> |
|---|
| 668 | |
|---|
| 669 | int main () { |
|---|
| 670 | using namespace boost::numeric::ublas; |
|---|
| 671 | coordinate_matrix<double> m (3, 3, 3 * 3); |
|---|
| 672 | for (unsigned i = 0; i < m.size1 (); ++ i) |
|---|
| 673 | for (unsigned j = 0; j < m.size2 (); ++ j) |
|---|
| 674 | m (i, j) = 3 * i + j; |
|---|
| 675 | std::cout << m << std::endl; |
|---|
| 676 | } |
|---|
| 677 | </pre> |
|---|
| 678 | <h4>Definition</h4> |
|---|
| 679 | <p>Defined in the header matrix_sparse.hpp.</p> |
|---|
| 680 | <h4>Template parameters</h4> |
|---|
| 681 | <table border="1" summary="parameters"> |
|---|
| 682 | <tbody> |
|---|
| 683 | <tr> |
|---|
| 684 | <th>Parameter</th> |
|---|
| 685 | <th>Description</th> |
|---|
| 686 | <th>Default</th> |
|---|
| 687 | </tr> |
|---|
| 688 | <tr> |
|---|
| 689 | <td><code>T</code></td> |
|---|
| 690 | <td>The type of object stored in the coordinate matrix.</td> |
|---|
| 691 | <td></td> |
|---|
| 692 | </tr> |
|---|
| 693 | <tr> |
|---|
| 694 | <td><code>F</code></td> |
|---|
| 695 | <td>Functor describing the storage organization. <a href= |
|---|
| 696 | "#coordinate_matrix_1">[1]</a></td> |
|---|
| 697 | <td><code>row_major</code></td> |
|---|
| 698 | </tr> |
|---|
| 699 | <tr> |
|---|
| 700 | <td><code>IB</code></td> |
|---|
| 701 | <td>The index base of the coordinate vector. <a href= |
|---|
| 702 | "#coordinate_matrix_2">[2]</a></td> |
|---|
| 703 | <td><code>0</code></td> |
|---|
| 704 | </tr> |
|---|
| 705 | <tr> |
|---|
| 706 | <td><code>IA</code></td> |
|---|
| 707 | <td>The type of the adapted array for indices. <a href= |
|---|
| 708 | "#coordinate_matrix_3">[3]</a></td> |
|---|
| 709 | <td><code>unbounded_array<std::size_t></code></td> |
|---|
| 710 | </tr> |
|---|
| 711 | <tr> |
|---|
| 712 | <td><code>TA</code></td> |
|---|
| 713 | <td>The type of the adapted array for values. <a href= |
|---|
| 714 | "#coordinate_matrix_3">[3]</a></td> |
|---|
| 715 | <td><code>unbounded_array<T></code></td> |
|---|
| 716 | </tr> |
|---|
| 717 | </tbody> |
|---|
| 718 | </table> |
|---|
| 719 | <h4>Model of</h4> |
|---|
| 720 | <p><a href="container_concept.htm#matrix">Matrix</a> .</p> |
|---|
| 721 | <h4>Type requirements</h4> |
|---|
| 722 | <p>None, except for those imposed by the requirements of <a href= |
|---|
| 723 | "container_concept.htm#matrix">Matrix</a> .</p> |
|---|
| 724 | <h4>Public base classes</h4> |
|---|
| 725 | <p><code>matrix_container<coordinate_matrix<T, F, IB, IA, |
|---|
| 726 | TA> ></code></p> |
|---|
| 727 | <h4>Members</h4> |
|---|
| 728 | <table border="1" summary="members"> |
|---|
| 729 | <tbody> |
|---|
| 730 | <tr> |
|---|
| 731 | <th>Member</th> |
|---|
| 732 | <th>Description</th> |
|---|
| 733 | </tr> |
|---|
| 734 | <tr> |
|---|
| 735 | <td><code>coordinate_matrix ()</code></td> |
|---|
| 736 | <td>Allocates a <code>coordinate_matrix</code> that holds at most |
|---|
| 737 | zero rows of zero elements.</td> |
|---|
| 738 | </tr> |
|---|
| 739 | <tr> |
|---|
| 740 | <td><code>coordinate_matrix (size_type size1, size_type2, size_type non_zeros = 0)</code></td> |
|---|
| 741 | <td>Allocates a <code>coordinate_matrix</code> that holds at most |
|---|
| 742 | <code>size1</code> rows of <code>size2</code> elements.</td> |
|---|
| 743 | </tr> |
|---|
| 744 | <tr> |
|---|
| 745 | <td><code>coordinate_matrix (const coordinate_matrix |
|---|
| 746 | &m)</code></td> |
|---|
| 747 | <td>The copy constructor.</td> |
|---|
| 748 | </tr> |
|---|
| 749 | <tr> |
|---|
| 750 | <td><code>template<class AE><br /> |
|---|
| 751 | coordinate_matrix (size_type non_zeros, const |
|---|
| 752 | matrix_expression<AE> &ae)</code></td> |
|---|
| 753 | <td>The extended copy constructor.</td> |
|---|
| 754 | </tr> |
|---|
| 755 | <tr> |
|---|
| 756 | <td><code>void resize (size_type size1, size_type size2, bool preserve = true)</code></td> |
|---|
| 757 | <td>Reallocates a <code>coordinate_matrix</code> to hold at most |
|---|
| 758 | <code>size1</code> rows of <code>size2</code> elements. The |
|---|
| 759 | existing elements of the <code>coordinate_matrix</code> are |
|---|
| 760 | preseved when specified.</td> |
|---|
| 761 | </tr> |
|---|
| 762 | <tr> |
|---|
| 763 | <td><code>size_type size1 () const</code></td> |
|---|
| 764 | <td>Returns the number of rows.</td> |
|---|
| 765 | </tr> |
|---|
| 766 | <tr> |
|---|
| 767 | <td><code>size_type size2 () const</code></td> |
|---|
| 768 | <td>Returns the number of columns.</td> |
|---|
| 769 | </tr> |
|---|
| 770 | <tr> |
|---|
| 771 | <td><code>const_reference operator () (size_type i, size_type j) |
|---|
| 772 | const</code></td> |
|---|
| 773 | <td>Returns the value of the <code>j</code>-th element in the |
|---|
| 774 | <code>i</code>-th row.</td> |
|---|
| 775 | </tr> |
|---|
| 776 | <tr> |
|---|
| 777 | <td><code>reference operator () (size_type i, size_type |
|---|
| 778 | j)</code></td> |
|---|
| 779 | <td>Returns a reference of the <code>j</code>-th element in the |
|---|
| 780 | <code>i</code>-th row.</td> |
|---|
| 781 | </tr> |
|---|
| 782 | <tr> |
|---|
| 783 | <td><code>coordinate_matrix &operator = (const |
|---|
| 784 | coordinate_matrix &m)</code></td> |
|---|
| 785 | <td>The assignment operator.</td> |
|---|
| 786 | </tr> |
|---|
| 787 | <tr> |
|---|
| 788 | <td><code>coordinate_matrix &assign_temporary |
|---|
| 789 | (coordinate_matrix &m)</code></td> |
|---|
| 790 | <td>Assigns a temporary. May change the coordinate matrix |
|---|
| 791 | <code>m</code>.</td> |
|---|
| 792 | </tr> |
|---|
| 793 | <tr> |
|---|
| 794 | <td><code>template<class AE><br /> |
|---|
| 795 | coordinate_matrix &operator = (const |
|---|
| 796 | matrix_expression<AE> &ae)</code></td> |
|---|
| 797 | <td>The extended assignment operator.</td> |
|---|
| 798 | </tr> |
|---|
| 799 | <tr> |
|---|
| 800 | <td><code>template<class AE><br /> |
|---|
| 801 | coordinate_matrix &assign (const matrix_expression<AE> |
|---|
| 802 | &ae)</code></td> |
|---|
| 803 | <td>Assigns a matrix expression to the coordinate matrix. Left and |
|---|
| 804 | right hand side of the assignment should be independent.</td> |
|---|
| 805 | </tr> |
|---|
| 806 | <tr> |
|---|
| 807 | <td><code>template<class AE><br /> |
|---|
| 808 | coordinate_matrix &operator += (const |
|---|
| 809 | matrix_expression<AE> &ae)</code></td> |
|---|
| 810 | <td>A computed assignment operator. Adds the matrix expression to |
|---|
| 811 | the coordinate matrix.</td> |
|---|
| 812 | </tr> |
|---|
| 813 | <tr> |
|---|
| 814 | <td><code>template<class AE><br /> |
|---|
| 815 | coordinate_matrix &plus_assign (const |
|---|
| 816 | matrix_expression<AE> &ae)</code></td> |
|---|
| 817 | <td>Adds a matrix expression to the coordinate matrix. Left and |
|---|
| 818 | right hand side of the assignment should be independent.</td> |
|---|
| 819 | </tr> |
|---|
| 820 | <tr> |
|---|
| 821 | <td><code>template<class AE><br /> |
|---|
| 822 | coordinate_matrix &operator -= (const |
|---|
| 823 | matrix_expression<AE> &ae)</code></td> |
|---|
| 824 | <td>A computed assignment operator. Subtracts the matrix expression |
|---|
| 825 | from the coordinate matrix.</td> |
|---|
| 826 | </tr> |
|---|
| 827 | <tr> |
|---|
| 828 | <td><code>template<class AE><br /> |
|---|
| 829 | coordinate_matrix &minus_assign (const |
|---|
| 830 | matrix_expression<AE> &ae)</code></td> |
|---|
| 831 | <td>Subtracts a matrix expression from the coordinate matrix. Left |
|---|
| 832 | and right hand side of the assignment should be independent.</td> |
|---|
| 833 | </tr> |
|---|
| 834 | <tr> |
|---|
| 835 | <td><code>template<class AT><br /> |
|---|
| 836 | coordinate_matrix &operator *= (const AT &at)</code></td> |
|---|
| 837 | <td>A computed assignment operator. Multiplies the coordinate |
|---|
| 838 | matrix with a scalar.</td> |
|---|
| 839 | </tr> |
|---|
| 840 | <tr> |
|---|
| 841 | <td><code>template<class AT><br /> |
|---|
| 842 | coordinate_matrix &operator /= (const AT &at)</code></td> |
|---|
| 843 | <td>A computed assignment operator. Divides the coordinate matrix |
|---|
| 844 | through a scalar.</td> |
|---|
| 845 | </tr> |
|---|
| 846 | <tr> |
|---|
| 847 | <td><code>void swap (coordinate_matrix &m)</code></td> |
|---|
| 848 | <td>Swaps the contents of the coordinate matrices.</td> |
|---|
| 849 | </tr> |
|---|
| 850 | <tr> |
|---|
| 851 | <td><code>true_reference insert_element (size_type i, size_type j, const_reference |
|---|
| 852 | t)</code></td> |
|---|
| 853 | <td>Inserts the value <code>t</code> at the <code>j</code>-th |
|---|
| 854 | element of the <code>i</code>-th row. Duplicates elements are not allowed.</td> |
|---|
| 855 | </tr> |
|---|
| 856 | <tr> |
|---|
| 857 | <td><code>void append_element (size_type i, size_type j, const_reference t)</code></td> |
|---|
| 858 | <td>Appends the value <code>t</code> at the <code>j</code>-th element of the <code>i</code>-th row. |
|---|
| 859 | Duplicate elements can be appended to a <code>coordinate_matrix</code>. They are merged into a single |
|---|
| 860 | arithmetically summed element by the <code>sort</code> function.</td> |
|---|
| 861 | </tr> |
|---|
| 862 | <tr> |
|---|
| 863 | <td><code>void erase_element (size_type i, size_type j)</code></td> |
|---|
| 864 | <td>Erases the value at the <code>j</code>-th element of the |
|---|
| 865 | <code>i</code>-th row.</td> |
|---|
| 866 | </tr> |
|---|
| 867 | <tr> |
|---|
| 868 | <td><code>void clear ()</code></td> |
|---|
| 869 | <td>Clears the coordinate matrix.</td> |
|---|
| 870 | </tr> |
|---|
| 871 | <tr> |
|---|
| 872 | <td><code>const_iterator1 begin1 () const</code></td> |
|---|
| 873 | <td>Returns a <code>const_iterator1</code> pointing to the |
|---|
| 874 | beginning of the <code>coordinate_matrix</code>.</td> |
|---|
| 875 | </tr> |
|---|
| 876 | <tr> |
|---|
| 877 | <td><code>const_iterator1 end1 () const</code></td> |
|---|
| 878 | <td>Returns a <code>const_iterator1</code> pointing to the end of |
|---|
| 879 | the <code>coordinate_matrix</code>.</td> |
|---|
| 880 | </tr> |
|---|
| 881 | <tr> |
|---|
| 882 | <td><code>iterator1 begin1 ()</code></td> |
|---|
| 883 | <td>Returns a <code>iterator1</code> pointing to the beginning of |
|---|
| 884 | the <code>coordinate_matrix</code>.</td> |
|---|
| 885 | </tr> |
|---|
| 886 | <tr> |
|---|
| 887 | <td><code>iterator1 end1 ()</code></td> |
|---|
| 888 | <td>Returns a <code>iterator1</code> pointing to the end of the |
|---|
| 889 | <code>coordinate_matrix</code>.</td> |
|---|
| 890 | </tr> |
|---|
| 891 | <tr> |
|---|
| 892 | <td><code>const_iterator2 begin2 () const</code></td> |
|---|
| 893 | <td>Returns a <code>const_iterator2</code> pointing to the |
|---|
| 894 | beginning of the <code>coordinate_matrix</code>.</td> |
|---|
| 895 | </tr> |
|---|
| 896 | <tr> |
|---|
| 897 | <td><code>const_iterator2 end2 () const</code></td> |
|---|
| 898 | <td>Returns a <code>const_iterator2</code> pointing to the end of |
|---|
| 899 | the <code>coordinate_matrix</code>.</td> |
|---|
| 900 | </tr> |
|---|
| 901 | <tr> |
|---|
| 902 | <td><code>iterator2 begin2 ()</code></td> |
|---|
| 903 | <td>Returns a <code>iterator2</code> pointing to the beginning of |
|---|
| 904 | the <code>coordinate_matrix</code>.</td> |
|---|
| 905 | </tr> |
|---|
| 906 | <tr> |
|---|
| 907 | <td><code>iterator2 end2 ()</code></td> |
|---|
| 908 | <td>Returns a <code>iterator2</code> pointing to the end of the |
|---|
| 909 | <code>coordinate_matrix</code>.</td> |
|---|
| 910 | </tr> |
|---|
| 911 | <tr> |
|---|
| 912 | <td><code>const_reverse_iterator1 rbegin1 () const</code></td> |
|---|
| 913 | <td>Returns a <code>const_reverse_iterator1</code> pointing to the |
|---|
| 914 | beginning of the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 915 | </tr> |
|---|
| 916 | <tr> |
|---|
| 917 | <td><code>const_reverse_iterator1 rend1 () const</code></td> |
|---|
| 918 | <td>Returns a <code>const_reverse_iterator1</code> pointing to the |
|---|
| 919 | end of the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 920 | </tr> |
|---|
| 921 | <tr> |
|---|
| 922 | <td><code>reverse_iterator1 rbegin1 ()</code></td> |
|---|
| 923 | <td>Returns a <code>reverse_iterator1</code> pointing to the |
|---|
| 924 | beginning of the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 925 | </tr> |
|---|
| 926 | <tr> |
|---|
| 927 | <td><code>reverse_iterator1 rend1 ()</code></td> |
|---|
| 928 | <td>Returns a <code>reverse_iterator1</code> pointing to the end of |
|---|
| 929 | the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 930 | </tr> |
|---|
| 931 | <tr> |
|---|
| 932 | <td><code>const_reverse_iterator2 rbegin2 () const</code></td> |
|---|
| 933 | <td>Returns a <code>const_reverse_iterator2</code> pointing to the |
|---|
| 934 | beginning of the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 935 | </tr> |
|---|
| 936 | <tr> |
|---|
| 937 | <td><code>const_reverse_iterator2 rend2 () const</code></td> |
|---|
| 938 | <td>Returns a <code>const_reverse_iterator2</code> pointing to the |
|---|
| 939 | end of the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 940 | </tr> |
|---|
| 941 | <tr> |
|---|
| 942 | <td><code>reverse_iterator2 rbegin2 ()</code></td> |
|---|
| 943 | <td>Returns a <code>reverse_iterator2</code> pointing to the |
|---|
| 944 | beginning of the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 945 | </tr> |
|---|
| 946 | <tr> |
|---|
| 947 | <td><code>reverse_iterator2 rend2 ()</code></td> |
|---|
| 948 | <td>Returns a <code>reverse_iterator2</code> pointing to the end of |
|---|
| 949 | the reversed <code>coordinate_matrix</code>.</td> |
|---|
| 950 | </tr> |
|---|
| 951 | </tbody> |
|---|
| 952 | </table> |
|---|
| 953 | <h4>Notes</h4> |
|---|
| 954 | <p><a name="coordinate_matrix_1" id="coordinate_matrix_1">[1]</a> |
|---|
| 955 | Supported parameters for the storage organization are |
|---|
| 956 | <code>row_major</code> and <code>column_major</code>.</p> |
|---|
| 957 | <p><a name="coordinate_matrix_2" id="coordinate_matrix_2">[2]</a> |
|---|
| 958 | Supported parameters for the index base are <code>0</code> and |
|---|
| 959 | <code>1</code> at least.</p> |
|---|
| 960 | <p><a name="coordinate_matrix_3" id="coordinate_matrix_3">[3]</a> |
|---|
| 961 | Supported parameters for the adapted array are |
|---|
| 962 | <code>unbounded_array<></code> , |
|---|
| 963 | <code>bounded_array<></code> and |
|---|
| 964 | <code>std::vector<></code> .</p> |
|---|
| 965 | <hr /> |
|---|
| 966 | <p>Copyright (©) 2000-2002 Joerg Walter, Mathias Koch<br /> |
|---|
| 967 | Permission to copy, use, modify, sell and distribute this document |
|---|
| 968 | is granted provided this copyright notice appears in all copies. |
|---|
| 969 | This document is provided ``as is'' without express or implied |
|---|
| 970 | warranty, and with no claim as to its suitability for any |
|---|
| 971 | purpose.</p> |
|---|
| 972 | </body> |
|---|
| 973 | </html> |
|---|