mailr25264 - /trunk/target_functions/c_chi2.c


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 26, 2014 - 09:25:
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];
         }
     }
 }




Related Messages


Powered by MHonArc, Updated Tue Aug 26 09:40:06 2014