/*
call-seq:
Function.new(x,y)
Creates a Function object with given +x+ and +y+ values.
*/
static VALUE function_initialize(VALUE self, VALUE x, VALUE y)
{
if(IS_A_DVECTOR(x) && IS_A_DVECTOR(y))
{
if(DVECTOR_SIZE(x) == DVECTOR_SIZE(y)) {
set_x_vector(self, x);
set_y_vector(self, y);
/* fine, this could have been written in pure Ruby...*/
set_spline_vector(self,Qnil);
/* We initialize the @spline_cache var */
}
else
rb_raise(rb_eArgError,"both vectors must have the same size");
}
else
rb_raise(rb_eArgError,"both arguments must be Dvector");
return self;
}