Skip to content
Snippets Groups Projects
Commit 5e882752 authored by Christoph Groth's avatar Christoph Groth
Browse files

simplify if clause

parent 40b9b37b
No related branches found
No related tags found
No related merge requests found
...@@ -84,14 +84,14 @@ class Solver(common.SparseSolver): ...@@ -84,14 +84,14 @@ class Solver(common.SparseSolver):
self.nrhs = nrhs self.nrhs = nrhs
if ordering is not None: if ordering is not None:
if ordering not in list(mumps.orderings.keys()) + ['kwant_decides']:
raise ValueError("Invalid ordering: " + ordering)
if ordering == 'kwant_decides': if ordering == 'kwant_decides':
# Choose what is considered to be the best ordering. # Choose what is considered to be the best ordering.
sorted_orderings = [order sorted_orderings = [order
for order in ['metis', 'scotch', 'auto'] for order in ['metis', 'scotch', 'auto']
if order in mumps.possible_orderings()] if order in mumps.possible_orderings()]
ordering = sorted_orderings[0] ordering = sorted_orderings[0]
elif ordering not in mumps.orderings:
raise ValueError("Invalid ordering: " + ordering)
self.ordering = ordering self.ordering = ordering
if sparse_rhs is not None: if sparse_rhs is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment