Hi there,

I have a nonlinear varargs function f(x...) that I'd like to maximize. That 
is, the function is defined as follows:

function f(x...)
    # do stuff here
    result
end

With a small number of arguments, for example 2, I can write the following 
and get the correct result:

    registerNLFunction(:f, 2, f, autodiff=true)
    m = Model()
    @defVar(m, x[1:2] >= 0.0)
    @setNLObjective(m, Max, f(x[1], x[2]))

With a large number of arguments, say 100, I'd prefer not to manually write 
f(x[1], ..., x[100]) in the @setNLObjective macro.
I have tried the following to no avail:
    @setNLObjective(m, Max, f(x...))
    @setNLObjective(m, Max, f(tuple(x...)))

Is there a way to get this going for 100 variables without having to 
manually write f(x[1], ..., x[100])?

Cheers,
Jock

p.s. Thanks for the great work on 0.12.0 - it's awesome.

Reply via email to