Closed hronellenfitsch closed 4 years ago
The following code fails:
using LeastSquaresOptim function f!(fvec, x) fvec[1] = 1 - x[1] fvec[2] = 10(x[2]-x[1]^2) end function g!(fjac, x) fjac[1,1] = -1 fjac[1,2] = 0 fjac[2,1] = -20x[1] fjac[2,2] = 10 end x = [-1.2; 1.] J = zeros(2, 2) y = similar(x) LeastSquaresProblem(x=x, y=y, f!=f!, g!=g!, J=J)
With the error message UndefVarError: f not defined.
This is especially strange since it is copied straight from the tests, and test LeastSquaresOptim runs through successfully.
The issue is that f!=f! is interpreted as f != f!, rather than f! = f!. Maybe I should change the keyword argument to avoid this kind of ambiguity.
f!=f!
f != f!
f! = f!
Thanks, that works.
The following code fails:
With the error message UndefVarError: f not defined.
This is especially strange since it is copied straight from the tests, and test LeastSquaresOptim runs through successfully.