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

get a more efficient TOA for lmi cone #654

Closed
lkapelevich opened this issue Mar 17, 2021 · 0 comments · Fixed by #662
Closed

get a more efficient TOA for lmi cone #654

lkapelevich opened this issue Mar 17, 2021 · 0 comments · Fixed by #662

Comments

@lkapelevich
Copy link
Collaborator

current corrector is O(d^2 * side^3), this is O(d * side^3) but still ugly

function correction(cone::LinMatrixIneq, primal_dir::AbstractVector)
    @assert cone.grad_updated
    sumAinvAs = cone.sumAinvAs
    corr = cone.correction
    dim = cone.dim
    side = cone.side
    A_aux = [zeros(dim) for _ in 1:side, _ in 1:side]
    for i in 1:dim, k in 1:side, j in 1:side
        A_aux[j, k][i] = sumAinvAs[i][j, k]
    end
    B = zero(sumAinvAs[1])
    for k in 1:side, j in 1:side
        B[j, k] = dot(A_aux[j, k], primal_dir)
    end
    for i in 1:dim
        corr[i] = dot(B * sumAinvAs[i], B')
    end
    return corr
end
@lkapelevich lkapelevich changed the title get a faster TOA for lmi cone get a more efficient TOA for lmi cone Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant