void define_module(RefNode *m, const FoxStatic *a_fs, FoxGlobal *a_fg) { fs = a_fs; fg = a_fg; mod_sqlite = m; define_const(m); define_class(m); }
void rubysdl_init_Key(VALUE mSDL) { mKey = rb_define_module_under(mSDL, "Key"); rb_define_module_function(mKey, "scan", Key_s_scan, 0); rb_define_module_function(mKey, "press?", Key_s_press_p, 1); rb_define_module_function(mKey, "modState", Key_s_modState, 0); rb_define_module_function(mKey, "enableKeyRepeat", Key_s_enableKeyRepeat, 2); rb_define_module_function(mKey, "disableKeyRepeat", Key_s_disableKeyRepeat, 0); rb_define_module_function(mKey, "getKeyName", Key_s_getKeyName, 1); define_const(); }
void Init_gsl_multimin(VALUE module) { VALUE mgsl_multimin; VALUE cgsl_multimin_fdfminimizer; VALUE cgsl_multimin_fminimizer; mgsl_multimin = rb_define_module_under(module, "MultiMin"); rb_define_singleton_method(mgsl_multimin, "test_gradient", rb_gsl_multimin_test_gradient, 2); #ifdef GSL_1_3_LATER rb_define_singleton_method(mgsl_multimin, "test_size", rb_gsl_multimin_test_size, 2); #endif cgsl_multimin_fdfminimizer = rb_define_class_under(mgsl_multimin, "FdfMinimizer", cGSL_Object); cgsl_multimin_fminimizer = rb_define_class_under(mgsl_multimin, "FMinimizer", cGSL_Object); define_const(cgsl_multimin_fdfminimizer, cgsl_multimin_fminimizer); cgsl_multimin_function = rb_define_class_under(mgsl_multimin, "Function", cgsl_function); rb_define_singleton_method(cgsl_multimin_function, "alloc", rb_gsl_multimin_function_new, -1); rb_define_method(cgsl_multimin_function, "eval", rb_gsl_multimin_function_eval, 1); rb_define_alias(cgsl_multimin_function, "call", "eval"); rb_define_method(cgsl_multimin_function, "set_proc", rb_gsl_multimin_function_set_f, -1); rb_define_alias(cgsl_multimin_function, "set_f", "set_proc"); rb_define_method(cgsl_multimin_function, "set_params", rb_gsl_multimin_function_set_params, -1); rb_define_method(cgsl_multimin_function, "params", rb_gsl_multimin_function_params, 0); rb_define_method(cgsl_multimin_function, "n", rb_gsl_multimin_function_n, 0); cgsl_multimin_function_fdf = rb_define_class_under(mgsl_multimin, "Function_fdf", cGSL_Object); rb_define_singleton_method(cgsl_multimin_function_fdf, "alloc", rb_gsl_multimin_function_fdf_new, -1); rb_define_method(cgsl_multimin_function_fdf, "set", rb_gsl_multimin_function_fdf_set, -1); rb_define_method(cgsl_multimin_function_fdf, "set_params", rb_gsl_multimin_function_fdf_set_params, -1); rb_define_method(cgsl_multimin_function_fdf, "set_procs", rb_gsl_multimin_function_fdf_set_procs, -1); rb_define_method(cgsl_multimin_function_fdf, "params", rb_gsl_multimin_function_fdf_params, 0); rb_define_method(cgsl_multimin_function_fdf, "n", rb_gsl_multimin_function_fdf_n, 0); rb_define_singleton_method(cgsl_multimin_fdfminimizer, "alloc", rb_gsl_fdfminimizer_new, 2); rb_define_method(cgsl_multimin_fdfminimizer, "set", rb_gsl_fdfminimizer_set, 4); rb_define_method(cgsl_multimin_fdfminimizer, "name", rb_gsl_fdfminimizer_name, 0); rb_define_method(cgsl_multimin_fdfminimizer, "iterate", rb_gsl_fdfminimizer_iterate, 0); rb_define_method(cgsl_multimin_fdfminimizer, "x", rb_gsl_fdfminimizer_x, 0); rb_define_method(cgsl_multimin_fdfminimizer, "f", rb_gsl_fdfminimizer_f, 0); rb_define_method(cgsl_multimin_fdfminimizer, "gradient", rb_gsl_fdfminimizer_gradient, 0); rb_define_method(cgsl_multimin_fdfminimizer, "minimum", rb_gsl_fdfminimizer_minimum, 0); rb_define_method(cgsl_multimin_fdfminimizer, "restart", rb_gsl_fdfminimizer_restart, 0); rb_define_method(cgsl_multimin_fdfminimizer, "test_gradient", rb_gsl_fdfminimizer_test_gradient, 1); /*****/ #ifdef GSL_1_3_LATER rb_define_singleton_method(cgsl_multimin_fminimizer, "alloc", rb_gsl_fminimizer_new, 2); rb_define_method(cgsl_multimin_fminimizer, "set", rb_gsl_fminimizer_set, 3); rb_define_method(cgsl_multimin_fminimizer, "name", rb_gsl_fminimizer_name, 0); rb_define_method(cgsl_multimin_fminimizer, "iterate", rb_gsl_fminimizer_iterate, 0); rb_define_method(cgsl_multimin_fminimizer, "x", rb_gsl_fminimizer_x, 0); rb_define_method(cgsl_multimin_fminimizer, "fval", rb_gsl_fminimizer_fval, 0); rb_define_method(cgsl_multimin_fminimizer, "minimum", rb_gsl_fminimizer_minimum, 0); rb_define_method(cgsl_multimin_fminimizer, "size", rb_gsl_fminimizer_size, 0); rb_define_method(cgsl_multimin_fminimizer, "test_size", rb_gsl_fminimizer_test_size, 1); #endif #ifdef HAVE_GSL_GSL_MULTIMIN_FSDF_H Init_multimin_fsdf(mgsl_multimin); #endif }