MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / solve

Function solve

dedalus/tools/array.py:135–139  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

133 """Create LinearOperator implicitly acting as a sparse matrix inverse."""
134 splu = spla.splu(matrix.tocsc(), permc_spec=permc_spec, **kw)
135 def solve(x):
136 if np.iscomplexobj(x) and matrix.dtype == np.float64:
137 return splu.solve(x.real) + 1j*splu.solve(x.imag)
138 else:
139 return splu.solve(x)
140 return spla.LinearOperator(shape=matrix.shape, dtype=matrix.dtype, matvec=solve, matmat=solve)
141
142

Callers

nothing calls this directly

Calls 1

solveMethod · 0.45

Tested by

no test coverage detected