Skip to content

Commit

Permalink
Fix Type Instabilites in Cubical Persistence (#50)
Browse files Browse the repository at this point in the history
* Fix Type Instabilites in Cubical Persistence

* bump version
  • Loading branch information
mtsch authored Jun 6, 2020
1 parent 1649c45 commit c878357
Show file tree
Hide file tree
Showing 2 changed files with 7 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 <[email protected]>"]
version = "0.6.3"
version = "0.6.4"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
8 changes: 6 additions & 2 deletions src/cubical.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ Base.LinearIndices(cf::Cubical) = LinearIndices(cf.data)
function diam(cf::Cubical{T}, vertices) where {T}
res = typemin(T)
for v in vertices
res = max(res, get(cf.data, v, missing))
if isnothing(get(cf.data, v, nothing))
return missing
else
res = max(res, cf.data[v])
end
end
return res
end
Expand Down Expand Up @@ -148,7 +152,7 @@ function Base.iterate(cc::CubeletCoboundary{A, N, C}, (dim, dir)=(1, 1)) where {
break
end

diff = CartesianIndex(ntuple(i -> i == dim ? dir : 0, N))
diff = CartesianIndex{N}(ntuple(isequal(dim), N) .* dir)
new_vertices = cc.vertices .+ Ref(diff)
diameter = max(diam(cc.cubelet), diam(cc.filtration, new_vertices))

Expand Down

2 comments on commit c878357

@mtsch
Copy link
Owner Author

@mtsch mtsch commented on c878357 Jun 6, 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/15949

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.6.4 -m "<description of version>" c8783578eccbf2f691d65f730ab82b1442f74abf
git push origin v0.6.4

Please sign in to comment.