|
4 | 4 | #include "ruby_integer.h" |
5 | 5 | #include "ruby_rational.h" |
6 | 6 | #include "ruby_constant.h" |
| 7 | +#include "ruby_function.h" |
7 | 8 | #include "symengine.h" |
8 | 9 |
|
9 | 10 | /////////////////// |
@@ -74,4 +75,74 @@ void Init_symengine() { |
74 | 75 | //Pow class |
75 | 76 | c_pow = rb_define_class_under(m_symengine, "Pow", c_basic); |
76 | 77 |
|
| 78 | + //Functions Class |
| 79 | + c_function = rb_define_class_under(m_symengine, "Function", c_basic); |
| 80 | + |
| 81 | + //Function SubClasses |
| 82 | + c_trig_function = rb_define_class_under(m_symengine, "TrigFunction", c_function); |
| 83 | + c_hyperbolic_function = rb_define_class_under(m_symengine, "HyperbolicFunction", c_function); |
| 84 | + c_lambertw = rb_define_class_under(m_symengine, "LambertW", c_function); |
| 85 | + c_dirichlet_eta = rb_define_class_under(m_symengine, "Dirichlet_eta", c_function); |
| 86 | + c_zeta = rb_define_class_under(m_symengine, "Zeta", c_function); |
| 87 | + c_gamma = rb_define_class_under(m_symengine, "Gamma", c_function); |
| 88 | + |
| 89 | + //TrigFunction SubClasses |
| 90 | + c_sin = rb_define_class_under(m_symengine, "Sin", c_trig_function); |
| 91 | + c_cos = rb_define_class_under(m_symengine, "Cos", c_trig_function); |
| 92 | + c_tan = rb_define_class_under(m_symengine, "Tan", c_trig_function); |
| 93 | + c_csc = rb_define_class_under(m_symengine, "Csc", c_trig_function); |
| 94 | + c_sec = rb_define_class_under(m_symengine, "Sec", c_trig_function); |
| 95 | + c_cot = rb_define_class_under(m_symengine, "Cot", c_trig_function); |
| 96 | + c_asin = rb_define_class_under(m_symengine, "ASin", c_trig_function); |
| 97 | + c_acos = rb_define_class_under(m_symengine, "ACos", c_trig_function); |
| 98 | + c_atan = rb_define_class_under(m_symengine, "ATan", c_trig_function); |
| 99 | + c_acsc = rb_define_class_under(m_symengine, "ACsc", c_trig_function); |
| 100 | + c_asec = rb_define_class_under(m_symengine, "ASec", c_trig_function); |
| 101 | + c_acot = rb_define_class_under(m_symengine, "ACot", c_trig_function); |
| 102 | + |
| 103 | + //HyperbolicFunction SubClasses |
| 104 | + c_sinh = rb_define_class_under(m_symengine, "Sinh", c_hyperbolic_function); |
| 105 | + c_cosh = rb_define_class_under(m_symengine, "Cosh", c_hyperbolic_function); |
| 106 | + c_tanh = rb_define_class_under(m_symengine, "Tanh", c_hyperbolic_function); |
| 107 | + c_csch = rb_define_class_under(m_symengine, "Csch", c_hyperbolic_function); |
| 108 | + c_sech = rb_define_class_under(m_symengine, "Sech", c_hyperbolic_function); |
| 109 | + c_coth = rb_define_class_under(m_symengine, "Coth", c_hyperbolic_function); |
| 110 | + c_asinh = rb_define_class_under(m_symengine, "ASinh", c_hyperbolic_function); |
| 111 | + c_acosh = rb_define_class_under(m_symengine, "ACosh", c_hyperbolic_function); |
| 112 | + c_atanh = rb_define_class_under(m_symengine, "ATanh", c_hyperbolic_function); |
| 113 | + c_acsch = rb_define_class_under(m_symengine, "ACsch", c_hyperbolic_function); |
| 114 | + c_asech = rb_define_class_under(m_symengine, "ASech", c_hyperbolic_function); |
| 115 | + c_acoth = rb_define_class_under(m_symengine, "ACoth", c_hyperbolic_function); |
| 116 | + |
| 117 | + //SymEngine Functions as Module Level Funcions |
| 118 | + rb_define_module_function(m_symengine, "abs", cfunction_abs, 1); |
| 119 | + rb_define_module_function(m_symengine, "sin", cfunction_sin, 1); |
| 120 | + rb_define_module_function(m_symengine, "cos", cfunction_cos, 1); |
| 121 | + rb_define_module_function(m_symengine, "tan", cfunction_tan, 1); |
| 122 | + rb_define_module_function(m_symengine, "csc", cfunction_csc, 1); |
| 123 | + rb_define_module_function(m_symengine, "cot", cfunction_cot, 1); |
| 124 | + rb_define_module_function(m_symengine, "sec", cfunction_sec, 1); |
| 125 | + rb_define_module_function(m_symengine, "asin", cfunction_asin, 1); |
| 126 | + rb_define_module_function(m_symengine, "acos", cfunction_acos, 1); |
| 127 | + rb_define_module_function(m_symengine, "asec", cfunction_asec, 1); |
| 128 | + rb_define_module_function(m_symengine, "acsc", cfunction_acsc, 1); |
| 129 | + rb_define_module_function(m_symengine, "atan", cfunction_atan, 1); |
| 130 | + rb_define_module_function(m_symengine, "acot", cfunction_acot, 1); |
| 131 | + rb_define_module_function(m_symengine, "sinh", cfunction_sinh, 1); |
| 132 | + rb_define_module_function(m_symengine, "cosh", cfunction_cosh, 1); |
| 133 | + rb_define_module_function(m_symengine, "tanh", cfunction_tanh, 1); |
| 134 | + rb_define_module_function(m_symengine, "csch", cfunction_csch, 1); |
| 135 | + rb_define_module_function(m_symengine, "sech", cfunction_sech, 1); |
| 136 | + rb_define_module_function(m_symengine, "coth", cfunction_coth, 1); |
| 137 | + rb_define_module_function(m_symengine, "asinh", cfunction_asinh, 1); |
| 138 | + rb_define_module_function(m_symengine, "acosh", cfunction_acosh, 1); |
| 139 | + rb_define_module_function(m_symengine, "asech", cfunction_asech, 1); |
| 140 | + rb_define_module_function(m_symengine, "acsch", cfunction_acsch, 1); |
| 141 | + rb_define_module_function(m_symengine, "atanh", cfunction_atanh, 1); |
| 142 | + rb_define_module_function(m_symengine, "acoth", cfunction_acoth, 1); |
| 143 | + rb_define_module_function(m_symengine, "lambertw", cfunction_lambertw, 1); |
| 144 | + rb_define_module_function(m_symengine, "dirichlet_eta", cfunction_dirichlet_eta, 1); |
| 145 | + rb_define_module_function(m_symengine, "zeta", cfunction_zeta, 1); |
| 146 | + rb_define_module_function(m_symengine, "gamma", cfunction_gamma, 1); |
| 147 | + |
77 | 148 | } |
0 commit comments