JuliaHomotopyContinuation / HomotopyContinuation.jl

A Julia package for solving systems of polynomials via homotopy continuation.
https://www.JuliaHomotopyContinuation.org
MIT License
178 stars 30 forks source link

Type inconsistency/failure to evaluate expressions #511

Open jamblejoe opened 1 year ago

jamblejoe commented 1 year ago

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.

PBrdng commented 1 year ago

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]))).