CGAL 5.5.2 - dD Geometry Kernel
|
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.
Types | |
typedef unspecified_type | NT |
the ring type of the components. | |
typedef unspecified_type | iterator |
the iterator type for accessing components. | |
typedef unspecified_type | const_iterator |
the const iterator type for accessing components. | |
Creation | |
Vector () | |
creates an instance v of type Vector . | |
Vector (int d) | |
creates an instance v of type Vector . More... | |
Vector (int d, NT x) | |
creates an instance v of type Vector . More... | |
template<class Forward_iterator > | |
Vector (Forward_iterator first, Forward_iterator last) | |
creates an instance v of type Vector ; v is initialized to the vector with entries set [first,last) . More... | |
Operations | |
int | dimension () |
returns the dimension of v . | |
bool | is_zero () |
returns true iff v is the zero vector. | |
NT & | operator[] (int i) |
returns the \( i\)-th component of v . More... | |
iterator | begin () |
iterator to the first component. | |
iterator | end () |
iterator beyond the last component. | |
const_iterator | begin () const |
iterator to the first component. | |
const_iterator | end () const |
iterator beyond the last component. | |
Vector | operator+ (const Vector &v1) |
Addition. More... | |
Vector | operator- (const Vector &v1) |
Subtraction. More... | |
NT | operator* (const Vector &v1) |
Inner Product. More... | |
Vector | operator- () |
Negation. | |
Vector & | operator+= (const Vector &v1) |
Addition plus assignment. More... | |
Vector & | operator-= (const Vector &v1) |
Subtraction plus assignment. More... | |
Vector & | operator*= (const NT &s) |
Scalar multiplication plus assignment. | |
Vector & | operator/= (const NT &s) |
Scalar division plus assignment. | |
Vector | operator* (const NT &r, const Vector &v) |
Component-wise multiplication with number \( r\). | |
Vector | operator* (const Vector &v, const NT &r) |
Component-wise multiplication with number \( r\). | |
Vector::Vector | ( | int | d | ) |
creates an instance v
of type Vector
.
v
is initialized to a vector of dimension \( d\).
Vector::Vector | ( | int | d, |
NT | x | ||
) |
creates an instance v
of type Vector
.
v
is initialized to a vector of dimension \( d\) with entries x
.
Vector::Vector | ( | Forward_iterator | first, |
Forward_iterator | last | ||
) |
creates an instance v
of type Vector
; v
is initialized to the vector with entries set [first,last)
.
ForwardIterator | has NT as value type. |
Inner Product.
v.dimension() = v1.dimension()
. Addition.
v.dimension() == v1.dimension()
. Addition plus assignment.
v.dimension() == v1.dimension()
. Subtraction.
v.dimension() = v1.dimension()
. Subtraction plus assignment.
v.dimension() == v1.dimension()
. NT& Vector::operator[] | ( | int | i | ) |
returns the \( i\)-th component of v
.