diff --git a/doc/expression.htm b/doc/expression.htm deleted file mode 100644 index 9dbd94a3..00000000 --- a/doc/expression.htm +++ /dev/null @@ -1,1029 +0,0 @@ - - -
- - - -
-Expression ConceptsA Scalar Expression is an expression convertible to a scalar -type.
-Default Constructible.
-| Value type | -value_type |
-The type of the scalar expression. | -
S |
-A type that is a model of Scalar Expression | -
In addition to the expressions defined in Default Constructible -the following expressions must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Evaluation | -operator value_type () const |
-- | value_type |
-
Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Evaluation | -operator value_type () const |
-- | Evaluates the scalar expression. | -- |
The run-time complexity of the evaluation is specific for the -evaluated scalar expression.
-vector_scalar_unary<E, F>vector_scalar_binary<E1, E2, F>A Vector Expression is an expression evaluatable to a vector. -Vector Expression provides an Indexed Bidirectional -Iterator or an Indexed Random Access -Iterator .
-Default Constructible.
-| Value type | -value_type |
--The element type of the vector expression. - | -
| Reference type | -reference |
-
-The return type when accessing an element of a vector expression.
- -Convertable to a value_type.
- |
-
| Const reference type | -const_reference |
-
-The return type when accessing an element of a constant vector expression.
- -Convertable to a value_type.
- |
-
| Size type | -size_type |
-
-The index type of the vector expression. Am unsigned integral type used to represent size and index values.
- -Can represent any nonnegative value of difference_type.
- |
-
| Distance type | -difference_type |
--A signed integral type used to represent the distance between two of the vector expression's iterators. - | -
| Const iterator type | -const_iterator |
-A type of iterator that may be used to examine a vector -expression's elements. | -
| Iterator type | -iterator |
-A type of iterator that may be used to modify a vector -expression's elements. | -
| Const reverse iterator type | -const_reverse_iterator |
-A Reverse Iterator adaptor whose base iterator type is the -vector expression's const iterator type. | -
| Reverse iterator type | -reverse_iterator |
-A Reverse Iterator adaptor whose base iterator type is the -vector expression's iterator type. | -
V |
-A type that is a model of Vector Expression | -
v, v1, v2 |
-Object of type V |
-
i |
-Object of a type convertible to size_type |
-
t |
-Object of a type convertible to value_type |
-
In addition to the expressions defined in Default Constructible -the following expressions must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Beginning of range | -v.begin () |
-- | const_iterator |
-
v.begin () |
-v is mutable. |
-iterator |
-|
| End of range | -v.end () |
-- | const_iterator |
-
v.end () |
-v is mutable. |
-iterator |
-|
| Size | -v.size () |
-- | size_type |
-
| Swap | -v1.swap (v2) |
-v1 and v2 are mutable. |
-void |
-
| Beginning of reverse range | -v.rbegin () |
-- | const_reverse_iterator |
-
v.rbegin () |
-v is mutable. |
-reverse_iterator |
-|
| End of reverse range | -v.rend () |
-- | const_reverse_iterator |
-
v.rend () |
-v is mutable. |
-reverse_iterator |
-|
| Element access | -v (i) |
-i is convertible to size_type. |
-Convertible to value_type. |
-
| Assignment | -v2 = v1 |
-v2 is mutable and v1 is convertible
-to V. |
-V & |
-
v2.assign (v1) |
-v2 is mutable and v1 is convertible
-to V. |
-V & |
-|
| Computed assignment | -v2 += v1 |
-v2 is mutable and v1 is convertible
-to V. |
-V & |
-
v2.plus_assign (v1) |
-v2 is mutable and v1 is convertible
-to V. |
-V & |
-|
v2 -= v1 |
-v2 is mutable and v1 is convertible
-to V. |
-V & |
-|
v2.minus_assign (v1) |
-v2 is mutable and v1 is convertible
-to V. |
-V & |
-|
v *= t |
-v is mutable and t is convertible to
-value_type. |
-V & |
-
Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Beginning of range | -v.begin () |
-- | Returns an iterator pointing to the first element in the vector -expression. | -v.begin () is either dereferenceable or
-past-the-end. It is past-the-end if and only if v.size () ==
-0. |
-
| End of range | -v.end () |
-- | Returns an iterator pointing one past the last element in the -vector expression. | -v.end () is past-the-end. |
-
| Size | -v.size () |
-- | Returns the size of the vector expression, that is, its number -of elements. | -v.size () >= 0 |
-
| Swap | -v1.swap (v2) |
-- | Equivalent to swap (v1, v2). |
-- |
| Beginning of reverse range | -v.rbegin () |
-- | Equivalent to reverse_iterator (v.end ()). |
-v.rbegin () is either dereferenceable or
-past-the-end. It is past-the-end if and only if v.size () ==
-0. |
-
| End of reverse range | -v.rend () |
-- | Equivalent to reverse_iterator (v.begin ()). |
-v.rend () is past-the-end. |
-
| Element access | -v (i) |
-0 <= i < v.size () |
-Returns the i-th element of the vector
-expression. |
-- |
| Assignment | -v2 = v1 |
-v1.size () == v2.size () |
-Assigns every element of the evaluated vector expression
-v1 to the corresponding element of v2
-. |
-- |
v2.assign (v1) |
-v1.size () == v2.size () |
-Assigns every element of v1 to the corresponding
-element of v2. |
-- | |
| Computed assignment | -v2 += v1 |
-v1.size () == v2.size () |
-Adds every element of the evaluated vector expression
-v1 to the corresponding element of
-v2. |
-- |
v2.plus_assign (v1) |
-v1.size () == v2.size () |
-Adds every element of v1 to the corresponding
-element of v2. |
-- | |
v2 -= v1 |
-v1.size () == v2.size () |
-Subtracts every element of the evaluated vector expression
-v1 from the corresponding element of v2
-. |
-- | |
v2.minus_assign (v1) |
-v1.size () == v2.size () |
-Subtracts every element of v1 from the
-corresponding element of v2. |
-- | |
v *= t |
-- | Multiplies every element of v with t
-. |
-- |
The run-time complexity of begin () and end
-() is specific for the evaluated vector expression,
-typically amortized constant time.
The run-time complexity of size () is constant
-time.
The run-time complexity of swap () is specific for
-the evaluated vector expression, typically constant time.
The run-time complexity of rbegin () and rend
-() is specific for the evaluated vector expression,
-typically amortized constant time.
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.
-The run-time complexity of the arithmetic operations is specific -for the evaluated vector expressions, typically linear in the size -of the expressions.
-| Valid range | -For any vector expression v, [v.begin (),
-v.end ()) is a valid range. |
-
| Completeness | -An algorithm that iterates through the range [v.begin (),
-v.end ()) will pass through every element of v
-. |
-
| Valid reverse range | -[v.rbegin (), v.rend ()) is a valid range. |
-
| Equivalence of ranges | -The distance from v.begin () to v.end
-() is the same as the distance from v.rbegin ()
-to v.rend (). |
-
vector_range<V>vector_slice<V>matrix_row<M>matrix_column<M>matrix_vector_range<M>matrix_vector_slice<M>vector_unary<E, F>vector_binary<E1, E2, F>vector_binary_scalar1<E1, E2, F>vector_binary_scalar2<E1, E2, F>matrix_vector_unary1<E>matrix_vector_unary2<E>matrix_vector_binary1<E1, E2, F>matrix_vector_binary2<E1, E2, F>A Matrix Expression is an expression evaluatable to a matrix. -Matrix Expression provides an Indexed -Bidirectional Column/Row Iterator or an Indexed Random -Access Column/Row Iterator .
-Default Constructible.
-| Value type | -value_type |
--The element type of the matrix expression. - | -
| Reference type | -reference |
-
-The return type when accessing an element of a matrix expression.
- -Convertable to a value_type.
- |
-
| Const reference type | -const_reference |
-
-The return type when accessing an element of a constant matrix expression.
- -Convertable to a value_type.
- |
-
| Size type | -size_type |
-
-The index type of the matrix expression. Am unsigned integral type used to represent size and index values.
- -Can represent any nonnegative value of difference_type.
- |
-
| Distance type | -difference_type |
--A signed integral type used to represent the distance between two of the matrix expression's iterators. - | -
| Const iterator types | -const_iterator1 |
-A type of column iterator that may be used to examine a matrix -expression's elements. | -
const_iterator2 |
-A type of row iterator that may be used to examine a matrix -expression's elements. | -|
| Iterator types | -iterator1 |
-A type of column iterator that may be used to modify a matrix -expression's elements. | -
iterator2 |
-A type of row iterator that may be used to modify a matrix -expression's elements. | -|
| Const reverse iterator types | -const_reverse_iterator1 |
-A Reverse Iterator adaptor whose base iterator type is the -matrix expression's const column iterator type. | -
const_reverse_iterator2 |
-A Reverse Iterator adaptor whose base iterator type is the -matrix expression's const row iterator type. | -|
| Reverse iterator types | -reverse_iterator1 |
-A Reverse Iterator adaptor whose base iterator type is the -matrix expression's column iterator type. | -
reverse_iterator2 |
-A Reverse Iterator adaptor whose base iterator type is the -matrix expression's row iterator type. | -
M |
-A type that is a model of Matrix Expression | -
m, m1, m2 |
-Object of type M |
-
i, j |
-Objects of a type convertible to size_type |
-
t |
-Object of a type convertible to value_type |
-
In addition to the expressions defined in Default Constructible -the following expressions must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Beginning of range | -m.begin1 () |
-- | const_iterator1 |
-
m.begin2 () |
-- | const_iterator2 |
-|
m.begin1 () |
-m is mutable. |
-iterator1 |
-|
m.begin2 () |
-m is mutable. |
-iterator2 |
-|
| End of range | -m.end1 () |
-- | const_iterator1 |
-
m.end2 () |
-- | const_iterator2 |
-|
m.end1 () |
-m is mutable. |
-iterator1 |
-|
m.end2 () |
-m is mutable. |
-iterator2 |
-|
| Size | -m.size1 () |
-- | size_type |
-
m.size2 () |
-- | size_type |
-|
| Swap | -m1.swap (m2) |
-m1 and m2 are mutable. |
-void |
-
| Beginning of reverse range | -m.rbegin1 () |
-- | const_reverse_iterator1 |
-
m.rbegin2 () |
-- | const_reverse_iterator2 |
-|
m.rbegin1 () |
-m is mutable. |
-reverse_iterator1 |
-|
m.rbegin2 () |
-m is mutable. |
-reverse_iterator2 |
-|
| End of reverse range | -m.rend1 () |
-- | const_reverse_iterator1 |
-
m.rend2 () |
-- | const_reverse_iterator2 |
-|
m.rend1 () |
-m is mutable. |
-reverse_iterator1 |
-|
m.rend2 () |
-m is mutable. |
-reverse_iterator2 |
-|
| Element access | -m (i, j) |
-i and j are convertible to
-size_type . |
-Convertible to value_type. |
-
| Assignment | -m2 = m1 |
-m2 is mutable and m1 is convertible
-to M. |
-M & |
-
m2.assign (m1) |
-m2 is mutable and m1 is convertible
-to M. |
-M & |
-|
| Computed assignment | -m2 += m1 |
-m2 is mutable and m1 is convertible
-to M. |
-M & |
-
m2.plus_assign (m1) |
-m2 is mutable and m1 is convertible
-to M. |
-M & |
-|
m2 -= m1 |
-m2 is mutable and m1 is convertible
-to M. |
-M & |
-|
m2.minus_assign (m1) |
-m2 is mutable and m1 is convertible
-to M. |
-M & |
-|
m *= t |
-m is mutable and t is convertible to
-value_type. |
-M & |
-
Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Beginning of range | -m.begin1 () |
-- | Returns an iterator pointing to the first element in the first -column of a matrix expression. | -m.begin1 () is either dereferenceable or
-past-the-end. It is past-the-end if and only if m.size1 () ==
-0. |
-
m.begin2 () |
-- | Returns an iterator pointing to the first element in the first -row of a matrix expression. | -m.begin2 () is either dereferenceable or
-past-the-end. It is past-the-end if and only if m.size2 () ==
-0. |
-|
| End of range | -m.end1 () |
-- | Returns an iterator pointing one past the last element in the -matrix expression. | -m.end1 () is past-the-end. |
-
m.end2 () |
-- | Returns an iterator pointing one past the last element in the -matrix expression. | -m.end2 () is past-the-end. |
-|
| Size | -m.size1 () |
-- | Returns the number of rows of the matrix expression. | -m.size1 () >= 0 |
-
m.size2 () |
-- | Returns the number of columns of the matrix expression. | -m.size2 () >= 0 |
-|
| Swap | -m1.swap (m2) |
-- | Equivalent to swap (m1, m2). |
-- |
| Beginning of reverse range | -m.rbegin1 () |
-- | Equivalent to reverse_iterator1 (m.end1 ()). |
-m.rbegin1 () is either dereferenceable or
-past-the-end. It is past-the-end if and only if m.size1 () ==
-0. |
-
m.rbegin2 () |
-- | Equivalent to reverse_iterator2 (m.end2 ()). |
-m.rbegin2 () is either dereferenceable or
-past-the-end. It is past-the-end if and only if m.size2 () ==
-0. |
-|
| End of reverse range | -m.rend1 () |
-- | Equivalent to reverse_iterator1 (m.begin1
-()). |
-m.rend1 () is past-the-end. |
-
m.rend2 () |
-- | Equivalent to reverse_iterator2 (m.begin2
-()). |
-m.rend2 () is past-the-end. |
-|
| Element access | -m (i, j) |
-0 <= i < m.size1 () and 0 <= j <
-m.size2 () |
-Returns the j-th element of the i-th
-row of the matrix expression. |
-- |
| Assignment | -m2 = m1 |
-m1.size1 () == m2.size1 () and |
-Assigns every element of the evaluated matrix expression
-m1 to the corresponding element of m2
-. |
-- |
m2.assign (m1) |
-m1.size1 () == m2.size1 () and |
-Assigns every element of m1 to the corresponding
-element of m2. |
-- | |
| Computed assignment | -m2 += m1 |
-m1.size1 () == m2.size1 () and |
-Adds every element of the evaluated matrix expression
-m1 to the corresponding element of
-m2. |
-- |
m2.plus_assign (m1) |
-m1.size1 () == m2.size1 () and |
-Adds every element of m1 to the corresponding
-element of m2. |
-- | |
m2 -= m1 |
-m1.size1 () == m2.size1 () and |
-Subtracts every element of the evaluated matrix expression
-m1 from the corresponding element of m2
-. |
-- | |
m2.minus_assign (m1) |
-m1.size1 () == m2.size1 () and |
-Subtracts every element of m1 from the
-corresponding element of m2. |
-- | |
m *= t |
-- | Multiplies every element of m with t
-. |
-- |
The run-time complexity of begin1 (), begin2
-() , end1 () and end2 () is
-specific for the evaluated matrix expression.
The run-time complexity of size1 () and size2
-() is constant time.
The run-time complexity of swap () is specific for
-the evaluated matrix expression, typically constant time.
The run-time complexity of rbegin1 (),
-rbegin2 () , rend1 () and rend2
-() is specific for the evaluated matrix expression.
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.
-The run-time complexity of the arithmetic operations is specific -for the evaluated matrix expressions, typically quadratic in the -size of the proxies.
-| Valid range | -For any matrix expression m, [m.begin1 (),
-m.end1 ()) and [m.begin2 (), m.end2 ()) are
-valid ranges. |
-
| Completeness | -An algorithm that iterates through the range [m.begin1
-(), m.end1 ()) will pass through every row of m
-, an algorithm that iterates through the range [m.begin2 (),
-m.end2 ()) will pass through every column of m
-. |
-
| Valid reverse range | -[m.rbegin1 (), m.rend1 ()) and [m.rbegin2
-(), m.rend2 ()) are valid ranges. |
-
| Equivalence of ranges | -The distance from m.begin1 () to m.end1
-() is the same as the distance from m.rbegin1
-() to m.rend1 () and the distance from
-m.begin2 () to m.end2 () is the same as
-the distance from m.rbegin2 () to m.rend2
-(). |
-
matrix_range<M>matrix_slice<M>triangular_adaptor<M, F>symmetric_adaptor<M, F>banded_adaptor<M>vector_matrix_binary<E1, E2, F>matrix_unary1<E, F>matrix_unary2<E, F>matrix_binary<E1, E2, F>matrix_binary_scalar1<E1, E2, F>matrix_binary_scalar2<E1, E2, F>matrix_matrix_binary<E1, E2, F>Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
-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.
-Iterator ConceptsAn Iterator is a restricted pointer-like object pointing into a -vector or matrix container.
-An Indexed Bidirectional Iterator is an iterator of a container -that can be dereferenced, incremented, decremented and carries -index information.
-Assignable, Equality Comparable, Default Constructible.
-| Value type | -The type of the value obtained by dereferencing a Indexed -Bidirectional Iterator | -
| Container type | -The type of the container a Indexed Bidirectional Iterator -points into. | -
I |
-A type that is a model of Indexed Bidirectional Iterator | -
T |
-The value type of I |
-
C |
-The container type of I |
-
it, itt, it1, it2 |
-Objects of type I |
-
t |
-Object of type T |
-
c |
-Object of type C |
-
A Indexed Bidirectional Iterator may be mutable, meaning -that the values referred to by objects of that type may be -modified, or constant , meaning that they may not. If an -iterator type is mutable, this implies that its value type is a -model of Assignable; the converse, though, is not necessarily -true.
-A Indexed Bidirectional Iterator may have a singular -value, meaning that the results of most operations, including -comparison for equality, are undefined. The only operation that is -guaranteed to be supported is assigning a nonsingular iterator to a -singular iterator.
-A Indexed Bidirectional Iterator may have a -dereferenceable value, meaning that dereferencing it yields -a well-defined value. Dereferenceable iterators are always -nonsingular, but the converse is not true.
-An Indexed Bidirectional Iterator is past-the-end if it -points beyond the last element of a container. Past-the-end values -are nonsingular and nondereferenceable.
-In addition to the expressions defined for Assignable, Equality -Comparable and Default Constructible, the following expressions -must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Default constructor | -I it |
-- | - |
| Dereference | -*it |
-- | Convertible to T. |
-
| Dereference assignment | -*it = t |
-I is mutable. |
-- |
| Member access | -it->m |
-T is a type for which t.m is
-defined. |
-- |
| Preincrement | -++ it |
-- | I & |
-
| Postincrement | -it ++ |
-- | I |
-
| Predecrement | --- it |
-- | I & |
-
| Postdecrement | -it -- |
-- | I |
-
| Index | -it.index () |
-- | C::size_type |
-
Semantics of an expression is defined only where it differs -from, or is not defined in, Assignable, Equality Comparable and -Default Constructible.
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Default constructor | -I it |
-- | - | it is singular. |
-
| Dereference | -*it |
-it is dereferenceable. |
-- | - |
| Dereference assignment | -*it = t |
-Same as for *it. |
-- | *it is a copy of t. |
-
| Member access | -it->m |
-it is dereferenceable. |
-Equivalent to (*it).m |
-- |
| Preincrement | -++ it |
-it is dereferenceable. |
-it is modified to point to the next element. |
-it is dereferenceable or past-the-end.
-.-If it1 == it2,-then ++ it1 == ++ it2. |
-
| Postincrement | -it ++ |
-Same as for ++ it. |
-Equivalent to - { |
-it is dereferenceable or past-the-end. |
-
| Predecrement | --- it |
-it is dereferenceable or past-the-end.-There exists a dereferenceable iterator itt such that
-it == ++ itt. |
-it is modified to point to the previous
-element. |
-it is dereferenceable.- &it = &-- it.-If it1 == it2,-then -- it1 == -- it2.-If it2 is dereferenceable and it1 ==
-++it2,-then --it1 == it2. |
-
| Postdecrement | -it -- |
-Same as for -- it. |
-Equivalent to - { |
-it is dereferenceable. |
-
| Index | -it.index () |
-it is dereferenceable. |
-it.index () >= 0-and - it.index () < it ().size () |
-If it1 == it2,-then it1.index () == it2.index ().-If it1 == it2,-then it1.index () < (++ it2).index
-().-If it1 == it2,-then it1.index () > (-- it2).index
-(). |
-
The complexity of operations on indexed bidirectional iterators -is guaranteed to be amortized constant time.
-| Identity | -it1 == it2 if and only if &*it1 ==
-&*it2. |
-
| Symmetry of increment and decrement | -If it is dereferenceable, then ++ it;
---it; is a null operation. Similarly, -- it; ++
-it; is a null operation. |
-
| Relation between iterator index and container element -operator | -If it is dereferenceable, *it == it ()
-(it.index ()). |
-
sparse_vector<T>::iteratorAn Indexed Random Access Iterator is an iterator of a container -that can be dereferenced, moved forward, moved backward and carries -index information.
-LessThanComparable, Indexed Bidirectional -Iterator .
-| Value type | -The type of the value obtained by dereferencing a Indexed -Random Access Iterator | -
| Container type | -The type of the container a Indexed Random Access Iterator -points into. | -
I |
-A type that is a model of Indexed Random Access Iterator | -
T |
-The value type of I |
-
C |
-The container type of I |
-
it, itt, it1, it2 |
-Objects of type I |
-
t |
-Object of type T |
-
n |
-Object of type C::difference_type |
-
An Indexed Random Access Iterator it1 is
-reachable from an Indexed Random Access Iterator
-it2 if, after applying operator ++ to
-it2 a finite number of times, it1 ==
-it2.
In addition to the expressions defined for Indexed Bidirectional -Iterator , the following expressions must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Forward motion | -it += n |
-- | I & |
-
| Iterator addition | -it + n |
-- | I |
-
| Backward motion | -i -= n |
-- | I & |
-
| Iterator subtraction | -it - n |
-- | I |
-
| Difference | -it1 - it2 |
-- | C::difference_type |
-
| Element operator | -it [n] |
-- | Convertible to T. |
-
| Element assignment | -it [n] = t |
-I is mutable |
-Convertible to T. |
-
Semantics of an expression is defined only where it differs -from, or is not defined in, Indexed Bidirectional -Iterator .
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Forward motion | -it += n |
-Including it itself, there must be n
-dereferenceable or past-the-end iterators following or preceding
-it, depending on whether n is positive or
-negative. |
-If n > 0, equivalent to executing ++
-it n times. If n < 0,
-equivalent to executing -- it n times. If
-n == 0, this is a null operation. |
-it is dereferenceable or past-the-end. |
-
| Iterator addition | -it + n |
-Same as for i += n. |
-Equivalent to - { |
-Result is dereferenceable or past-the-end. | -
| Backward motion | -it -= n |
-Including it itself, there must be n
-dereferenceable or past-the-end iterators preceding or following
-it, depending on whether n is positive or
-negative. |
-Equivalent to it += (-n). |
-it is dereferenceable or past-the-end. |
-
| Iterator subtraction | -it - n |
-Same as for i -= n. |
-Equivalent to - { |
-Result is dereferenceable or past-the-end. | -
| Difference | -it1 - it2 |
-Either it1 is reachable from it2 or
-it2 is reachable from it1, or both. |
-Returns a number n such that it1 == it2 +
-n |
-- |
| Element operator | -it [n] |
-it + n exists and is dereferenceable. |
-Equivalent to *(it + n) |
-- |
| Element assignment | -i[n] = t |
-Same as for it [n]. |
-Equivalent to *(it + n) = t |
-- |
The complexity of operations on indexed random access iterators -is guaranteed to be amortized constant time.
-| Symmetry of addition and subtraction | -If it + n is well-defined, then it += n; it
--= n; and (it + n) - n are null operations.
-Similarly, if it - n is well-defined, then it -=
-n; it += n; and (it - n) + n are null
-operations. |
-
| Relation between distance and addition | -If it1 - it2 is well-defined, then it1 ==
-it2 + (it1 - it2). |
-
| Reachability and distance | -If it1 is reachable from it2, then
-it1 - it2 >= 0. |
-
vector<T>::iteratorAn Indexed Bidirectional Column/Row Iterator is an iterator of a -container that can be dereferenced, incremented, decremented and -carries index information.
-Assignable, Equality Comparable, Default Constructible.
-| Value type | -The type of the value obtained by dereferencing a Indexed -Bidirectional Column/Row Iterator | -
| Container type | -The type of the container a Indexed Bidirectional Column/Row -Iterator points into. | -
I1 |
-A type that is a model of Indexed Bidirectional Column/Row -Iterator | -
I2 |
-A type that is a model of Indexed Bidirectional Row/Column -Iterator | -
T |
-The value type of I1 and I2 |
-
C |
-The container type of I1 and I2 |
-
it1, it1t, it11,
-it12 |
-Objects of type I1 |
-
it2, it2t |
-Objects of type I2 |
-
t |
-Object of type T |
-
c |
-Object of type C |
-
In addition to the expressions defined for Assignable, Equality -Comparable and Default Constructible, the following expressions -must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Default constructor | -I1 it1 |
-- | - |
| Dereference | -*it1 |
-- | Convertible to T. |
-
| Dereference assignment | -*it1 = t |
-I1 is mutable. |
-- |
| Member access | -it1->m |
-T is a type for which t.m is
-defined. |
-- |
| Preincrement | -++ it1 |
-- | I1 & |
-
| Postincrement | -it1 ++ |
-- | I1 |
-
| Predecrement | --- it1 |
-- | I1 & |
-
| Postdecrement | -it1 -- |
-- | I1 |
-
| Row Index | -it1.index1 () |
-- | C::size_type |
-
| Column Index | -it1.index2 () |
-- | C::size_type |
-
| Row/Column Begin | -it1.begin () |
-- | I2 |
-
| Row/Column End | -it1.end () |
-- | I2 |
-
| Reverse Row/Column Begin | -it1.rbegin () |
-- | reverse_iterator<I2> |
-
| Reverse Row/Column End | -it1.rend () |
-- | reverse_iterator<I2> |
-
Semantics of an expression is defined only where it differs -from, or is not defined in, Assignable, Equality Comparable and -Default Constructible.
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Default constructor | -I1 it1 |
-- | - | it1 is singular. |
-
| Dereference | -*it1 |
-it1 is dereferenceable. |
-- | - |
| Dereference assignment | -*it1 = t |
-Same as for *it1. |
-- | *it1 is a copy of t. |
-
| Member access | -it1->m |
-it1 is dereferenceable. |
-Equivalent to (*it1).m |
-- |
| Preincrement | -++ it1 |
-it1 is dereferenceable. |
-it1 is modified to point to the next element of
-the column/row, i.e. for column iterators holds- it1.index1 () < (++ it1).index1 () and- it1.index2 () == (++ it1).index2 (),-for row iterators holds - it1.index1 () == (++ it1).index1 () and- it1.index2 () < (++ it1).index2 (). |
-it1 is dereferenceable or past-the-end.
-.-If it11 == it12,-then ++ it11 == ++ it12. |
-
| Postincrement | -it1 ++ |
-Same as for ++ it1. |
-Equivalent to - { |
-it1 is dereferenceable or past-the-end. |
-
| Predecrement | --- it1 |
-it1 is dereferenceable or past-the-end.-There exists a dereferenceable iterator it1t such that
-it1 == ++ it1t. |
-it1 is modified to point to the previous
-element of the column/row, i.e. for column iterators holds- it1.index1 () > (-- it1).index1 () and- it1.index2 () == (-- it1).index2 (),-for row iterators holds - it1.index1 () == (-- it1).index1 () and- it1.index2 () > (-- it1).index2 (). |
-it1 is dereferenceable.- &it1 = &-- it1.-If it11 == it12,-then -- it11 == -- it12. |
-
| Postdecrement | -it1 -- |
-Same as for -- it1. |
-Equivalent to - { |
-it1 is dereferenceable. |
-
| Row Index | -it1.index1 () |
-it1 is dereferenceable. |
-it1.index1 () >= 0 and- it1.index1 () < it () .size1 () |
-If it11 == it12,-then it11.index1 () == it12.index1 ()
-.-If it11, it12 are Indexed Bidirectional
-Row Iterators with it11 == it12,-then it11.index1 () < (++ it12).index1
-().-If it11, it12 are Indexed Bidirectional
-Row Iterators with it11 == it12,-then it11.index1 () > (-- it12).index1
-(). |
-
| Column Index | -it1.index2 () |
-it1 is dereferenceable. |
-it1.index2 () >= 0 and- it1.index2 () < it () .size2 () |
-If it11 == it12,-then it11.index2 () == it12.index2 ()
-.-If it11, it12 are Indexed Bidirectional
-Column Iterators with it11 == it12,-then it11.index2 () < (++ it12).index2
-().-If it11, it12 are Indexed Bidirectional
-Column Iterators with it11 == it12,-then it11.index2 () > (-- it12).index2
-(). |
-
| Row/Column Begin | -it1.begin () |
-it1 is dereferenceable. |
-If it1 is a Indexed Bidirectional Column
-Iterator,-then it2 = it1.begin () is a Indexed Bidirectional Row
-Iterator-with it2.index1 () == it1.index1 ().
-If |
-- |
| Row/Column End | -it1.end () |
-it1 is dereferenceable. |
-If it1 is a Indexed Bidirectional Column
-Iterator,-then it2 = it1.end () is a Indexed Bidirectional Row
-Iterator-with it2.index1 () == it1.index1 ().
-If |
-- |
| Reverse Row/Column Begin | -it1.rbegin () |
-it1 is dereferenceable. |
-Equivalent to reverse_iterator<I2> (it1.end
-()). |
-- |
| Reverse Row/Column End | -it1.rend () |
-it1 is dereferenceable. |
-Equivalent to reverse_iterator<I2> (it1.begin
-()). |
-- |
The complexity of operations on indexed bidirectional column/row -iterators is guaranteed to be logarithmic depending on the size of -the container. The complexity of one iterator (depending on the -storage layout) can be lifted to be amortized constant time. The -complexity of the other iterator (depending on the storage layout -and the container) can be lifted to be amortized constant time for -the first row/first column respectively.
-| Identity | -it11 == it12 if and only if &*it11 ==
-&*it12. |
-
| Symmetry of increment and decrement | -If it1 is dereferenceable, then ++ it1;
---it1; is a null operation. Similarly, -- it1; ++
-it1; is a null operation. |
-
| Relation between iterator index and container element -operator | -If it1 is dereferenceable, *it1 == it1 ()
-(it1.index1 (), it2.index2 ()) |
-
| Relation between iterator column/row begin and iterator -index | -If it1 is a Indexed Bidirectional Column Iterator
-and it2 = it1.begin () then it2.index2 () <
-it2t.index2 () for all it2t with it2t ()
-== it2 () and it2t ().index1 () == it2 ().index1
-().
-If |
-
| Relation between iterator column/row end and iterator -index | -If it1 is a Indexed Bidirectional Column Iterator
-and it2 = it1.end () then it2.index2 () >
-it2t.index2 () for all it2t with it2t ()
-== it2 () and it2t ().index1 () == it2 ().index1
-().
-If |
-
sparse_matrix<T>::iterator1sparse_matrix<T>::iterator2An Indexed Random Access Column/Row Iterator is an iterator of a -container that can be dereferenced, incremented, decremented and -carries index information.
-Indexed -Bidirectional Column/Row Iterator .
-| Value type | -The type of the value obtained by dereferencing a Indexed -Random Access Column/Row Iterator | -
| Container type | -The type of the container a Indexed Random Access Column/Row -Iterator points into. | -
I |
-A type that is a model of Indexed Random Access Column/Row -Iterator | -
T |
-The value type of I |
-
C |
-The container type of I |
-
it, itt, it1, it2 |
-Objects of type I |
-
t |
-Object of type T |
-
c |
-Object of type C |
-
In addition to the expressions defined for Indexed Bidirectional -Column/Row Iterator , the following expressions must be -valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Forward motion | -it += n |
-- | I & |
-
| Iterator addition | -it + n |
-- | I |
-
| Backward motion | -i -= n |
-- | I & |
-
| Iterator subtraction | -it - n |
-- | I |
-
| Difference | -it1 - it2 |
-- | C::difference_type |
-
| Element operator | -it [n] |
-- | Convertible to T. |
-
| Element assignment | -it [n] = t |
-I is mutable |
-Convertible to T. |
-
Semantics of an expression is defined only where it differs -from, or is not defined in, Indexed Bidirectional -Column/Row Iterator .
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Forward motion | -it += n |
-Including it itself, there must be n
-dereferenceable or past-the-end iterators following or preceding
-it, depending on whether n is positive or
-negative. |
-If n > 0, equivalent to executing ++
-it n times. If n < 0,
-equivalent to executing -- it n times. If
-n == 0, this is a null operation. |
-it is dereferenceable or past-the-end. |
-
| Iterator addition | -it + n |
-Same as for i += n. |
-Equivalent to - { |
-Result is dereferenceable or past-the-end. | -
| Backward motion | -it -= n |
-Including it itself, there must be n
-dereferenceable or past-the-end iterators preceding or following
-it, depending on whether n is positive or
-negative. |
-Equivalent to it += (-n). |
-it is dereferenceable or past-the-end. |
-
| Iterator subtraction | -it - n |
-Same as for i -= n. |
-Equivalent to - { |
-Result is dereferenceable or past-the-end. | -
| Difference | -it1 - it2 |
-Either it1 is reachable from it2 or
-it2 is reachable from it1, or both. |
-Returns a number n such that it1 == it2 +
-n |
-- |
| Element operator | -it [n] |
-it + n exists and is dereferenceable. |
-Equivalent to *(it + n) |
-- |
| Element assignment | -i[n] = t |
-Same as for it [n]. |
-Equivalent to *(it + n) = t |
-- |
The complexity of operations on indexed random access Column/Row -iterators is guaranteed to be amortized constant time.
-| Symmetry of addition and subtraction | -If it + n is well-defined, then it += n; it
--= n; and (it + n) - n are null operations.
-Similarly, if it - n is well-defined, then it -=
-n; it += n; and (it - n) + n are null
-operations. |
-
| Relation between distance and addition | -If it1 - it2 is well-defined, then it1 ==
-it2 + (it1 - it2). |
-
| Reachability and distance | -If it1 is reachable from it2, then
-it1 - it2 >= 0. |
-
matrix<T>::iterator1matrix<T>::iterator2Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
-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.