るりまサーチ

最速Rubyリファレンスマニュアル検索!
2990件ヒット [1-100件を表示] (0.257秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix#tr -> Integer | Float | Rational | Complex (36426.0)

トレース (trace) を返します。

...トレース (trace) を返します。

行列のトレース (trace) とは、対角要素の和です。

//emlist[例][ruby]{
require
'matrix'
Matrix[[7,6], [3,9]].trace # => 16
//}

tr
ace は正方行列でのみ定義されます。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が...

StringScanner#string=(str) (27531.0)

スキャン対象の文字列を str に変更して、マッチ記録を捨てます。

...str に変更して、マッチ記録を捨てます。

@
param str スキャン対象の文字列を str に変更して、マッチ記録を捨てます。

@
return str を返します。

//emlist[例][ruby]{
require
'strscan'

str = '0123'
s = StringScanner.new('test string')
s.string = str...

Matrix#antisymmetric? -> bool (27325.0)

行列が反対称行列 (交代行列、歪〔わい〕対称行列とも) ならば true を返します。

... true を返します。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します

//emlist[][ruby]{
require
'matrix'

Matrix[[0, -2, Complex(1, 3)], [2, 0, 5], [-Complex(1, 3), -5, 0]].antisymmetric? # => true
Matrix.empty.antisymmetric? # => true

Mat...
...rix[[1, 2, 3], [4, 5, 6], [7, 8, 9]].antisymmetric? # => false
# 対角要素が違う
Matrix[[1, -2, 3], [2, 0, 6], [-3, -6, 0]].antisymmetric? # => false
# 符号が違う
Matrix[[0, 2, -3], [2, 0, 6], [-3, 6, 0]].antisymmetric? # => false
//}...

Matrix#skew_symmetric? -> bool (27325.0)

行列が反対称行列 (交代行列、歪〔わい〕対称行列とも) ならば true を返します。

... true を返します。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します

//emlist[][ruby]{
require
'matrix'

Matrix[[0, -2, Complex(1, 3)], [2, 0, 5], [-Complex(1, 3), -5, 0]].antisymmetric? # => true
Matrix.empty.antisymmetric? # => true

Mat...
...rix[[1, 2, 3], [4, 5, 6], [7, 8, 9]].antisymmetric? # => false
# 対角要素が違う
Matrix[[1, -2, 3], [2, 0, 6], [-3, -6, 0]].antisymmetric? # => false
# 符号が違う
Matrix[[0, 2, -3], [2, 0, 6], [-3, 6, 0]].antisymmetric? # => false
//}...

REXML::Attributes#get_attribute(name) -> Attribute | nil (24531.0)

name という名前の属性を取得します。

...

@
param name 属性名(文字列)
@
see REXML::Attributes#[]

//emlist[][ruby]{
require
'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("...
.../root/a").first

a.attributes.get_attribute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

絞り込み条件を変える

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (24531.0)

namespace と name で特定される属性を返します。

...prefix を含まない属性名を
指定します。

指定された属性が存在しない場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使うことで属性を正しく指定することができます。

@
par...
...URI, 文字列)
@
param name 属性名(文字列)

//emlist[][ruby]{
require
'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").fir...
...st

a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

Matrix#entrywise_product(m) -> Matrix (24525.0)

アダマール積(要素ごとの積)を返します。

...ダマール積(要素ごとの積)を返します。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。

//emlist[例][ruby]{
require
'matrix'

Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}...

Matrix#trace -> Integer | Float | Rational | Complex (24426.0)

トレース (trace) を返します。

...トレース (trace) を返します。

行列のトレース (trace) とは、対角要素の和です。

//emlist[例][ruby]{
require
'matrix'
Matrix[[7,6], [3,9]].trace # => 16
//}

tr
ace は正方行列でのみ定義されます。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が...

StringIO#truncate(len) -> Integer (24343.0)

自身のサイズが len になるように、自身を切り詰め、もしくは拡大します。 拡大した場合は、その部分を 0 で埋めます。 len を返します。

...

@
param len 変更したいサイズを整数で指定します。

@
raise IOError 自身が書き込み可能でない時に発生します。

@
raise Errno::EINVAL len がマイナスの時に発生します。

//emlist[例][ruby]{
require
"stringio"
a = StringIO.new("hoge", 'r+')
a.truncate(...
...2)
a.string #=> "ho"
a.truncate(5)
a.string #=> "ho\000\000\000"
//}...

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (21725.0)

要素から key という属性名の属性を削除します。

...

@
param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)

//emlist[][ruby]{
require
'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x")...
...; e # => <E y:x='bar'/>
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>