Skip to content

Commit de44822

Browse files
committed
diagonal dummy identity preconditioner
1 parent cd3ddeb commit de44822

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pypeec/lib_matrix/matrix_factorization.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,13 @@ def factor(rhs):
117117
return factor
118118

119119

120-
def _get_fact_diagonal(mat):
120+
def _get_fact_diagonal():
121121
"""
122122
Dummy factorization with a diagonal matrix.
123123
"""
124124

125-
# get the inverse of the diagonal
126-
inv = IMPORTLIB.diags(1/mat.diagonal(), format="csc")
127-
128-
# apply the diagonal inverse
129125
def factor(rhs):
130-
sol = inv*rhs
131-
return sol
126+
return rhs
132127

133128
return factor
134129

@@ -167,7 +162,7 @@ def factor_dummy(rhs):
167162
elif LIBRARY == "PyAMG":
168163
factor = _get_fact_pyamg(mat)
169164
elif LIBRARY == "Diagonal":
170-
factor = _get_fact_diagonal(mat)
165+
factor = _get_fact_diagonal()
171166
else:
172167
raise ValueError("invalid matrix factorization library")
173168

0 commit comments

Comments
 (0)