-
Notifications
You must be signed in to change notification settings - Fork 92
VectorQuadraticFunction constructor #2633
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
Conversation
Why not keep the existing implementation ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using -> import
Co-authored-by: Joaquim <joaquimdgarcia@gmail.com>
Co-authored-by: Joaquim <joaquimdgarcia@gmail.com>
I find the loop version simpler instead of having to mapreduce multiple times over the same vector |
ret = VectorQuadraticFunction{T}( | ||
VectorQuadraticTerm{T}[], | ||
VectorAffineTerm{T}[], | ||
T[], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned in the other PR also:
If this constructor is just for testing purposes and manually building constraints, I would be okay with the simple loop.
But, vectorize
is used in bridges in potentially large problems.
Hence, we need, at least, some sizehint!
s arounds
Closing in favor of #2636 |
In the same vein as #2626