From 84d908bc4e34426801246e37b351e96cbffe7a44 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Thu, 14 Jul 2005 09:17:14 +0000 Subject: [PATCH] Removed duplicate files expression.htm and iterator.htm were replaced by _concept.htm files svn path=/trunk/boost/libs/numeric/ublas/; revision=30067 --- doc/expression.htm | 1029 -------------------------------------- doc/iterator.htm | 1181 -------------------------------------------- 2 files changed, 2210 deletions(-) delete mode 100644 doc/expression.htm delete mode 100644 doc/iterator.htm 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 Concepts - - -

-Expression Concepts

-

Scalar -Expression

-

Description

-

A Scalar Expression is an expression convertible to a scalar -type.

-

Refinement of

-

Default Constructible.

-

Associated types

- - - - - - - - -
Value typevalue_typeThe type of the scalar expression.
-

Notation

- - - - - - - -
SA type that is a model of Scalar Expression
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Default Constructible -the following expressions must be valid.

- - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Evaluationoperator value_type () const value_type
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.

- - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Evaluationoperator value_type () const   Evaluates the scalar expression. 
-

Complexity guarantees

-

The run-time complexity of the evaluation is specific for the -evaluated scalar expression.

-

Invariants

-

Models

- -

Vector -Expression

-

Description

-

A Vector Expression is an expression evaluatable to a vector. -Vector Expression provides an Indexed Bidirectional -Iterator or an Indexed Random Access -Iterator .

-

Refinement of

-

Default Constructible.

-

Associated types

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Value typevalue_type -The element type of the vector expression. -
Reference typereference -The return type when accessing an element of a vector expression. -
-Convertable to avalue_type. -
Const reference typeconst_reference -The return type when accessing an element of a constant vector expression. -
-Convertable to avalue_type. -
Size typesize_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 typedifference_type -A signed integral type used to represent the distance between two of the vector expression's iterators. -
Const iterator typeconst_iteratorA type of iterator that may be used to examine a vector -expression's elements.
Iterator typeiteratorA type of iterator that may be used to modify a vector -expression's elements.
Const reverse iterator typeconst_reverse_iteratorA Reverse Iterator adaptor whose base iterator type is the -vector expression's const iterator type.
Reverse iterator typereverse_iteratorA Reverse Iterator adaptor whose base iterator type is the -vector expression's iterator type.
-

Notation

- - - - - - - - - - - - - - - - - - - -
VA type that is a model of Vector Expression
v, v1, v2Object of type V
iObject of a type convertible to size_type
tObject of a type convertible to value_type
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Default Constructible -the following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Beginning of rangev.begin () const_iterator
v.begin ()v is mutable.iterator
End of rangev.end () const_iterator
v.end ()v is mutable.iterator
Sizev.size () size_type
Swapv1.swap (v2)v1 and v2 are mutable.void
Beginning of reverse rangev.rbegin () const_reverse_iterator
v.rbegin ()v is mutable.reverse_iterator
End of reverse rangev.rend () const_reverse_iterator
v.rend ()v is mutable.reverse_iterator
Element accessv (i)i is convertible to size_type.Convertible to value_type.
Assignmentv2 = v1v2 is mutable and v1 is convertible -to V.V &
v2.assign (v1)v2 is mutable and v1 is convertible -to V.V &
Computed assignmentv2 += v1v2 is mutable and v1 is convertible -to V.V &
v2.plus_assign (v1)v2 is mutable and v1 is convertible -to V.V &
v2 -= v1v2 is mutable and v1 is convertible -to V.V &
v2.minus_assign (v1)v2 is mutable and v1 is convertible -to V.V &
v *= tv is mutable and t is convertible to -value_type.V &
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Beginning of rangev.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 rangev.end () Returns an iterator pointing one past the last element in the -vector expression.v.end () is past-the-end.
Sizev.size () Returns the size of the vector expression, that is, its number -of elements.v.size () >= 0
Swapv1.swap (v2) Equivalent to swap (v1, v2). 
Beginning of reverse rangev.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 rangev.rend () Equivalent to reverse_iterator (v.begin ()).v.rend () is past-the-end.
Element accessv (i)0 <= i < v.size ()Returns the i-th element of the vector -expression. 
Assignmentv2 = v1v1.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 assignmentv2 += v1v1.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 -= v1v1.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 -. 
-

Complexity guarantees

-

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.

-

Invariants

- - - - - - - - - - - - - - - - - - - -
Valid rangeFor any vector expression v, [v.begin (), -v.end ()) is a valid range.
CompletenessAn 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 rangesThe distance from v.begin () to v.end -() is the same as the distance from v.rbegin () -to v.rend ().
-

Models

- - -

Matrix -Expression

-

Description

-

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 .

-

Refinement of

-

Default Constructible.

-

Associated types

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Value typevalue_type -The element type of the matrix expression. -
Reference typereference -The return type when accessing an element of a matrix expression. -
-Convertable to avalue_type. -
Const reference typeconst_reference -The return type when accessing an element of a constant matrix expression. -
-Convertable to avalue_type. -
Size typesize_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 typedifference_type -A signed integral type used to represent the distance between two of the matrix expression's iterators. -
Const iterator typesconst_iterator1A type of column iterator that may be used to examine a matrix -expression's elements.
const_iterator2A type of row iterator that may be used to examine a matrix -expression's elements.
Iterator typesiterator1A type of column iterator that may be used to modify a matrix -expression's elements.
iterator2A type of row iterator that may be used to modify a matrix -expression's elements.
Const reverse iterator typesconst_reverse_iterator1A Reverse Iterator adaptor whose base iterator type is the -matrix expression's const column iterator type.
const_reverse_iterator2A Reverse Iterator adaptor whose base iterator type is the -matrix expression's const row iterator type.
Reverse iterator typesreverse_iterator1A Reverse Iterator adaptor whose base iterator type is the -matrix expression's column iterator type.
reverse_iterator2A Reverse Iterator adaptor whose base iterator type is the -matrix expression's row iterator type.
-

Notation

- - - - - - - - - - - - - - - - - - - -
MA type that is a model of Matrix Expression
m, m1, m2Object of type M
i, jObjects of a type convertible to size_type
tObject of a type convertible to value_type
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Default Constructible -the following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Beginning of rangem.begin1 () const_iterator1
m.begin2 () const_iterator2
m.begin1 ()m is mutable. iterator1
m.begin2 ()m is mutable.iterator2
End of rangem.end1 () const_iterator1
m.end2 () const_iterator2
m.end1 ()m is mutable. iterator1
m.end2 ()m is mutable.iterator2
Sizem.size1 () size_type
m.size2 () size_type
Swapm1.swap (m2)m1 and m2 are mutable. void
Beginning of reverse rangem.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 rangem.rend1 () const_reverse_iterator1
m.rend2 () const_reverse_iterator2
m.rend1 ()m is mutable.reverse_iterator1
m.rend2 ()m is mutable.reverse_iterator2
Element accessm (i, j)i and j are convertible to -size_type .Convertible to value_type.
Assignmentm2 = m1m2 is mutable and m1 is convertible -to M.M &
m2.assign (m1)m2 is mutable and m1 is convertible -to M.M &
Computed assignmentm2 += m1m2 is mutable and m1 is convertible -to M.M &
m2.plus_assign (m1)m2 is mutable and m1 is convertible -to M.M &
m2 -= m1m2 is mutable and m1 is convertible -to M.M &
m2.minus_assign (m1)m2 is mutable and m1 is convertible -to M.M &
m *= tm is mutable and t is convertible to -value_type.M &
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Beginning of rangem.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 rangem.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.
Sizem.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
Swapm1.swap (m2) Equivalent to swap (m1, m2). 
Beginning of reverse rangem.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 rangem.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 accessm (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. 
Assignmentm2 = m1m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Assigns every element of the evaluated matrix expression -m1 to the corresponding element of m2 -. 
m2.assign (m1)m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Assigns every element of m1 to the corresponding -element of m2. 
Computed assignmentm2 += m1m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Adds every element of the evaluated matrix expression -m1 to the corresponding element of -m2. 
m2.plus_assign (m1)m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Adds every element of m1 to the corresponding -element of m2. 
m2 -= m1m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Subtracts every element of the evaluated matrix expression -m1 from the corresponding element of m2 -. 
m2.minus_assign (m1)m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Subtracts every element of m1 from the -corresponding element of m2. 
m *= t Multiplies every element of m with t -. 
-

Complexity guarantees

-

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.

-

Invariants

- - - - - - - - - - - - - - - - - - - -
Valid rangeFor any matrix expression m, [m.begin1 (), -m.end1 ()) and [m.begin2 (), m.end2 ()) are -valid ranges.
CompletenessAn 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 rangesThe 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 -().
-

Models

- -
-

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.

- - diff --git a/doc/iterator.htm b/doc/iterator.htm deleted file mode 100644 index e1c677a2..00000000 --- a/doc/iterator.htm +++ /dev/null @@ -1,1181 +0,0 @@ - - - - - - -Iterator Concepts - - -

-Iterator Concepts

-

An Iterator is a restricted pointer-like object pointing into a -vector or matrix container.

-

Indexed Bidirectional -Iterator

-

Description

-

An Indexed Bidirectional Iterator is an iterator of a container -that can be dereferenced, incremented, decremented and carries -index information.

-

Refinement of

-

Assignable, Equality Comparable, Default Constructible.

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Bidirectional Iterator
Container typeThe type of the container a Indexed Bidirectional Iterator -points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
IA type that is a model of Indexed Bidirectional Iterator
TThe value type of I
CThe container type of I
it, itt, it1, it2Objects of type I
tObject of type T
cObject of type C
-

Definitions

-

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.

-

Valid expressions

-

In addition to the expressions defined for Assignable, Equality -Comparable and Default Constructible, the following expressions -must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Default constructorI it  
Dereference*it Convertible to T.
Dereference assignment*it = tI is mutable. 
Member accessit->mT is a type for which t.m is -defined. 
Preincrement++ it I &
Postincrementit ++ I
Predecrement-- it I &
Postdecrementit -- I
Indexit.index () C::size_type
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Assignable, Equality Comparable and -Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Default constructorI it  it is singular.
Dereference*itit is dereferenceable.  
Dereference assignment*it = tSame as for *it. *it is a copy of t.
Member accessit->mit is dereferenceable.Equivalent to (*it).m 
Preincrement++ itit is dereferenceable.it is modified to point to the next element.it is dereferenceable or past-the-end. -
-&it == &++ it
.
-If it1 == it2,
-then ++ it1 == ++ it2.
Postincrementit ++Same as for ++ it.Equivalent to
-{
- I itt = it;
- ++ it;
- return itt;
-}
it is dereferenceable or past-the-end.
Predecrement-- itit 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.
Postdecrementit --Same as for -- it.Equivalent to
-{
- I itt = it;
- -- it;
- return itt;
-}
it is dereferenceable. 
Indexit.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 -().
-

Complexity guarantees

-

The complexity of operations on indexed bidirectional iterators -is guaranteed to be amortized constant time.

-

Invariants

- - - - - - - - - - - - - - - -
Identityit1 == it2 if and only if &*it1 == -&*it2.
Symmetry of increment and decrementIf it is dereferenceable, then ++ it; ---it; is a null operation. Similarly, -- it; ++ -it; is a null operation.
Relation between iterator index and container element -operatorIf it is dereferenceable, *it == it () -(it.index ()).
-

Models

- -

Indexed Random Access -Iterator

-

Description

-

An Indexed Random Access Iterator is an iterator of a container -that can be dereferenced, moved forward, moved backward and carries -index information.

-

Refinement of

-

LessThanComparable, Indexed Bidirectional -Iterator .

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Random Access Iterator
Container typeThe type of the container a Indexed Random Access Iterator -points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
IA type that is a model of Indexed Random Access Iterator
TThe value type of I
CThe container type of I
it, itt, it1, it2Objects of type I
tObject of type T
nObject of type C::difference_type
-

Definitions

-

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.

-

Valid expressions

-

In addition to the expressions defined for Indexed Bidirectional -Iterator , the following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Forward motionit += n I &
Iterator additionit + n I
Backward motioni -= n I &
Iterator subtractionit - n I 
Differenceit1 - it2 C::difference_type
Element operatorit [n] Convertible to T.
Element assignmentit [n] = tI is mutableConvertible to T.
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Indexed Bidirectional -Iterator .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Forward motionit += nIncluding 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 additionit + nSame as for i += n.Equivalent to
-{
- I itt = it;
- return itt += n;
-}
Result is dereferenceable or past-the-end.
Backward motionit -= nIncluding 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 subtractionit - nSame as for i -= n.Equivalent to
-{
- I itt = it;
- return itt -= n;
-}
Result is dereferenceable or past-the-end.
Differenceit1 - it2Either it1 is reachable from it2 or -it2 is reachable from it1, or both.Returns a number n such that it1 == it2 + -n 
Element operatorit [n]it + n exists and is dereferenceable.Equivalent to *(it + n) 
Element assignmenti[n] = tSame as for it [n].Equivalent to *(it + n) = t 
-

Complexity guarantees

-

The complexity of operations on indexed random access iterators -is guaranteed to be amortized constant time.

-

Invariants

- - - - - - - - - - - - - - - -
Symmetry of addition and subtractionIf 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 additionIf it1 - it2 is well-defined, then it1 == -it2 + (it1 - it2).
Reachability and distanceIf it1 is reachable from it2, then -it1 - it2 >= 0.
-

Models

- -

Indexed Bidirectional -Column/Row Iterator

-

Description

-

An Indexed Bidirectional Column/Row Iterator is an iterator of a -container that can be dereferenced, incremented, decremented and -carries index information.

-

Refinement of

-

Assignable, Equality Comparable, Default Constructible.

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Bidirectional Column/Row Iterator
Container typeThe type of the container a Indexed Bidirectional Column/Row -Iterator points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I1A type that is a model of Indexed Bidirectional Column/Row -Iterator
I2A type that is a model of Indexed Bidirectional Row/Column -Iterator
TThe value type of I1 and I2
CThe container type of I1 and I2
it1, it1t, it11, -it12Objects of type I1
it2, it2tObjects of type I2
tObject of type T
cObject of type C
-

Definitions

-

Valid expressions

-

In addition to the expressions defined for Assignable, Equality -Comparable and Default Constructible, the following expressions -must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Default constructorI1 it1  
Dereference*it1 Convertible to T.
Dereference assignment*it1 = tI1 is mutable. 
Member accessit1->mT is a type for which t.m is -defined. 
Preincrement++ it1 I1 &
Postincrementit1 ++ I1
Predecrement-- it1 I1 &
Postdecrementit1 -- I1
Row Indexit1.index1 () C::size_type
Column Indexit1.index2 () C::size_type
Row/Column Beginit1.begin () I2
Row/Column Endit1.end () I2
Reverse Row/Column Beginit1.rbegin () reverse_iterator<I2>
Reverse Row/Column Endit1.rend () reverse_iterator<I2>
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Assignable, Equality Comparable and -Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Default constructorI1 it1  it1 is singular.
Dereference*it1it1 is dereferenceable.  
Dereference assignment*it1 = tSame as for *it1. *it1 is a copy of t.
Member accessit1->mit1 is dereferenceable.Equivalent to (*it1).m 
Preincrement++ it1it1 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. -
-&it1 == &++ it1
.
-If it11 == it12,
-then ++ it11 == ++ it12.
Postincrementit1 ++Same as for ++ it1.Equivalent to
-{
- I1 it1t = it1;
- ++ it1;
- return it1t;
-}
it1 is dereferenceable or past-the-end.
Predecrement-- it1it1 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.
Postdecrementit1 --Same as for -- it1.Equivalent to
-{
- I1 it1t = it1;
- -- it1;
- return it1t;
-}
it1 is dereferenceable. 
Row Indexit1.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 Indexit1.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 Beginit1.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 it1 is a Indexed Bidirectional Row -Iterator,
-then it2 = it1.begin () is a Indexed Bidirectional -Column Iterator
-with it2.index2 () == it1.index2 ().

-
 
Row/Column Endit1.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 it1 is a Indexed Bidirectional Row -Iterator,
-then it2 = it1.end () is a Indexed Bidirectional -Column Iterator
-with it2.index2 () == it1.index2 ().

-
 
Reverse Row/Column Beginit1.rbegin ()it1 is dereferenceable.Equivalent to reverse_iterator<I2> (it1.end -()). 
Reverse Row/Column Endit1.rend ()it1 is dereferenceable.Equivalent to reverse_iterator<I2> (it1.begin -()). 
-

Complexity guarantees

-

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.

-

Invariants

- - - - - - - - - - - - - - - - - - - - - - - -
Identityit11 == it12 if and only if &*it11 == -&*it12.
Symmetry of increment and decrementIf it1 is dereferenceable, then ++ it1; ---it1; is a null operation. Similarly, -- it1; ++ -it1; is a null operation.
Relation between iterator index and container element -operatorIf it1 is dereferenceable, *it1 == it1 () -(it1.index1 (), it2.index2 ())
Relation between iterator column/row begin and iterator -indexIf 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 it1 is a Indexed Bidirectional Row Iterator and -it2 = it1.begin () then it2.index1 () < -it2t.index1 () for all it2t with it2t () -== it2 () and it2t ().index2 () == it2 ().index2 -().

-
Relation between iterator column/row end and iterator -indexIf 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 it1 is a Indexed Bidirectional Row Iterator and -it2 = it1.end () then it2.index1 () > -it2t.index1 () for all it2t with it2t () -== it2 () and it2t ().index2 () == it2 ().index2 -().

-
-

Models

- -

Indexed Random Access -Column/Row Iterator

-

Description

-

An Indexed Random Access Column/Row Iterator is an iterator of a -container that can be dereferenced, incremented, decremented and -carries index information.

-

Refinement of

-

Indexed -Bidirectional Column/Row Iterator .

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Random Access Column/Row Iterator
Container typeThe type of the container a Indexed Random Access Column/Row -Iterator points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
IA type that is a model of Indexed Random Access Column/Row -Iterator
TThe value type of I
CThe container type of I
it, itt, it1, it2Objects of type I
tObject of type T
cObject of type C
-

Definitions

-

Valid expressions

-

In addition to the expressions defined for Indexed Bidirectional -Column/Row Iterator , the following expressions must be -valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Forward motionit += n I &
Iterator additionit + n I
Backward motioni -= n I &
Iterator subtractionit - n I 
Differenceit1 - it2 C::difference_type
Element operatorit [n] Convertible to T.
Element assignmentit [n] = tI is mutableConvertible to T.
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Indexed Bidirectional -Column/Row Iterator .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Forward motionit += nIncluding 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 additionit + nSame as for i += n.Equivalent to
-{
- I itt = it;
- return itt += n;
-}
Result is dereferenceable or past-the-end.
Backward motionit -= nIncluding 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 subtractionit - nSame as for i -= n.Equivalent to
-{
- I itt = it;
- return itt -= n;
-}
Result is dereferenceable or past-the-end.
Differenceit1 - it2Either it1 is reachable from it2 or -it2 is reachable from it1, or both.Returns a number n such that it1 == it2 + -n 
Element operatorit [n]it + n exists and is dereferenceable.Equivalent to *(it + n) 
Element assignmenti[n] = tSame as for it [n].Equivalent to *(it + n) = t 
-

Complexity guarantees

-

The complexity of operations on indexed random access Column/Row -iterators is guaranteed to be amortized constant time.

-

Invariants

- - - - - - - - - - - - - - - -
Symmetry of addition and subtractionIf 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 additionIf it1 - it2 is well-defined, then it1 == -it2 + (it1 - it2).
Reachability and distanceIf it1 is reachable from it2, then -it1 - it2 >= 0.
-

Models

- -
-

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.

- -