I checked the akima memory allocation and found some potential optimizations:

 * It is sufficient to allocate (size - 1) doubles for the spline coefficients 
b, c and d of akima_state_t.

 * It is sufficient to allocate (size + 3) doubles for the divided differences 
_m of akima_state_t.

 * The divided differences _m of akima_state_t are only accessed in akima_calc 
and akima_init / akima_init_periodic, hence could be freed earlier at the end 
of the calculation of the spline coefficients b, c and d in akima_calc.

Best regards,
Thomas Beutlich

--

http://tbeu.de

Reply via email to