From e2e77c4db1dcd0b4af33aae60850bcbc7dd2cce1 Mon Sep 17 00:00:00 2001 From: Carl-Martin Pfeiler <carl-martin.pfeiler@asc.tuwien.ac.at> Date: Fri, 8 Feb 2019 14:14:57 +0100 Subject: [PATCH] minor adj: safe ng->scipy if mat not regular --- _tools/algebra/scipySparseFromNgMatrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tools/algebra/scipySparseFromNgMatrix.py b/_tools/algebra/scipySparseFromNgMatrix.py index 3a028e2..ce0795d 100644 --- a/_tools/algebra/scipySparseFromNgMatrix.py +++ b/_tools/algebra/scipySparseFromNgMatrix.py @@ -7,7 +7,7 @@ def ScipySparseFromNgMatrix(a): import scipy.sparse as sp rows, cols, vals = a.mat.COO() - A = sp.csr_matrix( (vals.NumPy(), (rows, cols) ) ) + A = sp.csr_matrix( (vals.NumPy(), (rows, cols) ), shape=(a.mat.height, a.mat.width) ) return A -- GitLab