use Zero in sdiag instead of returing h to avoid confusion

This commit is contained in:
Lindsey Heagy
2016-02-04 18:49:42 -08:00
parent 05ce38013e
commit 2fb8de708a
+1 -2
View File
@@ -2,7 +2,6 @@ import numpy as np
import scipy.sparse as sp
from codeutils import isScalar
def mkvc(x, numDims=1):
"""Creates a vector with the number of dimension specified
@@ -41,7 +40,7 @@ def mkvc(x, numDims=1):
def sdiag(h):
"""Sparse diagonal matrix"""
if isinstance(h, Zero):
return h
return Zero()
return sp.spdiags(mkvc(h), 0, h.size, h.size, format="csr")