PARP Research Group Universidad de Murcia


Math functionality

Several classes and functions for numeric, vector and matrix scientific computations. More...

Classes

class  QVDirectedGraph< Element >
 Directed graph class. More...
class  QV2DMap
 Fast 2D nearest neigbour access data container. More...
class  QV3DPointF
 3D point representation More...
class  QV3DPolylineF
 3D polyline representation More...
class  QVCombinationIterator
 Iterator over all possible combinations over a set. More...
class  QVComplex
 Implementation of complex numbers. More...
class  QVDisjointSet
 Implementation of a disjoint set data type, based on the union-find algorithm. More...
class  QVEuclideanMapping3
 Class modeling rotation-translation transformations for 3D points. More...
class  QVMatrix
 Implementation of numerical matrices. More...
class  QVPermutation
 Implementation of permutations. More...
class  QVQuaternion
 Implementation of quaternions. More...
class  QVSparseBlockMatrix
 Implementation of sparse block matrices. More...
class  QVTensor
 Implementation of tensors, a generalization for matrices and vectors. More...
class  QVTensorIndex
 Indexes for tensors. More...
class  QVVector
 Implementation of numerical vectors. More...
class  QVVectorMap
 Fast nearest neigbour vector container. More...

Modules

 Matrix Algebra
 

Matrix algebra related functions (see also source programs in directory examples/matrixalgebra-tests for an exhaustive set of examples of use).


 Statistics
 

Statistics, regression and model fitting related functionality.


 Numerical analisis and function minimization
 

Function optimization and numerical derivative evaluation.


 Signal processing functionality
 

Signal filtering functions.


 Projective Geometry
 

Functions related to Projective Geometry.


Typedefs

typedef QPair< QPointF, QPointF > QPointFMatching

Functions

int qvIteratedBitCount (unsigned int n)
 Iterative bit counting routine.
int qvMITHAKMEMBitCount (unsigned int n)
 Bit counting routine from the MIT HAKMEM.
int qvNiftyParallelBitCount (unsigned int n)
 Nifty parallel bit counting routine.
std::ostream & operator<< (std::ostream &os, const QVComplex &complex)
 Prints the complex number contained in a complex number objecto to an output stream.
bool writeGraphToDotFile (const QString &fileName, const QVDirectedGraph< QString > &graph, const QStringList &nodeLabels=QStringList())
 Writes a directed graph in a .dot file.
double qvCombination (const int setRange, const int subsetRange)
 Obtains the number of combinations of a fixed size over the elements of a set.
double qvAngle (const QPointF &point1, const QPointF &point2)
 Returns the angle between two 2D vectors.
QVector< QVComplexqvSolveCubicPolynomial (const double a0, const double a1, const double a2, const double a3)
 Obtains the three complex (or real) solutions for a third grade polynomial.
double qvPointLineDistance (const QVVector &, const QPointF &)
 Obtains the geometric distance between a point and a line in the 2D plane.
double qvSymmetricFloor (const double value)
 Returns the natural number closest to a given real value.
std::ostream & operator<< (std::ostream &os, const QVMatrix &matrix)
std::istream & operator>> (std::istream &is, QVMatrix &matrix)
uint qHash (const QVMatrix &matrix)
bool writeQVMatrixToFile (const QString fileName, const QVMatrix &matrix, const int precission=7)
 Writes the content of a QVMatrix object in an ASCII file.
bool readQVMatrixFromFile (const QString fileName, QVMatrix &matrix)
 Reads the content of a QVMatrix object from an ASCII file.
QV3DPointF lnSO3 (const QVMatrix &R)
 Obtains the element from the Lie algebra so(3) corresponding to a rotation matrix.
QVMatrix expSO3 (const QV3DPointF &w)
 Obtains the rotation matrix corresponding to the element from the Lie algebra so(3).
std::ostream & operator<< (std::ostream &os, const QVPermutation &vector)
 Output stream operator for QVPermutaion.
std::ostream & operator<< (std::ostream &os, const QVVector &vector)
uint qHash (const QVVector &vector)

Detailed Description

Several classes and functions for numeric, vector and matrix scientific computations.


Typedef Documentation

typedef QPair<QPointF, QPointF> QPointFMatching

Type for a pair of points.

Definition at line 91 of file qvdefines.h.


Function Documentation

int qvIteratedBitCount ( unsigned int  n  ) 

Iterative bit counting routine.

This method counts the number of bits set to 1 in the input integer. It is the slower method for bit counting included in QVision, but can count bits on 64 bit integers.

Parameters:
N input unsigned integer
Returns:
the number of bits set to 1 in the input integer

Definition at line 27 of file qvbitcount.cpp.

int qvMITHAKMEMBitCount ( unsigned int  n  ) 

Bit counting routine from the MIT HAKMEM.

This method counts the number of bits set to 1 in the input integer. It is included in the HAKMEM, or AI Memo 239, which is a technical report from the MIT AI Lab.

Note:
This method can count only the 32 less significant bits.
Parameters:
N input unsigned integer
Returns:
the number of bits set to 1 in the input integer

Definition at line 39 of file qvbitcount.cpp.

int qvNiftyParallelBitCount ( unsigned int  n  ) 

Nifty parallel bit counting routine.

This method counts the number of bits set to 1 in the input integer. It is slightly faster than the qvMITHAKMEMBitCount method, and much faster than qvIteratedBitCount method.

Note:
This method can count only the 32 less significant bits.
Parameters:
n input unsigned integer
Returns:
the number of bits set to 1 in the input integer

Definition at line 49 of file qvbitcount.cpp.

Referenced by QVBRIEFDetector::distance().

std::ostream& operator<< ( std::ostream &  os,
const QVComplex complex 
)

Prints the complex number contained in a complex number objecto to an output stream.

Definition at line 82 of file qvcomplex.cpp.

bool writeGraphToDotFile ( const QString &  fileName,
const QVDirectedGraph< QString > &  graph,
const QStringList &  nodeLabels = QStringList() 
)

Writes a directed graph in a .dot file.

Parameters:
fileName Name for the .dot file.
graph Graph to store in the .dot file.
nodeLabels List of labels for the nodes in the .dot file.

Definition at line 40 of file qvdirectedgraph.cpp.

double qvCombination ( const int  setRange,
const int  subsetRange 
)

Obtains the number of combinations of a fixed size over the elements of a set.

Given a set size of n, this function returns the number of subsets of size k within that set.

$ qvCombination(n,k) = {n \choose k} = \frac{n!}{k!(n-k)!} $

Definition at line 52 of file qvmath.cpp.

Referenced by QVCombinationIterator::getSubsetNumber().

double qvAngle ( const QPointF &  point1,
const QPointF &  point2 
)

Returns the angle between two 2D vectors.

This function returns the angle defined between two input points.

Parameters:
point1 First point.
point2 Second point.
Returns:
A value in the range $ [ -\Pi, \Pi ] $ corresponding to the angle from the first point to the second.

Definition at line 85 of file qvmath.cpp.

QVector<QVComplex> qvSolveCubicPolynomial ( const double  a0,
const double  a1,
const double  a2,
const double  a3 
)

Obtains the three complex (or real) solutions for a third grade polynomial.

This function returns the three complex values which satisfy the following equation:

$ a_0 + a_1 x + a_2 x^2 + a_3 x^3 = 0 $

Note:
The value $ a_3 $ should not be zero, so the polynomial is bond to have three root values.
Parameters:
a0 coefficient $ a_0 $ of the polynomial.
a1 coefficient $ a_1 $ of the polynomial.
a2 coefficient $ a_2 $ of the polynomial.
a3 coefficient $ a_3 $ of the polynomial.

Definition at line 134 of file qvmath.cpp.

double qvPointLineDistance ( const QVVector ,
const QPointF &   
)

Obtains the geometric distance between a point and a line in the 2D plane.

Given a point

$ p \equiv (p_x, p_y) $

and a line

$l \equiv l_1 x + l_2 y + l_3 = 0 $

this function returns the geometric distance between the 2D point $ p $, and the closest point in the line $ l $. This distance is evaluated with the following expression:

$ qvPointLineDistance(l, p) = \frac{|l_1 p_x + l_2 p_y + l_3|}{\sqrt{{l_1}^2+{l_2}^2}} $

Parameters:
l 3D vector, containing the line coefficients $(l_1, l_2, l_3)$.
p Point

Definition at line 286 of file qvmath.cpp.

double qvSymmetricFloor ( const double  value  ) 

Returns the natural number closest to a given real value.

Parameters:
value Real value

Definition at line 291 of file qvmath.cpp.

Referenced by QVBRIEFDetector::QVBRIEFDetector().

std::ostream& operator<< ( std::ostream &  os,
const QVMatrix matrix 
)
Todo:
detailed description should follow

Definition at line 963 of file qvmatrix.cpp.

std::istream& operator>> ( std::istream &  is,
QVMatrix matrix 
)
Todo:
detailed description should follow

Definition at line 985 of file qvmatrix.cpp.

uint qHash ( const QVMatrix matrix  ) 
Todo:
detailed description should follow

Definition at line 1029 of file qvmatrix.cpp.

bool writeQVMatrixToFile ( const QString  fileName,
const QVMatrix matrix,
const int  precission = 7 
)

Writes the content of a QVMatrix object in an ASCII file.

Parameters:
fileName The name of the file to create. It is overwritten if already exists. The matrix values are stored in text format.
matrix The matrix to store in the file.
precission Number of decimal digits to display for the matrix elements.
Returns:
TRUE if success, FALSE otherwise.

Definition at line 1046 of file qvmatrix.cpp.

bool readQVMatrixFromFile ( const QString  fileName,
QVMatrix matrix 
)

Reads the content of a QVMatrix object from an ASCII file.

Parameters:
fileName The name of the file to read from.
matrix The image to store in the file.
Returns:
TRUE if success, FALSE otherwise.

Definition at line 1060 of file qvmatrix.cpp.

QV3DPointF lnSO3 ( const QVMatrix R  ) 

Obtains the element from the Lie algebra so(3) corresponding to a rotation matrix.

The special orthogonal group in three dimensions SO(3), also known as the rotation group, is a Lie group that contains the possible rotation matrices. This function converts a rotation matrix $ R$ (an element of the rotation group) to its corresponding element $ w $ on the Lie algebra so(3). The Lie algebra so(3) is used commonly to represent rotations in a regular space using only 3 coordinates.

Both elements $w$ and $R$ will satisfy the following equation:

$ R = e^{\left[w\right]_\times}$

There the operator $ [\cdot]_\times$ maps a vector to its corresponding cross product matrix, and the operator $e^\cdot$ is the matrix exponential operator.

Parameters:
R The rotation matrix
Returns:
The vector $w$.
See also:
expSO3
Note:
This function is based on code from the TooN library

Definition at line 1141 of file qvmatrix.cpp.

Referenced by globalEpipolarAdjustment(), and incrementalGEA().

QVMatrix expSO3 ( const QV3DPointF w  ) 

Obtains the rotation matrix corresponding to the element from the Lie algebra so(3).

The special orthogonal group in three dimensions SO(3), also known as the rotation group, is a Lie group that contains the possible rotation matrices. This function converts an element $ w $ on the Lie algebra so(3) to its corresponding rotation matrix $ R$ on the rotation group SO(3). The Lie algebra so(3) is used commonly to represent rotations in a regular space using only 3 coordinates.

Both elements $w$ and $R$ will satisfy the following equation:

$ R = e^{\left[w\right]_\times}$

Where the operator $ [\cdot]_\times$ maps a vector to its corresponding cross product matrix, and the operator $e^\cdot$ is the matrix exponential operator.

Parameters:
w The element from the Lie algebra so(3).
Returns:
The rotation matrix $R$.
See also:
lnSO3
Note:
This function is based on code from the TooN library

Definition at line 1117 of file qvmatrix.cpp.

Referenced by globalEpipolarAdjustment(), and incrementalGEA().

std::ostream& operator<< ( std::ostream &  os,
const QVPermutation vector 
)

Output stream operator for QVPermutaion.

Definition at line 100 of file qvpermutation.cpp.

std::ostream& operator<< ( std::ostream &  os,
const QVVector vector 
)
Todo:
detailed description should follow

Definition at line 428 of file qvvector.cpp.

uint qHash ( const QVVector vector  ) 
Todo:
detailed description should follow

Definition at line 441 of file qvvector.cpp.




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