Amesos Package Browser (Single Doxygen Collection) Development
amesos_klu_l_free_numeric.c
Go to the documentation of this file.
00001 /* ========================================================================== */
00002 /* === KLU_free_numeric ===================================================== */
00003 /* ========================================================================== */
00004 
00005 /* Free the KLU Numeric object. */
00006 
00007 /* This file should make the long int version of KLU */
00008 #define DLONG 1
00009 
00010 #include "amesos_klu_internal.h"
00011 
00012 Int KLU_free_numeric
00013 (
00014     KLU_numeric **NumericHandle,
00015     KLU_common  *Common
00016 )
00017 {
00018     KLU_numeric *Numeric ;
00019     Unit **LUbx ;
00020     size_t *LUsize ;
00021     Int block, n, nzoff, nblocks ;
00022 
00023     if (Common == NULL)
00024     {
00025   return (FALSE) ;
00026     }
00027     if (NumericHandle == NULL || *NumericHandle == NULL)
00028     {
00029   return (TRUE) ;
00030     }
00031 
00032     Numeric = *NumericHandle ;
00033 
00034     n = Numeric->n ;
00035     nzoff = Numeric->nzoff ;
00036     nblocks = Numeric->nblocks ;
00037     LUsize = Numeric->LUsize ;
00038 
00039     LUbx = (Unit **) Numeric->LUbx ;
00040     if (LUbx != NULL)
00041     {
00042   for (block = 0 ; block < nblocks ; block++)
00043   {
00044       KLU_free (LUbx [block], LUsize ? LUsize [block] : 0,
00045     sizeof (Unit), Common) ;
00046   }
00047     }
00048 
00049     KLU_free (Numeric->Pnum, n, sizeof (Int), Common) ;
00050     KLU_free (Numeric->Offp, n+1, sizeof (Int), Common) ;
00051     KLU_free (Numeric->Offi, nzoff+1, sizeof (Int), Common) ;
00052     KLU_free (Numeric->Offx, nzoff+1, sizeof (Entry), Common) ;
00053 
00054     KLU_free (Numeric->Lip,  n, sizeof (Int), Common) ;
00055     KLU_free (Numeric->Llen, n, sizeof (Int), Common) ;
00056     KLU_free (Numeric->Uip,  n, sizeof (Int), Common) ;
00057     KLU_free (Numeric->Ulen, n, sizeof (Int), Common) ;
00058 
00059     KLU_free (Numeric->LUsize, nblocks, sizeof (size_t), Common) ;
00060 
00061     KLU_free (Numeric->LUbx, nblocks, sizeof (Unit *), Common) ;
00062 
00063     KLU_free (Numeric->Udiag, n, sizeof (Entry), Common) ;
00064 
00065     KLU_free (Numeric->Rs,   n, sizeof (double), Common) ;
00066     KLU_free (Numeric->Pinv, n, sizeof (Int), Common) ;
00067 
00068     KLU_free (Numeric->Work, Numeric->worksize, 1, Common) ;
00069 
00070     KLU_free (Numeric, 1, sizeof (KLU_numeric), Common) ;
00071 
00072     *NumericHandle = NULL ;
00073     return (TRUE) ;
00074 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines