Class: MultifitLinear

Inherits:
DefGslModuleFunction show all
Defined in:
ext/numo/gsl/multifit/erbpp_multifit.rb

Constant Summary

Constants included from FuncParser

FuncParser::PARAM_DESC, FuncParser::PARAM_NAMES

Instance Attribute Summary

Attributes included from FuncParser

#args_in, #args_out, #args_param, #counter, #generate_array

Attributes inherited from ErbPP

#children, #parent

Instance Method Summary collapse

Methods inherited from DefGslModuleFunction

#initialize

Methods included from FuncParser

#argument_property, #c_args, #cdef_args, #def_ain, #def_aout, #desc_param, #desc_param_scalar, #find_name, #is_param, lookup, #method_args, #n_in, #n_input, #n_out, #n_param, #ndl_args, #param_desc, #param_names, #parse_args, #recv

Methods inherited from DefModuleFunction

#initialize

Methods inherited from DefMethod

#c_func, #c_iter, #c_name, #define_method_args, #id_op, #initialize, #op_map, #singleton

Methods included from DeclMethod

#def_alias, #def_alloc_func, #def_const, #def_method, #def_module_function, #def_singleton_method, #undef_alloc_func, #undef_method, #undef_singleton_method

Methods inherited from ErbPP

#add_child, #description, #find, #find_tmpl, #get, #initialize, #load_erb, #method_missing, #method_missing_alias, #result, #run, #set, #write

Constructor Details

This class inherits a constructor from DefGslModuleFunction

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ErbPP

Instance Method Details

#_mod_varObject



27
28
29
# File 'ext/numo/gsl/multifit/erbpp_multifit.rb', line 27

def _mod_var
  parent.module_var
end

#init_defObject



31
32
33
34
35
36
37
38
39
# File 'ext/numo/gsl/multifit/erbpp_multifit.rb', line 31

def init_def
  case func_name
  when /_linear$/
    super + "
  #{struct_def("LinearResult",%w[c cov chisq])}"
  else
    super
  end
end

#struct_def(cls, vars) ⇒ Object



41
42
43
44
45
46
47
# File 'ext/numo/gsl/multifit/erbpp_multifit.rb', line 41

def struct_def(cls,vars)
  items = vars.map{|v| "\"#{v}\""}.join(",")
  "/*
    Document-class: Numo::GSL::Multifit::LinearResult
    */
  c#{cls} = rb_struct_define_under(#{_mod_var},\"#{cls}\",#{items},NULL);"
end