mirror of
https://github.com/wassname/simpeg.git
synced 2026-06-29 11:01:30 +08:00
use Zero in sdiag instead of returing h to avoid confusion
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user