https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2010-03-30T14:24:33Z
Ruby Issue Tracking System
Ruby master - Feature #2772: Matrix: Calculating determinant using Bareiss algorithm [patch]
https://bugs.ruby-lang.org/issues/2772?journal_id=9534
2010-03-30T14:24:33Z
keiju (Keiju Ishitsuka)
keiju@ishitsuka.com
<ul></ul><p>=begin<br>
Hi, Marc-André</p>
<p>Did you test for Integer, Rational, Complex, and these mixed Matrix?</p>
<p>Please commit it if it was tested.<br>
=end</p>
Ruby master - Feature #2772: Matrix: Calculating determinant using Bareiss algorithm [patch]
https://bugs.ruby-lang.org/issues/2772?journal_id=9576
2010-03-31T06:37:52Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>keiju (Keiju Ishitsuka)</i> to <i>marcandre (Marc-Andre Lafortune)</i></li></ul><p>=begin</p>
<p>=end</p>
Ruby master - Feature #2772: Matrix: Calculating determinant using Bareiss algorithm [patch]
https://bugs.ruby-lang.org/issues/2772?journal_id=9583
2010-03-31T12:14:25Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul></ul><p>=begin<br>
Unless there is objection, the official spec of determinant will be to calculate the determinant using the algorithm of its choice.</p>
<p>Implementation will rely on #determinant_bareiss and #determinant_gaussian (depending on types of the elements), and users needing a specific algorithm can call those directly.</p>
<p>=end</p>
Ruby master - Feature #2772: Matrix: Calculating determinant using Bareiss algorithm [patch]
https://bugs.ruby-lang.org/issues/2772?journal_id=9586
2010-03-31T14:19:11Z
keiju (Keiju Ishitsuka)
keiju@ishitsuka.com
<ul></ul><p>=begin<br>
Hi. Marc-Andre,</p>
<p>In <a href="https://blade.ruby-lang.org/ruby-core/29154">[ruby-core:29154]</a> the message: "<a href="https://blade.ruby-lang.org/ruby-core/29154">[ruby-core:29154]</a> [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Matrix: Calculating determinant using Bareiss algorithm [patch] (Closed)" href="https://bugs.ruby-lang.org/issues/2772">#2772</a>]<br>
Matrix: Calculating determinant using Bareiss algorithm [patch]", on<br>
Mar/31 12:14(JST) Marc-Andre Lafortune writes:</p>
<blockquote>
<p>Unless there is objection, the official spec of determinant will be<br>
to calculate the determinant using the algorithm of its choice.</p>
</blockquote>
<blockquote>
<p>Implementation will rely on #determinant_bareiss and<br>
#determinant_gaussian (depending on types of the elements), and users<br>
needing a specific algorithm can call those directly.</p>
</blockquote>
<p>I agree the idea that the choice is possible.<br>
Which is the default det defined, determinant_bareiss or determinant_gaussian?</p>
<p>-- keiju</p>
<p>=end</p>
Ruby master - Feature #2772: Matrix: Calculating determinant using Bareiss algorithm [patch]
https://bugs.ruby-lang.org/issues/2772?journal_id=10527
2010-04-26T15:37:21Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul><li><strong>File</strong> <a href="/attachments/958">newdet.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/958/newdet.patch">newdet.patch</a> added</li></ul><p>=begin<br>
I have worked on the determinant (and the rank) methods for Matrix.</p>
<p>Unless I hear arguments against it, the methods #determinant_e and #rank_e will be deprecated. I don't know where the algorithm comes from, but it checks to see if the elimination didn't succeed, i.e. the float calculation introduced some small rounding error and that error remains instead of 0 (a sort of noise). In that case, the noise is then used as a pivot, so many values get divided by a small noisy value that should have been 0. Seems like a bad idea to me, and my informal tests seem to confirm that this gives erroneous results more often than the straight gaussian elimination (and much more than the bareiss-gauss elimination).</p>
<p>I've attached the patch I have so far if anyone is interested.</p>
<p>Note: this patch fixes a bug with #rank causing many rectangular matrices to not have the right rank (e.g Matrix[[0,1],[0,1],[0,1]].rank returned 2, now returns 1)</p>
<p>Also, Matrix#singular? and #regular? will raise an error for non-square matrices.<br>
=end</p>
Ruby master - Feature #2772: Matrix: Calculating determinant using Bareiss algorithm [patch]
https://bugs.ruby-lang.org/issues/2772?journal_id=10665
2010-04-30T03:27:06Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>=begin<br>
This issue was solved with changeset r27554.<br>
Marc-Andre, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<p>=end</p>