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

Add AbstractScalarFunction and AbstractVectorFunction #44

Closed
wants to merge 1 commit into from

Conversation

blegat
Copy link
Member

@blegat blegat commented Jul 16, 2017

No description provided.

@mlubin
Copy link
Member

mlubin commented Jul 16, 2017

Why is this extra level of abstraction needed?

@blegat
Copy link
Member Author

blegat commented Jul 16, 2017

I wouldn't say it is needed but it might be helpful to the solver wrappers. For example they might want to do:

addconstraint!(m::..., f::AbstractScalarFunction, s) = addconstraint!(m, MOI.vectorize(f), MOI.vectorize(s))

so that they do not need to implement the scalar versions (vectorize still needs to be defined). The issue is that it is not going to play well with NumberOfConstraint...

@mlubin
Copy link
Member

mlubin commented Jul 16, 2017

That's not quite correct because the constraint references will be of the wrong type.

@mlubin
Copy link
Member

mlubin commented Jul 16, 2017

I feel like this is better defined as Union{ScalarVariablewiseFuncton,ScalarAffineFunction,...} directly in the solver interface, rather than adding an extra level to the type hierarchy in MOI.

@mlubin
Copy link
Member

mlubin commented Jul 17, 2017

I'm going to close this for now.

@mlubin mlubin closed this Jul 17, 2017
@blegat blegat deleted the scalarvector branch July 25, 2017 12:04
odow added a commit that referenced this pull request Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants