![]() |
University of Murcia, Spain ![]() |
QVVector Class ReferenceImplementation of numerical vectors.
More...
|
Public Member Functions | |
QVVector () | |
Default constructor for QVVector. | |
QVVector (const int size, const double defaultValue=0) | |
Constructor for QVVector. | |
QVVector (const QVVector &vector) | |
Copy constructor for QVVector. | |
QVVector (const QVector< double > &vector) | |
Copy constructor for QVector. | |
QVVector (const QList< double > &list) | |
Convert constructor from QList. | |
QVVector (const QVMatrix &matrix) | |
Convert constructor from QVMatrix. | |
QVVector (const gsl_vector *vector) | |
Copy constructor for gsl_vector. | |
QVVector (const QPoint &point) | |
Convert constructor for QPoint. | |
QVVector (const QPointF &point) | |
Convert constructor for QPointF. | |
double | operator* (const QVVector &vector) const |
Vector dot product. | |
QVVector | operator^ (const QVVector &vector) const |
Vector cross product. | |
QVVector | operator+ (const QVVector &vector) const |
Vector add. | |
QVVector | operator- (const QVVector &vector) const |
Vector substraction. | |
QVVector | operator* (const double value) const |
Scalar multiplication. | |
QVVector | operator/ (const double value) const |
Scalar division. | |
QVVector | operator* (const QVMatrix &matrix) const |
Vector-matrix product. | |
bool | operator== (const QVVector &vector) const |
Compare operator. | |
QVVector & | operator+= (const QVVector &vector) |
Add compound assignment operator. | |
operator QPointF () const | |
Convert to QPointF operator. | |
operator gsl_vector * () const | |
Convert to gsl_vector * operator. | |
int | maxIndex () const |
Gets the location of the element with the maximal value. | |
int | minIndex () const |
Gets the location of the element with the minimal value. | |
void | set (const double value) |
Set vector elements to a value. | |
QVVector | subVector (const int firstIndex, const int lastIndex) |
Set vector elements to a value. | |
QVVector | scalarDivision (const double value) const |
Scalar division. | |
QVVector | scalarMultiplication (const double value) const |
Scalar multiplication. | |
double | norm2 () const |
Norm 2 of the vector. | |
QVVector | normalize () const |
Normalize vector. | |
double | max () const |
Maximal value contained in the vector. | |
double | min () const |
Minimal value contained in the vector. | |
double | sum () const |
Vector value accumulation. | |
double | mean () const |
Vector mean value. | |
double | variance () const |
Vector standard deviation value. | |
double | entropy (const double base=2) const |
Shannon's entropy of a probability state vector. | |
double | dotProduct (const QVVector &vector) const |
Vector dot product. | |
QVVector | crossProduct (const QVVector &vector) const |
Vector cross product. | |
QVVector | add (const QVVector &vector) const |
Vector add. | |
QVVector | substract (const QVVector &vector) const |
Vector substraction. | |
bool | equals (const QVVector &vector) const |
Compare operator. | |
QVMatrix | crossProductMatrix () const |
Obtain the matrix corresponding to the matrix multiplication notation for the vector cross product. | |
QVMatrix | toRowMatrix () const |
QVMatrix | toColumnMatrix () const |
Static Public Member Functions | |
static const QVVector | gaussianVector (const int radius, const double sigma) |
Vector of Gaussian distributed values. | |
static const QVVector | mexicanHatWaveletVector (const int radius, const double sigma) |
Vector of mexican hat wavelet distributed values. | |
static const QVVector | homogeneousCoordinates (const QPointF &point) |
Creates vector corresponding to the homogeneous coordinates of a 2D point. |
Definition at line 43 of file qvvector.h.
QVVector::QVVector | ( | ) | [inline] |
Default constructor for QVVector.
vector | operand for the product |
Definition at line 49 of file qvvector.h.
QVVector::QVVector | ( | const int | size, | |
const double | defaultValue = 0 | |||
) | [inline] |
Constructor for QVVector.
int | initializing size for the vector | |
defaultValue | default value to set all elements of the vector |
Definition at line 55 of file qvvector.h.
QVVector::QVVector | ( | const QVVector & | vector | ) | [inline] |
Copy constructor for QVVector.
vector | vector to be copied |
Definition at line 60 of file qvvector.h.
QVVector::QVVector | ( | const QVector< double > & | vector | ) | [inline] |
Copy constructor for QVector.
vector | vector to be copied |
Definition at line 65 of file qvvector.h.
QVVector::QVVector | ( | const QList< double > & | list | ) | [inline] |
Convert constructor from QList.
list | List of double values to be converted to QVVector |
Definition at line 70 of file qvvector.h.
QVVector::QVVector | ( | const QVMatrix & | matrix | ) |
Convert constructor from QVMatrix.
This function generates a vector containing the elements of a matrix in a row mayor order.
matrix | matrix to be converted. |
Definition at line 31 of file qvvector.cpp.
QVVector::QVVector | ( | const gsl_vector * | vector | ) | [inline] |
Copy constructor for gsl_vector.
vector | vector to be copied |
Definition at line 83 of file qvvector.h.
QVVector::QVVector | ( | const QPoint & | point | ) | [inline] |
Convert constructor for QPoint.
vector | vector to be copied |
Definition at line 92 of file qvvector.h.
QVVector::QVVector | ( | const QPointF & | point | ) | [inline] |
Convert constructor for QPointF.
vector | vector to be copied |
Definition at line 97 of file qvvector.h.
double QVVector::operator* | ( | const QVVector & | vector | ) | const [inline] |
Vector dot product.
vector | operand for the product |
Definition at line 105 of file qvvector.h.
Vector cross product.
vector | operand for the product |
Definition at line 111 of file qvvector.h.
Vector add.
vector | term for the operation |
Definition at line 117 of file qvvector.h.
Vector substraction.
vector | subtrahend for the operation |
Definition at line 123 of file qvvector.h.
QVVector QVVector::operator* | ( | const double | value | ) | const [inline] |
Scalar multiplication.
value | value to multiply each component of the vector |
Definition at line 129 of file qvvector.h.
QVVector QVVector::operator/ | ( | const double | value | ) | const [inline] |
Scalar division.
value | value to divide each component of the vector |
Definition at line 135 of file qvvector.h.
Referenced by normalize().
Vector-matrix product.
matrix | operand for the product |
Definition at line 68 of file qvvector.cpp.
bool QVVector::operator== | ( | const QVVector & | vector | ) | const [inline] |
Compare operator.
vector | vector to compare |
Definition at line 146 of file qvvector.h.
Add compound assignment operator.
vector | vector to add |
Definition at line 151 of file qvvector.h.
QVVector::operator QPointF | ( | ) | const [inline] |
Convert to QPointF operator.
Cast from homogeneous coordinates.
Definition at line 158 of file qvvector.h.
QVVector::operator gsl_vector * | ( | ) | const [inline] |
Convert to gsl_vector * operator.
value | gsl_vector |
Definition at line 171 of file qvvector.h.
int QVVector::maxIndex | ( | ) | const [inline] |
Gets the location of the element with the maximal value.
Definition at line 185 of file qvvector.h.
int QVVector::minIndex | ( | ) | const [inline] |
Gets the location of the element with the minimal value.
Definition at line 200 of file qvvector.h.
void QVVector::set | ( | const double | value | ) | [inline] |
Set vector elements to a value.
value | value to set all the elements of the vector |
Definition at line 215 of file qvvector.h.
QVVector QVVector::subVector | ( | const int | firstIndex, | |
const int | lastIndex | |||
) | [inline] |
Set vector elements to a value.
value | value to set all the elements of the vector |
Definition at line 224 of file qvvector.h.
Referenced by QVQuaternion::quaternionProduct().
QVVector QVVector::scalarDivision | ( | const double | value | ) | const [inline] |
Scalar division.
value | value to divide each component of the vector |
Definition at line 241 of file qvvector.h.
Referenced by operator/().
QVVector QVVector::scalarMultiplication | ( | const double | value | ) | const [inline] |
Scalar multiplication.
value | value to multiply each component of the vector |
Definition at line 253 of file qvvector.h.
Referenced by operator*().
double QVVector::norm2 | ( | ) | const [inline] |
Norm 2 of the vector.
Definition at line 264 of file qvvector.h.
Referenced by CalibrateCameraFromPlanarHomography(), GetExtrinsicCameraMatrixFromHomography(), HomographyTestError(), normalize(), QVMatrix::QVMatrix(), QVQuaternion::QVQuaternion(), and QVQuaternion::trackball().
QVVector QVVector::normalize | ( | ) | const [inline] |
Normalize vector.
Divides each element of the vector by its second norm.
Definition at line 271 of file qvvector.h.
double QVVector::sum | ( | ) | const |
Vector value accumulation.
This function returns the sumatory of the elements of the vector.
Definition at line 196 of file qvvector.cpp.
double QVVector::mean | ( | ) | const |
Vector mean value.
This function returns the standard average value of the vector:
Definition at line 205 of file qvvector.cpp.
Referenced by variance().
double QVVector::variance | ( | ) | const |
Vector standard deviation value.
This function returns a variance estimation of the elements in the vector:
Definition at line 210 of file qvvector.cpp.
double QVVector::entropy | ( | const double | base = 2 |
) | const |
Shannon's entropy of a probability state vector.
This function calculates the entropy of the elements of the vector. These elements are considered as the probabilities of a random variable, over a set domain. Thus the sum of the vector elements must be equal to . The entropy is computed with the following formula:
If the sum of the elements of the vector is not , they are normalized before computing the entropy. In the case of
for some
element of the vector, the value of the corresponding summand
is taken to be
, which is consistent with the limit
base | base of the logarithm in the entropy equation. |
Definition at line 220 of file qvvector.cpp.
double QVVector::dotProduct | ( | const QVVector & | vector | ) | const |
Vector dot product.
vector | operand for the product |
Definition at line 40 of file qvvector.cpp.
Referenced by operator*().
Vector cross product.
Computes the cross product for two vectors of size 3
vector | operand for the product |
Definition at line 51 of file qvvector.cpp.
Referenced by operator^().
Vector add.
vector | term for the operation |
Definition at line 82 of file qvvector.cpp.
Vector substraction.
vector | subtrahend for the operation |
Definition at line 93 of file qvvector.cpp.
Referenced by operator-().
bool QVVector::equals | ( | const QVVector & | vector | ) | const |
Compare operator.
vector | vector to compare |
Definition at line 104 of file qvvector.cpp.
Referenced by operator==().
const QVVector QVVector::gaussianVector | ( | const int | radius, | |
const double | sigma | |||
) | [static] |
Vector of Gaussian distributed values.
This function generates a vector containing homogeneously sampled values of a gaussian distribution. The size of the vector will equal the double of the radius of the gaussian distribution plus one. The standart deviation must be explicitally provided.
radius | Radius of the gaussian distribution. | |
sigma | Sigma of the gaussian distribution. |
Definition at line 143 of file qvvector.cpp.
const QVVector QVVector::mexicanHatWaveletVector | ( | const int | radius, | |
const double | sigma | |||
) | [static] |
Vector of mexican hat wavelet distributed values.
This function generates a vector containing homogeneously sampled values of a mexican hat wavelet distribution. The size of the vector will equal the double of the radius of the wavelet distribution plus one. The standart deviation must be explicitally provided.
radius | Radius of the wavelet distribution. | |
sigma | Sigma of the wavelet distribution. |
Definition at line 157 of file qvvector.cpp.
const QVVector QVVector::homogeneousCoordinates | ( | const QPointF & | point | ) | [static] |
Creates vector corresponding to the homogeneous coordinates of a 2D point.
point | 2D input point. |
Definition at line 171 of file qvvector.cpp.
QVMatrix QVVector::crossProductMatrix | ( | ) | const |
Obtain the matrix corresponding to the matrix multiplication notation for the vector cross product.
This function returns a matrix which can be used in the cross product multiplication rewritten as a matrix product. The cross product between two vectors:
Can be rewritten as the following matrix multiplication:
Where is the so called cross product matrix for vector
, which has the following structure:
This function only works on vectors of size 3.
vector | vector to compare |
Definition at line 116 of file qvvector.cpp.
QVMatrix QVVector::toRowMatrix | ( | ) | const |
QVMatrix QVVector::toColumnMatrix | ( | ) | const |
Definition at line 135 of file qvvector.cpp.
Referenced by QVMatrix::operator*().