odow / MathOptSymbolicAD.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type error in evaluator subexpression generation

michel2323 opened this issue · comments

This statement fails

subexpressions[i] = _to_expr(model, sub, variable_order, subexpressions)

if sub is for example:

sub = MathOptInterface.Nonlinear.Expression(MathOptInterface.Nonlinear.Node[MathOptInterface.Nonlinear.Node(MathOptInterface.Nonlinear.NODE_VALUE, 1, -1)], [0.0])

subexpr[i] is of type Expr wheres _to_expr returns a Float64 for that sub.
I can try to get an MWE if needed. But first, is this subexpression sub a valid expression? Should I look at where this is coming from?

It probably happens if you have @NLexpression(model, 1.0), where :(1.0) isn't actually an expression. Let me take a look.