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