8件ヒット
[1-8件を表示]
(0.156秒)
クラス
-
CSV
:: Table (2) - Complex (1)
- Matrix (1)
- NilClass (1)
- Numeric (1)
- String (1)
- UnboundMethod (1)
検索結果
先頭5件
-
Complex
# to _ c -> self (63643.0) -
self を返します。
self を返します。
//emlist[例][ruby]{
Complex(2).to_c # => (2+0i)
Complex(-8, 6).to_c # => (-8+6i)
//} -
NilClass
# to _ c -> Complex (63625.0) -
0+0i を返します。
0+0i を返します。
//emlist[例][ruby]{
nil.to_c # => (0+0i)
//} -
String
# to _ c -> Complex (54877.0) -
自身を複素数 (Complex) に変換した結果を返します。
自身を複素数 (Complex) に変換した結果を返します。
以下の形式を解析できます。i、j は大文字、小文字のどちらでも解析できます。
* 実部+虚部i
* 実部+虚部j
* 絶対値@偏角
それぞれの数値は以下のいずれかの形式で指定します。先頭の空白文字や複素
数値の後にある文字列は無視されます。また、数値オブジェクトと同様に各桁
の間に「_」を入れる事ができます。
* "1/3" のような分数の形式
* "0.3" のような10進数の形式
* "0.3E0" のような x.xEn の形式
自身が解析できない値であった場合は 0+0i を返します。
//emlis... -
Numeric
# to _ c -> Complex (54679.0) -
自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。
自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。
//emlist[例][ruby]{
1.to_c # => (1+0i)
-1.to_c # => (-1+0i)
1.0.to_c # => (1.0+0i)
Rational(1, 2).to_c # => ((1/2)+0i)
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。 -
CSV
:: Table # to _ csv(options = Hash . new) -> String (27304.0) -
CSV の文字列に変換して返します。
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_head... -
CSV
:: Table # to _ s(options = Hash . new) -> String (18004.0) -
CSV の文字列に変換して返します。
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_head... -
Matrix
# minor(from _ row . . to _ row , from _ col . . to _ col) -> Matrix (604.0) -
selfの部分行列を返します。
selfの部分行列を返します。
自分自身の部分行列を返します。
ただし、パラメータは次の方法で指定します。
(1) 開始行番号, 行の大きさ, 開始列番号, 列の大きさ
(2) 開始行番号..終了行番号, 開始列番号..終了列番号
@param from_row 部分行列の開始行(0オリジンで指定)
@param row_size 部分行列の行サイズ
@param from_col 部分行列の開始列(0オリジンで指定)
@param col_size 部分行列の列サイズ
//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3, ... -
UnboundMethod
# owner -> Class | Module (322.0) -
このメソッドが定義されている class か module を返します。
このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//}