aboutsummaryrefslogtreecommitdiffstats
path: root/lib/matrix.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove duplicated definition.naruse2011-07-091-9/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add Vector#normalize [ruby-dev:43829]marcandre2011-07-091-0/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix: Add LUP decompositionmarcandre2011-07-011-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Allow non integer exponents for Matrix#**marcandre2011-07-011-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix: Add Eigenvalue Decompositionmarcandre2011-07-011-0/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix: Add Matrix#roundmarcandre2011-07-011-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Matrix.zero can build rectangular matrices.marcandre2011-06-291-4/+6
| | | | | | Vector#r should be called #magnitude git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add Matrix#diagonal?, hermitian?, normal?, orthogonal?marcandre2011-06-291-0/+138
| | | | | | permutation?, symmetric?, {lower|upper}triangular?, unitary?, zero? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Specialize Matrix#find_index to return [row, col]marcandre2011-06-291-0/+31
| | | | | | and accept the same optional argument as #each git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Matrix#each{_with_index} can iterate over a subset of the ↵marcandre2011-06-291-19/+110
| | | | | | Matrix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Clean warnings: unused variables.naruse2010-06-231-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (eql?, ==, minor): Fix bugs when comparing/returningmarcandre2010-06-051-3/+5
| | | | | | some empty matrices. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: trivial optimizationsmarcandre2010-06-051-20/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (determinant): Trivial optimization (thanks to Benoit Daloze)marcandre2010-05-171-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * NEWS: List all changes to lib/matrixmarcandre2010-05-021-87/+90
| | | | | | * lib/matrix.rb: Improve doc and style. Trivial optimizations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Improve algorithm for Matrix#determinant and Matrix#rankmarcandre2010-04-291-128/+104
| | | | | | | {determinant,det,rank}_e are now deprecated. [ruby-core:28273] Also fixes a bug in Determinant#rank (e.g. [[0,1][0,1][0,1]]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Matrix#singular?, Matrix#regular?): raise on rectangularmarcandre2010-04-291-4/+4
| | | | | | matrices, and use determinant instead of rank. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: New method Matrix.build [ruby-core:28272]marcandre2010-04-111-1/+47
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Deprecate Vector#elements_to{i/f/r}marcandre2010-04-111-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Deprecate elements_to_{f/i/r}marcandre2010-04-111-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Handle coercion errors by raising TypeErrors [ruby-core:26736]marcandre2010-04-111-27/+31
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix rdoc. see r27156kazu2010-04-071-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Matrix.determinant: raise on rectangular matricesmarcandre2010-04-011-6/+6
| | | | | | [ruby-core:28271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: New Complex instance methods:marcandre2010-04-011-0/+73
| | | | | | | conjugate, conj, imaginary, imag, real, real?, rectangular, rect [ruby-core:26285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: New methods Matrix#each, #each_with_index, andmarcandre2010-04-011-0/+39
| | | | | | include Enumerable [ruby-core:28400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (empty): Reject negative sizesmarcandre2010-04-011-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: New method #empty? [ruby-core:26284]marcandre2010-04-011-2/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: removed compare_by*, inspect_org, cf [ruby-core:26268]marcandre2010-04-011-16/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb(Vector#each2, Vector#collect2): add type check forkeiju2010-03-291-0/+2
| | | | | | | | Integer[Bug #2495]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Vector#each): Return self and optimization [ruby-core:28405]marcandre2010-03-031-4/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Vector#each2, collect2): small refactoring.matz2010-03-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Vector#each): make Vector enumerable. matz2010-03-031-0/+11
| | | | | | [ruby-core:28405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Vector#each2): returns a self. [ruby-dev:40241]mame2010-02-011-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: add exception Matrix::ErrOperationNotImplementedkeiju2010-01-271-14/+30
| | | | | | | | | | | | | [ruby-dev:40149]. * lib/matrix.rb: change message of exception Matrix::ErrOperationNotDefined [ruby-dev:40150], [ruby-dev:40176]. * lib/matrix.rb: add method Vector#/ [ruby-dev:40151]. * lib/matrix.rb(Matrix::Scalar#+,-,/): delete meaningless when switch. [ruby-dev:40149] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (determinant): fix name error.mame2010-01-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: suppress warnings.akr2010-01-251-27/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Matrix#inverse_from): use #quo. backported r9490.nobu2010-01-091-1/+1
| | | | | | | | | | | * lib/matrix.rb (Matrix#determinant): ditto. [ruby-core:27507] * lib/matrix.rb (Matrix#rank): ditto. * lib/matrix.rb (Matrix::Scalar#initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (each2,collect2,map2): Fix enumerator [ruby-core:27225]marcandre2009-12-191-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (**): Optimization (up to 45% faster)marcandre2009-10-241-11/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix (transpose): bug fix for Matrix.empty(0,42).tmarcandre2009-10-241-0/+1
| | | | | | cf [ruby-core:23598] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix (column): handle negative arguments. cf [ruby-core:23598]marcandre2009-10-241-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix (minor): Also handle negative arguments like Array#[]marcandre2009-10-241-5/+18
| | | | | | cf [ruby-core:23598] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (transpose, inspect): Bug fixmarcandre2009-10-201-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (empty): Improved rdocmarcandre2009-10-201-2/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Bug fix. See detail [ruby-core:23598].keiju2009-10-201-96/+119
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Matrix#rank): Two bug fixes. One made ↵marcandre2009-09-161-2/+2
| | | | | | Matrix[[0,0],[0,0],[1,0]].rank raise a NoMethodError while the other one had Matrix[[0,1],[0,0],[1,0]].rank raise a TypeError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Optimizationsmarcandre2009-09-161-46/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (Matrix#/): Fix obvious bugmarcandre2009-09-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: fix previous optimizationmarcandre2009-09-161-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb (determinant): Bug fix where determinant failed on some ↵marcandre2009-09-161-1/+1
| | | | | | matrices [ruby-core:23597] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e