Class: DefStats

Inherits:
DefModule show all
Includes:
ErbppGsl
Defined in:
ext/numo/gsl/stats/parse_stats.rb

Instance Attribute Summary

Attributes inherited from ErbPP

#children, #parent

Instance Method Summary collapse

Methods included from ErbppGsl

FM, dbl, dblp, int, intp, long, read_const, read_enum, read_eval, read_func, read_func_pattern, read_type, str, szt, sztp, tp, uint, ulong, void

Methods inherited from DefModule

#_mod_var, #def_id, #id_list, #init_def, #init_erb, #initialize, #method_code

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, #init_def, #initialize, #load_erb, #method_missing, #method_missing_alias, #result, #run, #set, #write

Constructor Details

This class inherits a constructor from DefModule

Dynamic Method Handling

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

Instance Method Details

#check_func(h) ⇒ Object



22
23
24
25
26
27
28
# File 'ext/numo/gsl/stats/parse_stats.rb', line 22

def check_func(h)
  if t = lookup(h)
    StatsBasic.new(self,t,**h)
  else
    $stderr.puts "skip #{h[:func_name]}"
  end
end

#lookup(h) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'ext/numo/gsl/stats/parse_stats.rb', line 6

def lookup(h)
  dblbk = [dbl,/\[\]$/]
  case h
  when FM(name:"gsl_stats_spearman");         "stats_spearman"
  when FM(name:"gsl_stats_minmax_index");     "stats_minmax_index"
  when FM(name:"gsl_stats_minmax");           "stats_minmax"
  when FM(name:/_(min|max)_index$/);          "stats_1a0p_index"
  when FM(dblbk,szt,szt);                     "stats_1a0p"
  when FM(dblbk,szt,szt,dbl);                 "stats_1a1p"
  when FM(dblbk,szt,szt,dbl,dbl);             "stats_1a2p"
  when FM(dblbk,szt,dblbk,szt,szt);           "stats_2a0p"
  when FM(dblbk,szt,dblbk,szt,szt,dbl);       "stats_2a1p"
  when FM(dblbk,szt,dblbk,szt,szt,dbl,dbl);   "stats_2a2p"
  end
end