Skip to content

Instantly share code, notes, and snippets.

@Bajena

Bajena/block2.c Secret

Created April 23, 2020 20:18
Show Gist options
  • Save Bajena/64f6c0e767c8410511d1b00765dde9b8 to your computer and use it in GitHub Desktop.
Save Bajena/64f6c0e767c8410511d1b00765dde9b8 to your computer and use it in GitHub Desktop.
#include "ruby/ruby.h"
#include "matrices.h"
static VALUE inv_matrix(VALUE self, VALUE m) { // We'll implement it later }
static VALUE mul_matrix(VALUE self, VALUE m1, VALUE m2) { // We'll implement in later }
void Init_extension(void) {
VALUE MatrixBoost = rb_define_module("MatrixBoost");
VALUE NativeHelpers = rb_define_class_under(MatrixBoost, "NativeHelpers", rb_cObject);
rb_define_singleton_method(NativeHelpers, "mul_matrix", mul_matrix, 2);
rb_define_singleton_method(NativeHelpers, "inv_matrix", inv_matrix, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment