In fortran I have an external optimization routine that takes as an input the function f(x)
and the starting point and returns the value for local minimum. For example if the function is called minimum:
minimum(f,x0,xopt)
The problem is that the function I need to minimize depends on some additional arguments that are not part of the minimization routine: f(x,data)
.
How can I overcome this issue.
In matlab I would use anonymous function
g=@(x) f(x,data)
minimum(g, x0, xopt)
However as I understant in fortran 90 there are no anonymous function.
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…