mailRe: r8992 - in /branches/relax_disp/maths_fns: dispersion.c dispersion.h relax_disp.c relax_disp.h


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

Header


Content

Posted by Edward d'Auvergne on March 24, 2009 - 20:04:
Ah, the C coding part.  The Segfaults will be fun to debug!  I won't
be much use, I'll be out of action until May.

Bye,

Edward


On Tue, Mar 24, 2009 at 7:30 PM,  <sebastien.morin.1@xxxxxxxxx> wrote:
Author: semor
Date: Tue Mar 24 19:30:59 2009
New Revision: 8992

URL: http://svn.gna.org/viewcvs/relax?rev=8992&view=rev
Log:
Started to modify the C modules by changing a variable for relaxation 
dispersion.

The code now goes further, but still much work is needed...

The change was:
relax_times -> cpmg_frqs


Modified:
   branches/relax_disp/maths_fns/dispersion.c
   branches/relax_disp/maths_fns/dispersion.h
   branches/relax_disp/maths_fns/relax_disp.c
   branches/relax_disp/maths_fns/relax_disp.h

Modified: branches/relax_disp/maths_fns/dispersion.c
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/maths_fns/dispersion.c?rev=8992&r1=8991&r2=8992&view=diff
==============================================================================
--- branches/relax_disp/maths_fns/dispersion.c (original)
+++ branches/relax_disp/maths_fns/dispersion.c Tue Mar 24 19:30:59 2009
@@ -31,7 +31,7 @@



-void dispersion(double *params, double *relax_times, double *back_calc, 
int num_times) {
+void dispersion(double *params, double *cpmg_frqs, double *back_calc, int 
num_times) {
       /* Function to back calculate the effective transversal relaxation 
rate (R2eff).
       */

@@ -49,7 +49,7 @@

        /* Back calculate */
        else
-            back_calc[i] = params[1] * exp(-relax_times[i] * params[0]);
+            back_calc[i] = params[1] * exp(-cpmg_frqs[i] * params[0]);

    }
 }

Modified: branches/relax_disp/maths_fns/dispersion.h
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/maths_fns/dispersion.h?rev=8992&r1=8991&r2=8992&view=diff
==============================================================================
--- branches/relax_disp/maths_fns/dispersion.h (original)
+++ branches/relax_disp/maths_fns/dispersion.h Tue Mar 24 19:30:59 2009
@@ -22,6 +22,6 @@
 #ifndef RELAX_DISPERSION
 #define RELAX_DISPERSION

-void dispersion(double *params, double *relax_times, double *back_calc, 
int num_times);
+void dispersion(double *params, double *cpmg_frqs, double *back_calc, int 
num_times);

 #endif

Modified: branches/relax_disp/maths_fns/relax_disp.c
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/maths_fns/relax_disp.c?rev=8992&r1=8991&r2=8992&view=diff
==============================================================================
--- branches/relax_disp/maths_fns/relax_disp.c (original)
+++ branches/relax_disp/maths_fns/relax_disp.c Tue Mar 24 19:30:59 2009
@@ -35,36 +35,36 @@
 static PyObject *
 setup(PyObject *self, PyObject *args, PyObject *keywords) {
    /* Python declarations */
-    PyObject *values_arg, *sd_arg, *relax_times_arg, *scaling_matrix_arg;
-    extern PyArrayObject *numpy_values, *numpy_sd, *numpy_relax_times, 
*numpy_scaling_matrix;
+    PyObject *values_arg, *sd_arg, *cpmg_frqs_arg, *scaling_matrix_arg;
+    extern PyArrayObject *numpy_values, *numpy_sd, *numpy_cpmg_frqs, 
*numpy_scaling_matrix;

    /* Normal declarations */
-    extern double *values, *sd, *relax_times, *scaling_matrix;
+    extern double *values, *sd, *cpmg_frqs, *scaling_matrix;
    extern double relax_time_array;
    extern int num_params, num_times;

    /* The keyword list */
-    static char *keyword_list[] = {"num_params", "num_times", "values", 
"sd", "relax_times", "scaling_matrix", NULL};
+    static char *keyword_list[] = {"num_params", "num_times", "values", 
"sd", "cpmg_frqs", "scaling_matrix", NULL};

    /* Parse the function arguments */
-    if (!PyArg_ParseTupleAndKeywords(args, keywords, "iiOOOO", 
keyword_list, &num_params, &num_times, &values_arg, &sd_arg, 
&relax_times_arg, &scaling_matrix_arg))
+    if (!PyArg_ParseTupleAndKeywords(args, keywords, "iiOOOO", 
keyword_list, &num_params, &num_times, &values_arg, &sd_arg, 
&cpmg_frqs_arg, &scaling_matrix_arg))
        return NULL;

    Py_XDECREF(numpy_values);
    Py_XDECREF(numpy_sd);
-    Py_XDECREF(numpy_relax_times);
+    Py_XDECREF(numpy_cpmg_frqs);
    Py_XDECREF(numpy_scaling_matrix);

    /* Make the numpy arrays contiguous */
    numpy_values = (PyArrayObject *) 
PyArray_ContiguousFromObject(values_arg, PyArray_DOUBLE, 1, 1);
    numpy_sd = (PyArrayObject *) PyArray_ContiguousFromObject(sd_arg, 
PyArray_DOUBLE, 1, 1);
-    numpy_relax_times = (PyArrayObject *) 
PyArray_ContiguousFromObject(relax_times_arg, PyArray_DOUBLE, 1, 1);
+    numpy_cpmg_frqs = (PyArrayObject *) 
PyArray_ContiguousFromObject(cpmg_frqs_arg, PyArray_DOUBLE, 1, 1);
    numpy_scaling_matrix = (PyArrayObject *) 
PyArray_ContiguousFromObject(scaling_matrix_arg, PyArray_DOUBLE, 2, 2);

    /* Pointers to the numpy arrays */
    values = (double *) numpy_values->data;
    sd = (double *) numpy_sd->data;
-    relax_times = (double *) numpy_relax_times->data;
+    cpmg_frqs = (double *) numpy_cpmg_frqs->data;
    scaling_matrix = (double *) numpy_scaling_matrix->data;

    /* Return nothing */
@@ -98,7 +98,7 @@
    params = (double *) numpy_params->data;

    /* Back calculated the peak intensities */
-    dispersion(params, relax_times, back_calc, num_times);
+    dispersion(params, cpmg_frqs, back_calc, num_times);

    Py_DECREF(numpy_params);
    /* Calculate and return the chi-squared value */
@@ -132,7 +132,7 @@
    params = (double *) numpy_params->data;

    /* Back calculated the peak intensities */
-    dispersion(params, relax_times, back_calc, num_times);
+    dispersion(params, cpmg_frqs, back_calc, num_times);


    /* Test code (convert aaa to a numpy array */

Modified: branches/relax_disp/maths_fns/relax_disp.h
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/maths_fns/relax_disp.h?rev=8992&r1=8991&r2=8992&view=diff
==============================================================================
--- branches/relax_disp/maths_fns/relax_disp.h (original)
+++ branches/relax_disp/maths_fns/relax_disp.h Tue Mar 24 19:30:59 2009
@@ -37,7 +37,7 @@
 /****************************************/

 /* Variables sent to the setup function to be stored for later use */
-PyArrayObject *numpy_values, *numpy_sd, *numpy_relax_times, 
*numpy_scaling_matrix;
+PyArrayObject *numpy_values, *numpy_sd, *numpy_cpmg_frqs, 
*numpy_scaling_matrix;
 int num_params, num_times;
 double *sd;

@@ -45,7 +45,7 @@
 /*PyArrayObject *numpy_params;*/

 /* Pointers to contiguous PyArrayObjects */
-double *values, *sd, *relax_times, *scaling_matrix;
+double *values, *sd, *cpmg_frqs, *scaling_matrix;
 /*double *params;*/




_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

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




Related Messages


Powered by MHonArc, Updated Thu Mar 26 19:00:38 2009