[sent to the bug report]
Hi,
Adam C Powell IV wrote:
> Oh yeah, I've been neglecting this, haven't I... Can't take care of it
> before the end of the week, so feel free to NMU.
it's easy to file the bugs initially (mistitled) "NMU diff for ..."
under "no attention needed" :).
For the record I'm attaching the NMU diff verbatim from the original
report but with the bug number added.
Kind regards
T.
--
Thomas Viehmann, http://thomas.viehmann.net/
diff -u pysparse-1.0.1/Src/superlumodule.c pysparse-1.0.1/Src/superlumodule.c
--- pysparse-1.0.1/Src/superlumodule.c
+++ pysparse-1.0.1/Src/superlumodule.c
@@ -89,8 +89,9 @@
dCreate_Dense_Matrix(&B, self->n, 1, (double *)x->data, self->n, SLU_DN, SLU_D, SLU_GE);
#endif
+ StatInit(&dummy);
/* Solve the system, overwriting vector x. */
- dgstrs(trans, &self->L, &self->U, self->perm_r, self->perm_c, &B, &dummy, &info);
+ dgstrs(trans, &self->L, &self->U, self->perm_c, self->perm_r, &B, &dummy, &info);
/* free memory */
Destroy_SuperMatrix_Store(&B);
@@ -197,20 +198,17 @@
SuperMatrix A; /* A in NC format used by the factorization routine. */
SuperMatrix AC; /* Matrix postmultiplied by Pc */
mem_usage_t mem_usage;
- int lwork = 0;
int *etree;
int info;
- optionst.Trans = NOTRANS;
- optionst.DiagPivotThresh = diag_pivot_thresh;
- statt.panel_histo = &panel_size;
- statt.RefineSteps = relax;
+ set_default_options(&optionst);
+ /* the below comment is interesting because statt is a local variable. eh?
/* make sure StatInit is only called once */
- if (!StatInit_done) {
+ //if (!StatInit_done) {
StatInit(&statt);
- StatInit_done = 1;
- }
+ // StatInit_done = 1;
+ //}
/* Create SuperLUObject */
self = PyObject_New(SuperLUObject, &SuperLUType);
@@ -231,16 +229,17 @@
etree = intMalloc(n);
self->perm_r = intMalloc(n);
self->perm_c = intMalloc(n);
- if (self->perm_r == NULL || self->perm_c == NULL) {
+ if (self->perm_r == NULL || self->perm_c == NULL || etree == NULL) {
PyErr_NoMemory();
goto fail;
}
get_perm_c(permc_spec, &A, self->perm_c); /* calc column permutation */
sp_preorder(&optionst, &A, self->perm_c, etree, &AC); /* apply column permutation */
-
+ panel_size = sp_ienv(1);
+ relax = sp_ienv(2);
/* Perform factorization */
dgstrf(&optionst, &AC, drop_tol, relax, panel_size,
- etree, NULL, lwork, self->perm_r, self->perm_c,
+ etree, NULL, 0, self->perm_c,self->perm_r,
&self->L, &self->U, &statt, &info);
/* free memory */
@@ -263,8 +262,8 @@
return (PyObject *)self;
fail:
- PyMem_Del(self->perm_r);
- PyMem_Del(self->perm_c);
+ SUPERLU_FREE(self->perm_r);
+ SUPERLU_FREE(self->perm_c);
PyObject_Del(self);
return NULL;
}
diff -u pysparse-1.0.1/debian/changelog pysparse-1.0.1/debian/changelog
--- pysparse-1.0.1/debian/changelog
+++ pysparse-1.0.1/debian/changelog
@@ -1,3 +1,11 @@
+pysparse (1.0.1-5.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Fix pysparse.superlu module port to superlu 3 based on reading
+ the docs. Closes: #526527
+
+ -- Thomas Viehmann <[email protected]> Fri, 01 May 2009 20:56:39 +0200
+
pysparse (1.0.1-5) unstable; urgency=low
* Removed removal of /usr/lib and Build-Depends on python-central >= 0.6