coin-or / OS

Optimization Services
Other
1 stars 4 forks source link

handling of ASL MAXLIST #53

Open svigerske opened 5 years ago

svigerske commented 5 years ago

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 commented 5 years ago

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

svigerske commented 5 years ago

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

svigerske commented 5 years ago

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

Set assignee to @h-i-gassmann.

svigerske commented 5 years ago

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

Changing status from new to assigned.

svigerske commented 5 years ago

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

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