Skip to content

Commit

Permalink
Update for design changes to mark-as-deleted acsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
epatters committed Jul 18, 2023
1 parent 4fe40b7 commit d99ec32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/categorical_algebra/ACSetsGATsInterop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ function Presentation(s::BasicSchema{Symbol})
end


function DenseACSets.struct_acset(name::Symbol, parent, p::Presentation;
index::Vector=[], unique_index::Vector=[],
part_type::Type{<:AbstractParts}=IntParts)
DenseACSets.struct_acset(name, parent, Schema(p); index, unique_index, part_type)
function DenseACSets.struct_acset(name::Symbol, parent, p::Presentation; kw...)
DenseACSets.struct_acset(name, parent, Schema(p); kw...)
end

function DenseACSets.DynamicACSet(
Expand Down
8 changes: 4 additions & 4 deletions src/categorical_algebra/CSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -902,11 +902,11 @@ end


# For MarkAsDeleted one has to always look up the index of a given part
@inline Base.getindex(::BacktrackingState{<:ACSet{DenseParts}}, ::Symbol, x::Int) = x
@inline Base.getindex(state::BacktrackingState{<:ACSet{MarkAsDeleted}}, c::Symbol, x::Int) =
@inline Base.getindex(::BacktrackingState{<:ACSet{<:DenseParts}}, ::Symbol, x::Int) = x
@inline Base.getindex(state::BacktrackingState{<:ACSet{<:MarkAsDeleted}}, c::Symbol, x::Int) =
state.part_index[c][x]
@inline get_y_index(::BacktrackingState{<:ACSet{DenseParts}}, ::Symbol, y::Int) = y
@inline get_y_index(state::BacktrackingState{<:ACSet{MarkAsDeleted}}, c::Symbol, y::Int) =
@inline get_y_index(::BacktrackingState{<:ACSet{<:DenseParts}}, ::Symbol, y::Int) = y
@inline get_y_index(state::BacktrackingState{<:ACSet{<:MarkAsDeleted}}, c::Symbol, y::Int) =
state.codom_part_index[c][y]

@inline assignment(state::BacktrackingState, c::Symbol, x::Int) =
Expand Down

0 comments on commit d99ec32

Please sign in to comment.