1 /* ========================================================================== */ 2 /* === UMF_valid_symbolic =================================================== */ 3 /* ========================================================================== */ 4 5 /* -------------------------------------------------------------------------- */ 6 /* UMFPACK Copyright (c) Timothy A. Davis, CISE, */ 7 /* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */ 8 /* web: http://www.cise.ufl.edu/research/sparse/umfpack */ 9 /* -------------------------------------------------------------------------- */ 10 11 #include "umf_internal.h" 12 #include "umf_valid_symbolic.h" 13 14 /* Returns TRUE if the Symbolic object is valid, FALSE otherwise. */ 15 /* The UMFPACK_report_symbolic routine does a more thorough check. */ 16 UMF_valid_symbolic(SymbolicType * Symbolic)17GLOBAL Int UMF_valid_symbolic 18 ( 19 SymbolicType *Symbolic 20 ) 21 { 22 /* This routine does not check the contents of the individual arrays, so */ 23 /* it can miss some errors. All it checks for is the presence of the */ 24 /* arrays, and the Symbolic "valid" entry. */ 25 26 if (!Symbolic) 27 { 28 return (FALSE) ; 29 } 30 31 if (Symbolic->valid != SYMBOLIC_VALID) 32 { 33 /* Symbolic does not point to a SymbolicType object */ 34 return (FALSE) ; 35 } 36 37 if (!Symbolic->Cperm_init || !Symbolic->Rperm_init || 38 !Symbolic->Front_npivcol || !Symbolic->Front_1strow || 39 !Symbolic->Front_leftmostdesc || 40 !Symbolic->Front_parent || !Symbolic->Chain_start || 41 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols || 42 Symbolic->n_row <= 0 || Symbolic->n_col <= 0) 43 { 44 return (FALSE) ; 45 } 46 47 return (TRUE) ; 48 } 49