5164
|
1 /* ========================================================================== */ |
|
2 /* === UMF_valid_symbolic =================================================== */ |
|
3 /* ========================================================================== */ |
|
4 |
|
5 /* -------------------------------------------------------------------------- */ |
|
6 /* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */ |
|
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 |
|
13 /* Returns TRUE if the Symbolic object is valid, FALSE otherwise. */ |
|
14 /* The UMFPACK_report_symbolic routine does a more thorough check. */ |
|
15 |
|
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 } |