GCGlib  0.04.228
GCG Graphics Engine
Linear algebra functions and classes

Functions

bool gcgInverseMatrix2 (MATRIX2 inverse, MATRIX2 matrix)
 Computes the inverse of a 2x2 matrix by the direct method. It is suitable for fast inverse computation in bidimensional spaces. In this version, both input and output matrices are C vectors of 4 floats in row first order. More...
 
bool gcgInverseMatrix3 (MATRIX3 inverse, MATRIX3 matrix)
 Computes the inverse of a 3x3 matrix by the direct method. It is suitable for fast inverse computation in tridimensional spaces. More...
 
bool gcgInverseMatrix4 (MATRIX4 inverse, MATRIX4 matrix)
 Computes the inverse of a 4x4 matrix by the direct method. It is suitable for fast inverse computation in homogeneous spaces in computer graphics. In this version, both input and output matrices are C vectors of 16 floats in row first order. More...
 
bool gcgInverseMatrix2 (MATRIX2d inverse, MATRIX2d matrix)
 Computes the inverse of a 2x2 matrix by the direct method. It is suitable for fast inverse computation in bidimensional spaces. In this version, both input and output matrices are C vectors of 4 doubles in row first order. More...
 
bool gcgInverseMatrix3 (MATRIX3d inverse, MATRIX3d matrix)
 Computes the inverse of a 3x3 matrix by the direct method. It is suitable for fast inverse computation in tridimensional spaces. More...
 
bool gcgInverseMatrix4 (MATRIX4d inverse, MATRIX4d matrix)
 Computes the inverse of a 4x4 matrix by the direct method. It is suitable for fast inverse computation in homogeneous spaces in computer graphics. In this version, both input and output matrices are C vectors of 16 doubles in row first order. More...
 
bool gcgEigenSymmetric (int norder, float matrix[], float eigenvectors[], float eigenvalues[])
 Computes the eigensystem decomposition of a symmetric matrix matrix with arbitraty order. The resulted eigenvectors are stored as rows in a matrix eigenvectors with norder x norder elements. Their respective norder eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of norder x norder floats in row first order. More...
 
bool gcgEigenSymmetric (int norder, double matrix[], double eigenvectors[], double eigenvalues[])
 Computes the eigensystem decomposition of a symmetric matrix matrix with arbitraty order. The resulted eigenvectors are stored as rows in a matrix eigenvectors with norder x norder elements. Their respective norder eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of norder x norder doubles in row first order. More...
 
bool gcgEigenSymmetricMatrix3 (MATRIX3 matrix, MATRIX3 eigenvectors, VECTOR3 eigenvalues)
 Computes the eigensystem decomposition of a symmetric 3 x 3 matrix matrix. The resulted eigenvectors are stored as rows in a matrix eigenvectors with 3 x 3 elements. Their respective three eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of 3 x 3 floats in row first order. More...
 
bool gcgEigenSymmetricMatrix3 (MATRIX3d matrix, MATRIX3d eigenvectors, VECTOR3d eigenvalues)
 Computes the eigensystem decomposition of a symmetric 3 x 3 matrix matrix. The resulted eigenvectors are stored as rows in a matrix eigenvectors with 3 x 3 elements. Their respective three eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of 3 x 3 doubles in row first order. More...
 

Detailed Description

GCGlib provides a minimum linear algebra functionality which serves as basis for several methods. It is the core of important computer vision and computer geometry algorithms.

Function Documentation

◆ gcgEigenSymmetric() [1/2]

bool gcgEigenSymmetric ( int  norder,
float  matrix[],
float  eigenvectors[],
float  eigenvalues[] 
)

Computes the eigensystem decomposition of a symmetric matrix matrix with arbitraty order. The resulted eigenvectors are stored as rows in a matrix eigenvectors with norder x norder elements. Their respective norder eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of norder x norder floats in row first order.

Parameters
[in]norderorder of the input square matrix.
[in]matrixpointer to a square matrix of norder x norder elements stored in row first order.
[out]eigenvectorspointer to a square matrix of norder x norder elements that will receive the norder eigenvectors of the input matrix arranged by row first order.
[out]eigenvaluespointer to a vector of norder elements that will receive the eigenvalues of the input matrix. They are stored by decreasing eigenvalues and their positions are respective to the eigenvectors positions in the matrix eigenvectors.
Returns
true if the eigensystem was correctly computed. If it returns false, the results returned in eigenvectors and eigenvalues are undefined. Check GCG_REPORT_MESSAGE(gcgGetReport()) for knowing the problem.
See also
gcgEigenSymmetricMatrix3
Since
0.01.0

◆ gcgEigenSymmetric() [2/2]

bool gcgEigenSymmetric ( int  norder,
double  matrix[],
double  eigenvectors[],
double  eigenvalues[] 
)

Computes the eigensystem decomposition of a symmetric matrix matrix with arbitraty order. The resulted eigenvectors are stored as rows in a matrix eigenvectors with norder x norder elements. Their respective norder eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of norder x norder doubles in row first order.

Parameters
[in]norderorder of the input square matrix.
[in]matrixpointer to a square matrix of norder x norder elements stored in row first order.
[out]eigenvectorspointer to a square matrix of norder x norder elements that will receive the norder eigenvectors of the input matrix arranged by row first order.
[out]eigenvaluespointer to a vector of norder elements that will receive the eigenvalues of the input matrix. They are stored by decreasing eigenvalues and their positions are respective to the eigenvectors positions in the matrix eigenvectors.
Returns
true if the eigensystem was correctly computed. If it returns false, the results returned in eigenvectors and eigenvalues are undefined. Check GCG_REPORT_MESSAGE(gcgGetReport()) for knowing the problem.
See also
gcgEigenSymmetricMatrix3
Since
0.01.0

◆ gcgEigenSymmetricMatrix3() [1/2]

bool gcgEigenSymmetricMatrix3 ( MATRIX3  matrix,
MATRIX3  eigenvectors,
VECTOR3  eigenvalues 
)

Computes the eigensystem decomposition of a symmetric 3 x 3 matrix matrix. The resulted eigenvectors are stored as rows in a matrix eigenvectors with 3 x 3 elements. Their respective three eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of 3 x 3 floats in row first order.

Parameters
[in]matrixpointer to a square matrix of 3 x 3 elements stored in row first order.
[out]eigenvectorspointer to a square matrix of 3 x 3 elements that will receive the three eigenvectors of the input matrix arranged by row first order.
[out]eigenvaluespointer to a vector of three elements that will receive the eigenvalues of the input matrix. They are stored by decreasing eigenvalues and their positions are respective to the eigenvectors positions in the matrix eigenvectors.
Returns
true if the eigensystem was correctly computed. If it returns false, the results returned in eigenvectors and eigenvalues are undefined. Check GCG_REPORT_MESSAGE(gcgGetReport()) for knowing the problem.
See also
gcgEigenSymmetricMatrix
Since
0.01.0

◆ gcgEigenSymmetricMatrix3() [2/2]

bool gcgEigenSymmetricMatrix3 ( MATRIX3d  matrix,
MATRIX3d  eigenvectors,
VECTOR3d  eigenvalues 
)

Computes the eigensystem decomposition of a symmetric 3 x 3 matrix matrix. The resulted eigenvectors are stored as rows in a matrix eigenvectors with 3 x 3 elements. Their respective three eigenvalues are stored in the vector eigenvalues. The eigenvectors and eigenvalues are ordered by decreasing eigenvalues. Version adapted from the public domain Java Matrix library JAMA. In this version, the input and output matrices are C vectors of 3 x 3 doubles in row first order.

Parameters
[in]matrixpointer to a square matrix of 3 x 3 elements stored in row first order.
[out]eigenvectorspointer to a square matrix of 3 x 3 elements that will receive the three eigenvectors of the input matrix arranged by row first order.
[out]eigenvaluespointer to a vector of three elements that will receive the eigenvalues of the input matrix. They are stored by decreasing eigenvalues and their positions are respective to the eigenvectors positions in the matrix eigenvectors.
Returns
true if the eigensystem was correctly computed. If it returns false, the results returned in eigenvectors and eigenvalues are undefined. Check GCG_REPORT_MESSAGE(gcgGetReport()) for knowing the problem.
See also
gcgEigenSymmetricMatrix
Since
0.01.0

◆ gcgInverseMatrix2() [1/2]

bool gcgInverseMatrix2 ( MATRIX2  inverse,
MATRIX2  matrix 
)

Computes the inverse of a 2x2 matrix by the direct method. It is suitable for fast inverse computation in bidimensional spaces. In this version, both input and output matrices are C vectors of 4 floats in row first order.

Parameters
[out]inversePoints to the 2x2 matrix that receives the inverted matrix of matrix parameter. If it is a singular matrix, it receives its adjoint.
[in]matrixThe input 2x2 matrix to be inverted.
Returns
true if inverse exists and, in that case, the inverse parameter receives the inverted matrix. If returns false, the input matrix is singular and the inverse parameter receives its adjoint matrix.
See also
gcgInverseMatrix3
gcgInverseMatrix4
Since
0.01.0

◆ gcgInverseMatrix2() [2/2]

bool gcgInverseMatrix2 ( MATRIX2d  inverse,
MATRIX2d  matrix 
)

Computes the inverse of a 2x2 matrix by the direct method. It is suitable for fast inverse computation in bidimensional spaces. In this version, both input and output matrices are C vectors of 4 doubles in row first order.

Parameters
[out]inversePoints to the 2x2 matrix that receives the inverted matrix of matrix parameter. If it is a singular matrix, it receives its adjoint.
[in]matrixThe input 2x2 matrix to be inverted.
Returns
true if inverse exists and, in that case, the inverse parameter receives the inverted matrix. If returns false, the input matrix is singular and the inverse parameter receives its adjoint matrix.
See also
gcgInverseMatrix3
gcgInverseMatrix4
Since
0.01.0

◆ gcgInverseMatrix3() [1/2]

bool gcgInverseMatrix3 ( MATRIX3  inverse,
MATRIX3  matrix 
)

Computes the inverse of a 3x3 matrix by the direct method. It is suitable for fast inverse computation in tridimensional spaces.

Parameters
[out]inversePoints to the 3x3 matrix that receives the inverted matrix of matrix parameter. If it is a singular matrix, it receives its adjoint. In this version, both input and output matrices are C vectors of 9 floats in row first order.
[in]matrixThe input 3x3 matrix to be inverted.
Returns
true if inverse exists and, in that case, the inverse parameter receives the inverted matrix. If returns false, the input matrix is singular and the inverse parameter receives its adjoint matrix.
See also
gcgInverseMatrix2
gcgInverseMatrix4
Since
0.01.0

◆ gcgInverseMatrix3() [2/2]

bool gcgInverseMatrix3 ( MATRIX3d  inverse,
MATRIX3d  matrix 
)

Computes the inverse of a 3x3 matrix by the direct method. It is suitable for fast inverse computation in tridimensional spaces.

Parameters
[out]inversePoints to the 3x3 matrix that receives the inverted matrix of matrix parameter. If it is a singular matrix, it receives its adjoint. In this version, both input and output matrices are C vectors of 9 doubles in row first order.
[in]matrixThe input 3x3 matrix to be inverted.
Returns
true if inverse exists and, in that case, the inverse parameter receives the inverted matrix. If returns false, the input matrix is singular and the inverse parameter receives its adjoint matrix.
See also
gcgInverseMatrix2
gcgInverseMatrix4
Since
0.01.0

◆ gcgInverseMatrix4() [1/2]

bool gcgInverseMatrix4 ( MATRIX4  inverse,
MATRIX4  matrix 
)

Computes the inverse of a 4x4 matrix by the direct method. It is suitable for fast inverse computation in homogeneous spaces in computer graphics. In this version, both input and output matrices are C vectors of 16 floats in row first order.

Parameters
[out]inversePoints to the 4x4 matrix that receives the inverted matrix of matrix parameter. If it is a singular matrix, it receives its adjoint.
[in]matrixThe input 4x4 matrix to be inverted.
Returns
true if inverse exists and, in that case, the inverse parameter receives the inverted matrix. If returns false, the input matrix is singular and the inverse parameter receives its adjoint matrix.
See also
gcgInverseMatrix2
gcgInverseMatrix3
Since
0.01.0

◆ gcgInverseMatrix4() [2/2]

bool gcgInverseMatrix4 ( MATRIX4d  inverse,
MATRIX4d  matrix 
)

Computes the inverse of a 4x4 matrix by the direct method. It is suitable for fast inverse computation in homogeneous spaces in computer graphics. In this version, both input and output matrices are C vectors of 16 doubles in row first order.

Parameters
[out]inversePoints to the 4x4 matrix that receives the inverted matrix of matrix parameter. If it is a singular matrix, it receives its adjoint.
[in]matrixThe input 4x4 matrix to be inverted.
Returns
true if inverse exists and, in that case, the inverse parameter receives the inverted matrix. If returns false, the input matrix is singular and the inverse parameter receives its adjoint matrix.
See also
gcgInverseMatrix2
gcgInverseMatrix3
Since
0.01.0