-
Notifications
You must be signed in to change notification settings - Fork 8
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
Build faster paths for SAF constructions #305
Comments
Some potential improvements:
|
We have specialized λ = MOI.VariableIndex.(1:n)
mapreduce(identity, MA.add!!, λ; init = 0.0) For the second example, use nv = length(atoms)
for i in 1:nv
lhs[i] = dot(λ, [2dot(atoms[i], atoms[j]) for j in 1:nv])
rhs[i] = -dot(atoms[i], b)
end |
you do need the initial argument though, otherwise it doesn't work for summing variable indices:
|
the only issue is that you need to allocate a whole vector just to construct another SAF which itself will also allocate |
Yes, you need the You don't need to allocate anything. mapreduce(identity, (acc, j) -> add_mul!!(acc, λ[j], 2dot(atoms[i], atoms[j])), 1:nv; init = 0.0) Or just write the |
I was repeatedly solving large LPs that were fast enough and the bottleneck ended up being the SAF constructions.
Specifically, for
λ
a vector of variable indices:was noticeably slow when profiling, and:
was also extremely slow (taking more time than a solve. The length of atoms was in the hundreds.
For both, the bulk of the time was spent in the SAF construction, MA.operate, etc
The text was updated successfully, but these errors were encountered: