Backported from: https://github.com/pyamg/pyamg/commit/6f5e549e6105e18cfff9bf4b5f1834d081fa4510 Author: Luke Olson --- a/pyamg/aggregation/tests/test_smooth.py +++ b/pyamg/aggregation/tests/test_smooth.py @@ -485,6 +485,9 @@ class TestEnergyMin(TestCase): Bc = ml.levels[1].B P = ml.levels[0].P.tocsr() + T.eliminate_zeros() + P.eliminate_zeros() + # P should preserve B in its range, wherever P # has enough nonzeros mask = ((P.indptr[1:] - P.indptr[:-1]) >= B.shape[1])