dlr::numeric::Vector2D Class Reference

The Vector2D class represents a real valued 2D vector. More...

#include <vector2D.h>

List of all members.

Public Member Functions

 Vector2D ()
 The default constructor initializes to (0, 0).
 Vector2D (double xCoord, double yCoord)
 This constructor explicitly sets the 2D coordinates.
 Vector2D (double xCoord, double yCoord, double alpha)
 This constructor explicitly sets 2D homogeneous coordinates.
 Vector2D (const Vector2D &vec)
 The copy constructor deep copies its argument.
 ~Vector2D ()
 The destructor destroys the Vector2D instance.
Vector2Dclear ()
 Resets the vector to (0.0, 0.0).
void setValue (double xCoord, double yCoord)
 This member function explicitly sets the sets coordinates of the Vector2D instance.
void setValue (double xCoord, double yCoord, double alpha)
 This constructor explicitly sets 2D homogeneous coordinates.
double & x ()
 This member function returns the X component of the Vector2D by reference.
double x () const
 This member function returns the X component of the Vector2D by value.
double & y ()
 This member function returns the Y component of the Vector2D by value.
double y () const
 This member function returns the Y component of the Vector2D by value.
Vector2Doperator= (const Vector2D &vec)
 The assignment operator deep copies its argument.
double & operator[] (size_t index)
 The indexing operator returns a reference to the x, or y component of *this as if *this were a two element array.
double operator[] (size_t index) const
 The indexing operator returns the value of the x, or y component of *this as if *this were a two element array.
Vector2Doperator*= (double scalar)
 This operator multiplies each component of the Vector2D instance by a scalar.
Vector2Doperator/= (double scalar)
 This operator divides each component of the Vector2D instance by a scalar.
Vector2Doperator+= (const Vector2D &vec)
 This operator adds a scalar to each component of the Vector2D instance.
Vector2Doperator-= (const Vector2D &vec)
 This operator subtracts a scalar from each component of the Vector2D instance.
Vector2D operator- ()
 This operator returns a Vector2D equal to *this, but with each element negated.


Detailed Description

The Vector2D class represents a real valued 2D vector.

Definition at line 28 of file vector2D.h.


Constructor & Destructor Documentation

dlr::numeric::Vector2D::Vector2D (  )  [inline]

The default constructor initializes to (0, 0).

Definition at line 34 of file vector2D.h.

Referenced by operator-().

dlr::numeric::Vector2D::Vector2D ( double  xCoord,
double  yCoord 
) [inline]

This constructor explicitly sets the 2D coordinates.

Parameters:
xCoord The first component of the Vector2D.
yCoord The second component of the Vector2D.

Definition at line 45 of file vector2D.h.

dlr::numeric::Vector2D::Vector2D ( double  xCoord,
double  yCoord,
double  alpha 
) [inline]

This constructor explicitly sets 2D homogeneous coordinates.

The equivalent 2D coordinates are (xCoord/alpha, yCoord/alpha).

Parameters:
xCoord The first component of the Vector2D.
yCoord The second component of the Vector2D.
alpha The projective scale parameter.

Definition at line 59 of file vector2D.h.

dlr::numeric::Vector2D::Vector2D ( const Vector2D vec  )  [inline]

The copy constructor deep copies its argument.

Parameters:
other This argument is the Vector2D instance to be copied.

Definition at line 69 of file vector2D.h.

dlr::numeric::Vector2D::~Vector2D (  )  [inline]

The destructor destroys the Vector2D instance.

Definition at line 76 of file vector2D.h.


Member Function Documentation

Vector2D& dlr::numeric::Vector2D::clear (  )  [inline]

Resets the vector to (0.0, 0.0).

Returns:
A reference to *this.

Definition at line 84 of file vector2D.h.

Vector2D& dlr::numeric::Vector2D::operator*= ( double  scalar  )  [inline]

This operator multiplies each component of the Vector2D instance by a scalar.

Parameters:
scalar This argument is the scalar by which to multiply.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 207 of file vector2D.h.

Vector2D& dlr::numeric::Vector2D::operator+= ( const Vector2D vec  )  [inline]

This operator adds a scalar to each component of the Vector2D instance.

Parameters:
scalar This argument is the scalar to be added.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 239 of file vector2D.h.

References m_x, and m_y.

Vector2D dlr::numeric::Vector2D::operator- (  )  [inline]

This operator returns a Vector2D equal to *this, but with each element negated.

Returns:
The return value is a negated copy of *this.

Definition at line 264 of file vector2D.h.

References Vector2D().

Vector2D& dlr::numeric::Vector2D::operator-= ( const Vector2D vec  )  [inline]

This operator subtracts a scalar from each component of the Vector2D instance.

Parameters:
scalar This argument is the scalar to be subtracted.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 253 of file vector2D.h.

References m_x, and m_y.

Vector2D& dlr::numeric::Vector2D::operator/= ( double  scalar  )  [inline]

This operator divides each component of the Vector2D instance by a scalar.

Parameters:
scalar This argument is the scalar by which to divide.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 221 of file vector2D.h.

Vector2D& dlr::numeric::Vector2D::operator= ( const Vector2D vec  )  [inline]

The assignment operator deep copies its argument.

Parameters:
other This argument is the Vector2D instance to be copied.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 164 of file vector2D.h.

References m_x, m_y, and setValue().

double dlr::numeric::Vector2D::operator[] ( size_t  index  )  const [inline]

The indexing operator returns the value of the x, or y component of *this as if *this were a two element array.

Out of bounds indices will return this-y().

Parameters:
index This argument is the index into *this.
Returns:
The return value is the selected component of *this.

Definition at line 193 of file vector2D.h.

References x(), and y().

double& dlr::numeric::Vector2D::operator[] ( size_t  index  )  [inline]

The indexing operator returns a reference to the x, or y component of *this as if *this were a two element array.

Out-of-bounds indices will return this->y().

Parameters:
index This argument is the index into *this.
Returns:
The return value is the selected component of *this.

Definition at line 178 of file vector2D.h.

References x(), and y().

void dlr::numeric::Vector2D::setValue ( double  xCoord,
double  yCoord,
double  alpha 
) [inline]

This constructor explicitly sets 2D homogeneous coordinates.

The equivalent 2D coordinates are (xCoord/alpha, yCoord/alpha).

Parameters:
xCoord The first component of the Vector2D.
yCoord The second component of the Vector2D.
alpha The projective scale parameter.

Definition at line 114 of file vector2D.h.

void dlr::numeric::Vector2D::setValue ( double  xCoord,
double  yCoord 
) [inline]

This member function explicitly sets the sets coordinates of the Vector2D instance.

Parameters:
xCoord The first component of the Vector2D.
yCoord The second component of the Vector2D.

Definition at line 99 of file vector2D.h.

Referenced by dlr::numeric::BSpline2D< Type >::approximateScatteredData(), dlr::numeric::BSpline2D< Type >::BSpline2D(), operator=(), dlr::numeric::operator>>(), and dlr::numeric::BSpline2D< Type >::setControlPoints().

double dlr::numeric::Vector2D::x (  )  const [inline]

This member function returns the X component of the Vector2D by value.

Returns:
The return value the X coordinate.

Definition at line 134 of file vector2D.h.

double& dlr::numeric::Vector2D::x (  )  [inline]

double dlr::numeric::Vector2D::y (  )  const [inline]

This member function returns the Y component of the Vector2D by value.

Returns:
The return value the Y coordinate.

Definition at line 152 of file vector2D.h.

double& dlr::numeric::Vector2D::y (  )  [inline]


The documentation for this class was generated from the following file:

Generated on Wed Nov 25 00:42:50 2009 for dlrUtilities Utility Library by  doxygen 1.5.8