aboutsummaryrefslogtreecommitdiffstats
path: root/lib/matrix.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/matrix] Fix 0-th power [Bug #17521] (#4047)Marc-André Lafortune2021-01-101-1/+1
|
* [ruby/matrix] Make frozen matrices Ractor shareableMarc-Andre Lafortune2020-12-091-1/+5
|
* [ruby/matrix] Optimize **Marc-Andre Lafortune2020-12-051-15/+38
| | | | | | | Avoiding recursive call would imply iterating bits starting from most significant, which is not easy to do efficiently. Any saving would be dwarfed by the multiplications anyways. [Feature #15233]
* [ruby/matrix] Add Matrix#adjoint [#14]Marc-Andre Lafortune2020-05-011-0/+11
| | | | Patch adapted from Alessandro Minali
* [ruby/matrix] Optimize Matrix#*Marc-Andre Lafortune2020-05-011-10/+12
|
* [ruby/matrix] Fix Matrix#orthogonal?Marc-Andre Lafortune2020-05-011-3/+4
|
* [ruby/matrix] Fix Matrix#unitary? [#14]Marc-Andre Lafortune2020-05-011-3/+3
|
* [ruby-matrix] Update docs (nicer rendering, undocumented method)zverok2020-05-011-89/+105
|
* Fix message of ExceptionForMatrix::ErrOperationNotDefinedKazuhiro NISHIYAMA2020-02-091-1/+1
| | | | | | | | | | | ``` % RBENV_VERSION=2.6.5 ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)' #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector> % RBENV_VERSION=2.7.0 ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)' #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can\'t be defined: Vector op Vector> % RBENV_VERSION=master ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)' #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector> ```
* Simplified ErrDimensionMismatch classHiroshi SHIBATA2019-11-301-4/+2
|
* Support argument for ErrNotRegularHiroshi SHIBATA2019-11-301-2/+6
|
* Support existence usecase for the custom exception classesHiroshi SHIBATA2019-11-301-3/+13
|
* replace raise method from e2mmap on Scalar classHiroshi SHIBATA2019-11-301-5/+5
|
* raise method accepts 3 argument with exception classHiroshi SHIBATA2019-11-301-9/+9
|
* Remove re-define embedded error classes and extract argument on custom error ↵Hiroshi SHIBATA2019-11-301-16/+4
| | | | classes
* Use simple exception classes instead of e2mmapHiroshi SHIBATA2019-11-301-48/+73
|
* Add abs to Matrix (#2199)Fernando Wolf Bona2019-08-211-0/+7
|
* [ruby/matrix] Add Matrix::VERSION constantMarcus Stollsteimer2019-07-151-0/+2
| | | | | | | Add Matrix::VERSION for the gem version, use it in the gemspec, and make it also available for library users. https://github.com/ruby/matrix/commit/65c2bb1fa1
* proc.c: proc without blocknobu2019-01-101-2/+1
| | | | | | | * proc.c (proc_new): promoted lambda/proc/Proc.new with no block in a method called with a block to a warning/error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix.rb: Make Matrix & Vector mutable. Add #[]=, #map!.marcandre2018-11-021-21/+226
| | | | | | Adapted from patch by Grzegorz Jakubiak. [#14151] [Fix GH-1769] [Fix GH-1905] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Use consistent stylemarcandre2018-11-021-10/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: use consistent stylemarcandre2018-11-021-15/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix.rb: Alias antisymmetric? with skew_symmetric?marcandre2018-11-021-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Matrix: Add #reflexive? method. [Fix GH-1730]"marcandre2018-11-021-9/+0
| | | | | | This reverts commit 19fe6552c456e41c0b85816806399ca1609255c0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Matrix: Add #reflexive? method. [Fix GH-1730]marcandre2018-09-201-0/+9
| | | | | | Adapted from a patch by Yilo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Fix potential bug of Vector#angle_withmarcandre2018-09-161-3/+7
| | | | | | | Could happen for some linearly dependent vectors. Patch by Vasiliy Petrov. [Fix GH-1803] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed needless extension for require.hsbt2018-06-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix.rb: Document deprecated methods [#12032] [doc] [ci-skip]marcandre2018-02-061-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* matrix.rb: add Matrix#antisymmetric?stomar2018-01-111-0/+12
| | | | | | | | | * lib/matrix.rb: add Matrix#antisymmetric?. Proposed by Yilo (@yiloo). Patch by Marcus Stollsteimer (@stomar). [Fix GH-1788] * spec/ruby/library/matrix/antisymmetric_spec.rb: add specs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add uplevel keyword to Kernel#warn and use itshyouhei2017-12-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Fix example result [ci skip]kazu2017-11-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Add hadamard_product/entrywise_product.marcandre2017-11-201-0/+11
| | | | | | Based on a patch by Charley Hutchison. [GH-674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Add Matrix{.|#}combinemarcandre2017-11-201-0/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: accept vectors in {h|v}stackmarcandre2017-11-201-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Add explicit coercion #to_matrixmarcandre2017-11-201-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Remove method catalog [doc] [ci-skip]marcandre2017-11-091-104/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use caller with length to reduce unused stringskazu2017-10-211-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add Vector.zero and Vector#zero?marcandre2017-03-141-0/+20
| | | | | | Patch by Chia-sheng Chen [#13208] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* get rid of test failures on CI introduced at r56927usa2016-11-291-3/+3
| | | | | | | * lib/matrix.rb: now ruby warns ambiguous parentheses after a space in method definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: added documentation for Matrix#empty and Matrix#/hsbt2015-05-211-0/+2
| | | | | | [Feature #10070][ruby-dev:48433] Patch by @gogotanaka git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.marcandre2015-03-051-0/+8
| | | | | | [Fixes GH-802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: [Doc] Fix Vector multiplication documentation [ci-skip]marcandre2015-02-221-1/+1
| | | | | | [Fixes GH-837] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib.matrix.rb: Fix typo. Patch by Dimitrios Zorbas. [GH-772]marcandre2014-11-271-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Vector#independent? and associated class methodmarcandre2014-11-191-1/+40
| | | | | | patch by gogo tanaka [#10451] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add Vector#angle_withmarcandre2014-11-191-0/+15
| | | | | | Patch by Egunov Dmitriy [#10442] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Generalize Vector#cross_product to arbitrary dimensionsmarcandre2014-10-291-6/+28
| | | | | | based on a patch by gogo tanaka [#10074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add Matrix#adjucatemarcandre2014-10-291-0/+15
| | | | | | patch by gogo tanaka [#10056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add aliases for Vector#cross & dotmarcandre2014-10-291-2/+4
| | | | | | patch by gogo tanaka [#10352] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: Add @- and @+ for Matrix and Vector.marcandre2014-10-071-0/+20
| | | | | | patch by gogo tanaka [#10068] [#10069] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e