deferred callback execution #28

wants to merge 1 commit into


None yet

2 participants

tadam commented Aug 30, 2011

No description provided.

@tadam tadam * support deferred callback execution of gsl_function
 * gsl_root_fsolver_iterate() and gsl_min_fminimizer_iterate() works now
@leto leto commented on the diff Aug 30, 2011
@@ -3,6 +3,19 @@
%include "typemaps.i"
%include "renames.i"
+%typemap(freearg) gsl_function *;
+%newobject gsl_root_fsolver_alloc;
+%extend gsl_root_fsolver {
+ ~gsl_root_fsolver() {
leto Aug 30, 2011 owner

Does this mean that people must have a C++ compiler to compile Math::GSL ? Or is there some SWIG voodoo going on?

tadam Aug 30, 2011

Yes, it is SWIG voodoo :-)
I had compiled it with llvm-gcc, not llvm-g++.

Actually this code makes following things:

  1. SWIG creates function named delete_gsl_min_fminimizer() substituting there a code of ~gsl_root_fsolver()
  2. SWIG uses this function in XS(_wrap_delete_gsl_min_fminimizer) {...}
  3. Math::GSL::Min calls previous XS-mapped function function from DESTROY:
    if (exists $OWNER{$self}) {
    delete $OWNER{$self};

I don't see any C++ specific code here. But if you can, please make additional check on your machine.

leto commented Aug 30, 2011

This is awesome! Will test soon.

leto commented Sep 2, 2011

The tests passed on my machine with gcc. Merged! If you are unsure which subsystem to hack on next, getting the ODE subsystem working next would be a killer feature. It would allow people to solve ODE's with C-like speed from Perl, which would attract a lot of new users.

Keep the pull requests coming!

@leto leto closed this Sep 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment