-
Notifications
You must be signed in to change notification settings - Fork 92
Tidy functions.jl and improve docstrings #2108
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
]; | ||
|
||
julia> f = MOI.VectorQuadraticFunction(quad_terms, affine_terms, constants) | ||
MathOptInterface.VectorQuadraticFunction{Float64}(MathOptInterface.VectorQuadraticTerm{Float64}[MathOptInterface.VectorQuadraticTerm{Float64}(1, MathOptInterface.ScalarQuadraticTerm{Float64}(2.0, MathOptInterface.VariableIndex(1), MathOptInterface.VariableIndex(1))), MathOptInterface.VectorQuadraticTerm{Float64}(2, MathOptInterface.ScalarQuadraticTerm{Float64}(3.0, MathOptInterface.VariableIndex(1), MathOptInterface.VariableIndex(2)))], MathOptInterface.VectorAffineTerm{Float64}[MathOptInterface.VectorAffineTerm{Float64}(1, MathOptInterface.ScalarAffineTerm{Float64}(2.0, MathOptInterface.VariableIndex(1))), MathOptInterface.VectorAffineTerm{Float64}(2, MathOptInterface.ScalarAffineTerm{Float64}(3.0, MathOptInterface.VariableIndex(1)))], [4.0, 5.0]) |
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.
We should really improve the printing of functions, debugging it awful atm
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.
Yes. But that can be a separate PR.
I even wonder about something like:
ScalarAffineFunction:
constant: 1.0
terms:
VariableIndex(1) => 2.0
VariableIndex(2) => 2.0
VariableIndex(3) => 2.0
VariableIndex(4) => 2.0
Rather than trying to pretty-print it all.
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 would prefer pretty printing for the oneline version as it is sometimes coefficients of a multivariate polynomials that is trying to print itself in oneline.
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.
For the long version, your suggestion seems nice
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.
Open an issue? What is the "long version"?
Co-authored-by: Benoît Legat <[email protected]>
A follow-up to #2099
Preview: https://jump.dev/MathOptInterface.jl/previews/PR2108/reference/standard_form/