Expression Concepts
Scalar Expression
Description
A Scalar Expression is an expression convertible to a scalar type.
Refinement of
Default Constructible.
Associated types
Public base |
scaler_expression<S> |
S must be derived from this public base type. |
Value type |
|
The type of the scalar expression. |
Notation
|
A 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.
Name |
Expression |
Type requirements |
Return type |
Evaluation |
|
|
|
Expression semantics
Semantics of an expression is defined only where it differs from, or is not defined in Default Constructible.
| Name | Expression | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
Evaluation |
|
|
Evaluates the scalar expression. |
|
Complexity guarantees
The run-time complexity of the evaluation is specific for the evaluated scalar expression.
Invariants
Models
-
vector_scalar_unary -
vector_scalar_binary
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
Public base |
vector_expression<V> |
V must be derived from this public base type. |
Value type |
|
The element type of the vector expression. |
Reference type |
|
The return type when accessing an element
of a vector expression. |
Const reference type |
|
The return type when accessing
an element of a constant vector expression. |
Size type |
|
The index type of the vector expression. Am
unsigned integral type used to represent size and index values. |
Distance type |
|
A signed integral type used to represent the distance between two of the vector expression’s iterators. |
Const iterator type |
|
A type of iterator that may be used to examine a vector expression’s elements. |
Iterator type |
|
A type of iterator that may be used to modify a vector expression’s elements. |
Const reverse iterator type |
|
A Reverse Iterator adaptor whose base iterator type is the vector expression’s const iterator type. |
Reverse iterator type |
|
A Reverse Iterator adaptor whose base iterator type is the vector expression’s iterator type. |
Notation
|
A type that is a model of Vector Expression |
|
Object of type |
|
Object of a type convertible to |
|
Object of a type convertible to |
Definitions
Valid expressions
In addition to the expressions defined in Default Constructible the following expressions must be valid.
| Name | Expression | Type requirements | Return type |
|---|---|---|---|
Beginning of range |
|
|
|
|
|
|
|
End of range |
|
|
|
|
|
|
|
Size |
|
|
|
Swap |
|
|
|
Beginning of reverse range |
|
|
|
|
|
|
|
End of reverse range |
|
|
|
|
|
|
|
Element access |
|
|
Convertible to |
Assignment |
|
|
|
|
|
|
|
Computed assignment |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expression semantics
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 |
|
|
Returns an iterator pointing to the first element in the vector expression. |
|
End of range |
|
|
Returns an iterator pointing one past the last element in the vector expression. |
|
Size |
|
|
Returns the size of the vector expression, that is, its number of elements. |
|
Swap |
|
|
Equivalent to |
|
Beginning of reverse range |
|
|
Equivalent to
|
|
End of reverse range |
|
|
Equivalent to
|
|
Element access |
|
|
Returns the |
|
Assignment |
|
|
Assigns every
element of the evaluated vector expression |
|
|
|
Assigns every element
of |
|
|
Computed assignment |
|
|
Adds every
element of the evaluated vector expression |
|
|
|
Adds every element
of |
|
|
|
|
Subtracts every element of
the evaluated vector expression |
|
|
|
|
Subtracts every
element of |
|
|
|
|
Multiplies every element of |
|
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 range |
For any vector expression |
Completeness |
An algorithm that iterates through the range
|
Valid reverse range |
|
Equivalence of ranges |
The distance from |
Models
-
vector_range; -
vector_slice -
matrix_row -
matrix_column -
matrix_vector_range -
matrix_vector_slice -
vector_unary -
vector_binary -
vector_binary_scalar1 -
vector_binary_scalar2 -
matrix_vector_unary1 -
matrix_vector_unary2 -
matrix_vector_binary1 -
matrix_vector_binary2
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
immutable types
Public base |
|
M must be derived from this public base type. |
Value type |
|
The element type of the matrix expression. |
Const reference type |
|
The return type when accessing
an element of a constant matrix expression. |
Size type |
|
The index type of the matrix expression. Am
unsigned integral type used to represent size and index values. |
Distance type |
|
A signed integral type used to represent the distance between two of the matrix expression’s iterators. |
Const iterator types |
|
A type of column iterator that may be used to examine a matrix expression’s elements. |
|
A type of row iterator that may be used to examine a matrix expression’s elements. |
|
Const reverse iterator types |
|
A Reverse Iterator adaptor whose base iterator type is the matrix expression’s const column iterator type. |
|
A Reverse Iterator adaptor whose base iterator type is the matrix expression’s const row iterator type. |
mutable types
Reference type |
|
The return type when accessing an element
of a matrix expression. |
Iterator types |
|
A type of column iterator that may be used to modify a matrix expression’s elements. |
|
A type of row iterator that may be used to modify a matrix expression’s elements. |
|
Reverse iterator types |
|
A Reverse Iterator adaptor whose base iterator type is the matrix expression’s column iterator type. |
|
A Reverse Iterator adaptor whose base iterator type is the matrix expression’s row iterator type. |
Notation
|
A type that is a model of Matrix Expression |
|
Object of type |
|
Objects of a type convertible to |
|
Object of a type convertible to |
Definitions
Valid expressions
In addition to the expressions defined in Default Constructible the following expressions must be valid.
immutable expressions
| Name | Expression | Type requirements | Return type |
|---|---|---|---|
Size |
|
|
|
|
|
|
possibly mutable expressions
| Name | Expression | Type requirements | Return type |
|---|---|---|---|
Beginning of range |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End of range |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Swap |
|
|
|
Beginning of reverse range |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End of reverse range |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Element access |
|
|
Convertible to |
Assignment |
|
|
|
|
|
|
|
Computed assignment |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expression semantics
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 |
|
|
Returns an iterator pointing to the first element in the first column of a matrix expression. |
|
|
|
Returns an iterator pointing to the first element in the first row of a matrix expression. |
|
|
End of range |
|
|
Returns an iterator pointing one past the last element in the matrix expression. |
|
|
|
Returns an iterator pointing one past the last element in the matrix expression. |
|
|
Size |
|
|
Returns the number of rows of the matrix expression. |
|
|
|
Returns the number of columns of the matrix expression. |
|
|
Swap |
|
|
Equivalent to |
|
Beginning of reverse range |
|
|
Equivalent to
|
|
|
|
Equivalent to |
|
|
End of reverse range |
|
|
Equivalent to
|
|
|
|
Equivalent to |
|
|
Element access |
|
|
Returns the |
|
Assignment |
|
|
Assigns every element of the evaluated
matrix expression |
|
|
|
Assigns every element of |
|
|
Computed assignment |
|
|
Adds every element of the evaluated
matrix expression |
|
|
|
Adds every element of |
|
|
|
|
Subtracts every element of the evaluated
matrix expression |
|
|
|
|
Subtracts every element of |
|
|
|
|
Multiplies every element of |
|
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 range |
For any matrix expression |
Completeness |
An algorithm that iterates through the range
|
Valid reverse range |
|
Equivalence of ranges |
The distance from |
Models
-
matrix_range -
matrix_slice; -
triangular_adaptor -
symmetric_adaptor -
banded_adaptor -
vector_matrix_binary -
matrix_unary1 -
matrix_unary2 -
matrix_binary -
matrix_binary_scalar1 -
matrix_binary_scalar2 -
matrix_matrix_binary
Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
Copyright (©) 2021 Shikhar Vashistha
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 ).