Direct computation of the rank of a matrix, without using svd. More...
Go to the source code of this file.
Macros | |
| #define | VNL_RANK_INSTANTIATE(T) extern "please #include vnl/vnl_rank.hxx instead" |
Enumerations | |
| enum | vnl_rank_type { vnl_rank_row, vnl_rank_column, vnl_rank_both } |
| enum | vnl_rank_pivot_type { vnl_rank_pivot_one, vnl_rank_pivot_all } |
Functions | |
| template<class T > | |
| VNL_EXPORT unsigned int | vnl_rank (vnl_matrix< T > const &mat, vnl_rank_type=vnl_rank_both) |
| Returns the rank of a matrix. More... | |
| template<class T > | |
| VNL_EXPORT vnl_matrix< T > | vnl_rank_row_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type=vnl_rank_pivot_all) |
| Row reduce a matrix. More... | |
| template<class T > | |
| VNL_EXPORT vnl_matrix< T > | vnl_rank_column_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type=vnl_rank_pivot_all) |
| Column reduce a matrix. More... | |
| template<class T > | |
| VNL_EXPORT vnl_matrix< T > | vnl_rank_row_column_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type=vnl_rank_pivot_all) |
| Row and column reduce a matrix. More... | |
Direct computation of the rank of a matrix, without using svd.
Definition in file vnl_rank.h.
| #define VNL_RANK_INSTANTIATE | ( | T | ) | extern "please #include vnl/vnl_rank.hxx instead" |
Definition at line 70 of file vnl_rank.h.
| enum vnl_rank_pivot_type |
| Enumerator | |
|---|---|
| vnl_rank_pivot_one | |
| vnl_rank_pivot_all | |
Definition at line 20 of file vnl_rank.h.
| enum vnl_rank_type |
| Enumerator | |
|---|---|
| vnl_rank_row | |
| vnl_rank_column | |
| vnl_rank_both | |
Definition at line 19 of file vnl_rank.h.
| VNL_EXPORT unsigned int vnl_rank | ( | vnl_matrix< T > const & | mat, |
| vnl_rank_type | = vnl_rank_both |
||
| ) |
Returns the rank of a matrix.
By default, the row rank of the matrix is determined. Specify vnl_rank_column to obtain the column rank.
Definition at line 185 of file vnl_rank.hxx.
| VNL_EXPORT vnl_matrix< T > vnl_rank_column_reduce | ( | vnl_matrix< T > const & | mat, |
| vnl_rank_pivot_type | = vnl_rank_pivot_all |
||
| ) |
Column reduce a matrix.
Definition at line 57 of file vnl_rank.hxx.
| VNL_EXPORT vnl_matrix< T > vnl_rank_row_column_reduce | ( | vnl_matrix< T > const & | mat, |
| vnl_rank_pivot_type | = vnl_rank_pivot_all |
||
| ) |
Row and column reduce a matrix.
Perform both row reduction and column reduction on a matrix. The resulting matrix will in general no longer span the same row space (or column space) as the original matrix, but the rank will not have changed, and the number of nonzero elements will be minimal (viz at most one per row and one per column).
Definition at line 106 of file vnl_rank.hxx.
| VNL_EXPORT vnl_matrix< T > vnl_rank_row_reduce | ( | vnl_matrix< T > const & | mat, |
| vnl_rank_pivot_type | = vnl_rank_pivot_all |
||
| ) |
Row reduce a matrix.
First try to use 1 or -1 as pivot element in each row, to avoid divisions; then use any nonzero element as candidate pivot. Repeat this process until the matrix does not change any more. At that point, the matrix spans the same row space as before and contains as many zeros as possible.
When specifying vnl_rank_pivot_one is given as second argument, only elements with value 1 or -1 are used as candidate pivot elements.
Note that for integer matrices, the resulting matrix is still integer, and is guaranteed to be row equivalent with the original matrix.
Definition at line 8 of file vnl_rank.hxx.
1.8.15