Defines | Functions
core/vnl/vnl_rank.txx File Reference
#include "vnl_rank.h"

Go to the source code of this file.

Defines

#define vnl_rank_txx_
#define VNL_RANK_INSTANTIATE(T)

Functions

template<class T >
vnl_matrix< T > vnl_rank_row_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type t)
 Row reduce a matrix.
template<class T >
vnl_matrix< T > vnl_rank_column_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type t)
 Column reduce a matrix.
template<class T >
vnl_matrix< T > vnl_rank_row_column_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type t)
 Row and column reduce a matrix.
template<class T >
unsigned int vnl_rank (vnl_matrix< T > const &mat, vnl_rank_type t)
 Returns the rank of a matrix.

Define Documentation

#define VNL_RANK_INSTANTIATE (   T)
#define vnl_rank_txx_

Definition at line 3 of file vnl_rank.txx.


Function Documentation

template<class T >
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.txx.

template<class T >
vnl_matrix<T> vnl_rank_column_reduce ( vnl_matrix< T > const &  mat,
vnl_rank_pivot_type  t 
)

Column reduce a matrix.

Definition at line 57 of file vnl_rank.txx.

template<class T >
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.txx.

template<class T >
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.txx.