externals/SuiteSparse/LDL/ldl_di.c
/* This routine checks to see if a sparse matrix A is valid for input to
 * ldl_symbolic and ldl_numeric.  It returns 1 if the matrix is valid, 0
 * otherwise.  A is in sparse column form.  The numerical values in column j
 * are stored in Ax [Ap [j] ... Ap [j+1]-1], with row indices in
 * Ai [Ap [j] ... Ap [j+1]-1].  The Ax array is not checked.
 */
This routine checks to see if a sparse matrix A is valid for input to
ldl_symbolic and ldl_numeric.  It returns 1 if the matrix is valid, 0
otherwise.  A is in sparse column form.  The numerical values in column j
are stored in Ax [Ap [j] ...
This routine checks to see if a sparse matrix A is valid for input to ldl_symbolic and ldl_numeric . It returns 1 if the matrix is valid 0 otherwise . A is in sparse column form . The numerical values in column j are stored in Ax [ Ap [ j ] ...
LDL_int LDL_valid_matrix
(
    LDL_int n,
    LDL_int Ap [ ],
    LDL_int Ai [ ]
)
{
    LDL_int j, p ;
    if (n < 0 || !Ap || !Ai || Ap [0] != 0)
    {
	return (0) ;	    
    }
    for (j = 0 ; j < n ; j++)
    {
	if (Ap [j] > Ap [j+1])
	{
	    return (0) ;    
	}
    }
    for (p = 0 ; p < Ap [n] ; p++)
    {
	if (Ai [p] < 0 || Ai [p] >= n)
	{
	    return (0) ;    
	}
    }
    return (1) ;	    
}
LDL_int LDL_valid_matrix ( LDL_int n , LDL_int Ap [ ] , LDL_int Ai [ ] ) { LDL_int j , p ; if ( n < 0 || ! Ap || ! Ai || Ap [ 0 ] != 0 ) { return ( 0 ) ; } for ( j = 0 ; j < n ; j ++ ) { if ( Ap [ j ] > Ap [ j + 1 ] ) { return ( 0 ) ; } } for ( p = 0 ; p < Ap [ n ] ; p ++ ) { if ( Ai [ p ] < 0 || Ai [ p ] >= n ) { return ( 0 ) ; } } return ( 1 ) ; }
This routine checks to see if a sparse matrix A is valid for input to
 ldl_symbolic and ldl_numeric.
This routine checks to see if a sparse matrix A is valid for input to ldl_symbolic and ldl_numeric .
/* n must be >= 0, and Ap and Ai must be present */ /* Ap must be monotonically nondecreasing */ /* row indices must be in the range 0 to n-1 */ /* matrix is valid */