-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support user-specified permutation in CHOLMOD factorizations #10844
Conversation
589e9e4
to
66dbba4
Compare
👍 |
See also this IJulia notebook from my class. |
…β optional argument to a shift keyword arg, some code consolidation; change & to new Ref syntax in cholmod
66dbba4
to
501e6dd
Compare
at no point should it have been valid to pass |
👍 |
@vtjnash I think the old version was wrong. The signature for the C function is julia> SparseMatrix.CHOLMOD.sdmult!(AS, false, complex(1.0), complex(0.0), bS, cS) works, but julia> SparseMatrix.CHOLMOD.sdmult!(AS, false, complex(1.0, 1.0), complex(0.0), bS, cS)
ERROR: InexactError()
in ptr_arg_cconvert at base.jl:58
in sdmult! at sparse/cholmod.jl:578 Anyway, @stevengj has fixed the problem. |
@vtjnash, in at least some cases, CHOLMOD was only reading |
support user-specified permutation in CHOLMOD factorizations
We might want a backport of the complex-arg fix, but I don't think the API changes should be backported. |
This changes the
cholfact
andldltfact
sparse factorizations (via CHOLMOD) to accept aperm
argument specifying a user-defined permutation instead of the default AMD permutation. It also changes the (undocumented) optionalβ
argument to a (documented)shift
keyword argument. Some of the code is consolidated a bit, and I switched to using the new-styleRef{Complex128}
instead ofPtr{Cdouble}
(which seems easy to misuse by passing only a single real number when CHOLMOD sometimes expects two) for a couple of ccalls.I included a couple of other keywords args for cholmod options I was experimenting with, but was unsure whether to document them. Passing
perm
and settinguserperm_only=false
causes CHOLMOD to try both the user-specified permutation and AMD and pick the better of the two, and passingpostorder=false
omits a post-ordering pass in CHOLMOD (that doesn't affect nnz but supposedly effects supernodal efficiency).cc @andreasnoack, who helped track down the relevant functionality (I needed it for teaching, in order to show the effect of different orderings).