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
@@ -18,21 +18,19 @@
|
|
18
18
|
#include "include/rb_gsl_histogram.h"
|
19
19
|
#include "include/rb_gsl_complex.h"
|
20
20
|
#include "include/rb_gsl_poly.h"
|
21
|
-
#ifdef HAVE_NARRAY_H
|
22
21
|
#include "include/rb_gsl_with_narray.h"
|
23
|
-
#endif
|
24
22
|
|
25
|
-
int gsl_linalg_matmult_int(const gsl_matrix_int *A,
|
26
|
-
|
23
|
+
int gsl_linalg_matmult_int(const gsl_matrix_int *A,
|
24
|
+
const gsl_matrix_int *B, gsl_matrix_int *C);
|
27
25
|
|
28
26
|
#define BASE_DOUBLE
|
29
27
|
#include "include/templates_on.h"
|
30
|
-
#include "matrix_source.
|
28
|
+
#include "matrix_source.h"
|
31
29
|
#include "include/templates_off.h"
|
32
30
|
#undef BASE_DOUBLE
|
33
31
|
|
34
32
|
#define BASE_INT
|
35
33
|
#include "include/templates_on.h"
|
36
|
-
#include "matrix_source.
|
34
|
+
#include "matrix_source.h"
|
37
35
|
#include "include/templates_off.h"
|
38
36
|
#undef BASE_INT
|
@@ -27,7 +27,7 @@ void get_range_beg_en_n(VALUE range, double *beg, double *en, size_t *n, int *st
|
|
27
27
|
|
28
28
|
// From ext/matrix_source.c
|
29
29
|
void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
|
30
|
-
|
30
|
+
size_t *i, size_t *j, size_t *n1, size_t *n2);
|
31
31
|
|
32
32
|
static VALUE rb_gsl_matrix_complex_arithmetics(int flag, VALUE obj, VALUE bb)
|
33
33
|
{
|
@@ -73,28 +73,28 @@ static VALUE rb_gsl_matrix_complex_arithmetics(int flag, VALUE obj, VALUE bb)
|
|
73
73
|
Data_Get_Struct(bb, gsl_matrix_complex, cmb);
|
74
74
|
switch (flag) {
|
75
75
|
case GSL_MATRIX_COMPLEX_ADD:
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
cmnew = make_matrix_complex_clone(cm);
|
77
|
+
gsl_matrix_complex_add(cmnew, cmb);
|
78
|
+
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
|
79
|
+
break;
|
80
80
|
case GSL_MATRIX_COMPLEX_SUB:
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
cmnew = make_matrix_complex_clone(cm);
|
82
|
+
gsl_matrix_complex_sub(cmnew,cmb);
|
83
|
+
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
|
84
|
+
break;
|
85
85
|
case GSL_MATRIX_COMPLEX_MUL:
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
86
|
+
cmnew = make_matrix_complex_clone(cm);
|
87
|
+
gsl_matrix_complex_mul_elements(cmnew, cmb);
|
88
|
+
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
|
89
|
+
break;
|
90
90
|
case GSL_MATRIX_COMPLEX_DIV:
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
cmnew = make_matrix_complex_clone(cm);
|
92
|
+
gsl_matrix_complex_div_elements(cmnew, cmb);
|
93
|
+
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
|
94
|
+
break;
|
95
95
|
default:
|
96
|
-
|
97
|
-
|
96
|
+
rb_raise(rb_eRuntimeError, "operation not defined");
|
97
|
+
break;
|
98
98
|
}
|
99
99
|
} else if (rb_obj_is_kind_of(bb, cgsl_matrix)) {
|
100
100
|
Data_Get_Struct(bb, gsl_matrix, m);
|
@@ -102,80 +102,80 @@ static VALUE rb_gsl_matrix_complex_arithmetics(int flag, VALUE obj, VALUE bb)
|
|
102
102
|
cmnew = make_matrix_complex_clone(cm);
|
103
103
|
switch (flag) {
|
104
104
|
case GSL_MATRIX_COMPLEX_ADD:
|
105
|
-
|
106
|
-
|
105
|
+
gsl_matrix_complex_add(cmnew, cmb);
|
106
|
+
break;
|
107
107
|
case GSL_MATRIX_COMPLEX_SUB:
|
108
|
-
|
109
|
-
|
108
|
+
gsl_matrix_complex_sub(cmnew,cmb);
|
109
|
+
break;
|
110
110
|
case GSL_MATRIX_COMPLEX_MUL:
|
111
|
-
|
112
|
-
|
111
|
+
gsl_matrix_complex_mul_elements(cmnew, cmb);
|
112
|
+
break;
|
113
113
|
case GSL_MATRIX_COMPLEX_DIV:
|
114
|
-
|
115
|
-
|
114
|
+
gsl_matrix_complex_div_elements(cmnew, cmb);
|
115
|
+
break;
|
116
116
|
default:
|
117
|
-
|
118
|
-
|
117
|
+
rb_raise(rb_eRuntimeError, "operation not defined");
|
118
|
+
break;
|
119
119
|
}
|
120
120
|
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
|
121
121
|
} else if (rb_obj_is_kind_of(bb, cgsl_complex)) {
|
122
122
|
Data_Get_Struct(bb, gsl_complex, c);
|
123
123
|
switch (flag) {
|
124
124
|
case GSL_MATRIX_COMPLEX_ADD:
|
125
|
-
|
126
|
-
|
127
|
-
|
125
|
+
cmnew = make_matrix_complex_clone(cm);
|
126
|
+
gsl_matrix_complex_add_constant(cmnew, *c);
|
127
|
+
break;
|
128
128
|
case GSL_MATRIX_COMPLEX_SUB:
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
cmnew = make_matrix_complex_clone(cm);
|
130
|
+
gsl_matrix_complex_add_constant(cmnew, gsl_complex_negative(*c));
|
131
|
+
break;
|
132
132
|
case GSL_MATRIX_COMPLEX_MUL:
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
cmnew = make_matrix_complex_clone(cm);
|
134
|
+
gsl_matrix_complex_scale(cmnew, *c);
|
135
|
+
break;
|
136
136
|
case GSL_MATRIX_COMPLEX_DIV:
|
137
|
-
|
138
|
-
|
139
|
-
|
137
|
+
cmnew = make_matrix_complex_clone(cm);
|
138
|
+
gsl_matrix_complex_scale(cmnew, gsl_complex_inverse(*c));
|
139
|
+
break;
|
140
140
|
default:
|
141
|
-
|
142
|
-
|
141
|
+
rb_raise(rb_eRuntimeError, "operation not defined");
|
142
|
+
break;
|
143
143
|
}
|
144
144
|
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
|
145
145
|
} else if (rb_obj_is_kind_of(bb, cgsl_vector)) {
|
146
146
|
Data_Get_Struct(bb, gsl_vector, v);
|
147
147
|
switch (flag) {
|
148
148
|
case GSL_MATRIX_COMPLEX_MUL:
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
149
|
+
cvb = vector_to_complex(v);
|
150
|
+
cvnew = gsl_vector_complex_alloc(v->size);
|
151
|
+
if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
|
152
|
+
gsl_matrix_complex_mul_vector(cvnew, cm, cvb);
|
153
|
+
gsl_vector_complex_free(cvb);
|
154
|
+
return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, cvnew);
|
155
|
+
break;
|
156
156
|
default:
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
157
|
+
rb_raise(rb_eRuntimeError,
|
158
|
+
"operation is not defined %s and Matrix_Complex",
|
159
|
+
rb_class2name(CLASS_OF(bb)));
|
160
|
+
break;
|
161
161
|
}
|
162
162
|
} else if (rb_obj_is_kind_of(bb, cgsl_vector_complex)) {
|
163
163
|
if (!VECTOR_COMPLEX_COL_P(bb))
|
164
|
-
|
165
|
-
|
166
|
-
|
164
|
+
rb_raise(rb_eTypeError,
|
165
|
+
"Operation is not defined with %s (Vector::Complex::Col expected)",
|
166
|
+
rb_class2name(CLASS_OF(bb)));
|
167
167
|
Data_Get_Struct(bb, gsl_vector_complex, cv);
|
168
168
|
switch (flag) {
|
169
169
|
case GSL_MATRIX_COMPLEX_MUL:
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
170
|
+
cvnew = gsl_vector_complex_alloc(cv->size);
|
171
|
+
if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
|
172
|
+
gsl_matrix_complex_mul_vector(cvnew, cm, cv);
|
173
|
+
return Data_Wrap_Struct(cgsl_vector_complex_col, 0, gsl_vector_complex_free, cvnew);
|
174
174
|
default:
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
175
|
+
rb_raise(rb_eRuntimeError,
|
176
|
+
"operation is not defined %s and Matrix_Complex",
|
177
|
+
rb_class2name(CLASS_OF(bb)));
|
178
|
+
break;
|
179
179
|
}
|
180
180
|
} else {
|
181
181
|
rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
|
@@ -218,15 +218,15 @@ static VALUE rb_gsl_matrix_complex_eye(int argc, VALUE *argv, VALUE klass)
|
|
218
218
|
// if (RARRAY(argv[1])->len < 2) rb_raise(rb_eArgError, "wrong argument");
|
219
219
|
if (RARRAY_LEN(argv[1]) < 2) rb_raise(rb_eArgError, "wrong argument");
|
220
220
|
z = gsl_complex_rect(NUM2DBL(rb_ary_entry(argv[1], 0)),
|
221
|
-
|
221
|
+
NUM2DBL(rb_ary_entry(argv[1], 1)));
|
222
222
|
break;
|
223
223
|
default:
|
224
224
|
if (rb_obj_is_kind_of(argv[1], cgsl_complex)) {
|
225
|
-
|
225
|
+
Data_Get_Struct(argv[1], gsl_complex, pz);
|
226
226
|
z = *pz;
|
227
227
|
} else {
|
228
|
-
|
229
|
-
|
228
|
+
rb_raise(rb_eTypeError,
|
229
|
+
"wrong argument type %s", rb_class2name(CLASS_OF(argv[1])));
|
230
230
|
}
|
231
231
|
break;
|
232
232
|
}
|
@@ -244,7 +244,7 @@ static VALUE rb_gsl_matrix_complex_eye(int argc, VALUE *argv, VALUE klass)
|
|
244
244
|
m = gsl_matrix_complex_calloc(n, n);
|
245
245
|
if (m == NULL) rb_raise(rb_eNoMemError, "gsl_matrix_complex_alloc failed");
|
246
246
|
for (i = 0; i < n; i++) gsl_matrix_complex_set(m, i, i, z);
|
247
|
-
return
|
247
|
+
return Data_Wrap_Struct(klass, 0, gsl_matrix_complex_free, m);
|
248
248
|
}
|
249
249
|
|
250
250
|
static VALUE rb_gsl_matrix_complex_identity(VALUE klass, VALUE nn)
|
@@ -258,7 +258,7 @@ static VALUE rb_gsl_matrix_complex_identity(VALUE klass, VALUE nn)
|
|
258
258
|
if (m == NULL) rb_raise(rb_eNoMemError, "gsl_matrix_complex_calloc failed");
|
259
259
|
z = gsl_complex_rect(1.0, 0.0);
|
260
260
|
for (i = 0; i < n; i++) gsl_matrix_complex_set(m, i, i, z);
|
261
|
-
return
|
261
|
+
return Data_Wrap_Struct(klass, 0, gsl_matrix_complex_free, m);
|
262
262
|
}
|
263
263
|
|
264
264
|
static VALUE rb_gsl_matrix_complex_set_zero(VALUE obj)
|
@@ -300,8 +300,8 @@ static VALUE rb_gsl_matrix_complex_set_all(VALUE obj, VALUE s)
|
|
300
300
|
Data_Get_Struct(s, gsl_complex, z);
|
301
301
|
gsl_matrix_complex_set_all(m, *z);
|
302
302
|
} else {
|
303
|
-
rb_raise(rb_eTypeError,
|
304
|
-
|
303
|
+
rb_raise(rb_eTypeError,
|
304
|
+
"wrong argument type %s", rb_class2name(CLASS_OF(s)));
|
305
305
|
}
|
306
306
|
break;
|
307
307
|
}
|
@@ -323,7 +323,6 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
|
|
323
323
|
if(argc < 1 || argc > 5) {
|
324
324
|
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1-5)", argc);
|
325
325
|
}
|
326
|
-
|
327
326
|
Data_Get_Struct(obj, gsl_matrix_complex, m);
|
328
327
|
other = argv[argc-1];
|
329
328
|
|
@@ -357,7 +356,7 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
|
|
357
356
|
Data_Get_Struct(other, gsl_matrix_complex, mother);
|
358
357
|
if(n1 * n2 != mother->size1 * mother->size2) {
|
359
358
|
rb_raise(rb_eRangeError, "sizes do not match (%d x %d != %d x %d)",
|
360
|
-
|
359
|
+
(int) n1, (int) n2, (int) mother->size1, (int) mother->size2);
|
361
360
|
}
|
362
361
|
// TODO Change to gsl_matrix_memmove if/when GSL has such a function
|
363
362
|
// because gsl_matrix_memcpy does not handle overlapping regions (e.g.
|
@@ -375,7 +374,7 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
|
|
375
374
|
// m[...] = [[row0], [row1], ...] # multiple rows
|
376
375
|
if((int) n1 != RARRAY_LEN(other)) {
|
377
376
|
rb_raise(rb_eRangeError, "row counts do not match (%d != %d)",
|
378
|
-
|
377
|
+
(int) n1, (int) RARRAY_LEN(other));
|
379
378
|
}
|
380
379
|
for(k = 0; k < n1; k++) {
|
381
380
|
vv = gsl_matrix_complex_row(&mv.matrix, k);
|
@@ -399,7 +398,6 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
|
|
399
398
|
gsl_matrix_complex_set_all(&mv.matrix, rb_gsl_obj_to_gsl_complex(other, NULL));
|
400
399
|
}
|
401
400
|
}
|
402
|
-
|
403
401
|
return obj;
|
404
402
|
}
|
405
403
|
|
@@ -409,7 +407,7 @@ static VALUE rb_gsl_matrix_complex_set_row(int argc, VALUE *argv, VALUE obj)
|
|
409
407
|
size_t i, k;
|
410
408
|
gsl_complex z, *pz = &z;
|
411
409
|
if (argc < 2) rb_raise(rb_eArgError, "wrong number of arguments (%d for >= 2)",
|
412
|
-
|
410
|
+
argc);
|
413
411
|
CHECK_FIXNUM(argv[0]);
|
414
412
|
Data_Get_Struct(obj, gsl_matrix_complex, A);
|
415
413
|
i = FIX2INT(argv[0]);
|
@@ -436,7 +434,7 @@ static VALUE rb_gsl_matrix_complex_set_col(int argc, VALUE *argv, VALUE obj)
|
|
436
434
|
int j, k;
|
437
435
|
gsl_complex z, *pz = &z;
|
438
436
|
if (argc < 2) rb_raise(rb_eArgError, "wrong number of arguments (%d for >= 2)",
|
439
|
-
|
437
|
+
argc);
|
440
438
|
CHECK_FIXNUM(argv[0]);
|
441
439
|
Data_Get_Struct(obj, gsl_matrix_complex, A);
|
442
440
|
j = FIX2INT(argv[0]);
|
@@ -473,7 +471,7 @@ static VALUE rb_gsl_matrix_complex_get(int argc, VALUE *argv, VALUE obj)
|
|
473
471
|
if(ii < 0) ii += m->size1;
|
474
472
|
if(ij < 0) ij += m->size2;
|
475
473
|
c = ALLOC(gsl_complex);
|
476
|
-
*c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
|
474
|
+
*c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
|
477
475
|
retval = Data_Wrap_Struct(cgsl_complex, 0, free, c);
|
478
476
|
} else if(argc == 1 && TYPE(argv[0]) == T_FIXNUM) {
|
479
477
|
// m[i]
|
@@ -492,7 +490,7 @@ static VALUE rb_gsl_matrix_complex_get(int argc, VALUE *argv, VALUE obj)
|
|
492
490
|
if(ii < 0) ii += m->size1;
|
493
491
|
if(ij < 0) ij += m->size2;
|
494
492
|
c = ALLOC(gsl_complex);
|
495
|
-
*c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
|
493
|
+
*c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
|
496
494
|
retval = Data_Wrap_Struct(cgsl_complex, 0, free, c);
|
497
495
|
} else {
|
498
496
|
rb_raise(rb_eArgError, "Array index must have length 2, not %d", (int) RARRAY_LEN(argv[0]));
|
@@ -500,7 +498,6 @@ static VALUE rb_gsl_matrix_complex_get(int argc, VALUE *argv, VALUE obj)
|
|
500
498
|
} else {
|
501
499
|
retval = rb_gsl_matrix_complex_submatrix(argc, argv, obj);
|
502
500
|
}
|
503
|
-
|
504
501
|
return retval;
|
505
502
|
}
|
506
503
|
|
@@ -546,12 +543,12 @@ static VALUE rb_gsl_matrix_complex_to_a(VALUE obj)
|
|
546
543
|
size_t i, j;
|
547
544
|
Data_Get_Struct(obj, gsl_matrix_complex, m);
|
548
545
|
ma = rb_ary_new2(m->size1);
|
549
|
-
for(i=0; i < m->size1; i++) {
|
546
|
+
for(i = 0; i < m->size1; i++) {
|
550
547
|
ra = rb_ary_new2(m->size2);
|
551
548
|
rb_ary_store(ma, i, ra);
|
552
|
-
for(j=0; j < m->size2; j++) {
|
549
|
+
for(j = 0; j < m->size2; j++) {
|
553
550
|
c = ALLOC(gsl_complex);
|
554
|
-
*c = gsl_matrix_complex_get(m, i, j);
|
551
|
+
*c = gsl_matrix_complex_get(m, i, j);
|
555
552
|
rb_ary_store(ra, j, Data_Wrap_Struct(cgsl_complex, 0, free, c));
|
556
553
|
}
|
557
554
|
}
|
@@ -610,11 +607,11 @@ static VALUE rb_gsl_matrix_complex_to_s(int argc, VALUE *argv, VALUE obj)
|
|
610
607
|
int max_rows = 4;
|
611
608
|
int max_cols = 4;
|
612
609
|
|
613
|
-
switch(argc){
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
610
|
+
switch(argc) {
|
611
|
+
case 2: max_cols = NUM2INT(argv[1]);
|
612
|
+
case 1: max_rows = NUM2INT(argv[0]);
|
613
|
+
case 0: break;
|
614
|
+
default:
|
618
615
|
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0, 1, or 2)", argc);
|
619
616
|
}
|
620
617
|
|
@@ -628,7 +625,7 @@ static VALUE rb_gsl_matrix_complex_to_s(int argc, VALUE *argv, VALUE obj)
|
|
628
625
|
for (j = 0; j < m->size2; j++) {
|
629
626
|
z = gsl_matrix_complex_get(m, i, j);
|
630
627
|
sprintf(buf,
|
631
|
-
|
628
|
+
"%s[ %4.3e %4.3e ]", (j==0) ? "" : " ", GSL_REAL(z), GSL_IMAG(z));
|
632
629
|
rb_str_cat(str, buf, strlen(buf));
|
633
630
|
// if too many cols
|
634
631
|
if ((int) j >= max_cols-1 && j != m->size2-1) {
|
@@ -926,8 +923,8 @@ static VALUE rb_gsl_matrix_complex_add_diagonal(VALUE obj, VALUE s)
|
|
926
923
|
Data_Get_Struct(s, gsl_complex, z);
|
927
924
|
gsl_matrix_complex_add_diagonal(m, *z);
|
928
925
|
} else {
|
929
|
-
rb_raise(rb_eTypeError,
|
930
|
-
|
926
|
+
rb_raise(rb_eTypeError,
|
927
|
+
"wrong argument type %s", rb_class2name(CLASS_OF(s)));
|
931
928
|
}
|
932
929
|
break;
|
933
930
|
}
|
@@ -1001,7 +998,7 @@ static VALUE rb_gsl_matrix_complex_set_diagonal(VALUE obj, VALUE diag)
|
|
1001
998
|
for (i = 0; i < m->size1; i++) gsl_matrix_complex_set(m, i, i, gsl_vector_complex_get(v, i));
|
1002
999
|
} else {
|
1003
1000
|
rb_raise(rb_eTypeError, "wrong argument type %s (GSL::Vector_Complex or Array expected)",
|
1004
|
-
|
1001
|
+
rb_class2name(CLASS_OF(diag)));
|
1005
1002
|
}
|
1006
1003
|
return obj;
|
1007
1004
|
}
|
@@ -1055,7 +1052,7 @@ static VALUE rb_gsl_matrix_complex_coerce(VALUE obj, VALUE other)
|
|
1055
1052
|
return rb_ary_new3(2, vcm, obj);
|
1056
1053
|
} else {
|
1057
1054
|
rb_raise(rb_eTypeError, "cannot coerce %s to GSL::Matrix::Complex",
|
1058
|
-
|
1055
|
+
rb_class2name(CLASS_OF(other)));
|
1059
1056
|
}
|
1060
1057
|
break;
|
1061
1058
|
}
|
@@ -1273,8 +1270,8 @@ static VALUE rb_gsl_matrix_complex_logabs(VALUE obj)
|
|
1273
1270
|
return rb_gsl_matrix_complex_XXX(obj, gsl_complex_logabs);
|
1274
1271
|
}
|
1275
1272
|
|
1276
|
-
static VALUE rb_gsl_matrix_complex_XXX_complex(VALUE obj,
|
1277
|
-
|
1273
|
+
static VALUE rb_gsl_matrix_complex_XXX_complex(VALUE obj,
|
1274
|
+
gsl_complex (*f)(gsl_complex))
|
1278
1275
|
{
|
1279
1276
|
gsl_matrix_complex *m, *mnew;
|
1280
1277
|
size_t i, j;
|
@@ -1525,14 +1522,14 @@ static VALUE rb_gsl_matrix_complex_indgen_singleton(int argc, VALUE *argv, VALUE
|
|
1525
1522
|
// function, but it only determines absolute equality (i.e. is has no epsilon
|
1526
1523
|
// argument).
|
1527
1524
|
static int gsl_matrix_complex_equal_eps(const gsl_matrix_complex *m1,
|
1528
|
-
|
1525
|
+
const gsl_matrix_complex *m2, double eps)
|
1529
1526
|
{
|
1530
1527
|
gsl_complex z1, z2;
|
1531
1528
|
size_t i, j;
|
1532
1529
|
if (m1->size1 != m2->size1) return 0;
|
1533
|
-
if (m1->size2 != m2->size2) return 0;
|
1530
|
+
if (m1->size2 != m2->size2) return 0;
|
1534
1531
|
for (i = 0; i < m1->size1; i++) {
|
1535
|
-
for (j = 0; j < m1->size2; j++) {
|
1532
|
+
for (j = 0; j < m1->size2; j++) {
|
1536
1533
|
z1 = gsl_matrix_complex_get(m1, i, j);
|
1537
1534
|
z2 = gsl_matrix_complex_get(m2, i, j);
|
1538
1535
|
if (!rbgsl_complex_equal(&z1, &z2, eps)) return 0;
|
@@ -1602,7 +1599,7 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1602
1599
|
rb_define_method(cgsl_matrix_complex, "fwrite", rb_gsl_matrix_complex_fwrite, 1);
|
1603
1600
|
rb_define_method(cgsl_matrix_complex, "fread", rb_gsl_matrix_complex_fread, 1);
|
1604
1601
|
rb_define_method(cgsl_matrix_complex, "fscanf", rb_gsl_matrix_complex_fscanf, 1);
|
1605
|
-
|
1602
|
+
|
1606
1603
|
rb_define_singleton_method(cgsl_matrix_complex, "memcpy", rb_gsl_matrix_complex_memcpy, 2);
|
1607
1604
|
rb_define_method(cgsl_matrix_complex, "clone", rb_gsl_matrix_complex_clone, 0);
|
1608
1605
|
rb_define_alias(cgsl_matrix_complex, "duplicate", "clone");
|
@@ -1610,10 +1607,10 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1610
1607
|
rb_define_method(cgsl_matrix_complex, "swap_rows", rb_gsl_matrix_complex_swap_rows, 2);
|
1611
1608
|
rb_define_method(cgsl_matrix_complex, "swap_columns", rb_gsl_matrix_complex_swap_columns, 2);
|
1612
1609
|
rb_define_method(cgsl_matrix_complex, "swap_rowcol", rb_gsl_matrix_complex_swap_rowcol, 2);
|
1613
|
-
|
1610
|
+
|
1614
1611
|
rb_define_method(cgsl_matrix_complex, "transpose", rb_gsl_matrix_complex_transpose, 0);
|
1615
1612
|
rb_define_method(cgsl_matrix_complex, "isnull", rb_gsl_matrix_complex_isnull, 0);
|
1616
|
-
|
1613
|
+
|
1617
1614
|
rb_define_method(cgsl_matrix_complex, "add", rb_gsl_matrix_complex_add, 1);
|
1618
1615
|
rb_define_alias(cgsl_matrix_complex, "add_constant", "add");
|
1619
1616
|
rb_define_alias(cgsl_matrix_complex, "+", "add");
|
@@ -1624,13 +1621,13 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1624
1621
|
rb_define_alias(cgsl_matrix_complex, "/", "div_elements");
|
1625
1622
|
rb_define_method(cgsl_matrix_complex, "scale", rb_gsl_matrix_complex_scale, 1);
|
1626
1623
|
rb_define_method(cgsl_matrix_complex, "scale!", rb_gsl_matrix_complex_scale_bang, 1);
|
1627
|
-
|
1624
|
+
|
1628
1625
|
rb_define_method(cgsl_matrix_complex, "add_diagonal", rb_gsl_matrix_complex_add_diagonal, 1);
|
1629
|
-
|
1626
|
+
|
1630
1627
|
rb_define_method(cgsl_matrix_complex, "set_zero", rb_gsl_matrix_complex_set_zero, 0);
|
1631
1628
|
rb_define_method(cgsl_matrix_complex, "set_identity", rb_gsl_matrix_complex_set_identity, 0);
|
1632
1629
|
rb_define_method(cgsl_matrix_complex, "set_all", rb_gsl_matrix_complex_set_all, 1);
|
1633
|
-
|
1630
|
+
|
1634
1631
|
rb_define_method(cgsl_matrix_complex, "submatrix", rb_gsl_matrix_complex_submatrix, -1);
|
1635
1632
|
rb_define_alias(cgsl_matrix_complex, "view", "submatrix");
|
1636
1633
|
rb_define_method(cgsl_matrix_complex, "row", rb_gsl_matrix_complex_row, 1);
|
@@ -1642,13 +1639,13 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1642
1639
|
rb_define_method(cgsl_matrix_complex, "set_diagonal", rb_gsl_matrix_complex_set_diagonal, 1);
|
1643
1640
|
rb_define_method(cgsl_matrix_complex, "subdiagonal", rb_gsl_matrix_complex_subdiagonal, 1);
|
1644
1641
|
rb_define_method(cgsl_matrix_complex, "superdiagonal", rb_gsl_matrix_complex_superdiagonal, 1);
|
1645
|
-
|
1642
|
+
|
1646
1643
|
rb_define_method(cgsl_matrix_complex, "coerce", rb_gsl_matrix_complex_coerce, 1);
|
1647
|
-
|
1644
|
+
|
1648
1645
|
rb_define_method(cgsl_matrix_complex, "mul", rb_gsl_matrix_complex_mul, 1);
|
1649
1646
|
rb_define_alias(cgsl_matrix_complex, "*", "mul");
|
1650
1647
|
rb_define_method(cgsl_matrix_complex, "mul!", rb_gsl_matrix_complex_mul2, 1);
|
1651
|
-
|
1648
|
+
|
1652
1649
|
rb_define_method(cgsl_matrix_complex, "real", rb_gsl_matrix_complex_real, 0);
|
1653
1650
|
rb_define_alias(cgsl_matrix_complex, "to_real", "real");
|
1654
1651
|
rb_define_alias(cgsl_matrix_complex, "re", "real");
|
@@ -1662,7 +1659,7 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1662
1659
|
rb_define_alias(cgsl_matrix_complex, "conj", "conjugate");
|
1663
1660
|
rb_define_method(cgsl_matrix_complex, "dagger!", rb_gsl_matrix_complex_dagger, 0);
|
1664
1661
|
rb_define_method(cgsl_matrix_complex, "dagger", rb_gsl_matrix_complex_dagger2, 0);
|
1665
|
-
|
1662
|
+
|
1666
1663
|
rb_define_method(cgsl_matrix_complex, "trace", rb_gsl_matrix_complex_trace, 0);
|
1667
1664
|
rb_define_method(cgsl_matrix_complex, "each_row", rb_gsl_matrix_complex_each_row, 0);
|
1668
1665
|
rb_define_method(cgsl_matrix_complex, "each_col", rb_gsl_matrix_complex_each_col, 0);
|
@@ -1671,14 +1668,14 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1671
1668
|
rb_define_method(cgsl_matrix_complex, "collect!", rb_gsl_matrix_complex_collect_bang, 0);
|
1672
1669
|
rb_define_alias(cgsl_matrix_complex, "map", "collect");
|
1673
1670
|
rb_define_alias(cgsl_matrix_complex, "map!", "collect!");
|
1674
|
-
|
1671
|
+
|
1675
1672
|
rb_define_method(cgsl_matrix_complex, "to_a", rb_gsl_matrix_complex_to_a, 0);
|
1676
1673
|
|
1677
1674
|
rb_define_method(cgsl_matrix_complex, "size1", rb_gsl_matrix_complex_size1, 0);
|
1678
1675
|
rb_define_method(cgsl_matrix_complex, "size2", rb_gsl_matrix_complex_size2, 0);
|
1679
1676
|
rb_define_method(cgsl_matrix_complex, "shape", rb_gsl_matrix_complex_shape, 0);
|
1680
1677
|
rb_define_alias(cgsl_matrix_complex, "size", "shape");
|
1681
|
-
|
1678
|
+
|
1682
1679
|
/*****/
|
1683
1680
|
rb_define_method(cgsl_matrix_complex, "-@", rb_gsl_matrix_complex_uminus, 0);
|
1684
1681
|
rb_define_method(cgsl_matrix_complex, "+@", rb_gsl_matrix_complex_uplus, 0);
|
@@ -1728,9 +1725,9 @@ void Init_gsl_matrix_complex(VALUE module)
|
|
1728
1725
|
rb_define_method(cgsl_matrix_complex, "indgen", rb_gsl_matrix_complex_indgen, -1);
|
1729
1726
|
rb_define_method(cgsl_matrix_complex, "indgen!", rb_gsl_matrix_complex_indgen_bang, -1);
|
1730
1727
|
rb_define_singleton_method(cgsl_matrix_complex, "indgen", rb_gsl_matrix_complex_indgen_singleton, -1);
|
1731
|
-
|
1728
|
+
|
1732
1729
|
rb_define_method(cgsl_matrix_complex, "equal?", rb_gsl_matrix_complex_equal, -1);
|
1733
1730
|
rb_define_alias(cgsl_matrix_complex, "==", "equal?");
|
1734
1731
|
rb_define_method(cgsl_matrix_complex, "not_equal?", rb_gsl_matrix_complex_not_equal, -1);
|
1735
|
-
rb_define_alias(cgsl_matrix_complex, "!=", "not_equal?");
|
1732
|
+
rb_define_alias(cgsl_matrix_complex, "!=", "not_equal?");
|
1736
1733
|
}
|