From 813f521ea26ca25ed70158c1974cdb4be05fd565 Mon Sep 17 00:00:00 2001 From: Luke Morris Date: Wed, 26 Jun 2024 11:20:52 -0400 Subject: [PATCH] Remove redundant pointer transfer helpers --- src/openoperators.jl | 69 -------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/src/openoperators.jl b/src/openoperators.jl index 10f58bb..16bab74 100644 --- a/src/openoperators.jl +++ b/src/openoperators.jl @@ -1,72 +1,3 @@ -# Transferring pointers -# -------------------- - -""" function transfer_parents!(d::SummationDecapode, x, y) - -Transfer the parents of x to y. Also transfer TVar status from x to y. -""" -function transfer_parents!(d::SummationDecapode, x, y) - #set_subpart!(d, incident(d, x, [:tgt], copy=true), :tgt, y) - #set_subpart!(d, incident(d, x, [:res], copy=true), :res, y) - #set_subpart!(d, incident(d, x, [:sum], copy=true), :sum, y) - #set_subpart!(d, incident(d, x, [:incl], copy=true), :incl, y) - # XXX: This avoids allocations. - for i in parts(d, :Op1) - if d.subparts.tgt[i] == x - d.subparts.tgt[i] = y - end - end - for i in parts(d, :Op2) - if d.subparts.res[i] == x - d.subparts.res[i] = y - end - end - for i in parts(d, :Σ) - if d.subparts.sum[i] == x - d.subparts.sum[i] = y - end - end - for i in parts(d, :TVar) - if d.subparts.incl[i] == x - d.subparts.incl[i] = y - end - end - d -end - -""" function transfer_children!(d::SummationDecapode, x, y) - -Transfer the children of x to y. -""" -function transfer_children!(d::SummationDecapode, x, y) - #set_subpart!(d, incident(d, x, [:src], copy=true), :src, y) - #set_subpart!(d, incident(d, x, [:proj1], copy=true), :proj1, y) - #set_subpart!(d, incident(d, x, [:proj2], copy=true), :proj2, y) - #set_subpart!(d, incident(d, x, [:summand], copy=true), :summand, y) - # XXX: This avoids allocations. - for i in parts(d, :Op1) - if d.subparts.src[i] == x - d.subparts.src[i] = y - end - end - for i in parts(d, :Op2) - if d.subparts.proj1[i] == x - d.subparts.proj1[i] = y - end - end - for i in parts(d, :Op2) - if d.subparts.proj2[i] == x - d.subparts.proj2[i] = y - end - end - for i in parts(d, :Summand) - if d.subparts.summand[i] == x - d.subparts.summand[i] = y - end - end - d -end - # Opening up Op1s # --------------