Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
gpoon
Posted - 07/21/2009 : 2:31:06 PM Origin Ver. 8 and Service Release (Select Help-->About Origin): SR4 Operating System: XP
I am trying to take numerical derivatives of functions (not a dataset of points) in Origin C. I noticed that the NAG library doesn't have a function for differentiation for C (but does for Fortran). The GNU Scientific Library (GSL) does have such a function, but I cannot get it to work because, apparently, Origin C doesn't support calling external functions that return a struct type variable.
So this is what I was trying in my "ocgsl.h" file:
/* Definition of an arbitrary function with parameters */
Does Origin C (or NAG) have a differentiation function (for functions) that I just don't know about? Is there any way to overcome this limitation of calling functions that return struct type variables? Many thanks!
4 L A T E S T R E P L I E S (Newest First)
gpoon
Posted - 07/27/2009 : 02:16:46 AM It works! Thanks!
Iris_Bai
Posted - 07/22/2009 : 11:36:09 PM Hi Gregory,
Please try the following way to define a function pointer outside strcut:
The compiler returns "Error, syntax error in function declaration" at the line marked with the arrow. What is my mistake?
Thanks, Gregory
Iris_Bai
Posted - 07/21/2009 : 11:39:55 PM Hi,
Could you give more details about not work, for example compiling error? Origin C doesn't support external functions that return a struct type variable, but support struct type as output variable. In your code above, gsl_function is a struct and in gsl_diff_central function it is a output variable, not a return value. So should work in Origin C.