IsTotallyPositive

IsTotallyPositive is a function that determines whether or not a given matrix is totally positive (i.e., all of its square submatrices have positive determinant). The input matrix can be either full or sparse.

Syntax

 * ITP = IsTotallyPositive(X)
 * ITP = IsTotallyPositive(X,SUB_SIZES)
 * ITP = IsTotallyPositive(X,SUB_SIZES,TOL)
 * [ITP,WIT] = IsTotallyPositive(X,SUB_SIZES,TOL)

Input arguments

 * X: A matrix.
 * SUB_SIZES (optional, default 1:min(size(X))): A vector specifying the sizes of submatrices to be checked to have positive determinant.
 * TOL</tt> (optional, default length(X)*eps(norm(X,'fro'))</tt>): The numerical tolerance used when determining positivity.

Output arguments

 * ITP</tt>: A flag (either 1 or 0) indicating that X</tt> is or is not totally positive.
 * WIT</tt> (optional): If ITP = 0</tt> then WIT</tt> specifies a submatrix of X</tt> that has either negative or non-real determinant. More specifically, WIT</tt> is a matrix with 2 rows such that det(X(WIT(1,:),WIT(2,:)))</tt> is negative or non-real.

Vandermonde matrices
It is known that Vandermonde matrices are totally positive, under certain restrictions on the nodes: