Project

General

Profile

Bug #1020

Matrix#rank loops in some circumstances

Added by pragdave (Dave Thomas) over 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.1p5000 (2009-01-16 trunk 21610) [i386-darwin9.6.0]
Backport:
[ruby-core:21385]

Description

=begin
$ ruby -v -r matrix -e 'p Matrix[ [1,2,3], [4,5,6], [7,8,9] ].rank'
ruby 1.9.1p5000 (2009-01-16 trunk 21610) [i386-darwin9.6.0]
<< loops... >>

The answer should be 2.
=end

Associated revisions

Revision abc20ed0
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 24211
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

Revision 24211
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

Revision 24211
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

Revision 24211
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

Revision 24211
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

Revision 24211
Added by wanabe (_ wanabe) almost 10 years ago

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

Revision ac0ef5ab
Added by yugui (Yuki Sonoda) almost 10 years ago

merges r24211 from trunk into ruby_1_9_1.

  • lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid infinite loop. [Bug #1020]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by ko1 (Koichi Sasada) over 10 years ago

  • Assignee set to yugui (Yuki Sonoda)
  • Target version set to Next Major
  • ruby -v set to ruby 1.9.1p5000 (2009-01-16 trunk 21610) [i386-darwin9.6.0]

=begin

=end

#2

Updated by runpaint (Run Paint Run Run) almost 10 years ago

=begin
Similarly:

 $ ruby1.8 -rmatrix -ve 'p Matrix[ [1, 2, 0, 3], [1, -2, 3, 0], [0, 0, 4, 8], [2, 4, 0, 6] ].rank'
 ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
 3

 $ ruby -rmatrix -ve 'p Matrix[ [1, 2, 0, 3], [1, -2, 3, 0], [0, 0, 4, 8], [2, 4, 0, 6] ].rank'
 ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]
 ^C/usr/local/lib/ruby/1.9.1/matrix.rb:775:in `block in rank': Interrupt
from /usr/local/lib/ruby/1.9.1/matrix.rb:774:in `loop'
from /usr/local/lib/ruby/1.9.1/matrix.rb:774:in `rank'
from -e:1:in `<main>'

The second example just hangs until I kill it.
=end

#3

Updated by wanabe (_ wanabe) almost 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24211.
=end

Also available in: Atom PDF