Repository navigation
Throw an ArgumentError from cholesky and ldlt for an index type CHOLMOD cannot take - #1117
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1117 +/- ##
=======================================
Coverage 94.72% 94.73%
=======================================
Files 16 16
Lines 10319 10327 +8
=======================================
+ Hits 9775 9783 +8
Misses 544 544 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… CHOLMOD cannot take An index type that does not promote with `Int` to `Int32` or `Int64`, such as `UInt64`, now throws an `ArgumentError` naming the matrix type instead of a bare `TypeError`. `cholesky!` and `ldlt!` convert `A` to the index type of the factor, so they accept every index type, such as `Int16`, that `cholesky` and `ldlt` accept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ViralBShah
force-pushed
the
vs/cholmod-index-type-error
branch
from
October 26, 2026 14:01
efd0926 to
3ad68c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
choleskyandldltof a sparse matrix whose index type does not promote withIntto one CHOLMOD takes, such asUInt64, throw a bareTypeErrorfrom inside theCHOLMOD.Sparseconversion, wherelunames the matrix type.cholesky!andldlt!reject index types likeInt16thatcholeskyandldltaccept.Before
After
The six
CHOLMOD.Sparseconversions from aSparseMatrixCSCor aSymmetric/Hermitianview of one computedTi <: ITypes ? Ti : promote_type(Ti, Int)and passed the result toSparse{Tv, Ti}unchecked. They now call a helper,cholmod_itype, that does the same promotion and throws theArgumentErrorwhen the result is not inITypes; the message listsITypes, which isInt32alone on a 32-bit build.cholesky!(F, A)andldlt!(F, A)used to convertAtoSparse{eltype(F), Ti}withA's own index type, whichfactorize_p!then converted again to the factor's. They now convert straight to the factor's index type, so they accept any integer index type,UInt64included, as long as the indices fit. This touches dispatch: those two methods now take the index type fromFrather than fromA.🤖 Generated with Claude Code