Skip to content

Commit

Permalink
little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinDCarlson committed Oct 18, 2024
1 parent 28b2d30 commit 31d316e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ACSets = "227ef7b5-1206-438b-ac65-934d6da304b8"
AlgebraicInterfaces = "23cfdc9f-0504-424a-be1f-4892b28e2f0c"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Catlab = "134e5e36-593f-5add-ad60-77f754baafbe"
DataMigrations = "0c4ad18d-0c49-4bc2-90d5-5bca8f00d6ae"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Expand All @@ -18,6 +19,7 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
MeshIO = "7269a6da-0436-5bbc-96c2-40638cbb6118"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand Down
3 changes: 2 additions & 1 deletion src/SimplicialComplexes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ function pullback_primal(f::GeometricMap, v::PrimalVectorField{T}) where T
nv(f.cod) == length(v) || error("Vector field must have same number of vertices as codomain")
PrimalVectorField(T.(eachcol(hcat(v.data...)*as_matrix(f))))
end
*(f::GeometricMap,v::PrimalVectorField) = pullback_pr
#Is restriction the transpose?
*(f::GeometricMap,v::PrimalVectorField) = pullback_primal(f,v)

function dual_vertex_dimension(s::AbstractDeltaDualComplex,v::DualV)
n = v.data
Expand Down
6 changes: 6 additions & 0 deletions test/DiscreteExteriorCalculus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,12 @@ for s in [tetrahedron_s, cube_s]
# Desbrun, Kanso, Tong 2008, Equation 4.2.
@test dual_derivative(3-k,s) == (-1)^k * d(k-1,s)'
end
#Type conversion utilities
dt = DiscreteExteriorCalculus.dual_type
fs = DiscreteExteriorCalculus.fancy_acset_schema
@test all([dt(DeltaSet1D()) == DeltaDualComplex1D,dt(EmbeddedDeltaSet2D{Int,Vector{String}}()) == EmbeddedDeltaDualComplex2D{Int,String,Vector{String}}, dt(EmbeddedDeltaDualComplex1D{DeltaSet0D,Type,Real}()) == EmbeddedDeltaSet1D{DeltaSet0D,Real},dt(OrientedDeltaSet2D{Bool}()) == OrientedDeltaDualComplex2D{Bool}])
@test fancy_acset_schema(DeltaSet1D()) == SchDeltaSet1D

end

# 3D embedded dual complex
Expand Down
10 changes: 2 additions & 8 deletions test/SimplicialSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ glue_triangle!(s, 1, 4, 3)
@test triangles(s) == 1:2
@test ne(s) == 5
@test sort(map(Pair, src(s), tgt(s))) == [1=>2, 1=>3, 1=>4, 2=>3, 4=>3]
sd = extract_dual(s)
@test ntriangles(sd) == 12 && ne(sd) == 22 && nv(sd) == 11
#sd = extract_dual(s)
#@test ntriangles(sd) == 12 && ne(sd) == 22 && nv(sd) == 11
# 2D oriented simplicial sets
#----------------------------

Expand Down Expand Up @@ -556,10 +556,4 @@ vs = union(∂(0, s, E(es)), ∂(1, s, E(es)))
@test Set(vs) == Set(Lkf[1])
@test Set(Lkf[1]) == Set([1,2,3,4,5,7])

#Type conversion utilities
dt = CombinatorialSpaces.DiscreteExteriorCalculus.dual_type
fs = CombinatorialSpaces.DiscreteExteriorCalculus.fancy_acset_schema
@test all([dt(DeltaSet1D()) == DeltaDualComplex1D,dt(EmbeddedDeltaSet2D{Int,Vector{String}}()) == EmbeddedDeltaDualComplex2D{Int,String,Vector{String}}, dt(EmbeddedDeltaDualComplex1D{DeltaSet0D,Type,Real}()) == EmbeddedDeltaSet1D{DeltaSet0D,Real},dt(OrientedDeltaSet2D{Bool}()) == OrientedDeltaDualComplex2D{Bool}])
@test fancy_acset_schema(DeltaSet1D()) == SchDeltaSet1D

end

0 comments on commit 31d316e

Please sign in to comment.