PARP Research Group Universidad de Murcia


QVVectorMap Class Reference
[Math functionality]

Fast nearest neigbour vector container. More...

#include <QVVectorMap>

List of all members.

Public Member Functions

void add (const QVVector &vector)
 Adds a vector to the container.
 QVVectorMap (const QList< QVVector > &vectors=QList< QVVector >())
 Default constructor.
QVVector getClosestVector (const QVVector &vector) const
 Get the closest vector to a given one from the container.
QList< QVVectorgetClosestVectors (const QVVector &vector, const int n) const
 Get the closest vectors to a given one from the container.

Static Public Member Functions

static QList< QVVectorgetClosestVectors (const QVVector actualVector, const QList< QVVector > &vectors, const int n)
 function for debug purposes

Detailed Description

Fast nearest neigbour vector container.

Vector maps are created from a list of QVVector objects, or initialized manually, inserting the points with the add method:

QList<QVVector> vectors;
QVVector v1, v2, ...;
[...]
points.append(v1);
points.append(v2);

[...]

QVVectorMap vectorMap1(vectors), vectorMap2;
vectorMap2.add(v4);
vectorMap2.add(v5);

[...]

The method getClosestVectors can be used to obtain the points registered in the container, which are closer to a given vector.

Definition at line 56 of file qvvectormap.h.


Constructor & Destructor Documentation

QVVectorMap::QVVectorMap ( const QList< QVVector > &  vectors = QList<QVVector>()  ) 

Default constructor.

Parameters:
vectors Vectors to insert in the container.

Definition at line 30 of file qvvectormap.cpp.


Member Function Documentation

void QVVectorMap::add ( const QVVector vector  ) 

Adds a vector to the container.

Parameters:
point Vector to add to the container.

Definition at line 25 of file qvvectormap.cpp.

Referenced by QVVectorMap().

QVVector QVVectorMap::getClosestVector ( const QVVector vector  )  const

Get the closest vector to a given one from the container.

Returns:
If the container is empty, return the default value for QVVector. Else returns the vector which is closer to the given one.

Definition at line 44 of file qvvectormap.cpp.

QList< QVVector > QVVectorMap::getClosestVectors ( const QVVector vector,
const int  n 
) const

Get the closest vectors to a given one from the container.

Returns:
If the container holds n vectors or less, the return value is a list containing those vectors. Else, returns the n vectors contained which are closer to the given one.

Definition at line 52 of file qvvectormap.cpp.

Referenced by getClosestVector().

QList< QVVector > QVVectorMap::getClosestVectors ( const QVVector  actualVector,
const QList< QVVector > &  vectors,
const int  n 
) [static]

function for debug purposes

Definition at line 36 of file qvvectormap.cpp.


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



QVision framework. PARP research group. Copyright © 2007, 2008, 2009, 2010, 2011.