 Expression Concepts
Expression ConceptsA Scalar Expression is an expression convertible to a scalar type.
Default Constructible.
| Public base | scaler_expression<S> | S must be derived from this public base type. | 
| 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_unaryvector_scalar_binaryA Vector Expression is an expression evaluatable to a vector. Vector Expression provides an Indexed Bidirectional Iterator or an Indexed Random Access Iterator .
Default Constructible.
| Public base | vector_expression<V> | V must be derived from this public base type. | 
| 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 () | vis mutable. | iterator | |
| End of range | v.end () | const_iterator | |
| v.end () | vis mutable. | iterator | |
| Size | v.size () | size_type | |
| Swap | v1.swap (v2) | v1andv2are mutable. | void | 
| Beginning of reverse range | v.rbegin () | const_reverse_iterator | |
| v.rbegin () | vis mutable. | reverse_iterator | |
| End of reverse range | v.rend () | const_reverse_iterator | |
| v.rend () | vis mutable. | reverse_iterator | |
| Element access | v (i) | iis convertible tosize_type. | Convertible to value_type. | 
| Assignment | v2 = v1 | v2is mutable andv1is convertible
toV. | V & | 
| v2.assign (v1) | v2is mutable andv1is convertible
toV. | V & | |
| Computed assignment | v2 += v1 | v2is mutable andv1is convertible
toV. | V & | 
| v2.plus_assign (v1) | v2is mutable andv1is convertible
toV. | V & | |
| v2 -= v1 | v2is mutable andv1is convertible
toV. | V & | |
| v2.minus_assign (v1) | v2is mutable andv1is convertible
toV. | V & | |
| v *= t | vis mutable andtis convertible tovalue_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 ifv.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 ifv.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 v1to the corresponding element ofv2. | |
| v2.assign (v1) | v1.size () == v2.size () | Assigns every element of v1to the corresponding
element ofv2. | ||
| Computed assignment | v2 += v1 | v1.size () == v2.size () | Adds every element of the evaluated vector expression v1to the corresponding element ofv2. | |
| v2.plus_assign (v1) | v1.size () == v2.size () | Adds every element of v1to the corresponding
element ofv2. | ||
| v2 -= v1 | v1.size () == v2.size () | Subtracts every element of the evaluated vector expression v1from the corresponding element ofv2. | ||
| v2.minus_assign (v1) | v1.size () == v2.size () | Subtracts every element of v1from the
corresponding element ofv2. | ||
| v *= t | Multiplies every element of vwitht. | 
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 ofv. | 
| Valid reverse range | [v.rbegin (), v.rend ())is a valid range. | 
| Equivalence of ranges | The distance from v.begin ()tov.end
()is the same as the distance fromv.rbegin ()tov.rend (). | 
vector_range;vector_slicematrix_rowmatrix_columnmatrix_vector_rangematrix_vector_slicevector_unaryvector_binaryvector_binary_scalar1vector_binary_scalar2matrix_vector_unary1matrix_vector_unary2matrix_vector_binary1matrix_vector_binary2A 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.
| Public base | matrix_expression<M> | M must be derived from this public base type. | 
| Value type | value_type | The element type of the matrix expression. | 
| 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. | |
| 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. | 
| Reference type | reference | The return type when accessing an element of a matrix expression. Convertable to a value_type. | 
| 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. | |
| 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 | 
|---|---|---|---|
| Size | m.size1 () | size_type | |
| m.size2 () | size_type | 
| Name | Expression | Type requirements | Return type | 
|---|---|---|---|
| Beginning of range | m.begin1 () | const_iterator1 | |
| m.begin2 () | const_iterator2 | ||
| m.begin1 () | mis mutable. | iterator1 | |
| m.begin2 () | mis mutable. | iterator2 | |
| End of range | m.end1 () | const_iterator1 | |
| m.end2 () | const_iterator2 | ||
| m.end1 () | mis mutable. | iterator1 | |
| m.end2 () | mis mutable. | iterator2 | |
| Swap | m1.swap (m2) | m1andm2are mutable. | void | 
| Beginning of reverse range | m.rbegin1 () | const_reverse_iterator1 | |
| m.rbegin2 () | const_reverse_iterator2 | ||
| m.rbegin1 () | mis mutable. | reverse_iterator1 | |
| m.rbegin2 () | mis mutable. | reverse_iterator2 | |
| End of reverse range | m.rend1 () | const_reverse_iterator1 | |
| m.rend2 () | const_reverse_iterator2 | ||
| m.rend1 () | mis mutable. | reverse_iterator1 | |
| m.rend2 () | mis mutable. | reverse_iterator2 | |
| Element access | m (i, j) | iandjare convertible tosize_type. | Convertible to value_type. | 
| Assignment | m2 = m1 | m2is mutable andm1is convertible
toM. | M & | 
| m2.assign (m1) | m2is mutable andm1is convertible
toM. | M & | |
| Computed assignment | m2 += m1 | m2is mutable andm1is convertible
toM. | M & | 
| m2.plus_assign (m1) | m2is mutable andm1is convertible
toM. | M & | |
| m2 -= m1 | m2is mutable andm1is convertible
toM. | M & | |
| m2.minus_assign (m1) | m2is mutable andm1is convertible
toM. | M & | |
| m *= t | mis mutable andtis convertible tovalue_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 ifm.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 ifm.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 ifm.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 ifm.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 ()and0 <= j <
m.size2 () | Returns the j-th element of thei-th
row of the matrix expression. | |
| Assignment | m2 = m1 | m1.size1 () == m2.size1 ()and | Assigns every element of the evaluated matrix expression m1to the corresponding element ofm2. | |
| m2.assign (m1) | m1.size1 () == m2.size1 ()and | Assigns every element of m1to the corresponding
element ofm2. | ||
| Computed assignment | m2 += m1 | m1.size1 () == m2.size1 ()and | Adds every element of the evaluated matrix expression m1to the corresponding element ofm2. | |
| m2.plus_assign (m1) | m1.size1 () == m2.size1 ()and | Adds every element of m1to the corresponding
element ofm2. | ||
| m2 -= m1 | m1.size1 () == m2.size1 ()and | Subtracts every element of the evaluated matrix expression m1from the corresponding element ofm2. | ||
| m2.minus_assign (m1) | m1.size1 () == m2.size1 ()and | Subtracts every element of m1from the
corresponding element ofm2. | ||
| m *= t | Multiplies every element of mwitht. | 
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 ofm, an algorithm that iterates through the range[m.begin2 (),
m.end2 ())will pass through every column ofm. | 
| Valid reverse range | [m.rbegin1 (), m.rend1 ())and[m.rbegin2
(), m.rend2 ())are valid ranges. | 
| Equivalence of ranges | The distance from m.begin1 ()tom.end1
()is the same as the distance fromm.rbegin1
()tom.rend1 ()and the distance fromm.begin2 ()tom.end2 ()is the same as
the distance fromm.rbegin2 ()tom.rend2
(). | 
matrix_rangematrix_slice;triangular_adaptorsymmetric_adaptorbanded_adaptorvector_matrix_binarymatrix_unary1matrix_unary2matrix_binarymatrix_binary_scalar1matrix_binary_scalar2matrix_matrix_binaryCopyright (©) 2000-2002 Joerg Walter, Mathias Koch
   Use, modification and distribution are subject to the
   Boost Software License, Version 1.0.
   (See accompanying file LICENSE_1_0.txt
   or copy at 
      http://www.boost.org/LICENSE_1_0.txt
   ).