Open fb456 opened 1 year ago
Yes, that is not supported. You can find SArray/MArray support in the attempt at rewriting Optim from scratch in https://github.com/JuliaNLSolvers/NLSolvers.jl that is also a registered package but less tested. Let me know if you need help.
Hi,
I'm using Julia Version 1.8.5 and Optim v1.7.4 I am trying to optimize the following function, where a second order method is employed and the cost, gradient and hessian are calculated simultaneously. x is an array of length 2.
optimize(only_fgh!((F,G,H,x) -> costgradhess(F,G,H,x,x_0,y_0,a,b,alpha)), x_in, Newton())
where x_0,y_0,a,b,alpha are parameters needed by costgradhess. The optimization process worked perfectly when I use Vector{Float64} type for x. However, I decided to use StaticArrays (MArrays to be specific) for x to increase performance. Here is what it looks like (the code is quite long, so I skipped some parts)
However, I get the following error message (starting from the optimize function above).
I also get the same error when I declare the types of F,G and H above (Float64,MVector,and MMatrix). In addition, a very similar error message appears when I use SArrays.
Thank you very much for your help!