Repository navigation
Only accept the types that libklu provides - #60
Open
ViralBShah wants to merge 1 commit into
Open
ViralBShah wants to merge 1 commit into
ViralBShah wants to merge 1 commit into
Conversation
ViralBShah
force-pushed
the
klu-owns-vectors-julia-1.12
branch
from
October 31, 2026 14:58
575be64 to
260e88d
Compare
Member
Author
|
@rayegun @luke-kiernan What are your thoughts on this direction? We can either convert for all the types or just provide support for only the types that are provided by KLU. |
libklu provides Float64 and ComplexF64 values with Int32 and Int64 indices. KLU.jl converted other values, and solved real and complex right-hand sides of any type by copying and splitting them, so what looked like support for a type was a hidden conversion. klu, klu!, and the KLUFactorization constructor now accept only those combinations, with the same index type for colptr and rowval, and klu! a matrix with the same value and index types as the factorization. Anything else is a MethodError. Right-hand sides must have the same element type as the factorization. ldiv! and solve! had no methods for most other types already, and now have none for a real factorization with complex right-hand sides. The generic methods of \ and the three-argument ldiv! in LinearAlgebra convert them, so these have methods which throw an ArgumentError. This is breaking, so set the version to 0.7.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ViralBShah
force-pushed
the
klu-only-supported-types
branch
from
November 1, 2026 03:34
6211bc6 to
1344d8f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
==========================================
- Coverage 97.29% 97.19% -0.11%
==========================================
Files 1 1
Lines 407 392 -15
==========================================
- Hits 396 381 -15
Misses 11 11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
libklu provides
Float64andComplexF64values withInt32andInt64indices. KLU.jl converted other values and right-hand sides, so what looked like support for a type was a hidden conversion. This allows only what the library provides. Because this is breaking, it sets the version to 0.7.0.Breaking changes
kluwithFloat16,Float32,BigFloat,ComplexF32,Complex{Int}or other converted valuesMethodErrorklu!with values of another typeMethodErrorklu!(K, S)whereShas another index typeMethodErrorkluorKLUFactorizationwithInt32colptrandInt64rowvalMethodErrorfromkluMethodErrorldiv!(K, B)with a realKand complexBMethodErrorK \ BwhereBhas another element type, such asFloat32,Int, or real with a complexKArgumentErrorldiv!(Y, K, B)whereYorBhas another element typeArgumentErrorAll of these apply to
K'andtranspose(K)as well. Callers convert first, for exampleklu(Float64.(A))orK \ Float64.(b).\and the three-argumentldiv!throwArgumentErrorrather thanMethodErrorbecause LinearAlgebra's generic methods would otherwise accept and convert these, so KLU.jl needs its own methods to reject them.K \ Bstill accepts any array of the right element type, such as a non-strided view, and copies it.Testing
On Apple silicon macOS, the test suite passes on Julia 1.12.7 and 1.13.3, and Aqua and the docs build pass on 1.12.7. Linux and Windows are left to CI.
🤖 Generated with Claude Code