May 2008 Archives

Visualize the symmetry of Bessel Functions

| | Comments (0) | TrackBacks (0)
Previously I posted a graph of some Bessel functions on the interval zero to twenty, or [0,20] . Here is the same code but on the symmetric counterpart of the the previous interval, [-20, 20]. This allows use to plainly see that even-numbered Bessel functions are even functions (satisfy f(-x)=f(x)) while odd-numbered Bessel functions are odd ( satisfy f(-x)=-f(x) ).

View image

Strange crash resolved

| | Comments (0) | TrackBacks (0)
Evidently, this typemap was causing the issue with gcc 4.x:


 %typemap(freearg) double const [] {
    free($1);
}


What made it hard to track down was that I could not reproduce it on gcc 3.4.6. It was cargo-culted and unnecessary code. Have we learned our lesson?

strange crashes

| | Comments (0) | TrackBacks (0)
Since some time I get some strange crashes while running the tests on Math::GSL. I say strange because Jonathan doesn't have them with this configuration : swig 1.3.35/perl 5.10/gcc 3.4.6. My configuration is swig 1.3.35/perl 5.10/gcc 4.2.3. Here is the bactrace :

t/Poly........Name "swig_runtime_data::type_pointer3" used only once: possible typo at /usr/local/lib/perl5/5.10.0/i686-linux/DynaLoader.pm line 226.
*** glibc detected *** /usr/local/bin/perl: free(): invalid next size (fast): 0x083e9c18 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7e11a85]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7e154f0]
/home/thierry/gsoc/dev/Math-GSL/blib/arch/Poly.so(_wrap_gsl_poly_complex_eval+0x450)[0xb7a33581]
/usr/local/bin/perl(Perl_pp_entersub+0x2d7)[0x80a5347]
/usr/local/bin/perl(Perl_runops_standard+0xe)[0x80a3e0e]
/usr/local/bin/perl(perl_run+0x290)[0x80a0420]
/usr/local/bin/perl(main+0xc5)[0x80623a5]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7dbc450]
/usr/local/bin/perl[0x8062271]
======= Memory map: ========
08048000-0814e000 r-xp 00000000 08:05 352692     /usr/local/bin/perl
0814e000-08151000 rw-p 00105000 08:05 352692     /usr/local/bin/perl
08151000-08425000 rw-p 08151000 00:00 0          [heap]
b7900000-b7921000 rw-p b7900000 00:00 0
b7921000-b7a00000 ---p b7921000 00:00 0
b7a00000-b7a0a000 r-xp 00000000 08:05 49216      /lib/libgcc_s.so.1
b7a0a000-b7a0b000 rw-p 0000a000 08:05 49216      /lib/libgcc_s.so.1
b7a18000-b7a2e000 r-xp 00000000 08:05 566124     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Complex.so
b7a2e000-b7a2f000 rw-p 00016000 08:05 566124     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Complex.so
b7a2f000-b7a3c000 r-xp 00000000 08:05 566134     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Poly.so
b7a3c000-b7a3d000 rw-p 0000c000 08:05 566134     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Poly.so
b7a3d000-b7a42000 r-xp 00000000 08:05 550088     /usr/local/lib/perl5/5.10.0/i686-linux/auto/List/Util/Util.so
b7a42000-b7a43000 rw-p 00004000 08:05 550088     /usr/local/lib/perl5/5.10.0/i686-linux/auto/List/Util/Util.so
b7a43000-b7a5a000 r-xp 00000000 08:05 566320     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Const.so
b7a5a000-b7a5b000 rw-p 00017000 08:05 566320     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Const.so
b7a5b000-b7a8b000 r-xp 00000000 08:05 352735     /usr/local/lib/libgslcblas.so.0.0.0
b7a8b000-b7a8c000 rw-p 0002f000 08:05 352735     /usr/local/lib/libgslcblas.so.0.0.0
b7a8c000-b7c28000 r-xp 00000000 08:05 352739     /usr/local/lib/libgsl.so.0.12.0
b7c28000-b7c32000 rw-p 0019b000 08:05 352739     /usr/local/lib/libgsl.so.0.12.0
b7c37000-b7c3e000 r-xp 00000000 08:05 550369     /usr/local/lib/perl5/5.10.0/i686-linux/auto/Data/Dumper/Dumper.so
b7c3e000-b7c3f000 rw-p 00006000 08:05 550369     /usr/local/lib/perl5/5.10.0/i686-linux/auto/Data/Dumper/Dumper.so
b7c3f000-b7c44000 r-xp 00000000 08:05 566132     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Machine.so
b7c44000-b7c45000 rw-p 00004000 08:05 566132     /home/thierry/gsoc/dev/Math-GSL/blib/arch/Machine.so
b7c45000-b7c67000 r--p 00000000 08:05 445488     /usr/share/locale-langpack/fr/LC_MESSAGES/libc.mo
b7c67000-b7c78000 r-xp 00000000 08:05 550386     /usr/local/lib/perl5/5.10.0/i686-linux/auto/Storable/Storable.so
b7c78000-b7c79000 rw-p 00010000 08:05 550386     /usr/local/lib/perl5/5.10.0/i686-linux/auto/Storable/Storable.so
b7c79000-b7c7b000 r-xp 00000000 08:05 550098     /usr/local/lib/perl5/5.10.0/i686-linux/auto/Fcntl/Fcntl.so
b7c7b000-b7c7c000 rw-p 00002000 08:05 550098     /usr/local/lib/perl5/5.10.0/i686-linux/auto/Fcntl/Fcntl.so
b7c7c000-b7c80000 r-xp 00000000 08:05 550330     /usr/local/lib/perl5/5.10.0/i686-linux/auto/IO/IO.so
b7c80000-b7c81000 rw-p 00003000 08:05 550330     /usr/local/lib/perl5/5.10.0/i686-linux/auto/IO/IO.so
b7c81000-b7cc0000 r--p 00000000 08:05 296967     /usr/lib/locale/fr_CA.utf8/LC_CTYPE
b7cc0000-b7cc1000 r--p 00000000 08:05 297259     /usr/lib/locale/fr_CA.utf8/LC_NUMERIC
b7cc1000-b7cc2000 r--p 00000000 08:05 297237     /usr/lib/locale/fr_CA.utf8/LC_TIME
b7cc2000-b7da3000 r--p 00000000 08:05 296823     /usr/lib/locale/fr_CA.utf8/LC_COLLATE
b7da3000-b7da4000 r--p 00000000 08:05 297231     /usr/lib/locale/fr_CA.utf8/LC_MONETARY
b7da4000-b7da5000 r--p 00000000 08:05 311322     /usr/lib/locale/fr_CA.utf8/LC_MESSAGES/SYS_LC_MESSAGES
b7da5000-b7da6000 rw-p b7da5000 00:00 0
b7da6000-b7eef000 r-xp 00000000 08:05 66873      /lib/tls/i686/cmov/libc-2.7.so
b7eef000-b7ef0000 r--p 00149000 08:05 66873      /lib/tls/i686/cmov/libc-2.7.so
t/Poly........dubious                                                       
    Test returned status 0 (wstat 6, 0x6)

Bessel Function Example for Math::GSL

| | Comments (0) | TrackBacks (0)

There is now an examples/sf directory which has the Perl code to generate this graph with gnuplot. The function Math::GSL::SF::gsl_sf_bessel_Jn($n,$x) was used.




bessel.png

New timeline

| | Comments (0) | TrackBacks (0)
Here is the new timeline for the project this summer:

May 26: Special Functions
        Complex Numbers
        Polynomials

June 2: Vectors
        Matrices
        Polynomials

June 9: Permutations
        Randist
        RNG
        QRNG

June 16: CDF
         Linear Algebra
         Eigensystems

June 23: Fast Fourier Transform
         Discrete Fourier Transform
         Discrete Hankel Transform

June 30: Deeper testing of previously written code and extend examples.

July 7:  BLAS and Sort

July 14: Histograms and NTuples

July 21: Monte Carlo Integration
         Simulated Annealing
         Differential Equations

July 28: Differential Equations
         Interpolation
         Differentiation

August 4: Chebyshev Approximation 
          Series Acceleration
          Root-Finding

August 11: Least-Squares Fitting
           Physical Constants
           Minimization
           Wavelets

August 18: Polishing test and documentation and making sure everything work in order.

August 25: Polishing test and documentation and making sure everything work in order. 
           Writing and sending final evaluation.

Day-0 Report

| | Comments (0) | TrackBacks (0)
The last few weeks have been training for the real weeks to come. I've already started to code with the help of Jonathan Leto (the mentor for this project). The work to do is large but we should be able to go trough it this summer.

I have my own git repository for the project. We have two branches for the moment : master and bleed. Bleed is mainly for rough code. The other repository adresse can be found on the blog. I already worked on some simple subsystems of Math::GSL : PowInt, CDF and Randist. For the moment I'm working on the Matrix subsystem. Special Functions,Errno, PowInt, CDF and Randist subsystems have the interfaces mostly complete.

I wanted to learn to work with a more complex code editor such as nano, vim or emacs for a long time. My mentor was already working with vim so I'll learn to use it too this summer. Jonathan has showed me the basic to work with vim and I'm starting to be more productive with it. Before that, I was using gedit.

Since communicating with the perl and swig community is quite important, I subscribed to the swig-user mailing list for the moment. I'll also be using the #perl irc channel. Sadly, swig doesn't seem to have any irc channel at the moment.

One big issue for the moment is how to use typemaps provided by swig, once this will be solved, we will be able to work on any subsystem of Math::GSL we want

git, macs and open source fun

| | Comments (0) | TrackBacks (0)
Today I was trying to setup my git repository for Math::GSL and I went across problems with git (from MacPorts) when I tried pushing. After an hour or so of testing with people from the macports irc channel I came up with this procedure.

Hope this might help some people.
By the way this is a known problem.

About this Archive

This page is an archive of entries from May 2008 listed from newest to oldest.

April 2008 is the previous archive.

June 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Screw you, spammers! Clicky Web Analytics