Sha256: a1b121e5eced95ff9c7b999ccfa5e66f7039bc9c054e066705fde598efe5c1da

Contents?: true

Size: 1.4 KB

Versions: 11

Compression:

Stored size: 1.4 KB

Contents

/*
  sf_dilog.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_dilog(VALUE obj, VALUE x)
{
  return rb_gsl_sf_eval1(gsl_sf_dilog, x);
}

static VALUE rb_gsl_sf_dilog_e(VALUE obj, VALUE x)
{
  return rb_gsl_sf_eval_e(gsl_sf_dilog_e, x);
}

static VALUE rb_gsl_sf_complex_dilog_e(VALUE obj, VALUE r, VALUE theta)
{
  gsl_sf_result *re, *im;
  VALUE vre, vim;
  // local variable "status" declared and set, but never used
  //int status;
  Need_Float(r); Need_Float(theta);
  vre = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, re);
  vim = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, im);
  /*status =*/ gsl_sf_complex_dilog_e(NUM2DBL(r), NUM2DBL(theta), re, im);
  return rb_ary_new3(2, vre, vim);
}

void Init_gsl_sf_dilog(VALUE module)
{
  rb_define_module_function(module, "dilog",  rb_gsl_sf_dilog, 1);
  rb_define_module_function(module, "dilog_e",  rb_gsl_sf_dilog_e, 1);
  rb_define_module_function(module, "complex_dilog_e",  rb_gsl_sf_complex_dilog_e, 2);
}

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gsl-2.1.0.3 ext/gsl_native/sf_dilog.c
gsl-2.1.0.2 ext/gsl_native/sf_dilog.c
gsl-2.1.0.1 ext/gsl_native/sf_dilog.c
gsl-2.1.0 ext/gsl_native/sf_dilog.c
gsl-1.16.0.6 ext/gsl_native/sf_dilog.c
rb-gsl-1.16.0.5 ext/gsl_native/sf_dilog.c
rb-gsl-1.16.0.4 ext/gsl/sf_dilog.c
rb-gsl-1.16.0.3 ext/gsl/sf_dilog.c
rb-gsl-1.16.0.3.rc1 ext/gsl/sf_dilog.c
rb-gsl-1.16.0.2 ext/gsl/sf_dilog.c
rb-gsl-1.16.0.1 ext/gsl/sf_dilog.c