From: Xiaowei L. <ne...@bi...> - 2004-11-19 07:22:25
|
Hi, Marc I think your code would be modified as the follow which yields 4n residuals: void XXX:f(const vnl_vector<double>& x, vnl_vector<double>& fx) { ...... for ( int i = 0; i < n; i++ ) { ... fx[4*i] = (x1[i].first, x1_h[i].first)^2; fx[4*i+1] = (x1[i].second, x1_h[i].second)^2; fx[4*i+2] = (x2[i].first, x2_h[i].first)^2; fx[4*i+3] = (x2[i].second, x2_h[i].second)^2; } } in which,x1[i].first refers to the "x" element of a 2D point,and x1[i].second the "y" element. Shawrie Lee regards. |