#include <iso_math_vector.h>
Inherited by iso::math::Vector2< Type >, iso::math::Vector3< Type >, and iso::math::Vector4< Type >.
Inheritance diagram for iso::math::Vector< Type >:
Public Member Functions | |
Vector () | |
create default zero vector | |
Vector (unsigned int pDim) | |
create zero vector | |
Vector (unsigned int pDim, Type pValue) | |
create vector containing identical values | |
Vector (unsigned int pDim, const Type *pValues) | |
create vector from array of values | |
template<typename Type2> | |
Vector (unsigned int pDim, const Type2 *pValues) | |
create vector from array of values | |
Vector (unsigned int pDim, double pValue1, double pValue2,...) throw (MathException) | |
create vector from parameter list of values | |
Vector (const Vector< Type > &pVector) | |
create vector from vector | |
template<class Type2> | |
Vector (const Vector< Type2 > &pVector) | |
create vector from vector | |
virtual | ~Vector () |
destructor | |
void | reset () |
set all vector elements to 0 | |
virtual void | setDim (unsigned int pDim) |
set dimension of vector | |
void | set (Type pValue) |
set vector to identical values | |
void | set (Type pValue, unsigned int pDim) throw (MathException) |
set vector to new dimension and set all it's components to pValue | |
void | set (const Type *pValues) |
set vector to values from array | |
void | set (unsigned int pDim, double pValue1, double pValue2,...) throw (MathException) |
set vector to parameter list of values | |
void | set (const Vector< Type > &pVector) throw (MathException) |
set vector to values from vector | |
void | set (const Vector< Type > &pVector, bool pResize) throw (MathException) |
set vector to values from vector | |
void | setLength (Type pLength) |
scale vector to new length | |
const Vector< Type > & | operator= (Type pValue) |
vector = value | |
const Vector< Type > & | operator= (const Type *pValues) |
vector = values[] | |
const Vector< Type > & | operator= (const Vector< Type > &pVector) throw (MathException) |
vector = vector | |
Type & | operator[] (unsigned int pIndex) throw (MathException) |
vector[] | |
const Type & | operator[] (unsigned int pIndex) const throw (MathException) |
operator[] | |
const unsigned int & | dim () const |
return size of vector | |
Type * | values () |
return vector values | |
const Type * | values () const |
return vector values | |
Type | length () const |
return length of vector | |
Type | lengthSquared () const |
return length^2 of vector | |
const Vector< Type > & | operator+= (const Type pValue) |
vector += value | |
const Vector< Type > & | operator-= (const Type pValue) |
vector -= value | |
const Vector< Type > & | operator *= (const Type pValue) |
vector *= value | |
const Vector< Type > & | operator/= (Type pValue) |
vector /= value | |
Vector< Type > | operator+ (const Type pValue) const |
vector + value | |
Vector< Type > | operator- (const Type pValue) const |
vector - value | |
Vector< Type > | operator * (const Type pValue) const |
vector * value | |
Vector< Type > | operator/ (Type pValue) const |
vector / value | |
const Vector< Type > & | operator+= (const Vector< Type > &pVector) throw (MathException) |
vector += vector | |
const Vector< Type > & | operator-= (const Vector< Type > &pVector) throw (MathException) |
vector -= vector | |
virtual const Vector< Type > & | operator *= (const Vector< Type > &pVector) throw (MathException) |
vector *= vector | |
const Vector< Type > & | operator/= (const Vector< Type > &pVector) throw (MathException) |
vector /= vector | |
Vector< Type > | operator+ (const Vector< Type > &pVector) const throw (MathException) |
vector + vector | |
Vector< Type > | operator- (const Vector< Type > &pVector) const throw (MathException) |
vector - vector | |
virtual Vector< Type > | operator * (const Vector< Type > &pVector) const throw (MathException) |
vector * vector | |
Vector< Type > | operator/ (const Vector< Type > &pVector) const throw (MathException) |
vector / vector | |
Type | dot (const Vector< Type > &pVector) const throw (MathException) |
vector dot product | |
Type | sum () const |
return sum of all vector components | |
Type | product () const |
return product of all vector components | |
bool | operator== (const Type &pValue) const |
vector == pValue | |
bool | operator!= (const Type &pValue) const |
vector != pValue | |
bool | operator> (const Type &pValue) const |
vector > vector | |
bool | operator< (const Type &pValue) const |
vector > vector | |
bool | operator>= (const Type &pValue) const |
vector > vector | |
bool | operator<= (const Type &pValue) const |
vector > vector | |
bool | operator== (const Vector< Type > &pVector) const |
vector == vector | |
bool | operator!= (const Vector< Type > &pVector) const |
vector != vector | |
bool | operator> (const math::Vector< Type > &pVector) const throw (MathException) |
vector > vector | |
bool | operator< (const math::Vector< Type > &pVector) const throw (MathException) |
vector < vector | |
bool | operator>= (const math::Vector< Type > &pVector) const throw (MathException) |
vector >= vector | |
bool | operator<= (const math::Vector< Type > &pVector) const throw (MathException) |
vector <= vector | |
void | normalise () |
normalise vector length | |
void | limit (Type pMaxLength) |
limit vector length to max length | |
void | truncate (Type pThresh1, Type pThresh2) |
truncates a signal, crops everything above the upper threshold and below the lower threshold | |
void | truncate (const Vector< Type > &pThresh1, const Vector< Type > &pThresh2) throw (MathException) |
truncates a signal, crops everything above the upper threshold and below the lower threshold | |
void | invert () |
invert vector | |
operator base::String () const | |
base::String | info () const |
print vector information | |
Static Public Member Functions | |
static Type | dot (const Vector< Type > &pVector1, const Vector< Type > &pVector2) throw (MathException) |
vector dot product | |
static Vector< Type > | project (const Vector< Type > &pVector1, const Vector< Type > &pVector2) throw (MathException) |
projects vector 1 on vector 2 | |
Public Attributes | |
Type * | c |
vector elements | |
Protected Attributes | |
unsigned int | mDim |
dimension | |
Static Protected Attributes | |
static unsigned int | sDim |
default dimension | |
Friends | |
std::ostream & | operator<< (std::ostream &pOstream, const Vector< Type > &pVector) |
print vector information |
Vectors are always treated as column vectors!
Created by Daniel Bisig on 7/16/06. Copyright 2006 Daniel Bisig All rights reserved.
iso::math::Vector< Type >::Vector | ( | ) |
create default zero vector
iso::math::Vector< Type >::Vector | ( | unsigned int | pDim | ) |
create zero vector
pDim | size of vector |
iso::math::Vector< Type >::Vector | ( | unsigned int | pDim, | |
Type | pValue | |||
) |
create vector containing identical values
pDim | size of vector | |
pValue | value |
iso::math::Vector< Type >::Vector | ( | unsigned int | pDim, | |
const Type * | pValues | |||
) |
create vector from array of values
pDim | size of vector | |
pValues | array of values (must be of correct size) |
iso::math::Vector< Type >::Vector | ( | unsigned int | pDim, | |
const Type2 * | pValues | |||
) |
create vector from array of values
pDim | size of vector | |
pValues | array of values (must be of correct size) |
iso::math::Vector< Type >::Vector | ( | unsigned int | pDim, | |
double | pValue1, | |||
double | pValue2, | |||
... | ||||
) | throw (MathException) |
create vector from parameter list of values
pDim | size of vector | |
pValue1 | value 1 | |
pValue2 | value 2 |
MathException | pDim smaller than 2 |
iso::math::Vector< Type >::Vector | ( | const Vector< Type > & | pVector | ) |
create vector from vector
pVector | vector to copy |
iso::math::Vector< Type >::Vector | ( | const Vector< Type2 > & | pVector | ) |
create vector from vector
pVector | vector to copy |
iso::math::Vector< Type >::~Vector | ( | ) | [virtual] |
destructor
void iso::math::Vector< Type >::reset | ( | ) |
set all vector elements to 0
void iso::math::Vector< Type >::setDim | ( | unsigned int | pDim | ) | [virtual] |
set dimension of vector
pDim | new vector dimension |
Reimplemented in iso::math::Vector2< Type >, iso::math::Vector3< Type >, iso::math::Vector4< Type >, and iso::math::Vector2< unsigned int >.
void iso::math::Vector< Type >::set | ( | Type | pValue | ) | [inline] |
set vector to identical values
pValue | value |
void iso::math::Vector< Type >::set | ( | Type | pValue, | |
unsigned int | pDim | |||
) | throw (MathException) [inline] |
set vector to new dimension and set all it's components to pValue
pValue | value | |
pDim | new vector dimension |
MathException | always since this is an illegal function |
Reimplemented in iso::math::Vector2< unsigned int >.
void iso::math::Vector< Type >::set | ( | const Type * | pValues | ) | [inline] |
set vector to values from array
pValues | array of values |
void iso::math::Vector< Type >::set | ( | unsigned int | pDim, | |
double | pValue1, | |||
double | pValue2, | |||
... | ||||
) | throw (MathException) [inline] |
set vector to parameter list of values
pDim | size of vector | |
pValue1 | value 1 | |
pValue2 | value 2 |
MathException | pDim smaller than 2 or dimension mismatch |
void iso::math::Vector< Type >::set | ( | const Vector< Type > & | pVector | ) | throw (MathException) [inline] |
set vector to values from vector
pVector | vector to copy values from |
MathException | dimension mismatch |
void iso::math::Vector< Type >::set | ( | const Vector< Type > & | pVector, | |
bool | pResize | |||
) | throw (MathException) [inline] |
set vector to values from vector
pVector | vector to copy values from | |
pResize | change vector dim if necessary |
MathException | always since this is an illegal vector function |
void iso::math::Vector< Type >::setLength | ( | Type | pLength | ) |
scale vector to new length
pLength | new length |
const Vector< Type > & iso::math::Vector< Type >::operator= | ( | Type | pValue | ) | [inline] |
vector = value
pValue | value |
const Vector< Type > & iso::math::Vector< Type >::operator= | ( | const Type * | pValues | ) | [inline] |
vector = values[]
pValues | array of values (array must be of correct length) |
const Vector< Type > & iso::math::Vector< Type >::operator= | ( | const Vector< Type > & | pVector | ) | throw (MathException) [inline] |
vector = vector
pVector | vector to copy values from |
MathException | dimension mismatch |
Reimplemented in iso::math::Vector2< Type >, iso::math::Vector3< Type >, iso::math::Vector4< Type >, and iso::math::Vector2< unsigned int >.
Type & iso::math::Vector< Type >::operator[] | ( | unsigned int | pIndex | ) | throw (MathException) [inline] |
vector[]
pIndex | index of vector component |
MathException | index out of bounds |
const Type & iso::math::Vector< Type >::operator[] | ( | unsigned int | pIndex | ) | const throw (MathException) [inline] |
operator[]
pIndex | index of vector component |
MathException | index out of bounds |
const unsigned int & iso::math::Vector< Type >::dim | ( | ) | const [inline] |
return size of vector
Type * iso::math::Vector< Type >::values | ( | ) |
return vector values
const Type * iso::math::Vector< Type >::values | ( | ) | const |
return vector values
Type iso::math::Vector< Type >::length | ( | ) | const [inline] |
return length of vector
Type iso::math::Vector< Type >::lengthSquared | ( | ) | const [inline] |
return length^2 of vector
const Vector< Type > & iso::math::Vector< Type >::operator+= | ( | const Type | pValue | ) | [inline] |
vector += value
pValue | value |
const Vector< Type > & iso::math::Vector< Type >::operator-= | ( | const Type | pValue | ) | [inline] |
vector -= value
pValue | value |
const Vector< Type > & iso::math::Vector< Type >::operator *= | ( | const Type | pValue | ) | [inline] |
vector *= value
pValue | value |
const Vector< Type > & iso::math::Vector< Type >::operator/= | ( | Type | pValue | ) | [inline] |
vector /= value
pValue | value |
Vector< Type > iso::math::Vector< Type >::operator+ | ( | const Type | pValue | ) | const [inline] |
vector + value
pValue | value |
Vector< Type > iso::math::Vector< Type >::operator- | ( | const Type | pValue | ) | const [inline] |
vector - value
pValue | value |
Vector< Type > iso::math::Vector< Type >::operator * | ( | const Type | pValue | ) | const [inline] |
vector * value
pValue | value |
Vector< Type > iso::math::Vector< Type >::operator/ | ( | Type | pValue | ) | const [inline] |
vector / value
pValue | value |
const Vector< Type > & iso::math::Vector< Type >::operator+= | ( | const Vector< Type > & | pVector | ) | throw (MathException) [inline] |
vector += vector
pVector | vector |
MathException | dimension mismatch |
const Vector< Type > & iso::math::Vector< Type >::operator-= | ( | const Vector< Type > & | pVector | ) | throw (MathException) [inline] |
vector -= vector
pVector | vector |
MathException | dimension mismatch |
const Vector< Type > & iso::math::Vector< Type >::operator *= | ( | const Vector< Type > & | pVector | ) | throw (MathException) [virtual] |
vector *= vector
pVector | vector |
MathException | dimension mismatch |
const Vector< Type > & iso::math::Vector< Type >::operator/= | ( | const Vector< Type > & | pVector | ) | throw (MathException) [inline] |
vector /= vector
pVector | vector |
MathException | dimension mismatch |
Vector< Type > iso::math::Vector< Type >::operator+ | ( | const Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector + vector
pVector | vector |
MathException | dimension mismatch |
Vector< Type > iso::math::Vector< Type >::operator- | ( | const Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector - vector
pVector | vector |
MathException | dimension mismatch |
Vector< Type > iso::math::Vector< Type >::operator * | ( | const Vector< Type > & | pVector | ) | const throw (MathException) [virtual] |
vector * vector
pVector | vector |
MathException | dimension mismatch |
Vector< Type > iso::math::Vector< Type >::operator/ | ( | const Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector / vector
pVector | vector |
MathException | dimension mismatch |
Type iso::math::Vector< Type >::dot | ( | const Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector dot product
pVector | vector |
MathException | dimension mismatch |
Type iso::math::Vector< Type >::dot | ( | const Vector< Type > & | pVector1, | |
const Vector< Type > & | pVector2 | |||
) | throw (MathException) [static] |
vector dot product
pVector1 | vector 1 | |
pVector2 | vector 2 |
MathException | dimension mismatch |
Type iso::math::Vector< Type >::sum | ( | ) | const [inline] |
return sum of all vector components
Type iso::math::Vector< Type >::product | ( | ) | const [inline] |
return product of all vector components
Vector< Type > iso::math::Vector< Type >::project | ( | const Vector< Type > & | pVector1, | |
const Vector< Type > & | pVector2 | |||
) | throw (MathException) [static] |
projects vector 1 on vector 2
pVector1 | vector 1 | |
pVector2 | vector 2 |
MathException | dimension mismatch \ |
bool iso::math::Vector< Type >::operator== | ( | const Type & | pValue | ) | const [inline] |
vector == pValue
pValue | scalar value |
bool iso::math::Vector< Type >::operator!= | ( | const Type & | pValue | ) | const [inline] |
vector != pValue
pValue | scalar value |
bool iso::math::Vector< Type >::operator> | ( | const Type & | pValue | ) | const [inline] |
vector > vector
pValue | scalar value |
bool iso::math::Vector< Type >::operator< | ( | const Type & | pValue | ) | const [inline] |
vector > vector
pValue | scalar value |
bool iso::math::Vector< Type >::operator>= | ( | const Type & | pValue | ) | const [inline] |
vector > vector
pValue | scalar value |
bool iso::math::Vector< Type >::operator<= | ( | const Type & | pValue | ) | const [inline] |
vector > vector
pValue | scalar value |
bool iso::math::Vector< Type >::operator== | ( | const Vector< Type > & | pVector | ) | const [inline] |
vector == vector
bool iso::math::Vector< Type >::operator!= | ( | const Vector< Type > & | pVector | ) | const [inline] |
vector != vector
bool iso::math::Vector< Type >::operator> | ( | const math::Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector > vector
pVector | vector |
MathException | dimension mismatch |
bool iso::math::Vector< Type >::operator< | ( | const math::Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector < vector
pVector | vector |
MathException | dimension mismatch |
bool iso::math::Vector< Type >::operator>= | ( | const math::Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector >= vector
pVector | vector |
MathException | dimension mismatch |
bool iso::math::Vector< Type >::operator<= | ( | const math::Vector< Type > & | pVector | ) | const throw (MathException) [inline] |
vector <= vector
pVector | vector |
MathException | dimension mismatch |
void iso::math::Vector< Type >::normalise | ( | ) | [inline] |
normalise vector length
void iso::math::Vector< Type >::limit | ( | Type | pMaxLength | ) | [inline] |
limit vector length to max length
void iso::math::Vector< Type >::truncate | ( | Type | pThresh1, | |
Type | pThresh2 | |||
) | [inline] |
truncates a signal, crops everything above the upper threshold and below the lower threshold
pThresh1 | lower threshold | |
pThresh2 | upper threshold |
void iso::math::Vector< Type >::truncate | ( | const Vector< Type > & | pThresh1, | |
const Vector< Type > & | pThresh2 | |||
) | throw (MathException) [inline] |
truncates a signal, crops everything above the upper threshold and below the lower threshold
pThresh1 | lower threshold | |
pThresh2 | upper threshold |
MathException | dimension mismatch |
void iso::math::Vector< Type >::invert | ( | ) | [inline] |
invert vector
iso::math::Vector< Type >::operator base::String | ( | ) | const [inline] |
base::String iso::math::Vector< Type >::info | ( | ) | const |
print vector information
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Vector< Type > & | pVector | |||
) | [friend] |
print vector information
pOstream | output stream | |
pVector | vector |
Type* iso::math::Vector< Type >::c |
vector elements
unsigned int iso::math::Vector< Type >::mDim [protected] |
dimension
unsigned int iso::math::Vector< Type >::sDim [static, protected] |
default dimension