Skip to content

Commit

Permalink
fix: make type inference happier (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Feb 23, 2024
1 parent fc5b3c9 commit 7837669
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AbstractAlgebra"
uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
version = "0.40.0"
version = "0.40.1"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Expand Down
24 changes: 12 additions & 12 deletions src/Solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ function kernel(A::MatElem{<:FieldElement}; side::Symbol = :left)
check_option(side, [:right, :left], "side")

if side === :left
K = kernel(lazy_transpose(A), side = :right)
return lazy_transpose(K)
KK = kernel(lazy_transpose(A), side = :right)
return lazy_transpose(KK)::typeof(A)
end

n, K = AbstractAlgebra.nullspace(A)
Expand All @@ -317,8 +317,8 @@ function kernel(A::MatElem{<:RingElement}; side::Symbol = :left)
check_option(side, [:right, :left], "side")

if side === :right
H, U = hnf_with_transform(lazy_transpose(A))
return _kernel_of_hnf(A, H, U)[2]
HH, UU = hnf_with_transform(lazy_transpose(A))
return _kernel_of_hnf(A, HH, UU)[2]
else
H, U = hnf_with_transform(A)
_, X = _kernel_of_hnf(lazy_transpose(A), H, U)
Expand Down Expand Up @@ -445,8 +445,8 @@ function _can_solve_internal_no_check(A::MatElem{T}, b::MatElem{T}, task::Symbol

if side === :left
# For side == :left, we pretend that A and b are transposed
fl, sol, K = _can_solve_internal_no_check(lazy_transpose(A), lazy_transpose(b), task, side = :right)
return fl, data(sol), data(K)
fl, _sol, _K = _can_solve_internal_no_check(lazy_transpose(A), lazy_transpose(b), task, side = :right)
return fl, data(_sol), data(_K)
end

mu = hcat(deepcopy(A), deepcopy(b))
Expand Down Expand Up @@ -491,8 +491,8 @@ function _can_solve_internal_no_check(A::MatElem{T}, b::MatElem{T}, task::Symbol

if side === :left
# For side == :left, we pretend that A and b are transposed
fl, sol, K = _can_solve_internal_no_check(lazy_transpose(A), lazy_transpose(b), task, side = :right)
return fl, data(sol), data(K)
fl, _sol, _K = _can_solve_internal_no_check(lazy_transpose(A), lazy_transpose(b), task, side = :right)
return fl, data(_sol), data(_K)
end

H, S = hnf_with_transform(lazy_transpose(A))
Expand All @@ -510,8 +510,8 @@ function _can_solve_internal_no_check(C::SolveCtx{T}, b::MatElem{T}, task::Symbo
if side === :right
fl, sol = _can_solve_with_rref(b, transformation_matrix(C), rank(C), pivot_and_non_pivot_cols(C), task)
else
fl, sol = _can_solve_with_rref(lazy_transpose(b), transformation_matrix_of_transpose(C), rank(C), pivot_and_non_pivot_cols_of_transpose(C), task)
sol = data(sol)
fl, _sol = _can_solve_with_rref(lazy_transpose(b), transformation_matrix_of_transpose(C), rank(C), pivot_and_non_pivot_cols_of_transpose(C), task)
sol = data(_sol)
end
if !fl || task !== :with_kernel
return fl, sol, zero(b, 0, 0)
Expand All @@ -525,8 +525,8 @@ function _can_solve_internal_no_check(C::SolveCtx{T}, b::MatElem{T}, task::Symbo
if side === :right
fl, sol = _can_solve_with_hnf(b, reduced_matrix_of_transpose(C), transformation_matrix_of_transpose(C), task)
else
fl, sol = _can_solve_with_hnf(lazy_transpose(b), reduced_matrix(C), transformation_matrix(C), task)
sol = data(sol)
fl, _sol = _can_solve_with_hnf(lazy_transpose(b), reduced_matrix(C), transformation_matrix(C), task)
sol = data(_sol)
end
if !fl || task !== :with_kernel
return fl, sol, zero(b, 0, 0)
Expand Down

2 comments on commit 7837669

@thofma
Copy link
Member Author

@thofma thofma commented on 7837669 Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/101527

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.40.1 -m "<description of version>" 783766993bcf4096e1d30ca8ceff433ee9fda9a8
git push origin v0.40.1

Please sign in to comment.