Home > class_c_nokia_c_v_vector.html

Home > Research Areas > Projects > Nokia CV > Documentation > class_c_nokia_c_v_vector.html

Fixed point representation of a vector. More...

#include <ncvVector.h>

Inheritance diagram for CNokiaCVVector:

Inheritance graph


[legend]

Collaboration diagram for CNokiaCVVector:Collaboration graph





[legend]

List of all members.


Public Member Functions

IMPORT_C TVectorType Type ()
Getter of the vector type.
IMPORT_C TInt Size ()
Getter of the vector size/length.
IMPORT_C TInt Length ()
Getter of the vector size/length.
IMPORT_C CNokiaCVVector * Transpose () const
Creates the transpose vector of this vector,.
IMPORT_C CFixed SSD (CNokiaCVVector &aV)
Calculates the sum of squared distances of this and a given vector. KErrArgument thrown, if size and type don't match.
IMPORT_C CNokiaCVVector * Normalize ()
Creates the normalization of this vector.
IMPORT_C CFixed Magnitude ()
Calculates the magnitude of this vector.
IMPORT_C CFixed SquareMagnitude ()
Calculates the square magnitude of this vector.
IMPORT_C CNokiaCVVector * CrossProduct (CNokiaCVVector &aVector)
Calculates the cross product of this and the given vector.
IMPORT_C CFixed DotProduct (CNokiaCVVector &aVector)
Calculates the dot product of to same size vectors.
IMPORT_C CFixed Mahalanobis (CNokiaCVVector &aVectorB, CNokiaCVMatrix &aCovMatrix)
Calculates the Mahalanobis distance (x-y)'M^-1(x-y) of this and the given vector and covariance matrix.
Matrix Norms
IMPORT_C CFixed Norm2 ()
Calculates the L2-norm of a vector, no matter on the type of the vector.
IMPORT_C CFixed Norm ()
Calculates the L1-norm of a vector no matter on the type of the vector.
IMPORT_C CFixed NormInf ()
Calculates the LInf-norm of a vector no matter on the type of the vector.
Operations
Basic vector operations.
Note:
Every operation throws a KErrArgument error, if the operation is not allowed for the given vector e.g. when size dose not match.




IMPORT_C CFixed & operator() (const TInt aIndex)
Getter and setter for the element at the give index, type doesn't matter.

IMPORT_C CNokiaCVVector &
operator= (const CNokiaCVVector &aVector)

IMPORT_C TBool
operator== (const CNokiaCVVector &aVector)

IMPORT_C TBool
operator!= (const CNokiaCVVector &aVector)

IMPORT_C CNokiaCVVector *
operator+ (const CNokiaCVVector &aVector)

IMPORT_C CNokiaCVVector &
operator+= (const CNokiaCVVector &aVector)

IMPORT_C CNokiaCVVector *
operator- (const CNokiaCVVector &aVector)

IMPORT_C CNokiaCVVector &
operator-= (const CNokiaCVVector &aVector)

IMPORT_C CNokiaCVMatrix *
operator * (const CNokiaCVVector &aVector)

IMPORT_C CNokiaCVVector *
operator * (const CFixed aScalar)

IMPORT_C CNokiaCVVector &
operator *= (const CFixed aScalar)
IMPORT_C CNokiaCVMatrix * operator/ (const CNokiaCVVector &aVector)
Although a division is not defined for a vector one is implemented, that calculates multiplication with this and 1/aVector, where aVector is given.

IMPORT_C CNokiaCVVector *
operator/ (const CFixed aScalar)

IMPORT_C CNokiaCVVector &
operator/= (const CFixed aScalar)

Static Public Member Functions

static IMPORT_C CNokiaCVVector * NewL (const TInt aSize, const TVectorType aType)
Constructs a new CNokiaCVVector according to the given type and size.
static IMPORT_C CNokiaCVVector * Zero (const TInt aSize, const TVectorType aType)
Constructs a new CNokiaCVVector according to the given type and size with initial value zero (same as NewL).
static IMPORT_C CNokiaCVVector * Horizontal (const TInt aSize)
Constructs a new Horizontal CNokiaCVVector according to the given type and size with initial value zero (same as NewL(aSize, EHorizontalVector)).
static IMPORT_C CNokiaCVVector * Vertical (const TInt aSize)
Constructs a new Vertical CNokiaCVVector according to the given type and size with initial value zero (same as NewL(aSize, EHorizontalVector)).
static IMPORT_C CNokiaCVVector * Unit (const TInt aSize, const TVectorType aType, const TInt aNonZeroIndex)
Constructs an unit vector where the element at parameter aNonZeroIndex equals one, others zero e.g. e = [0 0 0 0 1 0] aNonZeroIndex = 4.


Detailed Description

Fixed point representation of a vector.

Definition at line 30 of file ncvVector.h.


Member Function Documentation

static IMPORT_C CNokiaCVVector* CNokiaCVVector::NewL ( const TInt aSize,
const TVectorType aType
) [static]

Constructs a new CNokiaCVVector according to the given type and size.

Parameters:
aSize - the length of the vector
aType - vector type EVertical or EHorizontal
Note:
the function can leave (NewL)
Returns:
A pointer to the created vector

static IMPORT_C CNokiaCVVector* CNokiaCVVector::Zero ( const TInt aSize,
const TVectorType aType
) [static]

Constructs a new CNokiaCVVector according to the given type and size with initial value zero (same as NewL).

Parameters:
aSize - the length of the vector
aType - vector type EVertical or EHorizontal
Note:
the function can leave
Returns:
A pointer to the created vector

static IMPORT_C CNokiaCVVector* CNokiaCVVector::Horizontal ( const TInt aSize ) [static]

Constructs a new Horizontal CNokiaCVVector according to the given type and size with initial value zero (same as NewL(aSize, EHorizontalVector)).

Parameters:
aSize - the length of the vector
Note:
the function can leave
Returns:
A pointer to the created vector

static IMPORT_C CNokiaCVVector* CNokiaCVVector::Vertical ( const TInt aSize ) [static]

Constructs a new Vertical CNokiaCVVector according to the given type and size with initial value zero (same as NewL(aSize, EHorizontalVector)).

Parameters:
aSize - the length of the vector
Note:
the function can leave
Returns:
A pointer to the created vector

static IMPORT_C CNokiaCVVector* CNokiaCVVector::Unit ( const TInt aSize,
const TVectorType aType,
const TInt aNonZeroIndex
) [static]

Constructs an unit vector where the element at parameter aNonZeroIndex equals one, others zero e.g. e = [0 0 0 0 1 0] aNonZeroIndex = 4.

Parameters:
aSize - the length of the vector
aType - the vector type
aNonZeroIndex - the index of the non-zero element
Note:
the function can leave
Returns:
A pointer to the created vector

IMPORT_C TVectorType CNokiaCVVector::Type ( )

Getter of the vector type.

Returns:
The type of this vector

IMPORT_C TInt CNokiaCVVector::Size ( )

Getter of the vector size/length.

Returns:
The type of this vector

IMPORT_C TInt CNokiaCVVector::Length ( )

Getter of the vector size/length.

Returns:
The type of this vector

IMPORT_C CFixed CNokiaCVVector::Norm2 ( )

Calculates the L2-norm of a vector, no matter on the type of the vector.

Note:
the function can leave
Returns:
The L2-norm of this vector

Reimplemented from CNokiaCVMatrix.

IMPORT_C CFixed CNokiaCVVector::Norm ( )

Calculates the L1-norm of a vector no matter on the type of the vector.

Returns:
The L1-norm of this vector

Reimplemented from CNokiaCVMatrix.

IMPORT_C CFixed CNokiaCVVector::NormInf ( )

Calculates the LInf-norm of a vector no matter on the type of the vector.

Returns:
The LInf-norm of this vector

Reimplemented from CNokiaCVMatrix.

IMPORT_C CNokiaCVVector* CNokiaCVVector::Transpose ( ) const

Creates the transpose vector of this vector,.

no matter on the type of the vector

Returns:
The LInf-norm of this vector

Overrides the Matrix transpose and changes the type also. KErrNoMemory thrown, if not enough memory to create a new vector

Note:
the function can leave

Reimplemented from CNokiaCVMatrix.

IMPORT_C CFixed CNokiaCVVector::SSD ( CNokiaCVVector & aV )

Calculates the sum of squared distances of this and a given vector. KErrArgument thrown, if size and type don't match.

Parameters:
The corresponding vector
Returns:
SSD of this and the given vector
Note:
This function is a Leaving function even though the name DOESN'T have an L

IMPORT_C CNokiaCVVector* CNokiaCVVector::Normalize ( )

Creates the normalization of this vector.

Note:
the function can leave
Returns:
The normalized vector KErrNoMemory thrown if not enough memory

IMPORT_C CFixed CNokiaCVVector::Magnitude ( )

Calculates the magnitude of this vector.

Returns:
The magnitude of this vector

IMPORT_C CFixed CNokiaCVVector::SquareMagnitude ( )

Calculates the square magnitude of this vector.

Returns:
The magnitude of this vector

IMPORT_C CNokiaCVVector* CNokiaCVVector::CrossProduct ( CNokiaCVVector & aVector )

Calculates the cross product of this and the given vector.

Parameters:
aVector - the vector with which the product is counted with
Returns:
The product vector
Note:
KErrArgument is thrown, if sizes don't match. of if the size of either one of the vectors is zero or greater then three. If the size of the vectors is 1, returns a zero vector of size three, if the vector size is two returns a vector of size three, where the only non-zero element is k-element

the function can leave

IMPORT_C CFixed CNokiaCVVector::DotProduct ( CNokiaCVVector & aVector )

Calculates the dot product of to same size vectors.

Parameters:
aVector - the vector with which the product is counted with
Returns:
The DotProduct of two vectors
Note:
the function can leave

IMPORT_C CFixed CNokiaCVVector::Mahalanobis ( CNokiaCVVector & aVectorB,
CNokiaCVMatrix & aCovMatrix
)

Calculates the Mahalanobis distance (x-y)'M^-1(x-y) of this and the given vector and covariance matrix.

Parameters:
aVectorB the other vector (y)
aCovMatrix the covariance matrix
Returns:
The Mahalanobis distance
Note:
KErrArgument is thrown, if sizes don't match or the vectors aren't the same type.

the function can leave

IMPORT_C CFixed& CNokiaCVVector::operator() ( const TInt aIndex )

Getter and setter for the element at the give index, type doesn't matter.

Parameters:
aIndex - the index number (starting from zero) from where to set/get an element
Returns:
the corresponding element in the vector

IMPORT_C CNokiaCVMatrix* CNokiaCVVector::operator/ ( const CNokiaCVVector & aVector )

Although a division is not defined for a vector one is implemented, that calculates multiplication with this and 1/aVector, where aVector is given.

Parameters:
aVector - the divider
Returns:
the division of this and the given vector


The documentation for this class was generated from the following file:
Generated on Tue Jul 10 22:58:43 2007 for NokiaComputerVisionLibrary by doxygen 1.5.2
Terms Of Use | Privacy Policy | Copyright © 2009 Nokia. All rights reserved.