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

Remove double reference CountedVector / DD #14

Open
matbesancon opened this issue Feb 5, 2020 · 2 comments
Open

Remove double reference CountedVector / DD #14

matbesancon opened this issue Feb 5, 2020 · 2 comments

Comments

@matbesancon
Copy link
Contributor

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

@blegat
Copy link
Member

blegat commented Feb 20, 2020

Closed by #16?

@matbesancon
Copy link
Contributor Author

I'll check today, I think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants