File: sf_elljac.c

package info (click to toggle)
ruby-gsl 1.15.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,528 kB
  • ctags: 6,328
  • sloc: ansic: 62,164; ruby: 17,917; makefile: 18; sh: 15
file content (30 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
  sf_elljac.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 "rb_gsl_sf.h"

static VALUE rb_gsl_sf_elljac_e(VALUE obj, VALUE n, VALUE m)
{
  double sn, cn, dn;
  // local variable "status" declared and set, but never used
  //int status;
  Need_Float(n); Need_Float(m);
  /*status =*/ gsl_sf_elljac_e(NUM2DBL(n), NUM2DBL(m), &sn, &cn, &dn);
  return rb_ary_new3(3, rb_float_new(sn), 
		     rb_float_new(cn), rb_float_new(dn));
}

void Init_gsl_sf_elljac(VALUE module)
{
  rb_define_module_function(module, "elljac_e",  rb_gsl_sf_elljac_e, 2);
  rb_define_module_function(module, "elljac",  rb_gsl_sf_elljac_e, 2);
}