IsTotallyPositive: Difference between revisions

From QETLAB
Jump to navigation Jump to search
Created page with "{{Function |name=IsTotallyPositive |desc=Determines whether or not a matrix is totally positive |req=opt_args |rel=IsPSD<br />IsTotallyNonsingular |upd=Decembe..."
 
m removed red links
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Function
{{Function
|name=IsTotallyPositive
|name=IsTotallyPositive
|desc=Determines whether or not a matrix is [[totally positive]]
|desc=Determines whether or not a matrix is totally positive
|req=[[opt_args]]
|rel=[[IsTotallyNonsingular]]
|rel=[[IsPSD]]<br />[[IsTotallyNonsingular]]
|cat=[[List of functions#Miscellaneous|Miscellaneous]]
|upd=December 13, 2012
|upd=December 13, 2012
|v=1.00}}
|v=0.50}}
<tt>'''IsTotallyPositive'''</tt> is a [[List of functions|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.
<tt>'''IsTotallyPositive'''</tt> is a [[List of functions|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==
==Syntax==
Line 27: Line 27:
===Vandermonde matrices===
===Vandermonde matrices===
It is known that [http://en.wikipedia.org/wiki/Vandermonde_matrix Vandermonde matrices] are totally positive, under certain restrictions on the nodes:
It is known that [http://en.wikipedia.org/wiki/Vandermonde_matrix Vandermonde matrices] are totally positive, under certain restrictions on the nodes:
<pre<noinclude></noinclude>>
<syntaxhighlight>
>> IsTotallyPositive(vander(5:-1:1))
>> IsTotallyPositive(vander(5:-1:1))


Line 33: Line 33:


     1
     1
</pre<noinclude></noinclude>>
</syntaxhighlight>


==Notes==
==Notes==
In practice, this function is practical for matrices of size up to about 15-by-15.
In practice, this function is practical for matrices of size up to about 15-by-15.
{{SourceCode|name=IsTotallyPositive}}

Latest revision as of 18:31, 9 December 2014

IsTotallyPositive
Determines whether or not a matrix is totally positive

Other toolboxes required none
Related functions IsTotallyNonsingular
Function category Miscellaneous

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)

Argument descriptions

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 (optional, default length(X)*eps(norm(X,'fro'))): The numerical tolerance used when determining positivity.

Output arguments

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

Examples

Vandermonde matrices

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

>> IsTotallyPositive(vander(5:-1:1))

ans =

     1

Notes

In practice, this function is practical for matrices of size up to about 15-by-15.

Source code

Click here to view this function's source code on github.