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

permute_affine not working with immutable array #793

Closed
matbesancon opened this issue Dec 12, 2021 · 1 comment
Closed

permute_affine not working with immutable array #793

matbesancon opened this issue Dec 12, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@matbesancon
Copy link
Contributor

if needs_permute(set)
        perm_idxs = permute_affine(set, 1:dim)
        perm_idxs .+= start
        append!(IM, perm_idxs)
else
        append!(IM, idxs)
end

this will result in problems because permute_affine is mutating the passed array:

function permute_affine(cone::SpecNucCone, vals::AbstractVector{T}) where {T}
    @views vals[2:end] = reshape(vals[2:end], cone.row_dim, cone.column_dim)'
    return vals
end

@matbesancon matbesancon added the bug Something isn't working label Dec 12, 2021
@chriscoey
Copy link
Collaborator

Thanks, good point!
should be fixed by 96f57a4#diff-8754e2bf9a8a760578a78a534e03e6e0144e08dc68f77bce0a904dc00e4ce970R87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants