I'm trying to wrap the following function to make a C extension.
int dsvd(float **a, int m, int n, float *w, float **v){
//do some things
}
And I have my init, which isn't quite right:
void Init_svd() {
VALUE rb_mSvd = rb_define_module("Svd");
rb_define_method(rb_mSvd, "svd", dsvd, 0);
}
I know I need to wrap dsvd so that I can pass a Value
to rb_define_method
but I can't quite figure out the right way to do it. I tried adapting this answer, but couldn't quite figure it out. Any suggestions?
edit* I also read the Pragmatic Programmer section on C extensions, but that's focused on object creation/allocation. I'm trying to provide a function that performs some transformations and returns a value, so i couldn't make that match up conceptually.