1 //------------------------------------------------------------------------------
2 // GB_phbix_free: free all content of a matrix
3 //------------------------------------------------------------------------------
4 
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7 
8 //------------------------------------------------------------------------------
9 
10 // Frees all allocatable content of a matrix, except for the header itself.
11 // A->magic becomes GB_MAGIC2.  If this matrix is given to a user-callable
12 // GraphBLAS function, it will generate a GrB_INVALID_OBJECT error.
13 
14 #include "GB.h"
15 
GB_phbix_free(GrB_Matrix A)16 void GB_phbix_free              // free all content of a matrix
17 (
18     GrB_Matrix A                // handle of matrix with content to free
19 )
20 {
21 
22     if (A != NULL)
23     {
24         GB_ph_free (A) ;            // free A->p and A->h
25         GB_bix_free (A) ;           // free A->b, A->i, and A->x
26         GB_FREE (&(A->logger), A->logger_size) ;        // free the error logger
27     }
28 }
29 
30