# opentl::math::Vector Class Reference

class for Vector More...

Inherits opentl::math::Matrix.

Inherited by opentl::math::Vector2, opentl::math::Vector3, opentl::math::Vector4, and opentl::math::Vector6.

List of all members.

## Public Member Functions
virtual double | abs ()
| Calculate absolute value (= length) of vector.
virtual void | add (const double s, const opentl::math::Vector &b, opentl::math::Vector &c)
virtual void | add (const Vector &b, Vector &c)
| this + b = c
virtual double | calcStdDeviation ()
| Function to calculate the Standard Deviation of a vector.
virtual std::size_t | dimension () const
virtual void | mult (const Vector &b, SquareMatrix &c)
| this * b = c
virtual void | mult (const double s, Vector &c)
| this * s = c
virtual void | normalize ()
double & | operator() (unsigned int row, unsigned int col=0) const
double & | operator[] (unsigned int n) const
| Get vector value at index n.
virtual void | sub (const Vector &b, Vector &c)
| this - b = c
| Vector (const Matrix &matrix)
| Constructor based on an existing matrix.
| Vector (const Vector &matrix)
| Constructor based on an existing Vector.
| Vector (std::size_t dim)
| Constructor.
| Vector ()
virtual | ~Vector ()
| Destructor.

## Detailed Description

class for Vector

Author:
  Claus Lenz <lenz@in.tum.de>

  Thomas Friedlhuber <friedlhu@in.tum.de>

## Constructor & Destructor Documentation

opentl::math::Vector::Vector | ( |  | ) |

opentl::math::Vector::Vector | ( | std::size_t | dim | ) | `[explicit]`

Constructor.

Parameters:

  | dim | dimension of vector

opentl::math::Vector::Vector | ( | const Vector & | matrix | ) | `[explicit]`

Constructor based on an existing Vector.

Parameters:

  | matrix | existing matrix

opentl::math::Vector::Vector | ( | const Matrix & | matrix | ) | `[explicit]`

Constructor based on an existing matrix.

Parameters:

  | matrix | existing matrix

virtual opentl::math::Vector::~Vector | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual double opentl::math::Vector::abs | ( |  | ) | `[virtual]`

Calculate absolute value (= length) of vector.

Returns:
  value

virtual void opentl::math::Vector::add | ( | const double | s,
|  | const opentl::math::Vector & | b,
|  | opentl::math::Vector & | c |
| ) |  |  | `[virtual]`

virtual void opentl::math::Vector::add | ( | const Vector & | b,
|  | Vector & | c |
| ) |  |  | `[virtual]`

this + b = c

virtual double opentl::math::Vector::calcStdDeviation | ( |  | ) | `[virtual]`

Function to calculate the Standard Deviation of a vector.

Returns:
  standard deviation value

virtual std::size_t opentl::math::Vector::dimension | ( |  | ) | const`[virtual]`

get dimension of vector

Returns:
  dimension

Reimplemented in opentl::math::Vector2, opentl::math::Vector3, and opentl::math::Vector4.

virtual void opentl::math::Vector::mult | ( | const Vector & | b,
|  | SquareMatrix & | c |
| ) |  |  | `[virtual]`

this * b = c

Parameters:

  | c | is a SquareMatrix

virtual void opentl::math::Vector::mult | ( | const double | s,
|  | Vector & | c |
| ) |  |  | `[virtual]`

this * s = c

virtual void opentl::math::Vector::normalize | ( |  | ) | `[virtual]`

normalize vector

Reimplemented in opentl::math::Vector2, opentl::math::Vector3, and opentl::math::Vector4.

double& opentl::math::Vector::operator() | ( | unsigned int | row,
|  | unsigned int | col = `0` |
| ) |  |  | const`[inline]`

double& opentl::math::Vector::operator[] | ( | unsigned int | n | ) | const`[inline]`

Get vector value at index n.

Parameters:

  | n | index value

Returns:
  value

virtual void opentl::math::Vector::sub | ( | const Vector & | b,
|  | Vector & | c |
| ) |  |  | `[virtual]`

this - b = c