First thank you for this very nice library.
I am very interested in fitting part of it.
It looks like the function I specify as "rep" in the lsfitfit arguments is never called.
Starting from the example 1, 2  or 3, and adding a pointer to my function like this:
Code:
   lsfitfit(state, function_cx_1_func, function_cx_1_grad, my_function_to_call_after_each_iteration, 0);
the code compile and run (and fits), but my_function_to_call_after_each_iteration is never called.
It looks like in the code of lsfitfit:
Code:
        while( alglib_impl::lsfititeration(state.c_ptr(), &_alglib_env_state) )
        {
            if( state.needf )
            {
                func(state.c, state.x, state.f, ptr);
                continue;
            }
            if( state.needfg )
            {
                grad(state.c, state.x, state.f, state.g, ptr);
                continue;
            }
            if( state.xupdated )
            {
                if( rep!=NULL )
                    rep(state.x, state.f, ptr);
                continue;
            }
            throw ap_error("ALGLIB: error in 'lsfitfit' (some derivatives were not provided?)");
        }
the if( state.xupdated ) is never tested. I put a break point here but it never fires.
Thank you,
Gael