Skip to content

[FileFormats.NL] support common subexpressions #2937

@GiovanniKarra

Description

@GiovanniKarra

On this line, if common subexpressions are detected, an error is thrown

This makes it impossible to load the whole CUTE collection from NL files into JuMP models.

For example, the scurly10.mod problem has these variables

# scurly10.mod
...
var x{i in 1..N} := 0.0001*scale[i]/(N+1);
var y{i in 1..N-K} = sum {j in i..i+K} x[j]*scale[j];
var z{i in N-K+1..N} = sum {j in i..N} x[j]*scale[j];
...

which seem to trigger the error.

My use case is a library that allows loading the CUTE problems into JuMP models, called CUTE.jl, and in order to do so I convert all the AMPL files into NL files and load them using the JuMP.read_from_file function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions