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

handling of ASL MAXLIST #53

Open
svigerske opened this issue Mar 5, 2019 · 5 comments
Open

handling of ASL MAXLIST #53

svigerske opened this issue Mar 5, 2019 · 5 comments

Comments

@svigerske
Copy link
Member

Issue created by migration from Trac.

Original creator: @svigerske

Original creation time: 2013-10-22 08:50:39

Version:

The MAXLIST operand in an AMPL expression is not handled correctly.
The attached files should demonstrate this behavior.

I talked to Victor at AMPL and the correct way to handle MAXLIST is to do the following:

You should first cast a pointer to an expression representing max (MAXLIST)
from expr* to expr_va* (https://github.com/ampl/ampl/blob/master/solvers/nlp.h#L100). Then you can iterate over arguments as follows:

for (const de *d = ((expr_va*)e)->L.d; d->e; ++d) {
  // d->e points to an argument
}

Here's a simple C++ wrapper around expr_va which can be used as an example:
https://github.com/ampl/ampl/blob/master/solvers/util/expr.h#L446

@svigerske
Copy link
Member Author

Attachment DG.mod by @svigerske created at 2013-10-22 08:51:08

@svigerske
Copy link
Member Author

Attachment DG.nl by @svigerske created at 2013-10-22 08:51:16

@svigerske
Copy link
Member Author

Comment by @h-i-gassmann created at 2015-03-05 21:10:22

Set assignee to @h-i-gassmann.

@svigerske
Copy link
Member Author

Comment by @h-i-gassmann created at 2015-03-05 21:10:22

Changing status from new to assigned.

@svigerske
Copy link
Member Author

Comment by JunMa created at 2015-03-13 17:57:27

Sorry for the late reply. Do you still encounter the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant