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