one step closer, need to figure out gradient of func and how to send cam/node/aspectratio with void* fdata

This commit is contained in:
Jonathan Bosson
2017-04-12 16:54:13 -06:00
parent ab877feaf9
commit f2aebcd880
2 changed files with 33 additions and 15 deletions

View File

@@ -163,9 +163,9 @@ int levmarq(int npar, double *par, int ny, double *y, double *dysq,
double error_func(double *par, int ny, double *y, double *dysq,
double (*func)(double *, int, void *), void *fdata) {
int x;
double res,e=0;
double res, e = 0;
for (x=0; x<ny; x++) {
for (x = 0; x < ny; x++) {
res = func(par, x, fdata) - y[x];
if (dysq) // weighted least-squares
e += res*res/dysq[x];