rb-gsl 1.16.0.4 → 1.16.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -0
- data/.travis.yml +24 -0
- data/AUTHORS +6 -0
- data/COPYING +341 -339
- data/ChangeLog +608 -587
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +14 -33
- data/THANKS +1 -1
- data/examples/blas/blas.rb +1 -1
- data/examples/bspline.rb +3 -3
- data/examples/complex/functions.rb +4 -4
- data/examples/complex/mul.rb +1 -1
- data/examples/const/physconst.rb +4 -4
- data/examples/const/travel.rb +4 -4
- data/examples/eigen/nonsymmv.rb +1 -1
- data/examples/eigen/qhoscillator.rb +3 -3
- data/examples/fft/radix2.rb +1 -1
- data/examples/fft/real-halfcomplex.rb +3 -3
- data/examples/fft/real-halfcomplex2.rb +3 -3
- data/examples/fit/expfit.rb +1 -1
- data/examples/fit/multifit.rb +1 -1
- data/examples/fit/ndlinear.rb +44 -44
- data/examples/fit/nonlinearfit.rb +1 -1
- data/examples/fit/wlinear.rb +3 -3
- data/examples/function/function.rb +1 -1
- data/examples/function/min.rb +1 -1
- data/examples/function/synchrotron.rb +2 -2
- data/examples/gallery/koch.rb +1 -1
- data/examples/histogram/cauchy.rb +2 -2
- data/examples/histogram/exponential.rb +1 -1
- data/examples/histogram/histo3d.rb +1 -1
- data/examples/histogram/histogram-pdf.rb +2 -2
- data/examples/histogram/xexp.rb +1 -1
- data/examples/integration/ahmed.rb +2 -2
- data/examples/integration/cosmology.rb +7 -7
- data/examples/integration/friedmann.rb +4 -4
- data/examples/integration/qng.rb +1 -1
- data/examples/interp/demo.rb +2 -2
- data/examples/linalg/LQ_solve.rb +1 -1
- data/examples/linalg/LU.rb +1 -1
- data/examples/linalg/LU2.rb +1 -1
- data/examples/linalg/LU_narray.rb +1 -1
- data/examples/linalg/PTLQ.rb +1 -1
- data/examples/linalg/QRPT.rb +1 -1
- data/examples/linalg/chol.rb +1 -1
- data/examples/linalg/chol_narray.rb +1 -1
- data/examples/linalg/complex.rb +1 -1
- data/examples/math/elementary.rb +1 -1
- data/examples/math/functions.rb +1 -1
- data/examples/math/inf_nan.rb +1 -1
- data/examples/math/minmax.rb +1 -1
- data/examples/math/power.rb +1 -1
- data/examples/math/test.rb +1 -1
- data/examples/min.rb +1 -1
- data/examples/multimin/bundle.rb +1 -1
- data/examples/multimin/cqp.rb +17 -17
- data/examples/multiroot/fsolver3.rb +1 -1
- data/examples/odeiv/binarysystem.rb +12 -12
- data/examples/odeiv/demo.rb +3 -3
- data/examples/odeiv/frei1.rb +7 -7
- data/examples/odeiv/frei2.rb +4 -4
- data/examples/odeiv/oscillator.rb +1 -1
- data/examples/odeiv/sedov.rb +3 -3
- data/examples/odeiv/whitedwarf.rb +11 -11
- data/examples/permutation/ex1.rb +2 -2
- data/examples/permutation/permutation.rb +1 -1
- data/examples/poly/demo.rb +1 -1
- data/examples/random/diffusion.rb +1 -1
- data/examples/random/generator.rb +2 -2
- data/examples/random/randomwalk.rb +3 -3
- data/examples/random/rng.rb +1 -1
- data/examples/roots/bisection.rb +1 -1
- data/examples/roots/brent.rb +1 -1
- data/examples/roots/demo.rb +1 -1
- data/examples/roots/newton.rb +2 -2
- data/examples/roots/recombination.gp +0 -1
- data/examples/sf/hyperg.rb +1 -1
- data/examples/sf/sphbessel.rb +1 -1
- data/examples/sort/sort.rb +1 -1
- data/examples/tamu_anova.rb +4 -4
- data/examples/vector/add.rb +1 -1
- data/examples/vector/decimate.rb +1 -1
- data/examples/vector/gnuplot.rb +8 -8
- data/examples/vector/vector.rb +2 -2
- data/examples/wavelet/wavelet1.rb +1 -1
- data/ext/{gsl → gsl_native}/alf.c +9 -9
- data/ext/{gsl → gsl_native}/array.c +64 -151
- data/ext/{gsl → gsl_native}/array_complex.c +61 -63
- data/ext/{gsl → gsl_native}/blas.c +0 -0
- data/ext/{gsl → gsl_native}/blas1.c +32 -32
- data/ext/{gsl → gsl_native}/blas2.c +54 -58
- data/ext/{gsl → gsl_native}/blas3.c +54 -54
- data/ext/{gsl → gsl_native}/block.c +3 -6
- data/ext/{gsl/block_source.c → gsl_native/block_source.h} +109 -111
- data/ext/gsl_native/bspline.c +122 -0
- data/ext/{gsl → gsl_native}/bundle.c +0 -0
- data/ext/{gsl → gsl_native}/cdf.c +76 -88
- data/ext/{gsl → gsl_native}/cheb.c +74 -85
- data/ext/{gsl → gsl_native}/combination.c +9 -16
- data/ext/{gsl → gsl_native}/common.c +7 -37
- data/ext/{gsl → gsl_native}/complex.c +113 -115
- data/ext/gsl_native/const.c +331 -0
- data/ext/{gsl → gsl_native}/const_additional.c +12 -33
- data/ext/gsl_native/cqp.c +283 -0
- data/ext/{gsl → gsl_native}/deriv.c +22 -30
- data/ext/{gsl → gsl_native}/dht.c +20 -28
- data/ext/{gsl → gsl_native}/diff.c +23 -25
- data/ext/{gsl → gsl_native}/dirac.c +44 -45
- data/ext/{gsl → gsl_native}/eigen.c +1031 -1082
- data/ext/{gsl → gsl_native}/error.c +13 -13
- data/ext/{gsl → gsl_native}/extconf.rb +5 -13
- data/ext/{gsl → gsl_native}/fft.c +192 -198
- data/ext/{gsl → gsl_native}/fit.c +16 -16
- data/ext/gsl_native/fresnel.c +312 -0
- data/ext/{gsl → gsl_native}/function.c +29 -35
- data/ext/{gsl → gsl_native}/geometry.c +15 -15
- data/ext/{gsl → gsl_native}/graph.c +37 -87
- data/ext/{gsl → gsl_native}/gsl.c +10 -23
- data/ext/{gsl → gsl_native}/gsl_narray.c +15 -24
- data/ext/{gsl → gsl_native}/histogram.c +123 -150
- data/ext/{gsl → gsl_native}/histogram2d.c +71 -96
- data/ext/{gsl → gsl_native}/histogram3d.c +72 -72
- data/ext/{gsl → gsl_native}/histogram3d_source.c +195 -196
- data/ext/{gsl → gsl_native}/histogram_find.c +31 -33
- data/ext/{gsl → gsl_native}/histogram_oper.c +43 -52
- data/ext/{gsl → gsl_native}/ieee.c +7 -15
- data/ext/{gsl → gsl_native}/include/rb_gsl.h +0 -7
- data/ext/{gsl → gsl_native}/include/rb_gsl_array.h +15 -25
- data/ext/{gsl → gsl_native}/include/rb_gsl_cheb.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_common.h +44 -52
- data/ext/{gsl → gsl_native}/include/rb_gsl_complex.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_const.h +0 -5
- data/ext/{gsl → gsl_native}/include/rb_gsl_dirac.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_eigen.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_fft.h +0 -3
- data/ext/{gsl → gsl_native}/include/rb_gsl_fit.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_function.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_graph.h +2 -2
- data/ext/{gsl → gsl_native}/include/rb_gsl_histogram.h +8 -8
- data/ext/{gsl → gsl_native}/include/rb_gsl_histogram3d.h +50 -50
- data/ext/{gsl → gsl_native}/include/rb_gsl_integration.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_interp.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_linalg.h +0 -1
- data/ext/{gsl → gsl_native}/include/rb_gsl_math.h +0 -4
- data/ext/{gsl → gsl_native}/include/rb_gsl_odeiv.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_poly.h +3 -3
- data/ext/{gsl → gsl_native}/include/rb_gsl_rational.h +1 -1
- data/ext/{gsl → gsl_native}/include/rb_gsl_rng.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_root.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_sf.h +39 -43
- data/ext/{gsl → gsl_native}/include/rb_gsl_statistics.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_tensor.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_with_narray.h +0 -0
- data/ext/{gsl → gsl_native}/include/templates_off.h +0 -0
- data/ext/{gsl → gsl_native}/include/templates_on.h +1 -1
- data/ext/{gsl → gsl_native}/integration.c +160 -183
- data/ext/{gsl → gsl_native}/interp.c +23 -31
- data/ext/gsl_native/jacobi.c +733 -0
- data/ext/{gsl → gsl_native}/linalg.c +448 -576
- data/ext/{gsl → gsl_native}/linalg_complex.c +84 -98
- data/ext/{gsl → gsl_native}/math.c +45 -63
- data/ext/{gsl → gsl_native}/matrix.c +4 -6
- data/ext/{gsl → gsl_native}/matrix_complex.c +111 -114
- data/ext/{gsl → gsl_native}/matrix_double.c +74 -77
- data/ext/{gsl → gsl_native}/matrix_int.c +49 -50
- data/ext/{gsl/matrix_source.c → gsl_native/matrix_source.h} +280 -302
- data/ext/{gsl → gsl_native}/min.c +43 -74
- data/ext/{gsl → gsl_native}/monte.c +45 -59
- data/ext/{gsl → gsl_native}/multifit.c +138 -147
- data/ext/{gsl → gsl_native}/multimin.c +55 -83
- data/ext/{gsl → gsl_native}/multimin_fsdf.c +15 -15
- data/ext/{gsl → gsl_native}/multiroots.c +61 -64
- data/ext/{gsl → gsl_native}/multiset.c +3 -7
- data/ext/{gsl → gsl_native}/ndlinear.c +320 -321
- data/ext/{gsl → gsl_native}/nmf.c +11 -11
- data/ext/{gsl → gsl_native}/nmf_wrap.c +1 -1
- data/ext/{gsl → gsl_native}/ntuple.c +13 -13
- data/ext/{gsl → gsl_native}/odeiv.c +95 -106
- data/ext/gsl_native/ool.c +879 -0
- data/ext/{gsl → gsl_native}/permutation.c +36 -34
- data/ext/{gsl → gsl_native}/poly.c +2 -5
- data/ext/{gsl → gsl_native}/poly2.c +6 -6
- data/ext/{gsl/poly_source.c → gsl_native/poly_source.h} +232 -275
- data/ext/{gsl → gsl_native}/qrng.c +6 -17
- data/ext/{gsl → gsl_native}/randist.c +218 -243
- data/ext/{gsl → gsl_native}/rational.c +9 -9
- data/ext/{gsl → gsl_native}/rng.c +29 -45
- data/ext/{gsl → gsl_native}/root.c +43 -43
- data/ext/{gsl → gsl_native}/sf.c +163 -197
- data/ext/{gsl → gsl_native}/sf_airy.c +0 -0
- data/ext/{gsl → gsl_native}/sf_bessel.c +6 -6
- data/ext/{gsl → gsl_native}/sf_clausen.c +0 -0
- data/ext/{gsl → gsl_native}/sf_coulomb.c +39 -39
- data/ext/{gsl → gsl_native}/sf_coupling.c +29 -29
- data/ext/{gsl → gsl_native}/sf_dawson.c +0 -0
- data/ext/{gsl → gsl_native}/sf_debye.c +0 -9
- data/ext/{gsl → gsl_native}/sf_dilog.c +0 -0
- data/ext/{gsl → gsl_native}/sf_elementary.c +2 -2
- data/ext/{gsl → gsl_native}/sf_ellint.c +42 -42
- data/ext/{gsl → gsl_native}/sf_elljac.c +2 -2
- data/ext/{gsl → gsl_native}/sf_erfc.c +0 -4
- data/ext/{gsl → gsl_native}/sf_exp.c +2 -2
- data/ext/{gsl → gsl_native}/sf_expint.c +1 -11
- data/ext/{gsl → gsl_native}/sf_fermi_dirac.c +0 -0
- data/ext/{gsl → gsl_native}/sf_gamma.c +1 -5
- data/ext/{gsl → gsl_native}/sf_gegenbauer.c +0 -0
- data/ext/{gsl → gsl_native}/sf_hyperg.c +0 -0
- data/ext/{gsl → gsl_native}/sf_laguerre.c +3 -3
- data/ext/{gsl → gsl_native}/sf_lambert.c +0 -0
- data/ext/{gsl → gsl_native}/sf_legendre.c +0 -0
- data/ext/{gsl → gsl_native}/sf_log.c +3 -3
- data/ext/gsl_native/sf_mathieu.c +235 -0
- data/ext/{gsl → gsl_native}/sf_power.c +0 -0
- data/ext/{gsl → gsl_native}/sf_psi.c +2 -11
- data/ext/{gsl → gsl_native}/sf_synchrotron.c +0 -0
- data/ext/{gsl → gsl_native}/sf_transport.c +0 -0
- data/ext/{gsl → gsl_native}/sf_trigonometric.c +3 -3
- data/ext/{gsl → gsl_native}/sf_zeta.c +0 -4
- data/ext/{gsl → gsl_native}/signal.c +60 -64
- data/ext/{gsl → gsl_native}/siman.c +36 -40
- data/ext/{gsl → gsl_native}/sort.c +3 -4
- data/ext/{gsl → gsl_native}/spline.c +25 -43
- data/ext/{gsl → gsl_native}/stats.c +102 -115
- data/ext/{gsl → gsl_native}/sum.c +32 -32
- data/ext/{gsl → gsl_native}/tamu_anova.c +0 -0
- data/ext/{gsl → gsl_native}/tensor.c +2 -4
- data/ext/{gsl/tensor_source.c → gsl_native/tensor_source.h} +144 -144
- data/ext/{gsl → gsl_native}/vector.c +2 -4
- data/ext/{gsl → gsl_native}/vector_complex.c +165 -171
- data/ext/{gsl → gsl_native}/vector_double.c +167 -174
- data/ext/{gsl → gsl_native}/vector_int.c +23 -25
- data/ext/{gsl/vector_source.c → gsl_native/vector_source.h} +400 -414
- data/ext/{gsl → gsl_native}/wavelet.c +215 -236
- data/lib/gsl.rb +1 -7
- data/lib/gsl/gnuplot.rb +2 -2
- data/lib/gsl/version.rb +1 -3
- data/rb-gsl.gemspec +29 -0
- data/rdoc/blas.rdoc +3 -3
- data/rdoc/bspline.rdoc +7 -7
- data/rdoc/cheb.rdoc +8 -8
- data/rdoc/cholesky_complex.rdoc +1 -1
- data/rdoc/combi.rdoc +9 -9
- data/rdoc/complex.rdoc +11 -11
- data/rdoc/const.rdoc +20 -20
- data/rdoc/dht.rdoc +6 -6
- data/rdoc/diff.rdoc +6 -6
- data/rdoc/ehandling.rdoc +3 -3
- data/rdoc/eigen.rdoc +11 -11
- data/rdoc/fft.rdoc +26 -26
- data/rdoc/fit.rdoc +18 -18
- data/rdoc/graph.rdoc +2 -2
- data/rdoc/hist.rdoc +16 -16
- data/rdoc/hist2d.rdoc +4 -4
- data/rdoc/hist3d.rdoc +3 -3
- data/rdoc/integration.rdoc +16 -16
- data/rdoc/interp.rdoc +11 -11
- data/rdoc/intro.rdoc +3 -3
- data/rdoc/linalg.rdoc +20 -20
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +13 -13
- data/rdoc/matrix.rdoc +22 -22
- data/rdoc/min.rdoc +9 -9
- data/rdoc/monte.rdoc +3 -3
- data/rdoc/multimin.rdoc +12 -12
- data/rdoc/multiroot.rdoc +12 -12
- data/rdoc/narray.rdoc +9 -9
- data/rdoc/ndlinear.rdoc +4 -4
- data/rdoc/nonlinearfit.rdoc +17 -17
- data/rdoc/ntuple.rdoc +5 -5
- data/rdoc/odeiv.rdoc +12 -12
- data/rdoc/perm.rdoc +11 -11
- data/rdoc/poly.rdoc +17 -17
- data/rdoc/qrng.rdoc +9 -9
- data/rdoc/randist.rdoc +10 -10
- data/rdoc/ref.rdoc +49 -49
- data/rdoc/rng.rdoc +9 -9
- data/rdoc/roots.rdoc +12 -12
- data/rdoc/sf.rdoc +35 -35
- data/rdoc/siman.rdoc +3 -3
- data/rdoc/sort.rdoc +6 -6
- data/rdoc/start.rdoc +2 -2
- data/rdoc/stats.rdoc +13 -13
- data/rdoc/sum.rdoc +4 -4
- data/rdoc/tensor.rdoc +3 -3
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +3 -3
- data/rdoc/vector.rdoc +28 -28
- data/rdoc/vector_complex.rdoc +6 -6
- data/rdoc/wavelet.rdoc +8 -8
- data/test/gsl/blas_test.rb +1 -1
- data/test/gsl/index_test.rb +61 -0
- data/test/gsl/matrix_test.rb +21 -0
- data/uncrustify.cfg +1693 -0
- metadata +212 -243
- data/README +0 -28
- data/ext/gsl/bspline.c +0 -130
- data/ext/gsl/const.c +0 -672
- data/ext/gsl/cqp.c +0 -283
- data/ext/gsl/fcmp.c +0 -64
- data/ext/gsl/fresnel.c +0 -312
- data/ext/gsl/jacobi.c +0 -739
- data/ext/gsl/ool.c +0 -879
- data/ext/gsl/oper_complex_source.c +0 -251
- data/ext/gsl/sf_mathieu.c +0 -238
- data/rdoc/index.rdoc +0 -50
@@ -1,7 +1,5 @@
|
|
1
1
|
#include "include/rb_gsl.h"
|
2
2
|
|
3
|
-
#ifdef GSL_1_14_LATER
|
4
|
-
|
5
3
|
VALUE cMultiset;
|
6
4
|
|
7
5
|
VALUE rb_gsl_multiset_alloc(VALUE klass, VALUE nn, VALUE kk)
|
@@ -18,7 +16,7 @@ VALUE rb_gsl_multiset_calloc(VALUE klass, VALUE nn, VALUE kk)
|
|
18
16
|
m = gsl_multiset_alloc(FIX2INT(nn), FIX2INT(kk));
|
19
17
|
return Data_Wrap_Struct(klass, 0, gsl_multiset_free, m);
|
20
18
|
}
|
21
|
-
|
19
|
+
|
22
20
|
VALUE rb_gsl_multiset_init_first(VALUE mm)
|
23
21
|
{
|
24
22
|
gsl_multiset *m;
|
@@ -180,14 +178,14 @@ VALUE rb_gsl_multiset_data2(VALUE mm, VALUE i)
|
|
180
178
|
p = gsl_multiset_data(m);
|
181
179
|
return INT2FIX(p[i]);
|
182
180
|
}
|
183
|
-
|
181
|
+
|
184
182
|
void Init_multiset(VALUE module)
|
185
183
|
{
|
186
184
|
cMultiset = rb_define_class_under(module, "Multiset", cGSL_Object);
|
187
185
|
rb_define_singleton_method(cMultiset, "alloc", rb_gsl_multiset_alloc, 2);
|
188
186
|
rb_define_singleton_method(cMultiset, "calloc", rb_gsl_multiset_calloc, 2);
|
189
187
|
rb_define_singleton_method(cMultiset, "memcpy", rb_gsl_multiset_memcpy, 2);
|
190
|
-
|
188
|
+
|
191
189
|
rb_define_method(cMultiset, "init_first", rb_gsl_multiset_init_first, 0);
|
192
190
|
rb_define_method(cMultiset, "init_last", rb_gsl_multiset_init_last, 0);
|
193
191
|
|
@@ -210,5 +208,3 @@ void Init_multiset(VALUE module)
|
|
210
208
|
rb_define_method(cMultiset, "fscanf", rb_gsl_multiset_fscanf, 1);
|
211
209
|
}
|
212
210
|
|
213
|
-
#endif
|
214
|
-
|
@@ -1,321 +1,320 @@
|
|
1
|
-
#include "include/rb_gsl.h"
|
2
|
-
|
3
|
-
#ifdef HAVE_NDLINEAR_GSL_MULTIFIT_NDLINEAR_H
|
4
|
-
#include <gsl/gsl_math.h>
|
5
|
-
#include <gsl/gsl_matrix.h>
|
6
|
-
#include <gsl/gsl_vector.h>
|
7
|
-
#include <gsl/gsl_multifit.h>
|
8
|
-
#include <ndlinear/gsl_multifit_ndlinear.h>
|
9
|
-
|
10
|
-
static VALUE cWorkspace;
|
11
|
-
|
12
|
-
enum Index_Ndlinear {
|
13
|
-
INDEX_NDIM = 0,
|
14
|
-
INDEX_N = 1,
|
15
|
-
INDEX_PROCS = 2,
|
16
|
-
INDEX_PARAMS = 3,
|
17
|
-
INDEX_FUNCS = 4,
|
18
|
-
INDEX_NDIM_I = 5,
|
19
|
-
|
20
|
-
NDLINEAR_ARY_SIZE = 6,
|
21
|
-
};
|
22
|
-
|
23
|
-
static void multifit_ndlinear_mark(gsl_multifit_ndlinear_workspace *w)
|
24
|
-
{
|
25
|
-
rb_gc_mark((VALUE) w->params);
|
26
|
-
}
|
27
|
-
|
28
|
-
typedef int (*UFUNC)(double, double[], void*);
|
29
|
-
typedef struct ufunc_struct
|
30
|
-
{
|
31
|
-
UFUNC *fptr;
|
32
|
-
} ufunc_struct;
|
33
|
-
|
34
|
-
static VALUE cUFunc;
|
35
|
-
static ufunc_struct* ufunc_struct_alloc(size_t n_dim) {
|
36
|
-
ufunc_struct *p;
|
37
|
-
p = (ufunc_struct*) malloc(sizeof(ufunc_struct));
|
38
|
-
p->fptr = malloc(sizeof(UFUNC)*n_dim);
|
39
|
-
return p;
|
40
|
-
}
|
41
|
-
static void ufunc_struct_free(ufunc_struct *p)
|
42
|
-
{
|
43
|
-
free(p->fptr);
|
44
|
-
free(p);
|
45
|
-
}
|
46
|
-
|
47
|
-
static int func_u(double x, double y[], void *data);
|
48
|
-
static VALUE rb_gsl_multifit_ndlinear_alloc(int argc, VALUE *argv, VALUE klass)
|
49
|
-
{
|
50
|
-
gsl_multifit_ndlinear_workspace *w;
|
51
|
-
int istart = 0;
|
52
|
-
size_t n_dim = 0, *N, i;
|
53
|
-
struct ufunc_struct *p;
|
54
|
-
VALUE params, wspace, pp;
|
55
|
-
switch (argc) {
|
56
|
-
case 4:
|
57
|
-
istart = 1;
|
58
|
-
CHECK_FIXNUM(argv[0]);
|
59
|
-
n_dim = FIX2INT(argv[0]);
|
60
|
-
|
61
|
-
case 3:
|
62
|
-
if (TYPE(argv[istart]) != T_ARRAY) {
|
63
|
-
rb_raise(rb_eTypeError, "Wrong argument type %s (Array expected)",
|
64
|
-
|
65
|
-
}
|
66
|
-
if (TYPE(argv[istart+1]) != T_ARRAY) {
|
67
|
-
rb_raise(rb_eTypeError, "Wrong argument type %s (Array expected)",
|
68
|
-
|
69
|
-
}
|
70
|
-
// n_dim = RARRAY(argv[istart])->len;
|
71
|
-
n_dim = RARRAY_LEN(argv[istart]);
|
72
|
-
N = (size_t*) malloc(sizeof(size_t)*n_dim);
|
73
|
-
break;
|
74
|
-
default:
|
75
|
-
rb_raise(rb_eArgError, "Wrong number of arguments (%d for 3 or 4)", argc);
|
76
|
-
}
|
77
|
-
for (i = 0; i < n_dim; i++) {
|
78
|
-
N[i] = FIX2INT(rb_ary_entry(argv[istart], i));
|
79
|
-
}
|
80
|
-
|
81
|
-
params
|
82
|
-
rb_ary_store(params,
|
83
|
-
rb_ary_store(params,
|
84
|
-
rb_ary_store(params,
|
85
|
-
rb_ary_store(params,
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
ytmp.vector.
|
117
|
-
ytmp.vector.
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
i
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
case
|
138
|
-
case
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
case
|
185
|
-
case
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
CHECK_VECTOR(argv[
|
201
|
-
|
202
|
-
|
203
|
-
Data_Get_Struct(argv[
|
204
|
-
Data_Get_Struct(argv[
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
case
|
222
|
-
case
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
CHECK_VECTOR(argv[
|
239
|
-
|
240
|
-
Data_Get_Struct(argv[
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
gsl_multifit_ndlinear_workspace
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
gsl_multifit_ndlinear_workspace
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
ary
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
chisq
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
rb_define_method(cWorkspace, "
|
314
|
-
rb_define_method(cWorkspace, "
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
1
|
+
#include "include/rb_gsl.h"
|
2
|
+
|
3
|
+
#ifdef HAVE_NDLINEAR_GSL_MULTIFIT_NDLINEAR_H
|
4
|
+
#include <gsl/gsl_math.h>
|
5
|
+
#include <gsl/gsl_matrix.h>
|
6
|
+
#include <gsl/gsl_vector.h>
|
7
|
+
#include <gsl/gsl_multifit.h>
|
8
|
+
#include <ndlinear/gsl_multifit_ndlinear.h>
|
9
|
+
|
10
|
+
static VALUE cWorkspace;
|
11
|
+
|
12
|
+
enum Index_Ndlinear {
|
13
|
+
INDEX_NDIM = 0,
|
14
|
+
INDEX_N = 1,
|
15
|
+
INDEX_PROCS = 2,
|
16
|
+
INDEX_PARAMS = 3,
|
17
|
+
INDEX_FUNCS = 4,
|
18
|
+
INDEX_NDIM_I = 5,
|
19
|
+
|
20
|
+
NDLINEAR_ARY_SIZE = 6,
|
21
|
+
};
|
22
|
+
|
23
|
+
static void multifit_ndlinear_mark(gsl_multifit_ndlinear_workspace *w)
|
24
|
+
{
|
25
|
+
rb_gc_mark((VALUE) w->params);
|
26
|
+
}
|
27
|
+
|
28
|
+
typedef int (*UFUNC)(double, double[], void*);
|
29
|
+
typedef struct ufunc_struct
|
30
|
+
{
|
31
|
+
UFUNC *fptr;
|
32
|
+
} ufunc_struct;
|
33
|
+
|
34
|
+
static VALUE cUFunc;
|
35
|
+
static ufunc_struct* ufunc_struct_alloc(size_t n_dim) {
|
36
|
+
ufunc_struct *p;
|
37
|
+
p = (ufunc_struct*) malloc(sizeof(ufunc_struct));
|
38
|
+
p->fptr = malloc(sizeof(UFUNC)*n_dim);
|
39
|
+
return p;
|
40
|
+
}
|
41
|
+
static void ufunc_struct_free(ufunc_struct *p)
|
42
|
+
{
|
43
|
+
free(p->fptr);
|
44
|
+
free(p);
|
45
|
+
}
|
46
|
+
|
47
|
+
static int func_u(double x, double y[], void *data);
|
48
|
+
static VALUE rb_gsl_multifit_ndlinear_alloc(int argc, VALUE *argv, VALUE klass)
|
49
|
+
{
|
50
|
+
gsl_multifit_ndlinear_workspace *w;
|
51
|
+
int istart = 0;
|
52
|
+
size_t n_dim = 0, *N, i;
|
53
|
+
struct ufunc_struct *p;
|
54
|
+
VALUE params, wspace, pp;
|
55
|
+
switch (argc) {
|
56
|
+
case 4:
|
57
|
+
istart = 1;
|
58
|
+
CHECK_FIXNUM(argv[0]);
|
59
|
+
n_dim = FIX2INT(argv[0]);
|
60
|
+
/* no break */
|
61
|
+
case 3:
|
62
|
+
if (TYPE(argv[istart]) != T_ARRAY) {
|
63
|
+
rb_raise(rb_eTypeError, "Wrong argument type %s (Array expected)",
|
64
|
+
rb_class2name(CLASS_OF(argv[istart])));
|
65
|
+
}
|
66
|
+
if (TYPE(argv[istart+1]) != T_ARRAY) {
|
67
|
+
rb_raise(rb_eTypeError, "Wrong argument type %s (Array expected)",
|
68
|
+
rb_class2name(CLASS_OF(argv[istart+1])));
|
69
|
+
}
|
70
|
+
// n_dim = RARRAY(argv[istart])->len;
|
71
|
+
n_dim = RARRAY_LEN(argv[istart]);
|
72
|
+
N = (size_t*) malloc(sizeof(size_t)*n_dim);
|
73
|
+
break;
|
74
|
+
default:
|
75
|
+
rb_raise(rb_eArgError, "Wrong number of arguments (%d for 3 or 4)", argc);
|
76
|
+
}
|
77
|
+
for (i = 0; i < n_dim; i++) {
|
78
|
+
N[i] = FIX2INT(rb_ary_entry(argv[istart], i));
|
79
|
+
}
|
80
|
+
params = rb_ary_new2(NDLINEAR_ARY_SIZE);
|
81
|
+
rb_ary_store(params, INDEX_NDIM, INT2FIX((int) n_dim));
|
82
|
+
rb_ary_store(params, INDEX_N, argv[istart]); /* N */
|
83
|
+
rb_ary_store(params, INDEX_PROCS, argv[istart+1]); /* procs */
|
84
|
+
rb_ary_store(params, INDEX_PARAMS, argv[istart+2]); /* params */
|
85
|
+
rb_ary_store(params, INDEX_NDIM_I, INT2FIX(0)); /* for the first parameter */
|
86
|
+
|
87
|
+
p = ufunc_struct_alloc(n_dim);
|
88
|
+
for (i = 0; i < n_dim; i++) p->fptr[i] = func_u;
|
89
|
+
pp = Data_Wrap_Struct(cUFunc, 0, ufunc_struct_free, p);
|
90
|
+
rb_ary_store(params, INDEX_FUNCS, pp);
|
91
|
+
|
92
|
+
w = gsl_multifit_ndlinear_alloc(n_dim, N, p->fptr, (void*) params);
|
93
|
+
|
94
|
+
free((size_t*) N);
|
95
|
+
|
96
|
+
wspace = Data_Wrap_Struct(cWorkspace, multifit_ndlinear_mark, gsl_multifit_ndlinear_free, w);
|
97
|
+
|
98
|
+
return wspace;
|
99
|
+
}
|
100
|
+
|
101
|
+
static int func_u(double x, double y[], void *data)
|
102
|
+
{
|
103
|
+
VALUE ary, vN, procs, proc, vy, params;
|
104
|
+
gsl_vector_view ytmp;
|
105
|
+
size_t i, n_dim;
|
106
|
+
int rslt;
|
107
|
+
ary = (VALUE) data;
|
108
|
+
n_dim = FIX2INT(rb_ary_entry(ary, INDEX_NDIM));
|
109
|
+
vN = rb_ary_entry(ary, INDEX_N);
|
110
|
+
procs = rb_ary_entry(ary, INDEX_PROCS);
|
111
|
+
params = rb_ary_entry(ary, INDEX_PARAMS);
|
112
|
+
i = FIX2INT(rb_ary_entry(ary, INDEX_NDIM_I));
|
113
|
+
proc = rb_ary_entry(procs, i);
|
114
|
+
|
115
|
+
ytmp.vector.data = (double*) y;
|
116
|
+
ytmp.vector.stride = 1;
|
117
|
+
ytmp.vector.size = FIX2INT(rb_ary_entry(vN, i));
|
118
|
+
vy = Data_Wrap_Struct(cgsl_vector_view, 0, NULL, &ytmp);
|
119
|
+
|
120
|
+
rslt = rb_funcall((VALUE) proc, RBGSL_ID_call, 3, rb_float_new(x), vy, params);
|
121
|
+
|
122
|
+
/* for the next parameter */
|
123
|
+
i += 1;
|
124
|
+
if (i == n_dim) i = 0;
|
125
|
+
rb_ary_store(ary, INDEX_NDIM_I, INT2FIX(i));
|
126
|
+
|
127
|
+
return GSL_SUCCESS;
|
128
|
+
}
|
129
|
+
|
130
|
+
static VALUE rb_gsl_multifit_ndlinear_design(int argc, VALUE *argv, VALUE obj)
|
131
|
+
{
|
132
|
+
gsl_multifit_ndlinear_workspace *w;
|
133
|
+
gsl_matrix *vars = NULL, *X = NULL;
|
134
|
+
int argc2, flag = 0, ret;
|
135
|
+
switch (TYPE(obj)) {
|
136
|
+
case T_MODULE:
|
137
|
+
case T_CLASS:
|
138
|
+
case T_OBJECT:
|
139
|
+
if (!rb_obj_is_kind_of(argv[argc-1], cWorkspace)) {
|
140
|
+
rb_raise(rb_eTypeError, "Wrong argument type %s (GSL::MultiFit::Ndlinear::Workspace expected)",
|
141
|
+
rb_class2name(CLASS_OF(argv[argc-1])));
|
142
|
+
}
|
143
|
+
Data_Get_Struct(argv[argc-1], gsl_multifit_ndlinear_workspace, w);
|
144
|
+
argc2 = argc-1;
|
145
|
+
break;
|
146
|
+
default:
|
147
|
+
Data_Get_Struct(obj, gsl_multifit_ndlinear_workspace, w);
|
148
|
+
argc2 = argc;
|
149
|
+
}
|
150
|
+
switch (argc2) {
|
151
|
+
case 1:
|
152
|
+
CHECK_MATRIX(argv[0]);
|
153
|
+
Data_Get_Struct(argv[0], gsl_matrix, vars);
|
154
|
+
X = gsl_matrix_alloc(vars->size1, w->n_coeffs);
|
155
|
+
flag = 1;
|
156
|
+
break;
|
157
|
+
case 2:
|
158
|
+
CHECK_MATRIX(argv[0]);
|
159
|
+
CHECK_MATRIX(argv[1]);
|
160
|
+
Data_Get_Struct(argv[0], gsl_matrix, vars);
|
161
|
+
Data_Get_Struct(argv[1], gsl_matrix, X);
|
162
|
+
break;
|
163
|
+
default:
|
164
|
+
rb_raise(rb_eArgError, "Wrong number of arguments.");
|
165
|
+
}
|
166
|
+
ret = gsl_multifit_ndlinear_design(vars, X, w);
|
167
|
+
|
168
|
+
if (flag == 1) {
|
169
|
+
return Data_Wrap_Struct(cgsl_matrix, 0, gsl_matrix_free, X);
|
170
|
+
} else {
|
171
|
+
return INT2FIX(ret);
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
static VALUE rb_gsl_multifit_ndlinear_est(int argc, VALUE *argv, VALUE obj)
|
176
|
+
{
|
177
|
+
gsl_multifit_ndlinear_workspace *w;
|
178
|
+
gsl_vector *x = NULL, *c = NULL;
|
179
|
+
gsl_matrix *cov = NULL;
|
180
|
+
double y, yerr;
|
181
|
+
int argc2;
|
182
|
+
switch (TYPE(obj)) {
|
183
|
+
case T_MODULE:
|
184
|
+
case T_CLASS:
|
185
|
+
case T_OBJECT:
|
186
|
+
if (!rb_obj_is_kind_of(argv[argc-1], cWorkspace)) {
|
187
|
+
rb_raise(rb_eTypeError, "Wrong argument type %s (GSL::MultiFit::Ndlinear::Workspace expected)",
|
188
|
+
rb_class2name(CLASS_OF(argv[argc-1])));
|
189
|
+
}
|
190
|
+
Data_Get_Struct(argv[argc-1], gsl_multifit_ndlinear_workspace, w);
|
191
|
+
argc2 = argc-1;
|
192
|
+
break;
|
193
|
+
default:
|
194
|
+
Data_Get_Struct(obj, gsl_multifit_ndlinear_workspace, w);
|
195
|
+
argc2 = argc;
|
196
|
+
}
|
197
|
+
switch (argc2) {
|
198
|
+
case 3:
|
199
|
+
CHECK_VECTOR(argv[0]);
|
200
|
+
CHECK_VECTOR(argv[1]);
|
201
|
+
CHECK_MATRIX(argv[2]);
|
202
|
+
Data_Get_Struct(argv[0], gsl_vector, x);
|
203
|
+
Data_Get_Struct(argv[1], gsl_vector, c);
|
204
|
+
Data_Get_Struct(argv[2], gsl_matrix, cov);
|
205
|
+
break;
|
206
|
+
default:
|
207
|
+
rb_raise(rb_eArgError, "Wrong number of arguments.");
|
208
|
+
}
|
209
|
+
gsl_multifit_ndlinear_est(x, c, cov, &y, &yerr, w);
|
210
|
+
return rb_ary_new3(2, rb_float_new(y), rb_float_new(yerr));
|
211
|
+
}
|
212
|
+
|
213
|
+
static VALUE rb_gsl_multifit_ndlinear_calc(int argc, VALUE *argv, VALUE obj)
|
214
|
+
{
|
215
|
+
gsl_multifit_ndlinear_workspace *w;
|
216
|
+
gsl_vector *x = NULL, *c = NULL;
|
217
|
+
double val;
|
218
|
+
int argc2;
|
219
|
+
switch (TYPE(obj)) {
|
220
|
+
case T_MODULE:
|
221
|
+
case T_CLASS:
|
222
|
+
case T_OBJECT:
|
223
|
+
if (!rb_obj_is_kind_of(argv[argc-1], cWorkspace)) {
|
224
|
+
rb_raise(rb_eTypeError,
|
225
|
+
"Wrong argument type %s (GSL::MultiFit::Ndlinear::Workspace expected)",
|
226
|
+
rb_class2name(CLASS_OF(argv[argc-1])));
|
227
|
+
}
|
228
|
+
Data_Get_Struct(argv[argc-1], gsl_multifit_ndlinear_workspace, w);
|
229
|
+
argc2 = argc-1;
|
230
|
+
break;
|
231
|
+
default:
|
232
|
+
Data_Get_Struct(obj, gsl_multifit_ndlinear_workspace, w);
|
233
|
+
argc2 = argc;
|
234
|
+
}
|
235
|
+
switch (argc2) {
|
236
|
+
case 2:
|
237
|
+
CHECK_VECTOR(argv[0]);
|
238
|
+
CHECK_VECTOR(argv[1]);
|
239
|
+
Data_Get_Struct(argv[0], gsl_vector, x);
|
240
|
+
Data_Get_Struct(argv[1], gsl_vector, c);
|
241
|
+
break;
|
242
|
+
default:
|
243
|
+
rb_raise(rb_eArgError, "Wrong number of arguments.");
|
244
|
+
}
|
245
|
+
val = gsl_multifit_ndlinear_calc(x, c, w);
|
246
|
+
return rb_float_new(val);
|
247
|
+
}
|
248
|
+
|
249
|
+
static VALUE rb_gsl_multifit_ndlinear_n_coeffs(VALUE obj)
|
250
|
+
{
|
251
|
+
gsl_multifit_ndlinear_workspace *w;
|
252
|
+
Data_Get_Struct(obj, gsl_multifit_ndlinear_workspace, w);
|
253
|
+
return INT2FIX(w->n_coeffs);
|
254
|
+
}
|
255
|
+
|
256
|
+
static VALUE rb_gsl_multifit_ndlinear_n_dim(VALUE obj)
|
257
|
+
{
|
258
|
+
gsl_multifit_ndlinear_workspace *w;
|
259
|
+
Data_Get_Struct(obj, gsl_multifit_ndlinear_workspace, w);
|
260
|
+
return INT2FIX(w->n_dim);
|
261
|
+
}
|
262
|
+
|
263
|
+
static VALUE rb_gsl_multifit_ndlinear_N(VALUE obj)
|
264
|
+
{
|
265
|
+
gsl_multifit_ndlinear_workspace *w;
|
266
|
+
VALUE ary;
|
267
|
+
Data_Get_Struct(obj, gsl_multifit_ndlinear_workspace, w);
|
268
|
+
ary = (VALUE) w->params;
|
269
|
+
return rb_ary_entry(ary, INDEX_N);
|
270
|
+
}
|
271
|
+
/*
|
272
|
+
static VALUE rb_gsl_multifit_linear_Rsq(VALUE module, VALUE vy, VALUE vchisq)
|
273
|
+
{
|
274
|
+
gsl_vector *y;
|
275
|
+
double chisq, Rsq;
|
276
|
+
CHECK_VECTOR(vy);
|
277
|
+
Data_Get_Struct(vy, gsl_vector, y);
|
278
|
+
chisq = NUM2DBL(vchisq);
|
279
|
+
gsl_multifit_linear_Rsq(y, chisq, &Rsq);
|
280
|
+
return rb_float_new(Rsq);
|
281
|
+
}
|
282
|
+
*/
|
283
|
+
void Init_ndlinear(VALUE module)
|
284
|
+
{
|
285
|
+
VALUE mNdlinear;
|
286
|
+
mNdlinear = rb_define_module_under(module, "Ndlinear");
|
287
|
+
cUFunc = rb_define_class_under(mNdlinear, "UFunc", rb_cObject);
|
288
|
+
cWorkspace = rb_define_class_under(mNdlinear, "Workspace", cGSL_Object);
|
289
|
+
|
290
|
+
rb_define_singleton_method(mNdlinear, "alloc",
|
291
|
+
rb_gsl_multifit_ndlinear_alloc, -1);
|
292
|
+
rb_define_singleton_method(cWorkspace, "alloc",
|
293
|
+
rb_gsl_multifit_ndlinear_alloc, -1);
|
294
|
+
|
295
|
+
rb_define_singleton_method(mNdlinear, "design",
|
296
|
+
rb_gsl_multifit_ndlinear_design, -1);
|
297
|
+
rb_define_singleton_method(cWorkspace, "design",
|
298
|
+
rb_gsl_multifit_ndlinear_design, -1);
|
299
|
+
rb_define_method(cWorkspace, "design",rb_gsl_multifit_ndlinear_est, -1);
|
300
|
+
rb_define_singleton_method(mNdlinear, "est",
|
301
|
+
rb_gsl_multifit_ndlinear_est, -1);
|
302
|
+
rb_define_singleton_method(cWorkspace, "est",
|
303
|
+
rb_gsl_multifit_ndlinear_est, -1);
|
304
|
+
rb_define_method(cWorkspace, "est",rb_gsl_multifit_ndlinear_est, -1);
|
305
|
+
|
306
|
+
rb_define_singleton_method(mNdlinear, "calc",
|
307
|
+
rb_gsl_multifit_ndlinear_calc, -1);
|
308
|
+
rb_define_singleton_method(cWorkspace, "calc",
|
309
|
+
rb_gsl_multifit_ndlinear_calc, -1);
|
310
|
+
rb_define_method(cWorkspace, "calc",rb_gsl_multifit_ndlinear_calc, -1);
|
311
|
+
|
312
|
+
rb_define_method(cWorkspace, "n_coeffs",rb_gsl_multifit_ndlinear_n_coeffs, 0);
|
313
|
+
rb_define_method(cWorkspace, "n_dim",rb_gsl_multifit_ndlinear_n_dim, 0);
|
314
|
+
rb_define_method(cWorkspace, "N",rb_gsl_multifit_ndlinear_N, 0);
|
315
|
+
|
316
|
+
// rb_define_module_function(module, "linear_Rsq", rb_gsl_multifit_linear_Rsq, 2);
|
317
|
+
}
|
318
|
+
|
319
|
+
#endif
|
320
|
+
|