CGAL 5.1 - dD Geometry Kernel

#include <Concepts/Vector.h>

Definition

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. More...
 
typedef unspecified_type iterator
 the iterator type for accessing components. More...
 
typedef unspecified_type const_iterator
 the const iterator type for accessing components. More...
 

Creation

 Vector ()
 creates an instance v of type Vector. More...
 
 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. More...
 
bool is_zero ()
 returns true iff v is the zero vector. More...
 
NToperator[] (int i)
 returns the \( i\)-th component of v. More...
 
iterator begin ()
 iterator to the first component. More...
 
iterator end ()
 iterator beyond the last component. More...
 
const_iterator begin () const
 iterator to the first component. More...
 
const_iterator end () const
 iterator beyond the last component. More...
 
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. More...
 
Vectoroperator+= (const Vector &v1)
 Addition plus assignment. More...
 
Vectoroperator-= (const Vector &v1)
 Subtraction plus assignment. More...
 
Vectoroperator*= (const NT &s)
 Scalar multiplication plus assignment. More...
 
Vectoroperator/= (const NT &s)
 Scalar division plus assignment. More...
 
Vector operator* (const NT &r, const Vector &v)
 Component-wise multiplication with number \( r\). More...
 
Vector operator* (const Vector &v, const NT &r)
 Component-wise multiplication with number \( r\). More...
 

Member Typedef Documentation

◆ const_iterator

typedef unspecified_type Vector::const_iterator

the const iterator type for accessing components.

◆ iterator

typedef unspecified_type Vector::iterator

the iterator type for accessing components.

◆ NT

typedef unspecified_type Vector::NT

the ring type of the components.

Constructor & Destructor Documentation

◆ Vector() [1/4]

Vector::Vector ( )

creates an instance v of type Vector.

◆ Vector() [2/4]

Vector::Vector ( int  d)

creates an instance v of type Vector.

v is initialized to a vector of dimension \( d\).

◆ Vector() [3/4]

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() [4/4]

template<class Forward_iterator >
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).

Template Parameters
ForwardIteratorhas NT as value type.

Member Function Documentation

◆ begin() [1/2]

iterator Vector::begin ( )

iterator to the first component.

◆ begin() [2/2]

const_iterator Vector::begin ( ) const

iterator to the first component.

◆ dimension()

int Vector::dimension ( )

returns the dimension of v.

◆ end() [1/2]

iterator Vector::end ( )

iterator beyond the last component.

◆ end() [2/2]

const_iterator Vector::end ( ) const

iterator beyond the last component.

◆ is_zero()

bool Vector::is_zero ( )

returns true iff v is the zero vector.

◆ operator*() [1/3]

Vector Vector::operator* ( const NT r,
const Vector v 
)

Component-wise multiplication with number \( r\).

◆ operator*() [2/3]

Vector Vector::operator* ( const Vector v,
const NT r 
)

Component-wise multiplication with number \( r\).

◆ operator*() [3/3]

NT Vector::operator* ( const Vector v1)

Inner Product.

Precondition
v.dimension() = v1.dimension().

◆ operator*=()

Vector& Vector::operator*= ( const NT s)

Scalar multiplication plus assignment.

◆ operator+()

Vector Vector::operator+ ( const Vector v1)

Addition.

Precondition
v.dimension() == v1.dimension().

◆ operator+=()

Vector& Vector::operator+= ( const Vector v1)

Addition plus assignment.

Precondition
v.dimension() == v1.dimension().

◆ operator-() [1/2]

Vector Vector::operator- ( )

Negation.

◆ operator-() [2/2]

Vector Vector::operator- ( const Vector v1)

Subtraction.

Precondition
v.dimension() = v1.dimension().

◆ operator-=()

Vector& Vector::operator-= ( const Vector v1)

Subtraction plus assignment.

Precondition
v.dimension() == v1.dimension().

◆ operator/=()

Vector& Vector::operator/= ( const NT s)

Scalar division plus assignment.

◆ operator[]()

NT& Vector::operator[] ( int  i)

returns the \( i\)-th component of v.

Precondition
\( 0\le i \le v.dimension()-1\).