// ============================================================================= // === spqr_freefac ============================================================ // ============================================================================= // SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. // SPDX-License-Identifier: GPL-2.0+ //------------------------------------------------------------------------------ #include "spqr.hpp" // Frees the contents of the QR factor object. template void spqr_freefac ( SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) { SuiteSparseQR_factorization *QR ; Int n, m, bncols, n1rows, r1nz ; if (QR_handle == NULL || *QR_handle == NULL) { // nothing to do; caller probably ran out of memory return ; } QR = *QR_handle ; n = QR->nacols ; m = QR->narows ; bncols = QR->bncols ; n1rows = QR->n1rows ; r1nz = QR->r1nz ; spqr_freenum (& (QR->QRnum), cc) ; spqr_freesym (& (QR->QRsym), cc) ; spqr_free (n+bncols, sizeof (Int), QR->Q1fill, cc) ; spqr_free (m, sizeof (Int), QR->P1inv, cc) ; spqr_free (m, sizeof (Int), QR->HP1inv, cc) ; spqr_free (n1rows+1, sizeof (Int), QR->R1p, cc) ; spqr_free (r1nz, sizeof (Int), QR->R1j, cc) ; spqr_free (r1nz, sizeof (Entry), QR->R1x, cc) ; spqr_free (n, sizeof (Int), QR->Rmap, cc) ; spqr_free (n, sizeof (Int), QR->RmapInv, cc) ; spqr_free (1, sizeof (SuiteSparseQR_factorization ), QR, cc) ; *QR_handle = NULL ; } // ============================================================================= template void spqr_freefac ( SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) ; template void spqr_freefac ( SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) ; template void spqr_freefac ( SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) ; template void spqr_freefac ( SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) ;