HomotopyContinuation.jl icon indicating copy to clipboard operation
HomotopyContinuation.jl copied to clipboard

Type inconsistency/failure to evaluate expressions

Open jamblejoe opened this issue 3 years ago • 1 comments

related #500

Expressions involving floats seem not to be evaluated, see e.g.

@var x[1:1]
F = System( x.^2; variables=x)
typeof(F([2])) == Vector{Int32}

F = System( 2 * x.^2; variables=x)
typeof(F([2])) == Vector{Int32}

but

F = System( 1. * x.^2; variables=x)
typeof(F([2])) == Vector{Expression}

The same holds for the Jacobian of the system. How do I force evaluation? I am following https://www.juliahomotopycontinuation.org/examples/monte-carlo-integration/ and https://www.juliahomotopycontinuation.org/examples/sampling/ but run into the above issue when evaluating the Jacobian.

jamblejoe avatar Aug 16 '22 09:08 jamblejoe

This is not supposed to happen. We'll fix it (currently discussing how...).

For now, you can use the following code: to_number.(expand.(F([2]))).

PBrdng avatar Aug 18 '22 08:08 PBrdng