rb-gsl 1.15.3.1 → 1.15.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHORS +2 -2
- data/ChangeLog +8 -0
- data/Rakefile +39 -96
- data/VERSION +1 -1
- data/ext/array.c +2 -2
- data/ext/block_source.c +1 -1
- data/ext/dirac.c +1 -1
- data/ext/eigen.c +13 -13
- data/ext/extconf.rb +17 -11
- data/ext/function.c +5 -5
- data/ext/gsl_narray.c +6 -6
- data/ext/histogram.c +7 -6
- data/ext/histogram2d.c +4 -4
- data/ext/interp.c +1 -1
- data/ext/linalg.c +13 -11
- data/ext/linalg_complex.c +8 -6
- data/ext/math.c +1 -1
- data/ext/matrix_complex.c +6 -6
- data/ext/matrix_source.c +10 -10
- data/ext/monte.c +2 -2
- data/ext/multimin.c +4 -4
- data/ext/multiroots.c +8 -8
- data/ext/nmf.c +6 -6
- data/ext/ntuple.c +4 -4
- data/ext/odeiv.c +2 -2
- data/ext/permutation.c +1 -1
- data/ext/poly2.c +6 -6
- data/ext/poly_source.c +9 -6
- data/ext/sf.c +31 -45
- data/ext/signal.c +2 -2
- data/ext/vector_complex.c +11 -10
- data/ext/vector_double.c +7 -4
- data/ext/vector_source.c +29 -26
- data/ext/wavelet.c +1 -1
- data/include/rb_gsl_common.h +12 -0
- data/include/rb_gsl_config.h +10 -1
- data/rdoc/blas.rdoc +4 -4
- data/rdoc/bspline.rdoc +8 -8
- data/rdoc/cheb.rdoc +9 -9
- data/rdoc/cholesky_complex.rdoc +1 -1
- data/rdoc/combi.rdoc +10 -10
- data/rdoc/complex.rdoc +12 -12
- data/rdoc/const.rdoc +21 -21
- data/rdoc/dht.rdoc +7 -7
- data/rdoc/diff.rdoc +7 -7
- data/rdoc/ehandling.rdoc +4 -4
- data/rdoc/eigen.rdoc +12 -12
- data/rdoc/fft.rdoc +27 -27
- data/rdoc/fit.rdoc +19 -19
- data/rdoc/function.rdoc +1 -1
- data/rdoc/graph.rdoc +3 -3
- data/rdoc/hist.rdoc +17 -17
- data/rdoc/hist2d.rdoc +5 -5
- data/rdoc/hist3d.rdoc +4 -4
- data/rdoc/index.rdoc +4 -4
- data/rdoc/integration.rdoc +17 -17
- data/rdoc/interp.rdoc +12 -12
- data/rdoc/intro.rdoc +4 -4
- data/rdoc/linalg.rdoc +21 -21
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +14 -14
- data/rdoc/matrix.rdoc +21 -21
- data/rdoc/min.rdoc +10 -10
- data/rdoc/monte.rdoc +4 -4
- data/rdoc/multimin.rdoc +13 -13
- data/rdoc/multiroot.rdoc +13 -13
- data/rdoc/narray.rdoc +10 -10
- data/rdoc/ndlinear.rdoc +5 -5
- data/rdoc/nonlinearfit.rdoc +18 -18
- data/rdoc/ntuple.rdoc +6 -6
- data/rdoc/odeiv.rdoc +13 -13
- data/rdoc/perm.rdoc +12 -12
- data/rdoc/poly.rdoc +18 -18
- data/rdoc/qrng.rdoc +10 -10
- data/rdoc/randist.rdoc +11 -11
- data/rdoc/ref.rdoc +50 -50
- data/rdoc/rng.rdoc +10 -10
- data/rdoc/rngextra.rdoc +5 -5
- data/rdoc/roots.rdoc +13 -13
- data/rdoc/sf.rdoc +36 -36
- data/rdoc/siman.rdoc +4 -4
- data/rdoc/sort.rdoc +7 -7
- data/rdoc/start.rdoc +1 -1
- data/rdoc/stats.rdoc +14 -14
- data/rdoc/sum.rdoc +5 -5
- data/rdoc/tensor.rdoc +4 -4
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +5 -5
- data/rdoc/vector.rdoc +29 -29
- data/rdoc/vector_complex.rdoc +6 -6
- data/rdoc/wavelet.rdoc +9 -9
- data/test/gsl/blas_test.rb +79 -0
- data/test/gsl/bspline_test.rb +63 -0
- data/test/gsl/cdf_test.rb +1512 -0
- data/test/gsl/cheb_test.rb +80 -0
- data/test/gsl/combination_test.rb +100 -0
- data/test/gsl/complex_test.rb +20 -0
- data/test/gsl/const_test.rb +29 -0
- data/test/gsl/deriv_test.rb +62 -0
- data/test/gsl/dht_test.rb +79 -0
- data/test/gsl/diff_test.rb +53 -0
- data/test/gsl/eigen_test.rb +563 -0
- data/test/gsl/err_test.rb +23 -0
- data/test/gsl/fit_test.rb +101 -0
- data/test/gsl/histo_test.rb +14 -0
- data/test/gsl/integration_test.rb +274 -0
- data/test/gsl/interp_test.rb +27 -0
- data/test/gsl/linalg_test.rb +463 -0
- data/test/gsl/matrix_nmf_test.rb +37 -0
- data/test/gsl/matrix_test.rb +77 -0
- data/test/gsl/min_test.rb +89 -0
- data/test/gsl/monte_test.rb +77 -0
- data/test/gsl/multifit_test.rb +753 -0
- data/test/gsl/multimin_test.rb +157 -0
- data/test/gsl/multiroot_test.rb +135 -0
- data/test/gsl/multiset_test.rb +52 -0
- data/test/gsl/odeiv_test.rb +275 -0
- data/test/gsl/poly_test.rb +338 -0
- data/test/gsl/qrng_test.rb +94 -0
- data/test/gsl/quartic_test.rb +28 -0
- data/test/gsl/randist_test.rb +122 -0
- data/test/gsl/rng_test.rb +303 -0
- data/test/gsl/roots_test.rb +78 -0
- data/test/gsl/sf_test.rb +2079 -0
- data/test/gsl/stats_test.rb +122 -0
- data/test/gsl/sum_test.rb +69 -0
- data/test/gsl/tensor_test.rb +396 -0
- data/test/gsl/vector_test.rb +223 -0
- data/test/gsl/wavelet_test.rb +130 -0
- data/test/gsl_test.rb +321 -0
- data/test/test_helper.rb +42 -0
- metadata +107 -150
- data/setup.rb +0 -1585
- data/tests/blas/amax.rb +0 -14
- data/tests/blas/asum.rb +0 -16
- data/tests/blas/axpy.rb +0 -25
- data/tests/blas/copy.rb +0 -23
- data/tests/blas/dot.rb +0 -23
- data/tests/bspline.rb +0 -53
- data/tests/cdf.rb +0 -1388
- data/tests/cheb.rb +0 -112
- data/tests/combination.rb +0 -123
- data/tests/complex.rb +0 -17
- data/tests/const.rb +0 -24
- data/tests/deriv.rb +0 -85
- data/tests/dht/dht1.rb +0 -17
- data/tests/dht/dht2.rb +0 -23
- data/tests/dht/dht3.rb +0 -23
- data/tests/dht/dht4.rb +0 -23
- data/tests/diff.rb +0 -78
- data/tests/eigen/eigen.rb +0 -220
- data/tests/eigen/gen.rb +0 -105
- data/tests/eigen/genherm.rb +0 -66
- data/tests/eigen/gensymm.rb +0 -68
- data/tests/eigen/nonsymm.rb +0 -53
- data/tests/eigen/nonsymmv.rb +0 -53
- data/tests/eigen/symm-herm.rb +0 -74
- data/tests/err.rb +0 -58
- data/tests/fit.rb +0 -124
- data/tests/gsl_test.rb +0 -118
- data/tests/gsl_test2.rb +0 -110
- data/tests/histo.rb +0 -12
- data/tests/integration/integration1.rb +0 -72
- data/tests/integration/integration2.rb +0 -71
- data/tests/integration/integration3.rb +0 -71
- data/tests/integration/integration4.rb +0 -71
- data/tests/interp.rb +0 -45
- data/tests/linalg/HH.rb +0 -64
- data/tests/linalg/LU.rb +0 -47
- data/tests/linalg/QR.rb +0 -77
- data/tests/linalg/SV.rb +0 -24
- data/tests/linalg/TDN.rb +0 -116
- data/tests/linalg/TDS.rb +0 -122
- data/tests/linalg/bidiag.rb +0 -73
- data/tests/linalg/cholesky.rb +0 -20
- data/tests/linalg/linalg.rb +0 -158
- data/tests/matrix/matrix_complex_test.rb +0 -36
- data/tests/matrix/matrix_nmf_test.rb +0 -39
- data/tests/matrix/matrix_test.rb +0 -48
- data/tests/min.rb +0 -99
- data/tests/monte/miser.rb +0 -31
- data/tests/monte/vegas.rb +0 -45
- data/tests/multifit/test_2dgauss.rb +0 -112
- data/tests/multifit/test_brown.rb +0 -90
- data/tests/multifit/test_enso.rb +0 -246
- data/tests/multifit/test_filip.rb +0 -155
- data/tests/multifit/test_gauss.rb +0 -97
- data/tests/multifit/test_longley.rb +0 -110
- data/tests/multifit/test_multifit.rb +0 -52
- data/tests/multimin.rb +0 -139
- data/tests/multiroot.rb +0 -131
- data/tests/multiset.rb +0 -52
- data/tests/narray/blas_dnrm2.rb +0 -20
- data/tests/odeiv.rb +0 -353
- data/tests/poly/poly.rb +0 -290
- data/tests/poly/special.rb +0 -65
- data/tests/qrng.rb +0 -131
- data/tests/quartic.rb +0 -29
- data/tests/randist.rb +0 -134
- data/tests/rng.rb +0 -305
- data/tests/roots.rb +0 -76
- data/tests/run-test.sh +0 -17
- data/tests/sf/gsl_test_sf.rb +0 -249
- data/tests/sf/test_airy.rb +0 -83
- data/tests/sf/test_bessel.rb +0 -306
- data/tests/sf/test_coulomb.rb +0 -17
- data/tests/sf/test_dilog.rb +0 -25
- data/tests/sf/test_gamma.rb +0 -209
- data/tests/sf/test_hyperg.rb +0 -356
- data/tests/sf/test_legendre.rb +0 -227
- data/tests/sf/test_mathieu.rb +0 -59
- data/tests/sf/test_mode.rb +0 -19
- data/tests/sf/test_sf.rb +0 -839
- data/tests/stats.rb +0 -174
- data/tests/stats_mt.rb +0 -16
- data/tests/sum.rb +0 -98
- data/tests/sys.rb +0 -323
- data/tests/tensor.rb +0 -419
- data/tests/vector/vector_complex_test.rb +0 -101
- data/tests/vector/vector_test.rb +0 -141
- data/tests/wavelet.rb +0 -142
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2881407d92b5a79d9a59dcef18de757e3b9bc52
|
4
|
+
data.tar.gz: f1c89f8bb663d1c65588d0254575fced093e6b2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbe15cdc58dc7e040309e91862b568eb3bd3144da086c9042867e80cf6a2da1a154ba125186dbaea39ce21f8f0a3dae50709b8dd24a4e287dbdddff44f247ddc
|
7
|
+
data.tar.gz: ee64e214328c06f4264adbfc254d408d46261050d3be142bf76bb8bf9e3a4ec6dacda77536634a20ec33d57b9288156ef5920fba4eb22f9c61d1d6cbfd3df3d6
|
data/AUTHORS
CHANGED
data/ChangeLog
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
Fri Jan 24 14:16:30 CET 2014
|
2
|
+
* Ruby/GSL 1.15.3.2
|
3
|
+
* Windows compatibility.
|
4
|
+
* Ruby 2.x compatibility.
|
5
|
+
* Ported tests to Test::Unit.
|
6
|
+
* Silenced compilation warnings.
|
7
|
+
* Switched to rake-compiler for compilation.
|
8
|
+
|
1
9
|
Sat Feb 26 08:18:45 PST 2011
|
2
10
|
* Ruby/GSL 1.14.7
|
3
11
|
* Fix conversion of non-DFLOAT NArray to GSL::Vector and
|
data/Rakefile
CHANGED
@@ -1,99 +1,42 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rubygems/package_task'
|
3
|
-
require 'rdoc/task'
|
4
|
-
|
5
1
|
RB_GSL_VERSION = File.readlines('VERSION')[0].chomp
|
6
2
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
#s.executables = []
|
47
|
-
#s.default_executable = nil
|
48
|
-
|
49
|
-
# C compilation
|
50
|
-
s.extensions = %w[ ext/extconf.rb ]
|
51
|
-
|
52
|
-
# Documentation
|
53
|
-
s.has_rdoc = true
|
54
|
-
s.rdoc_options = [
|
55
|
-
'--title', 'Ruby/GSL',
|
56
|
-
'--main', 'rdoc/index.rdoc',
|
57
|
-
'--exclude', 'ext/',
|
58
|
-
'--exclude', 'include/',
|
59
|
-
'--exclude', 'lib/',
|
60
|
-
]
|
61
|
-
s.extra_rdoc_files = FileList['rdoc/*'].to_a
|
62
|
-
|
63
|
-
# Testing TODO
|
64
|
-
#s.test_files = []
|
65
|
-
end
|
66
|
-
|
67
|
-
Rake::PackageTask.new('rb-gsl', RB_GSL_VERSION) do |pkg|
|
68
|
-
pkg.need_zip = true
|
69
|
-
pkg.need_tar = true
|
70
|
-
pkg.package_files = spec.files
|
71
|
-
end
|
72
|
-
|
73
|
-
Gem::PackageTask.new(spec) do |pkg|
|
74
|
-
pkg.need_zip = false
|
75
|
-
pkg.need_tar = false
|
76
|
-
end
|
77
|
-
|
78
|
-
task :default => [:package, :gem]
|
79
|
-
|
80
|
-
# --------------------------------------------------------------------
|
81
|
-
# Create a task to build the RDOC documentation tree.
|
82
|
-
|
83
|
-
desc "Create the RDoc html files"
|
84
|
-
Rake::RDocTask.new("rdoc") { |rdoc|
|
85
|
-
rdoc.rdoc_dir = 'html'
|
86
|
-
rdoc.title = 'Ruby/GSL'
|
87
|
-
rdoc.main = 'rdoc/index.rdoc'
|
88
|
-
rdoc.options << '--exclude' << 'ext/'
|
89
|
-
rdoc.options << '--exclude' << 'include/'
|
90
|
-
rdoc.options << '--exclude' << 'lib/'
|
91
|
-
rdoc.rdoc_files.include('rdoc/*.rdoc')
|
92
|
-
}
|
93
|
-
|
94
|
-
desc "Publish the RDoc files on RubyForge"
|
95
|
-
task :pub_rdoc => ["html/index.html"] do
|
96
|
-
mkdir_p "emptydir"
|
97
|
-
sh "scp -rq html/* www.rubyforge.org:/var/www/gforge-projects/rb-gsl/."
|
98
|
-
rm_r "emptydir"
|
3
|
+
begin
|
4
|
+
require 'hen'
|
5
|
+
|
6
|
+
Hen.lay! {{
|
7
|
+
:gem => {
|
8
|
+
:name => %q{rb-gsl},
|
9
|
+
:version => RB_GSL_VERSION,
|
10
|
+
:summary => %q{Ruby interface to the GNU Scientific Library [Ruby 2.x compatible fork]},
|
11
|
+
:description => %q{Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby},
|
12
|
+
:authors => ['Yoshiki Tsunesada', 'David MacMahon', 'Jens Wille'],
|
13
|
+
:email => %q{jens.wille@gmail.com},
|
14
|
+
:license => %q{GPL-2.0},
|
15
|
+
:homepage => :blackwinter,
|
16
|
+
:dependencies => [['narray', '>= 0.5.9']],
|
17
|
+
:requirements => ['GSL (http://www.gnu.org/software/gsl/)'],
|
18
|
+
:require_paths => %w[lib lib/gsl lib/ool ext],
|
19
|
+
|
20
|
+
:extra_files => FileList['examples/**/*', 'include/*', 'rdoc/*'].to_a,
|
21
|
+
|
22
|
+
:extension => {
|
23
|
+
:lib_dir => 'lib',
|
24
|
+
:ext_dir => 'ext',
|
25
|
+
:cross_compile => false
|
26
|
+
},
|
27
|
+
|
28
|
+
:required_ruby_version => '>= 1.8.1'
|
29
|
+
},
|
30
|
+
:rdoc => {
|
31
|
+
:title => 'Ruby/GSL{version: (v%s)}',
|
32
|
+
:rdoc_files => FileList['rdoc/*'].to_a,
|
33
|
+
:exclude => %w[ext include lib],
|
34
|
+
:main => 'rdoc/index.rdoc'
|
35
|
+
},
|
36
|
+
:test => {
|
37
|
+
:libs => %w[lib test]
|
38
|
+
}
|
39
|
+
}}
|
40
|
+
rescue LoadError => err
|
41
|
+
warn "Please install the `hen' gem. (#{err})"
|
99
42
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.15.3
|
1
|
+
1.15.3.2
|
data/ext/array.c
CHANGED
@@ -487,7 +487,7 @@ VALUE rb_gsl_range2vector(VALUE obj)
|
|
487
487
|
rb_class2name(CLASS_OF(obj)));
|
488
488
|
get_range_beg_en_n(obj, &beg, &en, &n, &step);
|
489
489
|
v = gsl_vector_alloc(n);
|
490
|
-
for (i = 0; i < n; i++) gsl_vector_set(v, i, (double) (beg+i));
|
490
|
+
for (i = 0; i < (int) n; i++) gsl_vector_set(v, i, (double) (beg+i));
|
491
491
|
return Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v);
|
492
492
|
}
|
493
493
|
|
@@ -502,7 +502,7 @@ VALUE rb_gsl_range2vector_int(VALUE obj)
|
|
502
502
|
rb_class2name(CLASS_OF(obj)));
|
503
503
|
get_range_int_beg_en_n(obj, &beg, &en, &n, &step);
|
504
504
|
v = gsl_vector_int_alloc(n);
|
505
|
-
for (i = 0; i < n; i++) gsl_vector_int_set(v, i, beg+i);
|
505
|
+
for (i = 0; i < (int) n; i++) gsl_vector_int_set(v, i, beg+i);
|
506
506
|
return Data_Wrap_Struct(cgsl_vector_int, 0, gsl_vector_int_free, v);
|
507
507
|
}
|
508
508
|
|
data/ext/block_source.c
CHANGED
@@ -230,7 +230,7 @@ static VALUE FUNCTION(rb_gsl_block,get)(int argc, VALUE *argv, VALUE obj)
|
|
230
230
|
break;
|
231
231
|
default:
|
232
232
|
bnew = FUNCTION(gsl_block,alloc)(argc);
|
233
|
-
for (j = 0; j < argc; j++) {
|
233
|
+
for (j = 0; (int) j < argc; j++) {
|
234
234
|
i = FIX2INT(argv[j]);
|
235
235
|
if (i < 0) k = b->size + i; else k = i;
|
236
236
|
bnew->data[j] = b->data[k];
|
data/ext/dirac.c
CHANGED
@@ -338,7 +338,7 @@ static VALUE rb_Dirac_matrix_whoami(int argc, VALUE *argv, VALUE obj)
|
|
338
338
|
VLambda[0], VLambda[1], VLambda[2], VLambda[3],
|
339
339
|
VLambda[4], VLambda[5], VLambda[6], VLambda[7]};
|
340
340
|
|
341
|
-
char *name[NUM] = {"Pauli1", "Pauli2", "Pauli3",
|
341
|
+
const char *name[NUM] = {"Pauli1", "Pauli2", "Pauli3",
|
342
342
|
"Gamma0", "Gamma1", "Gamma2", "Gamma3", "Gamma5",
|
343
343
|
"Eye2", "Eye4", "IEye2", "IEye4", "Lambda1", "Lambda2",
|
344
344
|
"Lambda3", "Lambda4", "Lambda5", "Lambda6",
|
data/ext/eigen.c
CHANGED
@@ -1060,8 +1060,8 @@ static VALUE rb_gsl_eigen_nonsymmv_narray(int argc, VALUE *argv, VALUE obj);
|
|
1060
1060
|
static VALUE rb_gsl_eigen_nonsymmv(int argc, VALUE *argv, VALUE obj)
|
1061
1061
|
{
|
1062
1062
|
gsl_matrix *m;
|
1063
|
-
gsl_vector_complex *v;
|
1064
|
-
gsl_matrix_complex *evec;
|
1063
|
+
gsl_vector_complex *v = NULL;
|
1064
|
+
gsl_matrix_complex *evec = NULL;
|
1065
1065
|
gsl_eigen_nonsymmv_workspace *w;
|
1066
1066
|
int vflag = 0, wflag = 0;
|
1067
1067
|
int istart = 0;
|
@@ -1196,9 +1196,9 @@ static VALUE rb_gsl_eigen_nonsymmv_narray(int argc, VALUE *argv, VALUE obj)
|
|
1196
1196
|
|
1197
1197
|
static VALUE rb_gsl_eigen_nonsymmv_Z(int argc, VALUE *argv, VALUE obj)
|
1198
1198
|
{
|
1199
|
-
gsl_matrix *m, *Z;
|
1200
|
-
gsl_vector_complex *v;
|
1201
|
-
gsl_matrix_complex *evec;
|
1199
|
+
gsl_matrix *m, *Z = NULL;
|
1200
|
+
gsl_vector_complex *v = NULL;
|
1201
|
+
gsl_matrix_complex *evec = NULL;
|
1202
1202
|
gsl_eigen_nonsymmv_workspace *w;
|
1203
1203
|
int vflag = 0, wflag = 0;
|
1204
1204
|
int istart = 0;
|
@@ -1571,7 +1571,7 @@ static VALUE rb_gsl_eigen_gensymm(int argc, VALUE *argv, VALUE obj)
|
|
1571
1571
|
gsl_vector *eval = NULL;
|
1572
1572
|
gsl_eigen_gensymm_workspace *w = NULL;
|
1573
1573
|
int flag;
|
1574
|
-
VALUE veval;
|
1574
|
+
VALUE veval = NULL;
|
1575
1575
|
flag = check_argv_gensymm(argc, argv, obj, &A, &B, &eval, &w);
|
1576
1576
|
Atmp = make_matrix_clone(A);
|
1577
1577
|
// Btmp = make_matrix_clone(B);
|
@@ -1606,7 +1606,7 @@ static VALUE rb_gsl_eigen_gensymmv(int argc, VALUE *argv, VALUE obj)
|
|
1606
1606
|
gsl_matrix *evec = NULL;
|
1607
1607
|
gsl_eigen_gensymmv_workspace *w = NULL;
|
1608
1608
|
int flag;
|
1609
|
-
VALUE veval, vevec;
|
1609
|
+
VALUE veval = NULL, vevec = NULL;
|
1610
1610
|
flag = check_argv_gensymmv(argc, argv, obj, &A, &B, &eval, &evec, &w);
|
1611
1611
|
Atmp = make_matrix_clone(A);
|
1612
1612
|
// Btmp = make_matrix_clone(B);
|
@@ -1645,7 +1645,7 @@ static VALUE rb_gsl_eigen_genherm(int argc, VALUE *argv, VALUE obj)
|
|
1645
1645
|
gsl_vector *eval = NULL;
|
1646
1646
|
gsl_eigen_genherm_workspace *w = NULL;
|
1647
1647
|
int flag;
|
1648
|
-
VALUE veval;
|
1648
|
+
VALUE veval = NULL;
|
1649
1649
|
flag = check_argv_genherm(argc, argv, obj, &A, &B, &eval, &w);
|
1650
1650
|
Atmp = make_matrix_complex_clone(A);
|
1651
1651
|
Btmp = make_matrix_complex_clone(B);
|
@@ -1680,7 +1680,7 @@ static VALUE rb_gsl_eigen_genhermv(int argc, VALUE *argv, VALUE obj)
|
|
1680
1680
|
gsl_matrix_complex *evec = NULL;
|
1681
1681
|
gsl_eigen_genhermv_workspace *w = NULL;
|
1682
1682
|
int flag;
|
1683
|
-
VALUE veval, vevec;
|
1683
|
+
VALUE veval = NULL, vevec = NULL;
|
1684
1684
|
flag = check_argv_genhermv(argc, argv, obj, &A, &B, &eval, &evec, &w);
|
1685
1685
|
Atmp = make_matrix_complex_clone(A);
|
1686
1686
|
Btmp = make_matrix_complex_clone(B);
|
@@ -1833,7 +1833,7 @@ static VALUE rb_gsl_eigen_gen(int argc, VALUE *argv, VALUE obj)
|
|
1833
1833
|
gsl_vector *beta = NULL;
|
1834
1834
|
gsl_eigen_gen_workspace *w = NULL;
|
1835
1835
|
int flag;
|
1836
|
-
VALUE valpha, vbeta;
|
1836
|
+
VALUE valpha = NULL, vbeta = NULL;
|
1837
1837
|
flag = check_argv_gen(argc, argv, obj, &A, &B, &alpha, &beta, &w);
|
1838
1838
|
// Atmp = make_matrix_clone(A);
|
1839
1839
|
// Btmp = make_matrix_clone(B);
|
@@ -1874,7 +1874,7 @@ static VALUE rb_gsl_eigen_gen_QZ(int argc, VALUE *argv, VALUE obj)
|
|
1874
1874
|
gsl_matrix *Q, *Z;
|
1875
1875
|
gsl_eigen_gen_workspace *w = NULL;
|
1876
1876
|
int flag;
|
1877
|
-
VALUE valpha, vbeta, vQ, vZ;
|
1877
|
+
VALUE valpha = NULL, vbeta = NULL, vQ, vZ;
|
1878
1878
|
flag = check_argv_gen(argc, argv, obj, &A, &B, &alpha, &beta, &w);
|
1879
1879
|
/* Atmp = make_matrix_clone(A);
|
1880
1880
|
Btmp = make_matrix_clone(B); */
|
@@ -1987,7 +1987,7 @@ static VALUE rb_gsl_eigen_genv(int argc, VALUE *argv, VALUE obj)
|
|
1987
1987
|
gsl_matrix_complex *evec = NULL;
|
1988
1988
|
gsl_eigen_genv_workspace *w = NULL;
|
1989
1989
|
int flag;
|
1990
|
-
VALUE valpha, vbeta, vevec;
|
1990
|
+
VALUE valpha = NULL, vbeta = NULL, vevec = NULL;
|
1991
1991
|
flag = check_argv_genv(argc, argv, obj, &A, &B, &alpha, &beta, &evec, &w);
|
1992
1992
|
// Atmp = make_matrix_clone(A);
|
1993
1993
|
// Btmp = make_matrix_clone(B);
|
@@ -2035,7 +2035,7 @@ static VALUE rb_gsl_eigen_genv_QZ(int argc, VALUE *argv, VALUE obj)
|
|
2035
2035
|
gsl_matrix *Q, *Z;
|
2036
2036
|
gsl_eigen_genv_workspace *w = NULL;
|
2037
2037
|
int flag;
|
2038
|
-
VALUE valpha, vbeta, vevec, vQ, vZ;
|
2038
|
+
VALUE valpha = NULL, vbeta = NULL, vevec = NULL, vQ, vZ;
|
2039
2039
|
flag = check_argv_genv(argc, argv, obj, &A, &B, &alpha, &beta, &evec, &w);
|
2040
2040
|
/* Atmp = make_matrix_clone(A);
|
2041
2041
|
Btmp = make_matrix_clone(B); */
|
data/ext/extconf.rb
CHANGED
@@ -125,7 +125,7 @@ def check_version(configfile)
|
|
125
125
|
configfile.printf("#ifndef GSL_1_11_LATER\n#define GSL_1_11_LATER\n#endif\n")
|
126
126
|
end
|
127
127
|
|
128
|
-
|
128
|
+
if ver >= "1.12.90"
|
129
129
|
configfile.printf("#ifndef GSL_1_13_LATER\n#define GSL_1_13_LATER\n#endif\n")
|
130
130
|
end
|
131
131
|
|
@@ -140,13 +140,17 @@ def check_version(configfile)
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
|
+
def file_path(path = '.')
|
144
|
+
File.expand_path(path, File.dirname(__FILE__))
|
145
|
+
end
|
146
|
+
|
143
147
|
#####
|
144
148
|
|
145
149
|
$CFLAGS ||= ''
|
146
|
-
$CFLAGS += " -Wall -I../include "
|
150
|
+
$CFLAGS += " -Wall -I#{file_path('../include')} "
|
147
151
|
|
148
152
|
begin
|
149
|
-
RB_GSL_CONFIG = File.open("../include/rb_gsl_config.h", "w")
|
153
|
+
RB_GSL_CONFIG = File.open(file_path("../include/rb_gsl_config.h"), "w")
|
150
154
|
RB_GSL_CONFIG.printf("#ifndef ___RB_GSL_CONFIG_H___\n")
|
151
155
|
RB_GSL_CONFIG.printf("#define ___RB_GSL_CONFIG_H___\n\n")
|
152
156
|
|
@@ -202,7 +206,7 @@ begin
|
|
202
206
|
|
203
207
|
begin
|
204
208
|
print("checking rb-gsl version...")
|
205
|
-
File.open("../VERSION") do |f|
|
209
|
+
File.open(file_path("../VERSION")) do |f|
|
206
210
|
ver = GSL::Version.new(f.gets.chomp)
|
207
211
|
puts(ver)
|
208
212
|
RB_GSL_CONFIG.printf("#ifndef RUBY_GSL_VERSION\n#define RUBY_GSL_VERSION \"#{ver}\"\n#endif\n")
|
@@ -223,7 +227,7 @@ begin
|
|
223
227
|
flag = 0
|
224
228
|
print("checking for GNU graph... ")
|
225
229
|
path.each do |dir|
|
226
|
-
if File.executable?(
|
230
|
+
if File.executable?(File.join(dir, "graph"))
|
227
231
|
puts("yes")
|
228
232
|
RB_GSL_CONFIG.printf("#ifndef HAVE_GNU_GRAPH\n#define HAVE_GNU_GRAPH\n#endif\n")
|
229
233
|
flag = 1
|
@@ -254,8 +258,8 @@ begin
|
|
254
258
|
require 'rubygems'
|
255
259
|
na_gemspec=Gem::Specification.find_by_path('narray.h')
|
256
260
|
if na_gemspec
|
257
|
-
narray_config =
|
258
|
-
$CPPFLAGS = " -I#{narray_config} "+$CPPFLAGS
|
261
|
+
narray_config = na_gemspec.full_gem_path
|
262
|
+
$CPPFLAGS = " -I#{File.join(narray_config, na_gemspec.require_path)} "+$CPPFLAGS
|
259
263
|
$LOCAL_LIBS = " -L#{File.join(narray_config, 'src')}" + $LOCAL_LIBS
|
260
264
|
end
|
261
265
|
rescue LoadError
|
@@ -268,9 +272,9 @@ if narray_config
|
|
268
272
|
end
|
269
273
|
end
|
270
274
|
|
271
|
-
|
275
|
+
unless arg_config('--disable-tamu-anova')
|
272
276
|
tamu_anova_config = dir_config('tamu_anova',$sitearchdir,$sitearchdir)
|
273
|
-
|
277
|
+
have_header("tamu_anova/tamu_anova.h")
|
274
278
|
if tamu_anova_config
|
275
279
|
have_library("tamuanova")
|
276
280
|
# if RUBY_PLATFORM =~ /cygwin|mingw/
|
@@ -279,7 +283,7 @@ if tamu_anova_config
|
|
279
283
|
end
|
280
284
|
end
|
281
285
|
|
282
|
-
File.open("../lib/gsl.rb", "w") do |file|
|
286
|
+
File.open(file_path("../lib/gsl.rb"), "w") do |file|
|
283
287
|
if have_narray_h
|
284
288
|
file.print("require('narray')\n")
|
285
289
|
end
|
@@ -288,7 +292,7 @@ File.open("../lib/gsl.rb", "w") do |file|
|
|
288
292
|
file.print("require('gsl/oper.rb')\n")
|
289
293
|
end
|
290
294
|
|
291
|
-
File.open("../lib/rbgsl.rb", "w") do |file|
|
295
|
+
File.open(file_path("../lib/rbgsl.rb"), "w") do |file|
|
292
296
|
if have_narray_h
|
293
297
|
file.print("require('narray')\n")
|
294
298
|
end
|
@@ -296,8 +300,10 @@ File.open("../lib/rbgsl.rb", "w") do |file|
|
|
296
300
|
file.print("require('gsl/oper.rb')\n")
|
297
301
|
end
|
298
302
|
|
303
|
+
Dir.chdir(file_path) {
|
299
304
|
srcs = Dir.glob("*.c") - ["vector_source.c", "matrix_source.c", "tensor_source.c", "poly_source.c", "block_source.c"]
|
300
305
|
|
301
306
|
$objs = srcs.collect { |f| f.sub(".c", ".o") }
|
307
|
+
}
|
302
308
|
|
303
309
|
create_makefile("rb_gsl")
|
data/ext/function.c
CHANGED
@@ -52,7 +52,7 @@ static VALUE rb_gsl_function_set_f(int argc, VALUE *argv, VALUE obj)
|
|
52
52
|
CHECK_PROC(argv[0]);
|
53
53
|
rb_ary_store(ary, 0, argv[0]);
|
54
54
|
ary2 = rb_ary_new2(argc-1);
|
55
|
-
for (i = 1; i < argc; i++) rb_ary_store(ary2, i-1, argv[i]);
|
55
|
+
for (i = 1; (int) i < argc; i++) rb_ary_store(ary2, i-1, argv[i]);
|
56
56
|
rb_ary_store(ary, 1, ary2);
|
57
57
|
break;
|
58
58
|
}
|
@@ -221,7 +221,7 @@ static VALUE rb_gsl_function_set_params(int argc, VALUE *argv, VALUE obj)
|
|
221
221
|
rb_ary_store(ary, 1, argv[0]);
|
222
222
|
} else {
|
223
223
|
ary2 = rb_ary_new2(argc);
|
224
|
-
for (i = 0; i < argc; i++) rb_ary_store(ary2, i, argv[i]);
|
224
|
+
for (i = 0; (int) i < argc; i++) rb_ary_store(ary2, i, argv[i]);
|
225
225
|
rb_ary_store(ary, 1, ary2);
|
226
226
|
}
|
227
227
|
return obj;
|
@@ -337,7 +337,7 @@ static VALUE rb_gsl_function_fdf_new(int argc, VALUE *argv, VALUE klass)
|
|
337
337
|
F->params = (void *) ary;
|
338
338
|
rb_ary_store(ary, 2, Qnil);
|
339
339
|
rb_ary_store(ary, 3, Qnil);
|
340
|
-
for (i = 0; i < argc; i++) setfunc(i, argv, F);
|
340
|
+
for (i = 0; (int) i < argc; i++) setfunc(i, argv, F);
|
341
341
|
return Data_Wrap_Struct(klass, gsl_function_fdf_mark, gsl_function_fdf_free, F);
|
342
342
|
}
|
343
343
|
|
@@ -360,7 +360,7 @@ static VALUE rb_gsl_function_fdf_set(int argc, VALUE *argv, VALUE obj)
|
|
360
360
|
ary = (VALUE) F->params;
|
361
361
|
rb_ary_store(ary, 2, Qnil);
|
362
362
|
rb_ary_store(ary, 3, Qnil);
|
363
|
-
for (i = 0; i < argc; i++) setfunc(i, argv, F);
|
363
|
+
for (i = 0; (int) i < argc; i++) setfunc(i, argv, F);
|
364
364
|
return obj;
|
365
365
|
}
|
366
366
|
|
@@ -427,7 +427,7 @@ static VALUE rb_gsl_function_fdf_set_params(int argc, VALUE *argv, VALUE obj)
|
|
427
427
|
rb_ary_store(ary, 3, argv[0]);
|
428
428
|
} else {
|
429
429
|
ary2 = rb_ary_new2(argc);
|
430
|
-
for (i = 0; i < argc; i++) rb_ary_store(ary2, i, argv[i]);
|
430
|
+
for (i = 0; (int) i < argc; i++) rb_ary_store(ary2, i, argv[i]);
|
431
431
|
rb_ary_store(ary, 3, ary2);
|
432
432
|
}
|
433
433
|
return obj;
|
data/ext/gsl_narray.c
CHANGED
@@ -31,7 +31,7 @@ static VALUE rb_gsl_vector_to_narray(VALUE obj, VALUE klass)
|
|
31
31
|
memcpy(NA_PTR_TYPE(nary,double*), v->data, shape[0]*sizeof(double));
|
32
32
|
} else {
|
33
33
|
int i;
|
34
|
-
for(i=0; i < v->size; i++) {
|
34
|
+
for(i=0; i < (int) v->size; i++) {
|
35
35
|
(NA_PTR_TYPE(nary,double*))[i] = gsl_vector_get(v, i);
|
36
36
|
}
|
37
37
|
}
|
@@ -50,7 +50,7 @@ static VALUE rb_gsl_vector_complex_to_narray(VALUE obj, VALUE klass)
|
|
50
50
|
memcpy(NA_PTR_TYPE(nary,double*), v->data, shape[0]*2*sizeof(double));
|
51
51
|
} else {
|
52
52
|
int i;
|
53
|
-
for(i=0; i < 2*v->size; i++) {
|
53
|
+
for(i=0; i < (int) (2*v->size); i++) {
|
54
54
|
(NA_PTR_TYPE(nary,gsl_complex*))[i] = gsl_vector_complex_get(v, i);
|
55
55
|
}
|
56
56
|
}
|
@@ -170,7 +170,7 @@ static VALUE rb_gsl_vector_int_to_narray(VALUE obj, VALUE klass)
|
|
170
170
|
memcpy(NA_PTR_TYPE(nary,int*), v->data, shape[0]*sizeof(int));
|
171
171
|
} else {
|
172
172
|
int i;
|
173
|
-
for(i=0; i < v->size; i++) {
|
173
|
+
for(i=0; i < (int) v->size; i++) {
|
174
174
|
(NA_PTR_TYPE(nary,int*))[i] = gsl_vector_int_get(v, i);
|
175
175
|
}
|
176
176
|
}
|
@@ -357,7 +357,7 @@ static VALUE rb_gsl_matrix_to_narray(VALUE obj, VALUE klass)
|
|
357
357
|
shape[0] = m->size2;
|
358
358
|
shape[1] = m->size1;
|
359
359
|
nary = na_make_object(NA_DFLOAT, 2, shape, klass);
|
360
|
-
for (i = 0; i < shape[1]; i++) {
|
360
|
+
for (i = 0; (int) i < shape[1]; i++) {
|
361
361
|
memcpy(NA_PTR_TYPE(nary,double*)+(i*shape[0]), m->data+(i*m->tda),
|
362
362
|
shape[0]*sizeof(double));
|
363
363
|
}
|
@@ -384,7 +384,7 @@ static VALUE rb_gsl_matrix_int_to_narray(VALUE obj, VALUE klass)
|
|
384
384
|
shape[0] = m->size2;
|
385
385
|
shape[1] = m->size1;
|
386
386
|
nary = na_make_object(NA_LINT, 2, shape, klass);
|
387
|
-
for (i = 0; i < shape[1]; i++) {
|
387
|
+
for (i = 0; (int) i < shape[1]; i++) {
|
388
388
|
memcpy(NA_PTR_TYPE(nary,int*)+(i*shape[0]), m->data+(i*m->tda),
|
389
389
|
shape[0]*sizeof(int));
|
390
390
|
}
|
@@ -583,7 +583,7 @@ EXTERN VALUE cgsl_histogram;
|
|
583
583
|
static VALUE rb_gsl_narray_histogram(int argc, VALUE *argv, VALUE obj)
|
584
584
|
{
|
585
585
|
double *ptr, *ptr_range;
|
586
|
-
gsl_histogram *h;
|
586
|
+
gsl_histogram *h = NULL;
|
587
587
|
gsl_vector *ranges;
|
588
588
|
gsl_vector_view v;
|
589
589
|
double min, max;
|