-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07b9f49
commit 13f2f0c
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
# [Functor Utils] (@id FunctorUtils) | ||
|
||
Functor Utils only includes 4 functions and builds off of Decompositions. | ||
|
||
We first define the forgetful functors vs. | ||
|
||
```julia | ||
function vs(X::Graph) FinSet(length(vertices(X))) end | ||
function vs(f::ACSetTransformation) components(f)[1] end | ||
``` | ||
|
||
We also define the functor skeleton taking set to the skeleton of the set. | ||
|
||
```julia | ||
function skeleton(s::FinSet) FinSet(length(s)) end | ||
function skeleton(f::FinFunction) | ||
(dd, cc) = (dom(f), codom(f)) | ||
ℓ = isempty(dd) ? Int[] : [findfirst(item -> item == f(x), collect(cc)) for x ∈ collect(dd)] | ||
FinFunction(ℓ, skeleton(dd), skeleton(cc)) | ||
end | ||
``` |