HP MLIB User's Guide Vol. 2 7th Ed.

Chapter 11 Introduction to Distributed SuperLU 763
Sample programs
printf (“x(%d, %d)=%f\n”, i+1, j+1, b_global[j*m+i]);
}
}
}
/* ------------------------------------------------------------
DEALLOCATE STORAGE.
------------------------------------------------------------*/
free(stat.utime);
free(stat.ops);
free( Astore->rowptr );
free( Astore->colind );
free( Astore->nzval );
free( Astore );
free(ScalePermstruct.perm_r);
free(ScalePermstruct.perm_c);
switch ( ScalePermstruct.DiagScale ) {
case ROW:
free(ScalePermstruct.R);
break;
case COL:
free(ScalePermstruct.C);
break;
case BOTH:
free(ScalePermstruct.R);
free(ScalePermstruct.C);
break;
}
/* void Destroy_LU(int_t n, gridinfo_t *grid, LUstruct_t *LUstruct)
* frees the memory allocated for the L and U
* factor matrices.
*
* n is the number of columns of A.
* grid points to storage for the grid.
* LUstruct points to the storage for the LU factors.
*/
Destroy_LU(n, &grid, &LUstruct);
free(LUstruct.etree);
free(LUstruct.Glu_persist);
free(LUstruct.Llu);
if ( options.SolveInitialized ) {
free((SOLVEstruct.gstrs_comm)->B_to_X_SendCnt);
free((SOLVEstruct.gstrs_comm)->X_to_B_SendCnt);
free((SOLVEstruct.gstrs_comm)->ptr_to_ibuf);
free(SOLVEstruct.gstrs_comm);
if ( options.IterRefine && options.RefineInitialized ) {
free((SOLVEstruct.gsmv_comm)->extern_start);