Your message dated Thu, 22 Sep 2005 14:42:03 +0900
with message-id <[EMAIL PROTECTED]>
and subject line Bug#329161: libruby1.8: Matrix class in 
/usr/lib/ruby/1.8/matrix.rb is totally broken
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 20 Sep 2005 00:30:44 +0000
>From [EMAIL PROTECTED] Mon Sep 19 17:30:44 2005
Return-path: <[EMAIL PROTECTED]>
Received: from pcp05454496pcs.sandia01.nm.comcast.net (balefire.icecavern.net) 
[68.35.95.14] 
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1EHW20-00079i-00; Mon, 19 Sep 2005 17:30:44 -0700
Received: from tonberry.icecavern.net (tonberry.icecavern.net [10.0.0.9])
        by balefire.icecavern.net (Postfix) with ESMTP id 1EE0940B82;
        Mon, 19 Sep 2005 18:30:39 -0600 (MDT)
Received: by tonberry.icecavern.net (Postfix, from userid 1000)
        id 004915D995; Mon, 19 Sep 2005 18:30:07 -0600 (MDT)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: "Wesley J. Landaker" <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: libruby1.8: Matrix class in /usr/lib/ruby/1.8/matrix.rb is totally 
broken
X-Mailer: reportbug 3.17
Date: Mon, 19 Sep 2005 18:30:07 -0600
Message-Id: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: libruby1.8
Version: 1.8.2-9
Severity: important

Ruby has a Matrix class in it's standard library that you can use with
"require 'matrix'" -- handy! Except, it is totally broken; not only do a
lot of things not work, but the things that "work" give incorrect
results!

Some examples:

1) It miscalculates the determinant:

>> require 'matrix'
=> true
>> x = Matrix[[3,-1,4],[2,5,1],[2,0,6]]
=> Matrix[[3, -1, 4], [2, 5, 1], [2, 0, 6]]
>> x.det
=> 90
>> x.t.det
=> 126

Notice that not only is the determinant wrong (it should be 60), but the
determinant of the transpose is wrong differently (det(A) == det(A^T)).

2) It doesn't do inversion right:

>> x.inverse
=> Matrix[[0, 1, 0], [0, 0, 0], [0, 0, 0]]
>> x.inverse.inverse
ExceptionForMatrix::ErrNotRegular: Not Regular Matrix
        from /usr/lib/ruby/1.8/matrix.rb:595:in `inverse_from'
        from /usr/lib/ruby/1.8/matrix.rb:591:in `inverse_from'
        from /usr/lib/ruby/1.8/matrix.rb:580:in `inverse'
        from (irb):6

So, one, the inverse is totally wrong, but the inverse isn't invertable.

This isn't just a fluke; I haven't got it to give the correct answer for
ANY matrix I've tried. There are quite a few other things that are
horribly broken.

Anyway, it's nice to have a Matrix class, and having a Matrix class with
some broken functionality isn't that bad, but it's *much worse* to have a
horribly broken Matrix class that does the wrong thing and gives bad
results.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-amd64-k8-sk98lin
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages libruby1.8 depends on:
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libncurses5                   5.4-9      Shared libraries for terminal hand
ii  zlib1g                        1:1.2.3-4  compression library - runtime

libruby1.8 recommends no packages.

-- no debconf information

---------------------------------------
Received: (at 329161-close) by bugs.debian.org; 22 Sep 2005 05:42:14 +0000
>From [EMAIL PROTECTED] Wed Sep 21 22:42:14 2005
Return-path: <[EMAIL PROTECTED]>
Received: from fs.yendot.org [164.46.240.253] 
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1EIJqY-0001cD-00; Wed, 21 Sep 2005 22:42:14 -0700
Received: from arika.org (rb.vpn.yendot.org [192.168.253.2])
        by fs.yendot.org (Postfix) with ESMTP id B4A9F6D411A;
        Thu, 22 Sep 2005 14:42:10 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
        by arika.org (Postfix) with ESMTP id 8499A2E70604;
        Thu, 22 Sep 2005 14:42:10 +0900 (JST)
Received: from arika.org ([127.0.0.1])
        by localhost (station [127.0.0.1]) (amavisd-new, port 10024)
        with ESMTP id 15462-01; Thu, 22 Sep 2005 14:42:04 +0900 (JST)
Received: from [172.16.1.6] (rice.p.arika.org [172.16.1.6])
        by arika.org (Postfix) with ESMTP id 4DDF12E70EE0;
        Thu, 22 Sep 2005 14:42:04 +0900 (JST)
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 22 Sep 2005 14:42:03 +0900
From: akira yamada <[EMAIL PROTECTED]>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.7.6) Gecko/20050331 
Thunderbird/1.0.2 Mnenhy/0.7.2.0
X-Accept-Language: ja, en-us, en
MIME-Version: 1.0
To: "Wesley J. Landaker" <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED]
Subject: Re: Bug#329161: libruby1.8: Matrix class in /usr/lib/ruby/1.8/matrix.rb
 is totally broken
References: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
X-Enigmail-Version: 0.92.0.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at arika.org
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02

Wesley J. Landaker wrote:
> Ruby has a Matrix class in it's standard library that you can use with
> "require 'matrix'" -- handy! Except, it is totally broken; not only do a
> lot of things not work, but the things that "work" give incorrect
> results!

Please use "matrix" with "mathn".
"ri Matrix" saies:

     Also note that the determinant of integer matrices may be
     incorrectly calculated unless you also +require 'mathn'+. This may
     be fixed in the future.

>> require 'matrix'
=> true
>> require 'mathn'
=> true
>> x = Matrix[[3,-1,4],[2,5,1],[2,0,6]]
=> Matrix[[3, -1, 4], [2, 5, 1], [2, 0, 6]]
>> x.det
=> 60
>> x.t.det
=> 60
>> x.inverse
=> Matrix[[1/2, 1/10, -7/20], [-1/6, 1/6, 1/12], [-1/6, -1/30, 17/60]]
>> x.inverse.inverse
=> Matrix[[3, -1, 4], [2, 5, 1], [2, 0, 6]]

Thank you.

-- 
akira yamada


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to