I have been spending weeks to write a conjugate gradient program to do multi-dimensional minimization. But the results didn’t seem to be right. I’m also reluctant to use Matlab optimization toolbox, although it is very powerful. So I searched again and again, and re-found GSL. GSL is numerical library for c/c++ programmers, of course it includes minimization functions. Also, opt++ (http://csmr.ca.sandia.gov/opt++/) seems to be not bad.