Project

numo-binrw

0.0
No release in over a year
Read binary files and handle them with `NArray`.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 12.3.3

Runtime

~> 0.9.2.0
 Project Readme

numo-binrw

build Gem Version

開発状況

  • 書き込み
    • 複数のファイル書き込み
    • 対応型
      • 倍精度浮動小数点数
      • 単精度浮動小数点
      • 32 Bit 整数
      • 64 Bit 整数
  • 読み込み
    • 複数のファイルから読み込み
    • 対応型
      • 倍精度浮動小数点数
      • 単精度浮動小数点
      • 32 Bit 整数
      • 64 Bit 整数

使用法

require "numo/binrw"

# 書き込み (例: 倍精度浮動小数点数)
a = Numo::DFloat.cast(0...100)
a.bin_write("dfdata.bin")

# 他の型で書き込み (例: 単精度浮動小数点)
b = Numo::SFloat.cast(0...100)
b.bin_write("fdata.bin")

# 複数ファイルに書き込み
c = Numo::Int32.cast(0...100).reshape(4, true)
c.bin_write(["idata01.bin", "idata02.bin", "idata03.bin", "idata04.bin"])

# 読み込み
d = Numo::Int32.bin_read("idata01.bin")
p d

## 複数ファイルから読み込み
e = Numo::Int32.bin_read(["idata01.bin", "idata02.bin", "idata03.bin", "idata04.bin"])
p e

インストール

gem install numo-binrw