Sha256: f57c8e2ecbed51ead18c9f5acdc8ab312aef25c1aec80937504cce0b5e0e31e8
Contents?: true
Size: 941 Bytes
Versions: 1
Compression:
Stored size: 941 Bytes
Contents
# narray-fromfile ## 概要 倍精度浮動小数点のバイナリファイルを NArray 行列として読み(書き)します。 ## インストール GitHub から、`narray-fromfile` をインストールするには以下のコマンドを実行します。 ```sh gem install specific_install gem specific_install -l "git://github.com/himeyama/narray-fromfile.git" ``` **Gemfile** に記述する場合は以下のようにして `bundle`。 ```rb gem "narray-fromfile", github: "himeyama/narray-fromfile.git", branch: :main ``` ## サンプル ### 書き込み ```rb require "numo/narray" require "fromfile" a = Numo::DFloat[1..256].reshape(16, 16) a.tofile("data.bin") ``` ### 読み込み ```rb require "numo/narray" require "fromfile" a = Numo::DFloat.fromfile("data.bin").reshape(16, 16) # 行と列のサイズは保存されないので、読み込み後 reshape する。 ``` ### 確認 ```sh od -t fD data.bin ```
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
narray-fromfile-0.1.2 | README.md |