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