Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Benjamin Krause
RE: Syntax Problem? [ reply ]  
2008-03-08 12:37
@Abdur-Rahman Advany

looking at the code, there seems to be an error.. i guess the lines:

u2 = GSL::Matrix[u.column(0), u.column(1)].transpose
v2 = GSL::Matrix[vt.column(0), vt.column(1)].transpose

should read

u2 = GSL::Matrix[u.column(0), u.column(1)]
v2 = GSL::Matrix[vt.column(0), vt.column(1)]

Ben

By: Benjamin Krause
RE: Syntax Problem? [ reply ]  
2008-03-08 07:28
Same problem here, the svd-recommender-gsl.rb throws an GSL::ERROR::EBADLEN error..

Ben

By: Abdul-Rahman Advany
RE: Syntax Problem? [ reply ]  
2008-02-02 01:21
Yoshiki,

I installed it from source using http://ftp.de.debian.org/debian/pool/main/libg/libgsl-ruby/libgsl-ruby_1.10.3-1.dsc

I was already patched!

Could you run the script http://www.igvita.com/download.php?file=http://www.igvita.com/downloads/svd-recommender-gsl.rb and see if it gives you any errors?

By: Yoshiki Tsunesada
RE: Syntax Problem? [ reply ]  
2008-02-02 01:07
Have you applied the modification I posted 2007-12-03 04:17 in this thread?

By: Abdul-Rahman Advany
RE: Syntax Problem? [ reply ]  
2008-01-30 18:04
Now its crashing on:

bobEmbed = bob * u2 * eig2.inv

Where bob =
(rdb:1) eval bob.inspect
"GSL::Matrix\n[ 5.000e+00 5.000e+00 0.000e+00 0.000e+00 0.000e+00 5.000e+00 ]"

Where u2 =
(rdb:1) eval u2.inspect
"GSL::Matrix\n[ -4.472e-01 -3.586e-01 -2.925e-01 -2.078e-01 -5.099e-01 -5.316e-01 \n 5.373e-01 -2.461e-01 4.033e-01 -6.700e-01 -5.970e-02 -1.887e-01 ]"

and Where eig2.inv =
(rdb:1) eval eig2.inv.inspect
"GSL::Matrix\n[ 5.645e-02 0.000e+00 \n 0.000e+00 1.565e-01 ]"


By: Abdul-Rahman Advany
RE: Syntax Problem? [ reply ]  
2008-01-30 17:47
But when I manually do

irb(main):001:0> require "gsl"
=> true
irb(main):004:0> bob = GSL::Matrix[[ -5.710e-01, -4.275e-01, -3.846e-01, -5.859e-01 ], [ 2.228e-01, 5.172e-01, -8.246e-01, -5.320e-02 ]]
=> GSL::Matrix
[ -5.710e-01 -4.275e-01 -3.846e-01 -5.859e-01
2.228e-01 5.172e-01 -8.246e-01 -5.320e-02 ]

things work fine... really can't figure this one out...

By: Abdul-Rahman Advany
RE: Syntax Problem? [ reply ]  
2008-01-30 17:36
I think I am facing the same problem, however I have install 1.10.3 (rb-gsl) (I think we are running the same script svd-recommendation-gsl.rb)

With ruby-debug I see the following values

(rdb:1) eval vt.column(0).inspect
"GSL::Vector::Col::View\n[ -5.710e-01 \n -4.275e-01 \n -3.846e-01 \n -5.859e-01 ]"
(rdb:1) eval vt.column(1).inspect
"GSL::Vector::Col::View\n[ 2.228e-01 \n 5.172e-01 \n -8.246e-01 \n -5.320e-02 ]"

But when I do the following:

u2 = GSL::Matrix[vt.column(0), u.column(1)].transpose

I get the error:

GSL::ERROR::EBADLEN Exception: Ruby/GSL error code 19, matrix column size and vector length are not equal (file getset_source.c, line 146), matrix/vector sizes are not conformant

By: Fabio M.A.
RE: Syntax Problem? [ reply ]  
2007-12-03 04:31

Awesome, suddenly the world makes sense again! Thanks!


By: Yoshiki Tsunesada
RE: Syntax Problem? [ reply ]  
2007-12-03 04:17
There is a bug in the source code ext/matrix_source.c, line 238. This looks
m = FUNCTION(gsl_matrix,alloc)(argc, v->size);
but must be
m = FUNCTION(gsl_matrix,alloc)(v->size, argc);
Please modify the source, or apply a patch I posted, you can find it in the patch page.

By: Fabio M.A.
Syntax Problem? [ reply ]  
2007-12-03 03:48
How can I create a new Matrix from 2 column views?

a1.inspect is
GSL::Vector::Col::View
[ -4.472e-01
-3.586e-01
-2.925e-01
-2.078e-01
-5.099e-01
-5.316e-01 ]

a2 is
GSL::Vector::Col::View
[ 5.373e-01
-2.461e-01
4.033e-01
-6.700e-01
-5.970e-02
-1.887e-01 ]

when I do

u2 = GSL::Matrix[a1, a2] I get:

Ruby/GSL error code 19, matrix column size and vector length are not equal (file getset_source.c, line 146), matrix/vector sizes are not conformant (GSL::ERROR::EBADLEN)

How exactly do I create a new Matrix from 2 column views?

Thanks,

Fabio.