diff --git a/SimPEG/sputils.py b/SimPEG/sputils.py index b078fff2..d9aab184 100644 --- a/SimPEG/sputils.py +++ b/SimPEG/sputils.py @@ -1,10 +1,9 @@ -import numpy as np from scipy import sparse as sp def sdiag(h): """Sparse diagonal matrix""" - return sp.spdiags(h, 0, np.size(h), np.size(h), format="csr") + return sp.spdiags(h, 0, h.size, h.size, format="csr") def speye(n): @@ -20,47 +19,3 @@ def kron3(A, B, C): def spzeros(n1, n2): """spzeros""" return sp.coo_matrix((n1, n2)).tocsr() - - -def appendBottom(A, B): - """append on bottom""" - C = sp.vstack((A, B)) - C = C.tocsr() - return C - - -def appendBottom3(A, B, C): - """append on bottom""" - C = appendBottom(appendBottom(A, B), C) - C = C.tocsr() - return C - - -def appendRight(A, B): - """append on right""" - C = sp.hstack((A, B)) - C = C.tocsr() - return C - - -def appendRight3(A, B, C): - """append on right""" - C = appendRight(appendRight(A, B), C) - C = C.tocsr() - return C - - -def blkDiag(A, B): - """blockdigonal""" - O12 = sp.coo_matrix((np.shape(A)[0], np.shape(B)[1])) - O21 = sp.coo_matrix((np.shape(B)[0], np.shape(A)[1])) - C = sp.vstack((sp.hstack((A, O12)), sp.hstack((O21, B)))) - C = C.tocsr() - return C - - -def blkDiag3(A, B, C): - """blockdigonal 3""" - ABC = blkDiag(blkDiag(A, B), C) - ABC = ABC.tocsr() - return ABC diff --git a/SimPEG/utils.py b/SimPEG/utils.py index 4937062b..fdeb2742 100644 --- a/SimPEG/utils.py +++ b/SimPEG/utils.py @@ -1,10 +1,6 @@ import numpy as np -def reshapeF(x, size): - return np.reshape(x, size, order='F') - - def mkvc(x, numDims=1): """Creates a vector with the number of dimension specified