Closed jschueller closed 10 months ago
Hi @jschueller Julien, I agree that it will be useful. It sounds like the C version of "user defined args
, f(x, *args)
", right?
args
, f(x, *args)
", you will not need to use the data_ptr
in the C interface, right? As far as I see, it can be implemented using a lambda function (if I understand this concept correctly) easily, right?Thanks
all good
1.
f = 0.0/0.0;
What about
f = NAN;
where NAN
is a macro from math.h
.
cmake --build . --target tests --parallel 4
Do we still run the C and Fortran examples? Or they have been renamed to tests
? I think we should run them, and examples
is a better name.
Thanks.
// check data is ok
if (data != data_ref)
{
printf("invalid data\n");
*f = NAN;
}
So we will not be informed by the test if there is a discrepancy between data
and data_ref
unless we check the message. What about raising an error so that we know if there is a problem?
we check at the end that the evaluation number is ok
I read NAN is not alwasy supported, but let me try
If it is not always supported, we should not use it in the production code, but maybe ok for a test ...
we check at the end that the evaluation number is ok
It is here, return (fabs(x[0]-3)>2e-2 || fabs(x[1]-2)>2e-2);
right? If yes, OK.
yes
In the C layer it can be useful to be able to reach user data from the objective function callback, this adds an extra pointer argument that is re-passed through the objective callback.