![]() |
An instance of data type Vector is a vector of variables of number type NT. Together with the type Matrix it realizes the basic operations of linear algebra.
| Vector::NT | |
|
the ring type of the components.
| |
| Vector::iterator | |
|
the iterator type for accessing components.
| |
| Vector::const_iterator | |
|
the const iterator type for accessing
components.
| |
| Vector v; | |||
|
creates an instance v of type
Vector.
| |||
| Vector v ( int d); | |||
|
creates an instance v of type
Vector. v is initialized to a vector of dimension d.
| |||
| Vector v ( int d, NT x); | |||
|
creates an instance v of
type Vector. v is initialized to a vector of dimension
d with entries x.
| |||
| template <class Forward_iterator> | |||
| Vector v ( Forward_iterator first, Forward_iterator last); | |||
creates an
instance v of type Vector; v is initialized to the
vector with entries set [first,last).
| |||
| int | v.dimension () | returns the dimension of v. | ||
| bool | v.is_zero () | returns true iff v is the zero vector. | ||
| NT& | v [ int i ] |
returns the i-th component of v.
| ||
| iterator | v.begin () | iterator to the first component. | ||
| iterator | v.end () | iterator beyond the last component. |
The same operations begin(), end() exist for const_iterator.
| Vector | v + v1 |
Addition.
| ||
| Vector | v - v1 |
Subtraction.
| ||
| NT | v * v1 |
Inner Product.
| ||
| Vector | - v | Negation. | ||
| Vector& | v += v1 |
Addition plus assignment.
| ||
| Vector& | v -= v1 |
Subtraction plus assignment.
| ||
| Vector& | v *= NT s | Scalar multiplication plus assignment. | ||
| Vector& | v /= NT s | Scalar division plus assignment. | ||
| Vector | NT r * v | Component-wise multiplication with number r. | ||
| Vector | v * NT r | Component-wise multiplication with number r. |