From: ara.t.howard@... Date: 2006-05-07T08:12:34+09:00 Subject: Re: Numerical Ruby - Segmentation faults, GSL trouble On Sun, 7 May 2006 Nuralanur@aol.com wrote: > Dear all, > > I have to determine the minima of a multiparameter mathematical function > numerically. > I try to use the simplex method, as implemented in Ruby-Gsl, to do this. > > Below is some code from an example as given in the documentation of Ruby/Gsl. > However, when I run this on Cygwin (Windows XP), I get a segmentation fault > from the line where the parameters are set, whereas in Fedora, I am not > allowed > to allocate even the function to minimize. > > Has anybody had this problem before ? Has anybody some self-written code > for multidimensional minimization (preferably simplex method)? > > Thank you very much in advance, > > Best regards > > Axel as to your first question, here are the results of running your code on my machine: jib:~ > ruby a.rb 1 6.500e+00 5.000e+00 f() = 512.500 size = 1.082 2 5.250e+00 4.000e+00 f() = 290.625 size = 1.372 3 5.250e+00 4.000e+00 f() = 290.625 size = 1.372 4 5.500e+00 1.000e+00 f() = 252.500 size = 1.372 5 2.625e+00 3.500e+00 f() = 101.406 size = 1.823 6 2.625e+00 3.500e+00 f() = 101.406 size = 1.823 7 0.000e+00 3.000e+00 f() = 60.000 size = 1.823 8 2.094e+00 1.875e+00 f() = 42.275 size = 1.303 9 2.094e+00 1.875e+00 f() = 42.275 size = 1.303 10 2.578e-01 1.906e+00 f() = 35.684 size = 1.026 11 5.879e-01 2.445e+00 f() = 35.664 size = 0.804 12 1.258e+00 2.025e+00 f() = 30.680 size = 0.467 13 1.258e+00 2.025e+00 f() = 30.680 size = 0.356 14 1.093e+00 1.849e+00 f() = 30.539 size = 0.285 15 8.830e-01 2.004e+00 f() = 30.137 size = 0.168 16 8.830e-01 2.004e+00 f() = 30.137 size = 0.123 17 9.582e-01 2.060e+00 f() = 30.090 size = 0.100 18 1.022e+00 2.004e+00 f() = 30.005 size = 0.061 19 1.022e+00 2.004e+00 f() = 30.005 size = 0.042 20 1.022e+00 2.004e+00 f() = 30.005 size = 0.042 21 1.022e+00 2.004e+00 f() = 30.005 size = 0.027 22 1.022e+00 2.004e+00 f() = 30.005 size = 0.021 23 9.920e-01 1.997e+00 f() = 30.001 size = 0.015 24 9.920e-01 1.997e+00 f() = 30.001 size = 0.013 converged to minimum at 25 9.920e-01 1.997e+00 f() = 30.001 size = 0.008 your code was 100% un-modified. so i think your install isn't good. i just installed the latest gsl, plotutils, and rb-gsl using export prefix=/dmsp/reference/ export LD_RUN_PATH=$prefix/lib export LD_LIBRARY_PATH=$prefix/lib for gsl : ./configure --prefix=$prefix && make && make install for plotutils : ./configure --prefix=$prefix && make && make install for rb-gsl : for w in config setup install;do ruby setup.rb $w;done eg. nothing special at all. so, sorry to say, it looks like you install is fubar. btw. my platform is jib:~ > uname -srm && cat /etc/redhat-release && ruby -v Linux 2.4.21-40.ELsmp i686 Red Hat Enterprise Linux WS release 3 (Taroon Update 7) ruby 1.8.1 (2003-12-25) [i686-linux] so, while it's not fedora, i'd be very suprised if it didn't work there too. regards. -a -- be kind whenever possible... it is always possible. - h.h. the 14th dali lama