Skip to content

Commit

Permalink
fix minor bugs in check_overflow (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsch authored Jun 14, 2020
1 parent 3cd6701 commit 6e41ddf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Ripserer"
uuid = "aa79e827-bd0b-42a8-9f10-2b302677a641"
authors = ["mtsch <matijacufar@gmail.com>"]
version = "0.8.0"
version = "0.8.1"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
4 changes: 2 additions & 2 deletions src/ripserer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ overflow. Throw `OverflowError` error if it would overflow.
check_overflow(::Type{<:AbstractSimplex}, ::Any, ::Any) = nothing

function check_overflow(S::Type{<:IndexedSimplex{D, T, I}}, n_vertices, field) where {D, T, I}
len = length(S(1, one(T)))
len = length(S(1, oneunit(T)))
len > n_vertices && throw(ArgumentError("$S has more than $(n_vertices) vertices."))
acc_int = zero(I)
acc_big = big(0)
Expand All @@ -31,7 +31,7 @@ function check_overflow(S::Type{<:IndexedSimplex{D, T, I}}, n_vertices, field) w
i -= 1
end
CE = chain_element_type(S, field)
index(simplex(CE(S(acc_int, one(T))))) acc_int && throw(OverflowError(
index(simplex(CE(S(acc_int, oneunit(T))))) acc_int && throw(OverflowError(
"$S on $(n_vertices) vertices overflows. Try using a bigger index type"
))
end
Expand Down

2 comments on commit 6e41ddf

@mtsch
Copy link
Owner Author

@mtsch mtsch commented on 6e41ddf Jun 14, 2020

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

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.8.1 -m "<description of version>" 6e41ddf50a17007649bc29033118b7e0ebacd8e7
git push origin v0.8.1

Please sign in to comment.