mutable struct DoubleDescription{T<:Real,C}
A::Matrix{T}
R::Vector{C}
K::Set{Int}
adj::Dict{Tuple{Int,Int},Bool}
num_rays::Int
end
mutable struct CountedVector{T<:Real,C}
v::Vector{T}
Av::Vector{T}
dd::DoubleDescription{T,C}
id::Int
function CountedVector{T}(v::Vector{T}, dd::DoubleDescription{T,C}) where {T,C}
dd.num_rays += 1
canonicalize!(v)
new{T,C}(v, dd.A*v, dd, dd.num_rays)
end
end
One should be able to restructure things to avoid double references