1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
/*
sf_fermi_dirac.c
Ruby/GSL: Ruby extension library for GSL (GNU Scientific Library)
(C) Copyright 2001-2006 by Yoshiki Tsunesada
Ruby/GSL is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include "include/rb_gsl_sf.h"
static VALUE rb_gsl_sf_fermi_dirac_m1(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_m1, x);
}
static VALUE rb_gsl_sf_fermi_dirac_m1_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_m1_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_0(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_0, x);
}
static VALUE rb_gsl_sf_fermi_dirac_0_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_0_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_1(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_1, x);
}
static VALUE rb_gsl_sf_fermi_dirac_1_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_1_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_2(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_2, x);
}
static VALUE rb_gsl_sf_fermi_dirac_2_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_2_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_int(VALUE obj, VALUE j, VALUE x)
{
return rb_gsl_sf_eval_int_double(gsl_sf_fermi_dirac_int, j, x);
}
static VALUE rb_gsl_sf_fermi_dirac_int_e(VALUE obj, VALUE j, VALUE x)
{
return rb_gsl_sf_eval_e_int_double(gsl_sf_fermi_dirac_int_e, j, x);
}
static VALUE rb_gsl_sf_fermi_dirac_mhalf(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_mhalf, x);
}
static VALUE rb_gsl_sf_fermi_dirac_mhalf_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_mhalf_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_half(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_half, x);
}
static VALUE rb_gsl_sf_fermi_dirac_half_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_half_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_3half(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval1(gsl_sf_fermi_dirac_3half, x);
}
static VALUE rb_gsl_sf_fermi_dirac_3half_e(VALUE obj, VALUE x)
{
return rb_gsl_sf_eval_e(gsl_sf_fermi_dirac_3half_e, x);
}
static VALUE rb_gsl_sf_fermi_dirac_inc_0(VALUE obj, VALUE x, VALUE b)
{
return rb_float_new(gsl_sf_fermi_dirac_inc_0(NUM2DBL(x), NUM2DBL(b)));
}
static VALUE rb_gsl_sf_fermi_dirac_inc_0_e(VALUE obj, VALUE x, VALUE b)
{
return rb_gsl_sf_eval_e_double2(gsl_sf_fermi_dirac_inc_0_e, x, b);
}
void Init_gsl_sf_fermi_dirac(VALUE module)
{
VALUE mgsl_sf_fermi;
rb_define_module_function(module, "fermi_dirac_m1", rb_gsl_sf_fermi_dirac_m1, 1);
rb_define_module_function(module, "fermi_dirac_m1_e", rb_gsl_sf_fermi_dirac_m1_e, 1);
rb_define_module_function(module, "fermi_dirac_0", rb_gsl_sf_fermi_dirac_0, 1);
rb_define_module_function(module, "fermi_dirac_0_e", rb_gsl_sf_fermi_dirac_0_e, 1);
rb_define_module_function(module, "fermi_dirac_1", rb_gsl_sf_fermi_dirac_1, 1);
rb_define_module_function(module, "fermi_dirac_1_e", rb_gsl_sf_fermi_dirac_1_e, 1);
rb_define_module_function(module, "fermi_dirac_2", rb_gsl_sf_fermi_dirac_2, 1);
rb_define_module_function(module, "fermi_dirac_2_e", rb_gsl_sf_fermi_dirac_2_e, 1);
rb_define_module_function(module, "fermi_dirac_int", rb_gsl_sf_fermi_dirac_int, 2);
rb_define_module_function(module, "fermi_dirac_int_e", rb_gsl_sf_fermi_dirac_int_e, 2);
rb_define_module_function(module, "fermi_dirac_mhalf", rb_gsl_sf_fermi_dirac_mhalf, 1);
rb_define_module_function(module, "fermi_dirac_mhalf_e", rb_gsl_sf_fermi_dirac_mhalf_e, 1);
rb_define_module_function(module, "fermi_dirac_half", rb_gsl_sf_fermi_dirac_half, 1);
rb_define_module_function(module, "fermi_dirac_half_e", rb_gsl_sf_fermi_dirac_half_e, 1);
rb_define_module_function(module, "fermi_dirac_3half", rb_gsl_sf_fermi_dirac_3half, 1);
rb_define_module_function(module, "fermi_dirac_3half_e", rb_gsl_sf_fermi_dirac_3half_e, 1);
rb_define_module_function(module, "fermi_dirac_inc_0", rb_gsl_sf_fermi_dirac_inc_0, 2);
rb_define_module_function(module, "fermi_dirac_inc_0_e", rb_gsl_sf_fermi_dirac_inc_0_e, 2);
mgsl_sf_fermi = rb_define_module_under(module, "Fermi_Dirac");
rb_define_module_function(mgsl_sf_fermi, "m1", rb_gsl_sf_fermi_dirac_m1, 1);
rb_define_module_function(mgsl_sf_fermi, "m1_e", rb_gsl_sf_fermi_dirac_m1_e, 1);
rb_define_module_function(mgsl_sf_fermi, "zero", rb_gsl_sf_fermi_dirac_0, 1);
rb_define_module_function(mgsl_sf_fermi, "zero_e", rb_gsl_sf_fermi_dirac_0_e, 1);
rb_define_module_function(mgsl_sf_fermi, "one", rb_gsl_sf_fermi_dirac_1, 1);
rb_define_module_function(mgsl_sf_fermi, "one_e", rb_gsl_sf_fermi_dirac_1_e, 1);
rb_define_module_function(mgsl_sf_fermi, "two", rb_gsl_sf_fermi_dirac_2, 1);
rb_define_module_function(mgsl_sf_fermi, "two_e", rb_gsl_sf_fermi_dirac_2_e, 1);
rb_define_module_function(mgsl_sf_fermi, "int", rb_gsl_sf_fermi_dirac_int, 2);
rb_define_module_function(mgsl_sf_fermi, "int_e", rb_gsl_sf_fermi_dirac_int_e, 2);
rb_define_module_function(mgsl_sf_fermi, "mhalf", rb_gsl_sf_fermi_dirac_mhalf, 1);
rb_define_module_function(mgsl_sf_fermi, "mhalf_e", rb_gsl_sf_fermi_dirac_mhalf_e, 1);
rb_define_module_function(mgsl_sf_fermi, "half", rb_gsl_sf_fermi_dirac_half, 1);
rb_define_module_function(mgsl_sf_fermi, "half_e", rb_gsl_sf_fermi_dirac_half_e, 1);
rb_define_module_function(mgsl_sf_fermi, "threehalf", rb_gsl_sf_fermi_dirac_3half, 1);
rb_define_module_function(mgsl_sf_fermi, "threehalf_e", rb_gsl_sf_fermi_dirac_3half_e, 1);
rb_define_module_function(mgsl_sf_fermi, "inc_0", rb_gsl_sf_fermi_dirac_inc_0, 2);
rb_define_module_function(mgsl_sf_fermi, "inc_0_e", rb_gsl_sf_fermi_dirac_inc_0_e, 2);
}
|