shyouhei
f2a91397fd
Add uplevel keyword to Kernel#warn and use it
...
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
2017-12-12 11:56:25 +00:00
kazu
0e7c83e374
[DOC] Fix example result [ci skip]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20 12:57:08 +00:00
marcandre
b1152fab0f
lib/matrix: Add hadamard_product/entrywise_product.
...
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
2017-11-20 02:18:43 +00:00
marcandre
980c0dd360
lib/matrix: Add Matrix{.|#}combine
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20 02:18:34 +00:00
marcandre
62646c8d67
lib/matrix: accept vectors in {h|v}stack
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20 02:18:23 +00:00
marcandre
aa95a42190
lib/matrix: Add explicit coercion #to_matrix
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20 02:18:12 +00:00
marcandre
3527c863be
lib/matrix: Remove method catalog [doc] [ci-skip]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 22:05:44 +00:00
kazu
dabdec31e4
Use caller with length to reduce unused strings
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:40:03 +00:00
marcandre
666df14594
* lib/matrix.rb: Add Vector.zero and Vector#zero?
...
Patch by Chia-sheng Chen [#13208 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-14 20:09:30 +00:00
usa
40c9f1f328
get rid of test failures on CI introduced at r56927
...
* 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
2016-11-29 15:23:12 +00:00
naruse
3e92b635fb
Add frozen_string_literal: false for all files
...
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
2015-12-16 05:07:31 +00:00
hsbt
e398e64ad7
* lib/matrix.rb: added documentation for Matrix#empty and Matrix#/
...
[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
2015-05-21 08:29:32 +00:00
marcandre
b81950f480
* lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.
...
[Fixes GH-802]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05 23:45:42 +00:00
marcandre
ecf33043b8
* lib/matrix.rb: [Doc] Fix Vector multiplication documentation [ci-skip]
...
[Fixes GH-837]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-22 20:22:31 +00:00
marcandre
969057c95a
* lib.matrix.rb: Fix typo. Patch by Dimitrios Zorbas. [GH-772]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27 01:03:46 +00:00
marcandre
387e0dbe3f
* lib/matrix.rb: Vector#independent? and associated class method
...
patch by gogo tanaka [#10451 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-19 17:44:46 +00:00
marcandre
4da89e192a
* lib/matrix.rb: Add Vector#angle_with
...
Patch by Egunov Dmitriy [#10442 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-19 17:32:58 +00:00
marcandre
aa87ea9915
* lib/matrix.rb: Generalize Vector#cross_product to arbitrary dimensions
...
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
2014-10-29 02:43:52 +00:00
marcandre
764524f65b
* lib/matrix.rb: Add Matrix#adjucate
...
patch by gogo tanaka [#10056 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-29 02:43:28 +00:00
marcandre
dc38c87779
* lib/matrix.rb: Add aliases for Vector#cross & dot
...
patch by gogo tanaka [#10352 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-29 02:42:56 +00:00
marcandre
a2ae7bccf8
* lib/matrix.rb: Add @- and @+ for Matrix and Vector.
...
patch by gogo tanaka [#10068 ] [#10069 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07 20:18:35 +00:00
marcandre
56d5728589
* lib/matrix.rb: Add Matrix#laplace_expansion.
...
patch by gogo tanaka [#10073 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07 19:30:48 +00:00
marcandre
eb9c3e7120
* lib/matrix.rb: Add Vector.basis.
...
Based on patch by gogo tanaka [#10072 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07 19:29:53 +00:00
marcandre
5b46b07bf3
* lib/matrix.rb: Add hstack & vstack methods.
...
Based on a patch by creasywuqiong. [Fix GH-344]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-03 03:44:20 +00:00
marcandre
f59098d118
* lib/matrix.rb: Fix Matrix.rows copy bug.
...
Patch by Arron Mabrey. [Fix GH-707]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-03 03:38:06 +00:00
ayumin
1ddf81134b
* lib/matrix.rb: Fix docs. Patched by Ben Woodall. [GH-726]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-24 22:54:10 +00:00
marcandre
b0eda56826
* lib/matrix.rb: Avoid using `and`.
...
Patch by gogo tanaka [#10058 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-18 10:04:15 +00:00
marcandre
72d0536606
* lib/matrix.rb: Fix sign for cross_product [ #9499 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-11 05:19:33 +00:00
marcandre
d11d87c362
* lib/matrix.rb: Add Matrix#cofactor [fix GH-568]
...
Patch by gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-06 17:46:16 +00:00
marcandre
b8ba202301
* lib/matrix.rb: Add first_minor [fix GH-568]
...
Patch by gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-06 17:45:54 +00:00
marcandre
bcf8dd1096
* lib/matrix: Handle empty diagonal matrix case [fix GH-576]
...
Patch by gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-06 17:45:07 +00:00
marcandre
2ea4ed6395
* lib/matrix.rb: Fix typo in rdoc
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19 16:36:42 +00:00
marcandre
2106aa1990
* lib/matrix.rb: Add Vector#cross_product, patch by Luis Ezcurdia
...
[fix GH-276] [rubyspec:81eec89a124]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 03:08:28 +00:00
marcandre
9a912c66d4
* lib/matrix.rb: Fix error message, patch by pypypy [Bug #7777 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 05:43:36 +00:00
marcandre
ddea0c8232
* lib/matrix.rb: Take conjugate for inner product
...
[rubyspec:5a01ad5719f2] [ruby-dev:46101]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-30 04:53:58 +00:00
zzak
f2a997d858
* lib/matrix.rb (#dup): typo in example [ruby-core:50946][Bug #7582 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-17 17:36:56 +00:00
marcandre
8aac5f48fc
* lib/matrix: alias {row|column}_size to {row|column}_count and use the latter.
...
[Bug #7369 ] [ruby-core:49409]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-10 16:53:57 +00:00
marcandre
23798cd67b
* lib/matrix.rb: Fix determinant_e [ruby-dev:46305] [Bug #7228 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 18:21:17 +00:00
nobu
e6c5b9f308
revert r37326 "remove string literal concatenation"
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 14:06:31 +00:00
nobu
db1f7079b6
remove string literal concatenation
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 10:07:22 +00:00
nobu
7c2230bd8c
matrix.rb: complex vector
...
* lib/matrix.rb (Vector#magnitude): accumulate squares of absolute
values to fix for complex vector. [ruby-dev:46100] [Bug #6966 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-03 05:49:06 +00:00
marcandre
b62792e540
* lib/matrix.rb (hermitian?): Bug fix, patch by George Koehler
...
[Bug #6290 ] [rubyspec:4b9573d7613]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16 03:17:45 +00:00
drbrain
68bf801c39
* lib/matrix.rb: Clean up extra whitespace in output documentation.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-26 03:04:11 +00:00
marcandre
b906a46edd
* lib/matrix.rb (symmetric?): Trivial optimization
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-30 06:04:04 +00:00
marcandre
506b253856
* lib/matrix.rb: Deal with subclasses of Matrix [redmine #5307 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-10 20:23:36 +00:00
naruse
53e667a9eb
Remove duplicated definition.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 19:11:06 +00:00
marcandre
1e696acc7e
* lib/matrix.rb: Add Vector#normalize [ruby-dev:43829]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 02:41:14 +00:00
marcandre
c8e2388257
* lib/matrix: Add LUP decomposition
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-01 06:23:12 +00:00
marcandre
59a3d59496
* lib/matrix.rb: Allow non integer exponents for Matrix#**
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-01 06:21:24 +00:00
marcandre
004c34f9de
* lib/matrix: Add Eigenvalue Decomposition
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-01 06:13:35 +00:00