>>>>> "N" == Niko Schwarz <niko.schwarz / gmx.net> writes:

N> |         a = a.sort { |a, b|  
                 ^         ^
                 |         |

N> thats the first problem. what you see is a workaround, but i dont get why 
N> a.sort! { bla...
N> doesnt work.

 because you re-use `a' as a parameter for the block, change the name
 something like

            a.sort! { |x, y| ... }


N> and here goes the second problem. for some weird reason which ive been 
N> trying to find the whole afternoon, a[0] is a fixnum in run 2.

N> |         a.map! { |elt|
N> |             faktor = (-a[0][s]) / tri[tri.length-1][s]
N> |             0.upto(elt.length-1) { |i|
N> |                 elt[i] += ( tri[tri.length-1][i] * faktor)
N> |             }
N> |         }

 a.map! replace the value with the result returned by the block, in your
 case this is the value returned by #upto

 Write it
            a.map! { |elt|
                 faktor = (-a[0][s]) / tri[tri.length-1][s]
                 0.upto(elt.length-1) { |i|
                     elt[i] += ( tri[tri.length-1][i] * faktor)
                 }
                 elt # return the value of elt
            }


Guy Decoux