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

754 HP MLIB LAPACK User’s Guide
Sample programs
printf (“The solution is:\n”);
for (i = 0; i < n; ++i) {
printf (“x(%d)=%f\n”, i+1, b[i]);
}
}
/* Deallocate storage */
free(stat.utime);
free(stat.ops);
free(((NCformat *)A.Store)->rowind);
free(((NCformat *)A.Store)->colptr);
free(((NCformat *)A.Store)->nzval);
free(A.Store);
/* 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(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;
}
free(LUstruct.etree);
free(LUstruct.Glu_persist);
free(LUstruct.Llu);
free(b);
free(berr);
/* ------------------------------------------------------------
Release the process grid and terminate the MPI environment.
------------------------------------------------------------*/
out: