Skip to content

Commit

Permalink
Merge pull request #69 from IntegralEquations/zero-rkmatrix
Browse files Browse the repository at this point in the history
Test aca on zero matrix
  • Loading branch information
maltezfaria authored Jul 7, 2024
2 parents 11bd965 + 5585438 commit 2e42ffa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "HMatrices"
uuid = "8646bddf-ab1c-4fa7-9c51-ba187d647618"
version = "0.2.8"
version = "0.2.9"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
8 changes: 8 additions & 0 deletions src/compressor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ function _aca_partial(K, irange, jrange, atol, rmax, rtol, istart, buffer_ = not
if svdvals(δ)[end] == 0
@debug "zero pivot found during partial aca"
i = findfirst(x -> x == true, I)
if isnothing(i)
# ran out of candidate rows. Good case: the matrix is zero. Bad
# case: aca failed
all(j -> iszero(K[first(irange), j]), jrange) &&
all(i -> iszero(K[i, first(jrange)]), irange) ||
@warn "aca possibly failed on $irange × $jrange"
break
end
else # δ != 0
= inv(δ)
# rdiv!(b,δ) # b <-- b/δ
Expand Down
4 changes: 4 additions & 0 deletions test/compressor_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Random.seed!(1)
R = aca(M, irange, jrange)
@test rank(R) == r

# test zero matrix
R = aca(zero(M), irange, jrange)
@test norm(Matrix(R)) 0.0

# test fast update of frobenius norm
m, n = 10000, 1000
r = 10
Expand Down

2 comments on commit 2e42ffa

@maltezfaria
Copy link
Member Author

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/110625

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.2.9 -m "<description of version>" 2e42ffac2835bc9f0ed87fb718a21de0f8dc57e4
git push origin v0.2.9

Please sign in to comment.