Class: Numo::GSL::Poly::ComplexWorkspace

Inherits:
Object
  • Object
show all
Defined in:
ext/numo/gsl/poly/gsl_poly.c

Class Method Summary collapse

Class Method Details

.new(n) ⇒ Object

allocate instance of ComplexWorkspace class.

This function allocates space for a gsl_poly_complex_workspace struct and a workspace suitable for solving a polynomial with n coefficients using the routine gsl_poly_complex_solve.

The function returns a pointer to the newly allocated gsl_poly_complex_workspace if no errors were detected, and a null pointer in the case of error.

Parameters:

  • n (Integer)

    parameter



74
75
76
77
78
79
80
81
82
83
# File 'ext/numo/gsl/poly/gsl_poly.c', line 74

static VALUE
poly_complex_workspace_s_new(VALUE self, VALUE v1)
{
    gsl_poly_complex_workspace *w;
    w = gsl_poly_complex_workspace_alloc(NUM2SIZET(v1));
    if (!w) {
        rb_raise(rb_eNoMemError,"fail to allocate struct");
    }
    return TypedData_Wrap_Struct(cComplexWorkspace, &poly_complex_workspace_data_type, (void*)w);
}