I have a C # dll library with one method gaccepting the following function fin C # as input
void f(double[] x, ref double func, double[] grad, object obj)
The values โโof funcand are updated in the function body grad. Input signature g(f)in F # reads
f:float[]-> byref<float> -> float[]-> obj->unit
how can i write fin f # for use g(f)in f #?
EDIT when I follow ildjarn below for example
let f(x:float[]) (func:byref<float>) (grad:float[]) (obj: obj) =
func <- ...
grad.[0] <- ...
grad.[1] <- ...
...
()
I got an error on g(f)using
This function value is used to construct a delegate type whose signature includes the byref argument. You must use an explicit lambda expression with four arguments.
, ? .
: , g(fun (x:float[]) (func:byref<float>) (grad:float[]) (obj: obj) -> .... f.