mailr26880 - in /branches/relax_fit_c_class/target_functions: relax_fit.c relax_fit.h


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

Header


Content

Posted by edward on December 01, 2014 - 19:45:
Author: bugman
Date: Mon Dec  1 19:45:20 2014
New Revision: 26880

URL: http://svn.gna.org/viewcvs/relax?rev=26880&view=rev
Log:
Conversion of the relax_fit C module to a Python C class structure.

This follows the 'Extending and Embedding the Python Interpreter' document, 
specifically the design
of 
https://docs.python.org/2/extending/newtypes.html#providing-finer-control-over-data-attributes.

Extensive changes have been made including converting the setup() function 
into the __init__()
method, converting all functions to methods, creating the C struct for the 
class 'self' object and
defining Python data storage for the model name, the number of parameters and 
relaxation times, and
the numpy data storage for the chi-squared gradient and Hessian and the 
Jacobian and chi-squared
Jacobian.  The gradient and Hessian methods now return numpy arrays rather 
than Python lists of
lists, and all methods require the parameter argument to be a numpy array (it 
segfaults otherwise).
A __new__() method has been defined to create the class and it initial 
objects.  And a special class
destructor has been created to clear out the objects in 'self'.

Target function aliasing is handled by creating NULL method definitions in 
the PyMethodDef list.
Then the list is manipulated to alias the method by setting the NULL method 
item to one of the real
methods.



Modified:
    branches/relax_fit_c_class/target_functions/relax_fit.c
    branches/relax_fit_c_class/target_functions/relax_fit.h

[This mail would be too long, it was shortened to contain the URLs only.]

Modified: branches/relax_fit_c_class/target_functions/relax_fit.c
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_fit_c_class/target_functions/relax_fit.c?rev=26880&r1=26879&r2=26880&view=diff

Modified: branches/relax_fit_c_class/target_functions/relax_fit.h
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_fit_c_class/target_functions/relax_fit.h?rev=26880&r1=26879&r2=26880&view=diff




Related Messages


Powered by MHonArc, Updated Mon Dec 01 20:00:02 2014