Comparison & Hashing on matrices
- Function: int matrix_compare (const matrix_t* ma,const matrix_t* mb)
- Compares the two matrices row by row. The order is
compatible with that defined on vectors, that is, if for the first
non equal row
i
, ma->p[i
] is less than mb->p[i
], then
the result is negative. In the case where the dimensions are different, compare first the number of rows, then the number of columns.
- Function: unsigned int matrix_hash (const matrix_t* mat)
- This function computes a key associated to the matrix. The function is
compatible with the previous comparison function, that is, two
matrices which are identical with
matrix_compare
give the same key.
- Function: int matrix_compare_sort (matrix_t* ma, matrix_t* mb)
- Compares matrices considered as sets of vectors. The two matrices
are sorted if they are not yet sorted, and then compared row by row
with
matrix_compare
. In the case where the dimensions are different, compare first the number of rows, then the number of columns.
- Function: unsigned int matrix_hash_sort (matrix_t* mat)
- This function computes a key associated to the matrix considered as
a set of vectors. The matrix is sorted if it is not yet sorted, and
then hashed with the
matrix_hash
. The function is compatible
with the previous comparison function, that is, two matrices which
are identical with matrix_compare_sort
gives the same key.
This document was generated
on October, 27 2006
using texi2html