Next: , Previous: Finding maximum and minimum elements of matrices, Up: Matrices


8.4.12 Matrix properties

— Function: int gsl_matrix_isnull (const gsl_matrix * m)
— Function: int gsl_matrix_ispos (const gsl_matrix * m)
— Function: int gsl_matrix_isneg (const gsl_matrix * m)

These functions return 1 if all the elements of the matrix m are zero, strictly positive, or strictly negative respectively, and 0 otherwise. To test for a non-negative matrix, use the expression !gsl_matrix_isneg(m). To test whether a matrix is positive-definite, use the Cholesky decomposition (see Cholesky Decomposition).