Blame view

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