Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure you can add SetFunctionCallables to BipartiteDiagrams during limit computation #868

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/categorical_algebra/FinSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,14 @@ function limit(d::BipartiteFreeDiagram{<:SetOb,<:FinDomFunction{Int}})

# For uniformity, e.g. when pairing below, ensure that all objects in layer 2
# are type sets.
# XX: map can introduce overtight typing
if !all(x isa TypeSet for x in ob₂(d))
d = map(d, ob₁=identity, ob₂=ensure_type_set, hom=ensure_type_set_codom)
end

# Make sure Hom isn't too tight
d′ = BipartiteFreeDiagram{SetOb,FinDomFunction{Int}}()
copy_parts!(d′,d)
d = d′
KevinDCarlson marked this conversation as resolved.
Show resolved Hide resolved
# It is generally optimal to compute all equalizers (self joins) first, so as
# to reduce the sizes of later pullbacks (joins) and products (cross joins).
d, ιs = equalize_all(d)
Expand Down Expand Up @@ -925,7 +929,7 @@ end
ensure_type_set(s::FinSet) = TypeSet(eltype(s))
ensure_type_set(s::TypeSet) = s
ensure_type_set_codom(f::FinFunction) =
FinDomFunction([f(i) for i in dom(f)], dom(f), TypeSet(eltype(codom(f))))
FinDomFunction(f.func,dom(f), TypeSet(eltype(codom(f))))
KevinDCarlson marked this conversation as resolved.
Show resolved Hide resolved
ensure_type_set_codom(f::IndexedFinFunctionVector) =
IndexedFinDomFunctionVector(f.func, index=f.index)
ensure_type_set_codom(f::FinDomFunction) = f
Expand Down
Loading