Skip to content

Instantly share code, notes, and snippets.

@tamuratak
Last active January 11, 2016 10:06
Show Gist options
  • Save tamuratak/35cd6bf182f45a7998de to your computer and use it in GitHub Desktop.
Save tamuratak/35cd6bf182f45a7998de to your computer and use it in GitHub Desktop.
ruby-eigen

C++で書かれた線型代数ライブラリであるEigenのRuby用バインディングをリリースしました。 SWIGを使っており、ここまでの開発には1週間もかかっていません。SWIGマジすごい。

https://github.com/ruby-eigen/ruby-eigen/

SWIGファイル

  • eigen.i
  • eigen_array.i
  • rb_error_handle.i

のうち rb_error_handle.i だけが ruby の実装に依存していて、 他の *.i ファイルは他言語のバインディングを作る際にも使えるはずです。

Eigen::MatrixDouble などでは Eigen のAPIをそのまま実装して、 他のMatrixやNMatrixなどのRuby流のAPIはEigen::Matrixで実装するのがよいと考えています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment