1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
Description: Fix build failure against SuiteSparse 4.1
In SuiteSparse 4.1, the 2by2 strategy for ordering and pivoting in UMFPACK has
been removed (it was already deprecated in SuiteSparse 3.4). This patch removes
the code and options in the python interface that are related to this strategy.
Author: Sébastien Villemot <sebastien@debian.org>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708379
Forwarded: no
Last-Update: 2013-08-05
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Src/umfpackmodule.c
+++ b/Src/umfpackmodule.c
@@ -493,7 +493,7 @@
}
static PyObject *
-newUMFPackObject(LLMatObject *matrix, int strategy, double tol2by2, int scale,
+newUMFPackObject(LLMatObject *matrix, int strategy, int scale,
double tolpivot, double tolsympivot)
{
UMFPackObject *self;
@@ -546,9 +546,6 @@
if (strategy != -1)
self->Control[UMFPACK_STRATEGY] = strategy;
- if (tol2by2 != -1)
- self->Control[UMFPACK_2BY2_TOLERANCE] = tol2by2;
-
if (scale != -1)
self->Control[UMFPACK_SCALE] = scale;
@@ -664,9 +661,6 @@
\"UMFPACK_STRATEGY_AUTO\"\n\
\"UMFPACK_STRATEGY_UNSYMMETRIC\"\n\
\"UMFPACK_STRATEGY_SYMMETRIC\"\n\
- \"UMFPACK_STRATEGY_2BY2\"\n\
-\n\
-tol2by2 tolerance for the 2 by 2 strategy\n\
\n\
scale scaling UMFPACK would use\n\
\"UMFPACK_SCALE_NONE\"\n\
@@ -685,19 +679,17 @@
factorize(PyObject *self, PyObject *args, PyObject *keywds) {
LLMatObject *matrix;
char *strategy="UMFPACK_STRATEGY_AUTO";
- double tol2by2 = 0.1;
char *scale="UMFPACK_SCALE_SUM";
double tolpivot = 0.1;
double tolsympivot = 0.0;
int res;
int strategyval = UMFPACK_STRATEGY_AUTO, scaleval = UMFPACK_SCALE_SUM;
- static char *kwlist[] = {"", "strategy", "tol2by2", "scale", "tolpivot", "tolsympivot", NULL};
+ static char *kwlist[] = {"", "strategy", "scale", "tolpivot", "tolsympivot", NULL};
- res = PyArg_ParseTupleAndKeywords(args, keywds, "O!|sdsdd", kwlist,
+ res = PyArg_ParseTupleAndKeywords(args, keywds, "O!|ssdd", kwlist,
&LLMatType, &matrix,
&strategy,
- &tol2by2,
&scale,
&tolpivot,
&tolsympivot);
@@ -710,8 +702,6 @@
strategyval = UMFPACK_STRATEGY_UNSYMMETRIC;
else if (strcmp("UMFPACK_STRATEGY_SYMMETRIC", strategy) == 0)
strategyval = UMFPACK_STRATEGY_SYMMETRIC;
- else if (strcmp("UMFPACK_STRATEGY_2BY2", strategy) == 0)
- strategyval = UMFPACK_STRATEGY_2BY2;
if (strcmp("UMFPACK_SCALE_NONE", scale) == 0)
scaleval = UMFPACK_SCALE_NONE;
@@ -720,7 +710,7 @@
if (strcmp("UMFPACK_SCALE_MAX", scale) == 0)
scaleval = UMFPACK_SCALE_MAX;
- return newUMFPackObject(matrix, strategyval, tol2by2, scaleval, tolpivot, tolsympivot);
+ return newUMFPackObject(matrix, strategyval, scaleval, tolpivot, tolsympivot);
}
--- a/Lib/pysparseUmfpack.py
+++ b/Lib/pysparseUmfpack.py
@@ -57,9 +57,7 @@
:strategy: string that specifies what kind of ordering and pivoting
strategy UMFPACK should use. Valid values are 'auto',
- 'unsymmetric', 'symmetric' and '2by2'. Default: 'auto'
-
- :tol2by2: tolerance for the 2 by 2 strategy. Default: 0.1
+ 'unsymmetric' and 'symmetric'. Default: 'auto'
:scale: string that specifies the scaling UMFPACK should use. Valid
values are 'none', 'sum', and 'max'. Default: 'sum'.
@@ -130,7 +128,7 @@
if 'strategy' in kwargs.keys():
strategy = upper(kwargs.get('strategy'))
- if strategy not in ['AUTO', 'UNSYMMETRIC', 'SYMMETRIC', '2BY2']:
+ if strategy not in ['AUTO', 'UNSYMMETRIC', 'SYMMETRIC']:
strategy = 'AUTO'
kwargs['strategy'] = 'UMFPACK_STRATEGY_' + strategy
--- a/Test/testUmfpack.py
+++ b/Test/testUmfpack.py
@@ -52,11 +52,6 @@
self.LU.solve(self.b)
self.failUnless(self.computeError(self.LU.sol) < self.tol)
- def test2by2(self):
- self.LU = PysparseUmfpackSolver(self.A, strategy='2by2')
- self.LU.solve(self.b)
- self.failUnless(self.computeError(self.LU.sol) < self.tol)
-
def testNoScaling(self):
self.LU = PysparseUmfpackSolver(self.A, scale='none')
self.LU.solve(self.b)
@@ -114,11 +109,6 @@
self.LU.solve(self.b)
self.failUnless(self.computeError(self.LU.sol) < self.tol)
- def testPoisson1d2by2(self):
- self.LU = PysparseUmfpackSolver(self.B, strategy='2by2')
- self.LU.solve(self.b)
- self.failUnless(self.computeError(self.LU.sol) < self.tol)
-
def testPoisson1dNoScaling(self):
self.LU = PysparseUmfpackSolver(self.B, scale='none')
self.LU.solve(self.b)
@@ -180,11 +170,6 @@
self.LU.solve(self.b)
self.failUnless(self.computeError(self.LU.sol) < self.tol)
- def testPoisson2d2by2(self):
- self.LU = PysparseUmfpackSolver(self.B, strategy='2by2')
- self.LU.solve(self.b)
- self.failUnless(self.computeError(self.LU.sol) < self.tol)
-
def testPoisson2dNoScaling(self):
self.LU = PysparseUmfpackSolver(self.B, scale='none')
self.LU.solve(self.b)
|