Blame view

fvn_sparse/UMFPACK/Source/umfpack_free_numeric.c 1.88 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
48
49
50
51
52
53
54
55
56
57
  /* ========================================================================== */
  /* === UMFPACK_free_numeric ================================================= */
  /* ========================================================================== */
  
  /* -------------------------------------------------------------------------- */
  /* 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                       */
  /* -------------------------------------------------------------------------- */
  
  /*  User-callable.  Free the entire Numeric object (consists of 11 to 13
   *  malloc'd objects.  See UMFPACK_free_numeric.h for details.
   */
  
  #include "umf_internal.h"
  #include "umf_free.h"
  
  GLOBAL void UMFPACK_free_numeric
  (
      void **NumericHandle
  )
  {
  
      NumericType *Numeric ;
      if (!NumericHandle)
      {
  	return ;
      }
      Numeric = *((NumericType **) NumericHandle) ;
      if (!Numeric)
      {
  	return ;
      }
  
      /* these 9 objects always exist */
      (void) UMF_free ((void *) Numeric->D) ;
      (void) UMF_free ((void *) Numeric->Rperm) ;
      (void) UMF_free ((void *) Numeric->Cperm) ;
      (void) UMF_free ((void *) Numeric->Lpos) ;
      (void) UMF_free ((void *) Numeric->Lilen) ;
      (void) UMF_free ((void *) Numeric->Lip) ;
      (void) UMF_free ((void *) Numeric->Upos) ;
      (void) UMF_free ((void *) Numeric->Uilen) ;
      (void) UMF_free ((void *) Numeric->Uip) ;
  
      /* Rs does not exist if scaling was not performed */
      (void) UMF_free ((void *) Numeric->Rs) ;
  
      /* Upattern can only exist for singular or rectangular matrices */
      (void) UMF_free ((void *) Numeric->Upattern) ;
  
      /* these 2 objects always exist */
      (void) UMF_free ((void *) Numeric->Memory) ;
      (void) UMF_free ((void *) Numeric) ;
  
      *NumericHandle = (void *) NULL ;
  }