Module: Xgboost

Defined in:
lib/xgboost.rb,
lib/xgboost/version.rb,
ext/xgboost/xgboost.c

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.add_in_c(op1, op2) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'ext/xgboost/xgboost.c', line 11

VALUE rb_xgboost_add_in_c(VALUE klass, VALUE op1, VALUE op2)
{
  if (!FIXNUM_P(op1))
    rb_raise(rb_eArgError, "Argument 1 has to be of type Fixnum");

  if (!FIXNUM_P(op2))
    rb_raise(rb_eArgError, "Argument 2 has to be of type Fixnum");

  long op1_long = FIX2LONG(op1);
  long op2_long = FIX2LONG(op2);

  return LONG2FIX(op1_long + op2_long);
}

.this_is_cObject



5
6
7
8
9
# File 'ext/xgboost/xgboost.c', line 5

VALUE rb_xgboost_this_is_c(VALUE klass)
{
  VALUE r_result = rb_int_new(42);
  return r_result;
}