Author: bugman
Date: Tue Aug 26 09:25:32 2014
New Revision: 25264
URL: http://svn.gna.org/viewcvs/relax?rev=25264&view=rev
Log:
Fixes for the target function chi-squared gradient C function.
Modified:
trunk/target_functions/c_chi2.c
Modified: trunk/target_functions/c_chi2.c
URL:
http://svn.gna.org/viewcvs/relax/trunk/target_functions/c_chi2.c?rev=25264&r1=25263&r2=25264&view=diff
==============================================================================
--- trunk/target_functions/c_chi2.c (original)
+++ trunk/target_functions/c_chi2.c Tue Aug 26 09:25:32 2014
@@ -105,8 +105,9 @@
/* Calculate the chi-squared gradient. */
for (j = 0; j < M; ++j) {
+ dchi2[j] = 0.0;
for (i = 0; i < num_times; ++i) {
- dchi2[j] += -2.0 / (errors[i]*errors[i]) * (data[i] -
back_calc_vals[i]) * back_calc_grad[j][i];
+ dchi2[j] += -2.0 / square(errors[i]) * (data[i] -
back_calc_vals[i]) * back_calc_grad[j][i];
}
}
}
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits