Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/numeric/ublas/doc/expression_concept.htm @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 28.7 KB
Line 
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 http-equiv="Content-Type" content="text/html; charset=us-ascii" />
6<link href="ublas.css" type="text/css" />
7<title>Expression Concepts</title>
8</head>
9<body>
10<h1><img src="../../../../boost.png" align="middle" />
11Expression Concepts</h1>
12<h2><a name="scalar_expression" id="scalar_expression"></a>Scalar Expression</h2>
13<h4>Description</h4>
14<p>A Scalar Expression is an expression convertible to a scalar
15type.</p>
16<h4>Refinement of</h4>
17<p>Default Constructible.</p>
18<h4>Associated types</h4>
19<table border="1" summary="associated types">
20<tbody>
21<tr>
22<td>Public base</td>
23<td>scaler_expression&lt;S&gt;</td>
24<td>S must be derived from this public base type.</td>
25</tr>
26<tr>
27<td>Value type</td>
28<td><code>value_type</code></td>
29<td>The type of the scalar expression.</td>
30</tr>
31</tbody>
32</table>
33<h4>Notation</h4>
34<table border="0" summary="notation">
35<tbody>
36<tr>
37<td><code>S</code></td>
38<td>A type that is a model of Scalar Expression</td>
39</tr>
40</tbody>
41</table>
42<h4>Definitions</h4>
43<h4>Valid expressions</h4>
44<p>In addition to the expressions defined in Default Constructible
45the following expressions must be valid.</p>
46<table border="1" summary="expressions">
47<tbody>
48<tr>
49<th>Name</th>
50<th>Expression</th>
51<th>Type requirements</th>
52<th>Return type</th>
53</tr>
54<tr>
55<td>Evaluation</td>
56<td><code>operator value_type () const</code></td>
57<td>&nbsp;</td>
58<td><code>value_type</code></td>
59</tr>
60</tbody>
61</table>
62<h4>Expression semantics</h4>
63<p>Semantics of an expression is defined only where it differs
64from, or is not defined in Default Constructible.</p>
65<table border="1" summary="semantics">
66<tbody>
67<tr>
68<th>Name</th>
69<th>Expression</th>
70<th>Precondition</th>
71<th>Semantics</th>
72<th>Postcondition</th>
73</tr>
74<tr>
75<td>Evaluation</td>
76<td><code>operator value_type () const</code></td>
77<td>&nbsp;</td>
78<td>&nbsp; Evaluates the scalar expression.</td>
79<td>&nbsp;</td>
80</tr>
81</tbody>
82</table>
83<h4>Complexity guarantees</h4>
84<p>The run-time complexity of the evaluation is specific for the
85evaluated scalar expression.</p>
86<h4>Invariants</h4>
87<h4>Models</h4>
88<ul>
89<li><code>vector_scalar_unary</code></li>
90<li><code>vector_scalar_binary</code></li>
91</ul>
92<h2><a name="vector_expression" id="vector_expression"></a>Vector Expression</h2>
93<h4>Description</h4>
94<p>A Vector Expression is an expression evaluatable to a vector.
95Vector Expression provides an <a href=
96"iterator_concept.htm#indexed_bidirectional_iterator">Indexed Bidirectional
97Iterator</a> or an <a href=
98"iterator_concept.htm#indexed_random_access_iterator">Indexed Random Access
99Iterator</a> .</p>
100<h4>Refinement of</h4>
101<p>Default Constructible.</p>
102<h4>Associated types</h4>
103<table border="1" summary="associated types">
104<tbody>
105<tr>
106<td>Public base</td>
107<td>vector_expression&lt;V&gt;</td>
108<td>V must be derived from this public base type.</td>
109</tr>
110<tr>
111<td>Value type</td>
112<td><code>value_type</code></td>
113<td>
114The element type of the vector expression.
115</td>
116</tr>
117<tr>
118<td>Reference type</td>
119<td><code>reference</code></td>
120<td>
121The return type when accessing an element of a vector expression.
122<br />
123Convertable to a<code>value_type</code>.
124</td>
125</tr>
126<tr>
127<td>Const reference type</td>
128<td><code>const_reference</code></td>
129<td>
130The return type when accessing an element of a constant vector expression.
131<br />
132Convertable to a<code>value_type</code>.
133</td>
134</tr>
135<tr>
136<td>Size type</td>
137<td><code>size_type</code></td>
138<td>
139The index type of the vector expression. Am unsigned integral type used to represent size and index values.
140<br />
141Can represent any nonnegative value of <code>difference_type</code>.
142</td>
143</tr>
144<tr>
145<td>Distance type</td>
146<td><code>difference_type</code></td>
147<td>
148A signed integral type used to represent the distance between two of the vector expression&#039;s iterators.
149</td>
150</tr>
151<tr>
152<td>Const iterator type</td>
153<td><code>const_iterator</code></td>
154<td>A type of iterator that may be used to examine a vector
155expression's elements.</td>
156</tr>
157<tr>
158<td>Iterator type</td>
159<td><code>iterator</code></td>
160<td>A type of iterator that may be used to modify a vector
161expression's elements.</td>
162</tr>
163<tr>
164<td>Const reverse iterator type</td>
165<td><code>const_reverse_iterator</code></td>
166<td>A Reverse Iterator adaptor whose base iterator type is the
167vector expression's const iterator type.</td>
168</tr>
169<tr>
170<td>Reverse iterator type</td>
171<td><code>reverse_iterator</code></td>
172<td>A Reverse Iterator adaptor whose base iterator type is the
173vector expression's iterator type.</td>
174</tr>
175</tbody>
176</table>
177<h4>Notation</h4>
178<table border="0" summary="notation">
179<tbody>
180<tr>
181<td><code>V</code></td>
182<td>A type that is a model of Vector Expression</td>
183</tr>
184<tr>
185<td><code>v, v1, v2</code></td>
186<td>Object of type <code>V</code></td>
187</tr>
188<tr>
189<td><code>i</code></td>
190<td>Object of a type convertible to <code>size_type</code></td>
191</tr>
192<tr>
193<td><code>t</code></td>
194<td>Object of a type convertible to <code>value_type</code></td>
195</tr>
196</tbody>
197</table>
198<h4>Definitions</h4>
199<h4>Valid expressions</h4>
200<p>In addition to the expressions defined in Default Constructible
201the following expressions must be valid.</p>
202<table border="1" summary="expressions">
203<tbody>
204<tr>
205<th>Name</th>
206<th>Expression</th>
207<th>Type requirements</th>
208<th>Return type</th>
209</tr>
210<tr>
211<td rowspan="2">Beginning of range</td>
212<td><code>v.begin ()</code></td>
213<td>&nbsp;</td>
214<td><code>const_iterator</code></td>
215</tr>
216<tr>
217<td><code>v.begin ()</code></td>
218<td><code>v</code> is mutable.</td>
219<td><code>iterator</code></td>
220</tr>
221<tr>
222<td rowspan="2">End of range</td>
223<td><code>v.end ()</code></td>
224<td>&nbsp;</td>
225<td><code>const_iterator</code></td>
226</tr>
227<tr>
228<td><code>v.end ()</code></td>
229<td><code>v</code> is mutable.</td>
230<td><code>iterator</code></td>
231</tr>
232<tr>
233<td>Size</td>
234<td><code>v.size ()</code></td>
235<td>&nbsp;</td>
236<td><code>size_type</code></td>
237</tr>
238<tr>
239<td>Swap</td>
240<td><code>v1.swap (v2)</code></td>
241<td><code>v1</code> and <code>v2</code> are mutable.</td>
242<td><code>void</code></td>
243</tr>
244<tr>
245<td rowspan="2">Beginning of reverse range</td>
246<td><code>v.rbegin ()</code></td>
247<td>&nbsp;</td>
248<td><code>const_reverse_iterator</code></td>
249</tr>
250<tr>
251<td><code>v.rbegin ()</code></td>
252<td><code>v</code> is mutable.</td>
253<td><code>reverse_iterator</code></td>
254</tr>
255<tr>
256<td rowspan="2">End of reverse range</td>
257<td><code>v.rend ()</code></td>
258<td>&nbsp;</td>
259<td><code>const_reverse_iterator</code></td>
260</tr>
261<tr>
262<td><code>v.rend ()</code></td>
263<td><code>v</code> is mutable.</td>
264<td><code>reverse_iterator</code></td>
265</tr>
266<tr>
267<td>Element access</td>
268<td><code>v (i)</code></td>
269<td><code>i</code> is convertible to <code>size_type</code>.</td>
270<td>Convertible to <code>value_type</code>.</td>
271</tr>
272<tr>
273<td rowspan="2">Assignment</td>
274<td><code>v2 = v1</code></td>
275<td><code>v2</code> is mutable and <code>v1</code> is convertible
276to <code>V</code>.</td>
277<td><code>V &amp;</code></td>
278</tr>
279<tr>
280<td><code>v2.assign (v1)</code></td>
281<td><code>v2</code> is mutable and <code>v1</code> is convertible
282to <code>V</code>.</td>
283<td><code>V &amp;</code></td>
284</tr>
285<tr>
286<td rowspan="5">Computed assignment</td>
287<td><code>v2 += v1</code></td>
288<td><code>v2</code> is mutable and <code>v1</code> is convertible
289to <code>V</code>.</td>
290<td><code>V &amp;</code></td>
291</tr>
292<tr>
293<td><code>v2.plus_assign (v1)</code></td>
294<td><code>v2</code> is mutable and <code>v1</code> is convertible
295to <code>V</code>.</td>
296<td><code>V &amp;</code></td>
297</tr>
298<tr>
299<td><code>v2 -= v1</code></td>
300<td><code>v2</code> is mutable and <code>v1</code> is convertible
301to <code>V</code>.</td>
302<td><code>V &amp;</code></td>
303</tr>
304<tr>
305<td><code>v2.minus_assign (v1)</code></td>
306<td><code>v2</code> is mutable and <code>v1</code> is convertible
307to <code>V</code>.</td>
308<td><code>V &amp;</code></td>
309</tr>
310<tr>
311<td><code>v *= t</code></td>
312<td><code>v</code> is mutable and <code>t</code> is convertible to
313<code>value_type</code>.</td>
314<td><code>V &amp;</code></td>
315</tr>
316</tbody>
317</table>
318<h4>Expression semantics</h4>
319<p>Semantics of an expression is defined only where it differs
320from, or is not defined in Default Constructible.</p>
321<table border="1" summary="semantics">
322<tbody>
323<tr>
324<th>Name</th>
325<th>Expression</th>
326<th>Precondition</th>
327<th>Semantics</th>
328<th>Postcondition</th>
329</tr>
330<tr>
331<td>Beginning of range</td>
332<td><code>v.begin ()</code></td>
333<td>&nbsp;</td>
334<td>Returns an iterator pointing to the first element in the vector
335expression.</td>
336<td><code>v.begin ()</code> is either dereferenceable or
337past-the-end. It is past-the-end if and only if <code>v.size () ==
3380</code>.</td>
339</tr>
340<tr>
341<td>End of range</td>
342<td><code>v.end ()</code></td>
343<td>&nbsp;</td>
344<td>Returns an iterator pointing one past the last element in the
345vector expression.</td>
346<td><code>v.end ()</code> is past-the-end.</td>
347</tr>
348<tr>
349<td>Size</td>
350<td><code>v.size ()</code></td>
351<td>&nbsp;</td>
352<td>Returns the size of the vector expression, that is, its number
353of elements.</td>
354<td><code>v.size () &gt;= 0</code></td>
355</tr>
356<tr>
357<td>Swap</td>
358<td><code>v1.swap (v2)</code></td>
359<td>&nbsp;</td>
360<td>Equivalent to <code>swap (v1, v2)</code>.</td>
361<td>&nbsp;</td>
362</tr>
363<tr>
364<td>Beginning of reverse range</td>
365<td><code>v.rbegin ()</code></td>
366<td>&nbsp;</td>
367<td>Equivalent to <code>reverse_iterator (v.end ())</code>.</td>
368<td><code>v.rbegin ()</code> is either dereferenceable or
369past-the-end. It is past-the-end if and only if <code>v.size () ==
3700</code>.</td>
371</tr>
372<tr>
373<td>End of reverse range</td>
374<td><code>v.rend ()</code></td>
375<td>&nbsp;</td>
376<td>Equivalent to <code>reverse_iterator (v.begin ())</code>.</td>
377<td><code>v.rend ()</code> is past-the-end.</td>
378</tr>
379<tr>
380<td>Element access</td>
381<td><code>v (i)</code></td>
382<td><code>0 &lt;= i &lt; v.size ()</code></td>
383<td>Returns the <code>i</code>-th element of the vector
384expression.</td>
385<td>&nbsp;</td>
386</tr>
387<tr>
388<td rowspan="2">Assignment</td>
389<td><code>v2 = v1</code></td>
390<td><code>v1.size () == v2.size ()</code></td>
391<td>Assigns every element of the evaluated vector expression
392<code>v1</code> to the corresponding element of <code>v2</code>
393.</td>
394<td>&nbsp;</td>
395</tr>
396<tr>
397<td><code>v2.assign (v1)</code></td>
398<td><code>v1.size () == v2.size ()</code></td>
399<td>Assigns every element of <code>v1</code> to the corresponding
400element of <code>v2</code>.</td>
401<td>&nbsp;</td>
402</tr>
403<tr>
404<td rowspan="5">Computed assignment</td>
405<td><code>v2 += v1</code></td>
406<td><code>v1.size () == v2.size ()</code></td>
407<td>Adds every element of the evaluated vector expression
408<code>v1</code> to the corresponding element of
409<code>v2</code>.</td>
410<td>&nbsp;</td>
411</tr>
412<tr>
413<td><code>v2.plus_assign (v1)</code></td>
414<td><code>v1.size () == v2.size ()</code></td>
415<td>Adds every element of <code>v1</code> to the corresponding
416element of <code>v2</code>.</td>
417<td>&nbsp;</td>
418</tr>
419<tr>
420<td><code>v2 -= v1</code></td>
421<td><code>v1.size () == v2.size ()</code></td>
422<td>Subtracts every element of the evaluated vector expression
423<code>v1</code> from the corresponding element of <code>v2</code>
424.</td>
425<td>&nbsp;</td>
426</tr>
427<tr>
428<td><code>v2.minus_assign (v1)</code></td>
429<td><code>v1.size () == v2.size ()</code></td>
430<td>Subtracts every element of <code>v1</code> from the
431corresponding element of <code>v2</code>.</td>
432<td>&nbsp;</td>
433</tr>
434<tr>
435<td><code>v *= t</code></td>
436<td>&nbsp;</td>
437<td>Multiplies every element of <code>v</code> with <code>t</code>
438.</td>
439<td>&nbsp;</td>
440</tr>
441</tbody>
442</table>
443<h4>Complexity guarantees</h4>
444<p>The run-time complexity of <code>begin ()</code> and <code>end
445()</code> is specific for the evaluated vector expression,
446typically amortized constant time.</p>
447<p>The run-time complexity of <code>size ()</code> is constant
448time.</p>
449<p>The run-time complexity of <code>swap ()</code> is specific for
450the evaluated vector expression, typically constant time.</p>
451<p>The run-time complexity of <code>rbegin ()</code> and <code>rend
452()</code> is specific for the evaluated vector expression,
453typically amortized constant time.</p>
454<p>The run-time complexity of the element access is specific for
455the evaluated vector expression, typically amortized constant time
456for the dense and logarithmic for the sparse case.</p>
457<p>The run-time complexity of the arithmetic operations is specific
458for the evaluated vector expressions, typically linear in the size
459of the expressions.</p>
460<h4>Invariants</h4>
461<table border="1" summary="invariants">
462<tbody>
463<tr>
464<td>Valid range</td>
465<td>For any vector expression <code>v</code>, <code>[v.begin (),
466v.end ())</code> is a valid range.</td>
467</tr>
468<tr>
469<td>Completeness</td>
470<td>An algorithm that iterates through the range <code>[v.begin (),
471v.end ())</code> will pass through every element of <code>v</code>
472.</td>
473</tr>
474<tr>
475<td>Valid reverse range</td>
476<td><code>[v.rbegin (), v.rend ())</code> is a valid range.</td>
477</tr>
478<tr>
479<td>Equivalence of ranges</td>
480<td>The distance from <code>v.begin ()</code> to <code>v.end
481()</code> is the same as the distance from <code>v.rbegin ()</code>
482to <code>v.rend ()</code>.</td>
483</tr>
484</tbody>
485</table>
486<h4>Models</h4>
487<ul>
488<li><code>vector_range;</code></li>
489<li><code>vector_slice</code></li>
490<li><code>matrix_row</code></li>
491<li><code>matrix_column</code></li>
492<li><code>matrix_vector_range</code></li>
493<li><code>matrix_vector_slice</code></li>
494<li><code>vector_unary</code></li>
495<li><code>vector_binary</code></li>
496<li><code>vector_binary_scalar1</code></li>
497<li><code>vector_binary_scalar2</code></li>
498<li><code>matrix_vector_unary1</code></li>
499<li><code>matrix_vector_unary2</code></li>
500<li><code>matrix_vector_binary1</code></li>
501<li><code>matrix_vector_binary2</code></li>
502</ul>
503
504<h2><a name="matrix_expression" id="matrix_expression"></a>Matrix Expression</h2>
505<h4>Description</h4>
506<p>A Matrix Expression is an expression evaluatable to a matrix.
507Matrix Expression provides an <a href=
508"iterator_concept.htm#indexed_bidirectional_cr_iterator">Indexed
509Bidirectional Column/Row Iterator</a> or an <a href=
510"iterator_concept.htm#indexed_random_access_cr_iterator">Indexed Random
511Access Column/Row Iterator</a> .</p>
512<h4>Refinement of</h4>
513<p>Default Constructible.</p>
514<h4>Associated types</h4>
515<table border="1" summary="associated types">
516<tbody>
517<tr>
518<td>Public base</td>
519<td>matrix_expression&lt;M&gt;</td>
520<td>M must be derived from this public base type.</td>
521</tr>
522<tr>
523<td>Value type</td>
524<td><code>value_type</code></td>
525<td>
526The element type of the matrix expression.
527</td>
528</tr>
529<tr>
530<td>Reference type</td>
531<td><code>reference</code></td>
532<td>
533The return type when accessing an element of a matrix expression.
534<br />
535Convertable to a<code>value_type</code>.
536</td>
537</tr>
538<tr>
539<td>Const reference type</td>
540<td><code>const_reference</code></td>
541<td>
542The return type when accessing an element of a constant matrix expression.
543<br />
544Convertable to a<code>value_type</code>.
545</td>
546</tr>
547<tr>
548<td>Size type</td>
549<td><code>size_type</code></td>
550<td>
551The index type of the matrix expression. Am unsigned integral type used to represent size and index values.
552<br />
553Can represent any nonnegative value of <code>difference_type</code>.
554</td>
555</tr>
556<tr>
557<td>Distance type</td>
558<td><code>difference_type</code></td>
559<td>
560A signed integral type used to represent the distance between two of the matrix expression&#039;s iterators.
561</td>
562</tr>
563<tr>
564<td rowspan="2">Const iterator types</td>
565<td><code>const_iterator1</code></td>
566<td>A type of column iterator that may be used to examine a matrix
567expression's elements.</td>
568</tr>
569<tr>
570<td><code>const_iterator2</code></td>
571<td>A type of row iterator that may be used to examine a matrix
572expression's elements.</td>
573</tr>
574<tr>
575<td rowspan="2">Iterator types</td>
576<td><code>iterator1</code></td>
577<td>A type of column iterator that may be used to modify a matrix
578expression's elements.</td>
579</tr>
580<tr>
581<td><code>iterator2</code></td>
582<td>A type of row iterator that may be used to modify a matrix
583expression's elements.</td>
584</tr>
585<tr>
586<td rowspan="2">Const reverse iterator types</td>
587<td><code>const_reverse_iterator1</code></td>
588<td>A Reverse Iterator adaptor whose base iterator type is the
589matrix expression's const column iterator type.</td>
590</tr>
591<tr>
592<td><code>const_reverse_iterator2</code></td>
593<td>A Reverse Iterator adaptor whose base iterator type is the
594matrix expression's const row iterator type.</td>
595</tr>
596<tr>
597<td rowspan="2">Reverse iterator types</td>
598<td><code>reverse_iterator1</code></td>
599<td>A Reverse Iterator adaptor whose base iterator type is the
600matrix expression's column iterator type.</td>
601</tr>
602<tr>
603<td><code>reverse_iterator2</code></td>
604<td>A Reverse Iterator adaptor whose base iterator type is the
605matrix expression's row iterator type.</td>
606</tr>
607</tbody>
608</table>
609<h4>Notation</h4>
610<table border="0" summary="notation">
611<tbody>
612<tr>
613<td><code>M</code></td>
614<td>A type that is a model of Matrix Expression</td>
615</tr>
616<tr>
617<td><code>m, m1, m2</code></td>
618<td>Object of type <code>M</code></td>
619</tr>
620<tr>
621<td><code>i, j</code></td>
622<td>Objects of a type convertible to <code>size_type</code></td>
623</tr>
624<tr>
625<td><code>t</code></td>
626<td>Object of a type convertible to <code>value_type</code></td>
627</tr>
628</tbody>
629</table>
630<h4>Definitions</h4>
631<h4>Valid expressions</h4>
632<p>In addition to the expressions defined in Default Constructible
633the following expressions must be valid.</p>
634<table border="1" summary="expressions">
635<tbody>
636<tr>
637<th>Name</th>
638<th>Expression</th>
639<th>Type requirements</th>
640<th>Return type</th>
641</tr>
642<tr>
643<td rowspan="4">Beginning of range</td>
644<td><code>m.begin1 ()</code></td>
645<td>&nbsp;</td>
646<td><code>const_iterator1</code></td>
647</tr>
648<tr>
649<td><code>m.begin2 ()</code></td>
650<td>&nbsp;</td>
651<td><code>const_iterator2</code></td>
652</tr>
653<tr>
654<td><code>m.begin1 ()</code></td>
655<td><code>m</code> is mutable.&nbsp;</td>
656<td><code>iterator1</code></td>
657</tr>
658<tr>
659<td><code>m.begin2 ()</code></td>
660<td><code>m</code> is mutable.</td>
661<td><code>iterator2</code></td>
662</tr>
663<tr>
664<td rowspan="4">End of range</td>
665<td><code>m.end1 ()</code></td>
666<td>&nbsp;</td>
667<td><code>const_iterator1</code></td>
668</tr>
669<tr>
670<td><code>m.end2 ()</code></td>
671<td>&nbsp;</td>
672<td><code>const_iterator2</code></td>
673</tr>
674<tr>
675<td><code>m.end1 ()</code></td>
676<td><code>m</code> is mutable.&nbsp;</td>
677<td><code>iterator1</code></td>
678</tr>
679<tr>
680<td><code>m.end2 ()</code></td>
681<td><code>m</code> is mutable.</td>
682<td><code>iterator2</code></td>
683</tr>
684<tr>
685<td rowspan="2">Size</td>
686<td><code>m.size1 ()</code></td>
687<td>&nbsp;</td>
688<td><code>size_type</code></td>
689</tr>
690<tr>
691<td><code>m.size2 ()</code></td>
692<td>&nbsp;</td>
693<td><code>size_type</code></td>
694</tr>
695<tr>
696<td>Swap</td>
697<td><code>m1.swap (m2)</code></td>
698<td><code>m1</code> and <code>m2</code> are mutable.&nbsp;</td>
699<td><code>void</code></td>
700</tr>
701<tr>
702<td rowspan="4">Beginning of reverse range</td>
703<td><code>m.rbegin1 ()</code></td>
704<td>&nbsp;</td>
705<td><code>const_reverse_iterator1</code></td>
706</tr>
707<tr>
708<td><code>m.rbegin2 ()</code></td>
709<td>&nbsp;</td>
710<td><code>const_reverse_iterator2</code></td>
711</tr>
712<tr>
713<td><code>m.rbegin1 ()</code></td>
714<td><code>m</code> is mutable.&nbsp;</td>
715<td><code>reverse_iterator1</code></td>
716</tr>
717<tr>
718<td><code>m.rbegin2 ()</code></td>
719<td><code>m</code> is mutable.</td>
720<td><code>reverse_iterator2</code></td>
721</tr>
722<tr>
723<td rowspan="4">End of reverse range</td>
724<td><code>m.rend1 ()</code></td>
725<td>&nbsp;</td>
726<td><code>const_reverse_iterator1</code></td>
727</tr>
728<tr>
729<td><code>m.rend2 ()</code></td>
730<td>&nbsp;</td>
731<td><code>const_reverse_iterator2</code></td>
732</tr>
733<tr>
734<td><code>m.rend1 ()</code></td>
735<td><code>m</code> is mutable.</td>
736<td><code>reverse_iterator1</code></td>
737</tr>
738<tr>
739<td><code>m.rend2 ()</code></td>
740<td><code>m</code> is mutable.</td>
741<td><code>reverse_iterator2</code></td>
742</tr>
743<tr>
744<td>Element access</td>
745<td><code>m (i, j)</code></td>
746<td><code>i</code> and <code>j</code> are convertible to
747<code>size_type</code> .</td>
748<td>Convertible to <code>value_type</code>.</td>
749</tr>
750<tr>
751<td rowspan="2">Assignment</td>
752<td><code>m2 = m1</code></td>
753<td><code>m2</code> is mutable and <code>m1</code> is convertible
754to <code>M</code>.</td>
755<td><code>M &amp;</code></td>
756</tr>
757<tr>
758<td><code>m2.assign (m1)</code></td>
759<td><code>m2</code> is mutable and <code>m1</code> is convertible
760to <code>M</code>.</td>
761<td><code>M &amp;</code></td>
762</tr>
763<tr>
764<td rowspan="5">Computed assignment</td>
765<td><code>m2 += m1</code></td>
766<td><code>m2</code> is mutable and <code>m1</code> is convertible
767to <code>M</code>.</td>
768<td><code>M &amp;</code></td>
769</tr>
770<tr>
771<td><code>m2.plus_assign (m1)</code></td>
772<td><code>m2</code> is mutable and <code>m1</code> is convertible
773to <code>M</code>.</td>
774<td><code>M &amp;</code></td>
775</tr>
776<tr>
777<td><code>m2 -= m1</code></td>
778<td><code>m2</code> is mutable and <code>m1</code> is convertible
779to <code>M</code>.</td>
780<td><code>M &amp;</code></td>
781</tr>
782<tr>
783<td><code>m2.minus_assign (m1)</code></td>
784<td><code>m2</code> is mutable and <code>m1</code> is convertible
785to <code>M</code>.</td>
786<td><code>M &amp;</code></td>
787</tr>
788<tr>
789<td><code>m *= t</code></td>
790<td><code>m</code> is mutable and <code>t</code> is convertible to
791<code>value_type</code>.</td>
792<td><code>M &amp;</code></td>
793</tr>
794</tbody>
795</table>
796<h4>Expression semantics</h4>
797<p>Semantics of an expression is defined only where it differs
798from, or is not defined in Default Constructible.</p>
799<table border="1" summary="semantics">
800<tbody>
801<tr>
802<th>Name</th>
803<th>Expression</th>
804<th>Precondition</th>
805<th>Semantics</th>
806<th>Postcondition</th>
807</tr>
808<tr>
809<td rowspan="2">Beginning of range</td>
810<td><code>m.begin1 ()</code></td>
811<td>&nbsp;</td>
812<td>Returns an iterator pointing to the first element in the first
813column of a matrix expression.</td>
814<td><code>m.begin1 ()</code> is either dereferenceable or
815past-the-end. It is past-the-end if and only if <code>m.size1 () ==
8160</code>.</td>
817</tr>
818<tr>
819<td><code>m.begin2 ()</code></td>
820<td>&nbsp;</td>
821<td>Returns an iterator pointing to the first element in the first
822row of a matrix expression.</td>
823<td><code>m.begin2 ()</code> is either dereferenceable or
824past-the-end. It is past-the-end if and only if <code>m.size2 () ==
8250</code>.</td>
826</tr>
827<tr>
828<td rowspan="2">End of range</td>
829<td><code>m.end1 ()</code></td>
830<td>&nbsp;</td>
831<td>Returns an iterator pointing one past the last element in the
832matrix expression.</td>
833<td><code>m.end1 ()</code> is past-the-end.</td>
834</tr>
835<tr>
836<td><code>m.end2 ()</code></td>
837<td>&nbsp;</td>
838<td>Returns an iterator pointing one past the last element in the
839matrix expression.</td>
840<td><code>m.end2 ()</code> is past-the-end.</td>
841</tr>
842<tr>
843<td rowspan="2">Size</td>
844<td><code>m.size1 ()</code></td>
845<td>&nbsp;</td>
846<td>Returns the number of rows of the matrix expression.</td>
847<td><code>m.size1 () &gt;= 0</code></td>
848</tr>
849<tr>
850<td><code>m.size2 ()</code></td>
851<td>&nbsp;</td>
852<td>Returns the number of columns of the matrix expression.</td>
853<td><code>m.size2 () &gt;= 0</code></td>
854</tr>
855<tr>
856<td>Swap</td>
857<td><code>m1.swap (m2)</code></td>
858<td>&nbsp;</td>
859<td>Equivalent to <code>swap (m1, m2)</code>.</td>
860<td>&nbsp;</td>
861</tr>
862<tr>
863<td rowspan="2">Beginning of reverse range</td>
864<td><code>m.rbegin1 ()</code></td>
865<td>&nbsp;</td>
866<td>Equivalent to <code>reverse_iterator1 (m.end1 ())</code>.</td>
867<td><code>m.rbegin1 ()</code> is either dereferenceable or
868past-the-end. It is past-the-end if and only if <code>m.size1 () ==
8690</code>.</td>
870</tr>
871<tr>
872<td><code>m.rbegin2 ()</code></td>
873<td>&nbsp;</td>
874<td>Equivalent to <code>reverse_iterator2 (m.end2 ())</code>.</td>
875<td><code>m.rbegin2 ()</code> is either dereferenceable or
876past-the-end. It is past-the-end if and only if <code>m.size2 () ==
8770</code>.</td>
878</tr>
879<tr>
880<td rowspan="2">End of reverse range</td>
881<td><code>m.rend1 ()</code></td>
882<td>&nbsp;</td>
883<td>Equivalent to <code>reverse_iterator1 (m.begin1
884())</code>.</td>
885<td><code>m.rend1 ()</code> is past-the-end.</td>
886</tr>
887<tr>
888<td><code>m.rend2 ()</code></td>
889<td>&nbsp;</td>
890<td>Equivalent to <code>reverse_iterator2 (m.begin2
891())</code>.</td>
892<td><code>m.rend2 ()</code> is past-the-end.</td>
893</tr>
894<tr>
895<td>Element access</td>
896<td><code>m (i, j)</code></td>
897<td><code>0 &lt;= i &lt; m.size1 ()</code> and <code>0 &lt;= j &lt;
898m.size2 ()</code></td>
899<td>Returns the <code>j</code>-th element of the <code>i</code>-th
900row of the matrix expression.</td>
901<td>&nbsp;</td>
902</tr>
903<tr>
904<td rowspan="2">Assignment</td>
905<td><code>m2 = m1</code></td>
906<td><code>m1.size1 () == m2.size1 ()</code> and <code><br />
907m1.size2 () == m2.size2 ()</code></td>
908<td>Assigns every element of the evaluated matrix expression
909<code>m1</code> to the corresponding element of <code>m2</code>
910.</td>
911<td>&nbsp;</td>
912</tr>
913<tr>
914<td><code>m2.assign (m1)</code></td>
915<td><code>m1.size1 () == m2.size1 ()</code> and <code><br />
916m1.size2 () == m2.size2 ()</code></td>
917<td>Assigns every element of <code>m1</code> to the corresponding
918element of <code>m2</code>.</td>
919<td>&nbsp;</td>
920</tr>
921<tr>
922<td rowspan="5">Computed assignment</td>
923<td><code>m2 += m1</code></td>
924<td><code>m1.size1 () == m2.size1 ()</code> and <code><br />
925m1.size2 () == m2.size2 ()</code></td>
926<td>Adds every element of the evaluated matrix expression
927<code>m1</code> to the corresponding element of
928<code>m2</code>.</td>
929<td>&nbsp;</td>
930</tr>
931<tr>
932<td><code>m2.plus_assign (m1)</code></td>
933<td><code>m1.size1 () == m2.size1 ()</code> and <code><br />
934m1.size2 () == m2.size2 ()</code></td>
935<td>Adds every element of <code>m1</code> to the corresponding
936element of <code>m2</code>.</td>
937<td>&nbsp;</td>
938</tr>
939<tr>
940<td><code>m2 -= m1</code></td>
941<td><code>m1.size1 () == m2.size1 ()</code> and <code><br />
942m1.size2 () == m2.size2 ()</code></td>
943<td>Subtracts every element of the evaluated matrix expression
944<code>m1</code> from the corresponding element of <code>m2</code>
945.</td>
946<td>&nbsp;</td>
947</tr>
948<tr>
949<td><code>m2.minus_assign (m1)</code></td>
950<td><code>m1.size1 () == m2.size1 ()</code> and <code><br />
951m1.size2 () == m2.size2 ()</code></td>
952<td>Subtracts every element of <code>m1</code> from the
953corresponding element of <code>m2</code>.</td>
954<td>&nbsp;</td>
955</tr>
956<tr>
957<td><code>m *= t</code></td>
958<td>&nbsp;</td>
959<td>Multiplies every element of <code>m</code> with <code>t</code>
960.</td>
961<td>&nbsp;</td>
962</tr>
963</tbody>
964</table>
965<h4>Complexity guarantees</h4>
966<p>The run-time complexity of <code>begin1 ()</code>, <code>begin2
967()</code> , <code>end1 ()</code> and <code>end2 ()</code> is
968specific for the evaluated matrix expression.</p>
969<p>The run-time complexity of <code>size1 ()</code> and <code>size2
970()</code> is constant time.</p>
971<p>The run-time complexity of <code>swap ()</code> is specific for
972the evaluated matrix expression, typically constant time.</p>
973<p>The run-time complexity of <code>rbegin1 ()</code>,
974<code>rbegin2 ()</code> , <code>rend1 ()</code> and <code>rend2
975()</code> is specific for the evaluated matrix expression.</p>
976<p>The run-time complexity of the element access is specific for
977the evaluated matrix expression, typically amortized constant time
978for the dense and logarithmic for the sparse case.</p>
979<p>The run-time complexity of the arithmetic operations is specific
980for the evaluated matrix expressions, typically quadratic in the
981size of the proxies.</p>
982<h4>Invariants</h4>
983<table border="1" summary="invariants">
984<tbody>
985<tr>
986<td>Valid range</td>
987<td>For any matrix expression <code>m</code>, <code>[m.begin1 (),
988m.end1 ())</code> and <code>[m.begin2 (), m.end2 ())</code> are
989valid ranges.</td>
990</tr>
991<tr>
992<td>Completeness</td>
993<td>An algorithm that iterates through the range <code>[m.begin1
994(), m.end1 ())</code> will pass through every row of <code>m</code>
995, an algorithm that iterates through the range <code>[m.begin2 (),
996m.end2 ())</code> will pass through every column of <code>m</code>
997.</td>
998</tr>
999<tr>
1000<td>Valid reverse range</td>
1001<td><code>[m.rbegin1 (), m.rend1 ())</code> and <code>[m.rbegin2
1002(), m.rend2 ())</code> are valid ranges.</td>
1003</tr>
1004<tr>
1005<td>Equivalence of ranges</td>
1006<td>The distance from <code>m.begin1 ()</code> to <code>m.end1
1007()</code> is the same as the distance from <code>m.rbegin1
1008()</code> to <code>m.rend1 ()</code> and the distance from
1009<code>m.begin2 ()</code> to <code>m.end2 ()</code> is the same as
1010the distance from <code>m.rbegin2 ()</code> to <code>m.rend2
1011()</code>.</td>
1012</tr>
1013</tbody>
1014</table>
1015<h4>Models</h4>
1016<ul>
1017<li><code>matrix_range</code></li>
1018<li><code>matrix_slice;</code></li>
1019<li><code>triangular_adaptor</code></li>
1020<li><code>symmetric_adaptor</code></li>
1021<li><code>banded_adaptor</code></li>
1022<li><code>vector_matrix_binary</code></li>
1023<li><code>matrix_unary1</code></li>
1024<li><code>matrix_unary2</code></li>
1025<li><code>matrix_binary</code></li>
1026<li><code>matrix_binary_scalar1</code></li>
1027<li><code>matrix_binary_scalar2</code></li>
1028<li><code>matrix_matrix_binary</code></li>
1029</ul>
1030<hr />
1031<p>Copyright (&copy;) 2000-2002 Joerg Walter, Mathias Koch<br />
1032Permission to copy, use, modify, sell and distribute this document
1033is granted provided this copyright notice appears in all copies.
1034This document is provided ``as is'' without express or implied
1035warranty, and with no claim as to its suitability for any
1036purpose.</p>
1037</body>
1038</html>
Note: See TracBrowser for help on using the repository browser.