mailr25345 - in /branches/frame_order_cleanup: ./ target_functions/relax_fit.c


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

Header


Content

Posted by edward on August 27, 2014 - 18:57:
Author: bugman
Date: Wed Aug 27 18:57:20 2014
New Revision: 25345

URL: http://svn.gna.org/viewcvs/relax?rev=25345&view=rev
Log:
Merged revisions 25344 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r25344 | bugman | 2014-08-27 18:56:05 +0200 (Wed, 27 Aug 2014) | 6 lines
  
  Clean up of the declarations in the target_functions.relax_fit C module.
  
  The Python list objects are now declared at the start of the functions, and 
then PyList_New() is
  called later on.  This allows the code to compile on certain Windows 
systems.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/target_functions/relax_fit.c

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug 27 18:57:20 2014
@@ -1 +1 @@
-/trunk:1-25342
+/trunk:1-25344

Modified: branches/frame_order_cleanup/target_functions/relax_fit.c
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/target_functions/relax_fit.c?rev=25345&r1=25344&r2=25345&view=diff
==============================================================================
--- branches/frame_order_cleanup/target_functions/relax_fit.c   (original)
+++ branches/frame_order_cleanup/target_functions/relax_fit.c   Wed Aug 27 
18:57:20 2014
@@ -132,6 +132,7 @@
 
     /* Declarations. */
     PyObject *params_arg;
+    PyObject *list;
     int i;
 
     /* Parse the function arguments, the only argument should be the 
parameter array. */
@@ -152,7 +153,7 @@
     dchi2(dchi2_vals, values, back_calc, back_calc_grad, sd, num_times, 
num_params);
 
     /* Convert to a Python list, and scale the values. */
-    PyObject *list = PyList_New(0);
+    list = PyList_New(0);
     Py_INCREF(list);
     for (i = 0; i < num_params; i++) {
         PyList_Append(list, PyFloat_FromDouble(dchi2_vals[i] * 
scaling_matrix[i]));
@@ -170,6 +171,7 @@
 
     /* Declarations. */
     PyObject *params_arg;
+    PyObject *list, *list2;
     int j, k;
 
     /* Parse the function arguments, the only argument should be the 
parameter array. */
@@ -195,10 +197,10 @@
     d2chi2(d2chi2_vals, values, back_calc, back_calc_grad, back_calc_hess, 
sd, num_times, num_params);
 
     /* Convert to a Python list, and scale the values. */
-    PyObject *list = PyList_New(0);
+    list = PyList_New(0);
     Py_INCREF(list);
     for (j = 0; j < num_params; j++) {
-        PyObject *list2 = PyList_New(0);
+        list2 = PyList_New(0);
         Py_INCREF(list2);
         for (k = 0; k < num_params; k++) {
             PyList_Append(list2, PyFloat_FromDouble(d2chi2_vals[j][k] * 
scaling_matrix[j] * scaling_matrix[k]));
@@ -234,6 +236,7 @@
 
     /* Declarations. */
     PyObject *params_arg;
+    PyObject *list, *list2;
     int i, j;
 
     /* Parse the function arguments, the only argument should be the 
parameter array. */
@@ -248,10 +251,10 @@
     exponential_dI0(params[index_I0], params[index_R], index_I0, 
relax_times, back_calc_grad, num_times);
 
     /* Convert to a Python list of lists. */
-    PyObject *list = PyList_New(0);
+    list = PyList_New(0);
     Py_INCREF(list);
     for (i = 0; i < num_params; i++) {
-        PyObject *list2 = PyList_New(0);
+        list2 = PyList_New(0);
         Py_INCREF(list2);
         for (j = 0; j < num_times; j++) {
             PyList_Append(list2, PyFloat_FromDouble(back_calc_grad[i][j]));




Related Messages


Powered by MHonArc, Updated Wed Aug 27 20:20:03 2014