gsl 1.15.3 → 1.16.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +24 -0
- data/AUTHORS +10 -2
- data/COPYING +341 -339
- data/ChangeLog +612 -554
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +14 -93
- 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/{alf.c → gsl_native/alf.c} +10 -10
- data/ext/{array.c → gsl_native/array.c} +70 -159
- data/ext/{array_complex.c → gsl_native/array_complex.c} +63 -66
- data/ext/{blas.c → gsl_native/blas.c} +2 -3
- data/ext/{blas1.c → gsl_native/blas1.c} +35 -36
- data/ext/{blas2.c → gsl_native/blas2.c} +57 -62
- data/ext/{blas3.c → gsl_native/blas3.c} +57 -58
- data/ext/{block.c → gsl_native/block.c} +14 -18
- data/ext/{block_source.c → gsl_native/block_source.h} +110 -112
- data/ext/gsl_native/bspline.c +122 -0
- data/ext/{bundle.c → gsl_native/bundle.c} +0 -0
- data/ext/{cdf.c → gsl_native/cdf.c} +79 -93
- data/ext/{cheb.c → gsl_native/cheb.c} +78 -89
- data/ext/{combination.c → gsl_native/combination.c} +11 -19
- data/ext/{common.c → gsl_native/common.c} +9 -41
- data/ext/{complex.c → gsl_native/complex.c} +116 -118
- data/ext/gsl_native/const.c +331 -0
- data/ext/{const_additional.c → gsl_native/const_additional.c} +13 -34
- data/ext/gsl_native/cqp.c +283 -0
- data/ext/{deriv.c → gsl_native/deriv.c} +25 -33
- data/ext/{dht.c → gsl_native/dht.c} +23 -31
- data/ext/{diff.c → gsl_native/diff.c} +26 -28
- data/ext/{dirac.c → gsl_native/dirac.c} +45 -46
- data/ext/{eigen.c → gsl_native/eigen.c} +1044 -1095
- data/ext/{error.c → gsl_native/error.c} +18 -18
- data/ext/gsl_native/extconf.rb +118 -0
- data/ext/{fft.c → gsl_native/fft.c} +197 -204
- data/ext/{fit.c → gsl_native/fit.c} +17 -18
- data/ext/gsl_native/fresnel.c +312 -0
- data/ext/{function.c → gsl_native/function.c} +37 -43
- data/ext/{geometry.c → gsl_native/geometry.c} +16 -16
- data/ext/{graph.c → gsl_native/graph.c} +39 -89
- data/ext/{gsl.c → gsl_native/gsl.c} +12 -33
- data/ext/{gsl_narray.c → gsl_native/gsl_narray.c} +20 -30
- data/ext/{histogram.c → gsl_native/histogram.c} +133 -160
- data/ext/{histogram2d.c → gsl_native/histogram2d.c} +78 -104
- data/ext/{histogram3d.c → gsl_native/histogram3d.c} +76 -76
- data/ext/{histogram3d_source.c → gsl_native/histogram3d_source.c} +196 -197
- data/ext/{histogram_find.c → gsl_native/histogram_find.c} +32 -34
- data/ext/{histogram_oper.c → gsl_native/histogram_oper.c} +43 -52
- data/ext/{ieee.c → gsl_native/ieee.c} +9 -21
- data/{include → ext/gsl_native/include}/rb_gsl.h +4 -26
- data/{include → ext/gsl_native/include}/rb_gsl_array.h +15 -39
- data/{include → ext/gsl_native/include}/rb_gsl_cheb.h +0 -2
- data/{include → ext/gsl_native/include}/rb_gsl_common.h +61 -61
- data/{include → ext/gsl_native/include}/rb_gsl_complex.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_const.h +0 -6
- data/ext/gsl_native/include/rb_gsl_dirac.h +6 -0
- data/{include → ext/gsl_native/include}/rb_gsl_eigen.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_fft.h +0 -13
- data/{include → ext/gsl_native/include}/rb_gsl_fit.h +0 -2
- data/{include → ext/gsl_native/include}/rb_gsl_function.h +0 -4
- data/{include → ext/gsl_native/include}/rb_gsl_graph.h +2 -4
- data/{include → ext/gsl_native/include}/rb_gsl_histogram.h +8 -8
- data/{include → ext/gsl_native/include}/rb_gsl_histogram3d.h +50 -50
- data/{include → ext/gsl_native/include}/rb_gsl_integration.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_interp.h +0 -5
- data/{include → ext/gsl_native/include}/rb_gsl_linalg.h +2 -6
- data/{include → ext/gsl_native/include}/rb_gsl_math.h +0 -6
- data/{include → ext/gsl_native/include}/rb_gsl_odeiv.h +0 -3
- data/{include → ext/gsl_native/include}/rb_gsl_poly.h +3 -7
- data/{include → ext/gsl_native/include}/rb_gsl_rational.h +1 -8
- data/{include → ext/gsl_native/include}/rb_gsl_rng.h +0 -1
- data/{include → ext/gsl_native/include}/rb_gsl_root.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_sf.h +39 -48
- data/{include → ext/gsl_native/include}/rb_gsl_statistics.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_tensor.h +0 -2
- data/{include → ext/gsl_native/include}/rb_gsl_with_narray.h +3 -1
- data/{include → ext/gsl_native/include}/templates_off.h +0 -0
- data/{include → ext/gsl_native/include}/templates_on.h +1 -1
- data/ext/{integration.c → gsl_native/integration.c} +164 -189
- data/ext/{interp.c → gsl_native/interp.c} +25 -38
- data/ext/gsl_native/jacobi.c +733 -0
- data/ext/{linalg.c → gsl_native/linalg.c} +462 -589
- data/ext/{linalg_complex.c → gsl_native/linalg_complex.c} +93 -106
- data/ext/{math.c → gsl_native/math.c} +48 -67
- data/ext/{matrix.c → gsl_native/matrix.c} +13 -16
- data/ext/{matrix_complex.c → gsl_native/matrix_complex.c} +119 -123
- data/ext/{matrix_double.c → gsl_native/matrix_double.c} +79 -82
- data/ext/{matrix_int.c → gsl_native/matrix_int.c} +53 -54
- data/ext/{matrix_source.c → gsl_native/matrix_source.h} +292 -318
- data/ext/{min.c → gsl_native/min.c} +45 -76
- data/ext/{monte.c → gsl_native/monte.c} +50 -64
- data/ext/{multifit.c → gsl_native/multifit.c} +142 -151
- data/ext/{multimin.c → gsl_native/multimin.c} +64 -92
- data/ext/{multimin_fsdf.c → gsl_native/multimin_fsdf.c} +16 -16
- data/ext/{multiroots.c → gsl_native/multiroots.c} +73 -76
- data/ext/{multiset.c → gsl_native/multiset.c} +4 -8
- data/ext/{ndlinear.c → gsl_native/ndlinear.c} +320 -321
- data/ext/{nmf.c → gsl_native/nmf.c} +11 -11
- data/ext/{nmf_wrap.c → gsl_native/nmf_wrap.c} +1 -1
- data/ext/{ntuple.c → gsl_native/ntuple.c} +23 -23
- data/ext/{odeiv.c → gsl_native/odeiv.c} +101 -116
- data/ext/gsl_native/ool.c +879 -0
- data/ext/{permutation.c → gsl_native/permutation.c} +39 -37
- data/ext/{poly.c → gsl_native/poly.c} +10 -13
- data/ext/{poly2.c → gsl_native/poly2.c} +16 -16
- data/ext/{poly_source.c → gsl_native/poly_source.h} +249 -293
- data/ext/{qrng.c → gsl_native/qrng.c} +9 -20
- data/ext/{randist.c → gsl_native/randist.c} +222 -247
- data/ext/{rational.c → gsl_native/rational.c} +12 -12
- data/ext/{rng.c → gsl_native/rng.c} +30 -47
- data/ext/{root.c → gsl_native/root.c} +47 -48
- data/ext/{sf.c → gsl_native/sf.c} +196 -244
- data/ext/{sf_airy.c → gsl_native/sf_airy.c} +2 -2
- data/ext/{sf_bessel.c → gsl_native/sf_bessel.c} +7 -7
- data/ext/{sf_clausen.c → gsl_native/sf_clausen.c} +1 -1
- data/ext/{sf_coulomb.c → gsl_native/sf_coulomb.c} +40 -40
- data/ext/{sf_coupling.c → gsl_native/sf_coupling.c} +30 -30
- data/ext/{sf_dawson.c → gsl_native/sf_dawson.c} +1 -1
- data/ext/{sf_debye.c → gsl_native/sf_debye.c} +1 -10
- data/ext/{sf_dilog.c → gsl_native/sf_dilog.c} +1 -1
- data/ext/{sf_elementary.c → gsl_native/sf_elementary.c} +3 -3
- data/ext/{sf_ellint.c → gsl_native/sf_ellint.c} +43 -43
- data/ext/{sf_elljac.c → gsl_native/sf_elljac.c} +3 -3
- data/ext/{sf_erfc.c → gsl_native/sf_erfc.c} +1 -5
- data/ext/{sf_exp.c → gsl_native/sf_exp.c} +3 -3
- data/ext/{sf_expint.c → gsl_native/sf_expint.c} +2 -12
- data/ext/{sf_fermi_dirac.c → gsl_native/sf_fermi_dirac.c} +1 -1
- data/ext/{sf_gamma.c → gsl_native/sf_gamma.c} +2 -6
- data/ext/{sf_gegenbauer.c → gsl_native/sf_gegenbauer.c} +1 -1
- data/ext/{sf_hyperg.c → gsl_native/sf_hyperg.c} +1 -1
- data/ext/{sf_laguerre.c → gsl_native/sf_laguerre.c} +4 -4
- data/ext/{sf_lambert.c → gsl_native/sf_lambert.c} +1 -1
- data/ext/{sf_legendre.c → gsl_native/sf_legendre.c} +1 -1
- data/ext/{sf_log.c → gsl_native/sf_log.c} +4 -4
- data/ext/gsl_native/sf_mathieu.c +235 -0
- data/ext/{sf_power.c → gsl_native/sf_power.c} +1 -1
- data/ext/{sf_psi.c → gsl_native/sf_psi.c} +3 -12
- data/ext/{sf_synchrotron.c → gsl_native/sf_synchrotron.c} +1 -1
- data/ext/{sf_transport.c → gsl_native/sf_transport.c} +1 -1
- data/ext/{sf_trigonometric.c → gsl_native/sf_trigonometric.c} +4 -4
- data/ext/{sf_zeta.c → gsl_native/sf_zeta.c} +1 -5
- data/ext/{signal.c → gsl_native/signal.c} +63 -68
- data/ext/{siman.c → gsl_native/siman.c} +45 -49
- data/ext/{sort.c → gsl_native/sort.c} +6 -7
- data/ext/{spline.c → gsl_native/spline.c} +28 -46
- data/ext/{stats.c → gsl_native/stats.c} +105 -118
- data/ext/{sum.c → gsl_native/sum.c} +34 -34
- data/ext/{tamu_anova.c → gsl_native/tamu_anova.c} +1 -1
- data/ext/{tensor.c → gsl_native/tensor.c} +8 -11
- data/ext/{tensor_source.c → gsl_native/tensor_source.h} +147 -148
- data/ext/{vector.c → gsl_native/vector.c} +11 -14
- data/ext/{vector_complex.c → gsl_native/vector_complex.c} +179 -184
- data/ext/{vector_double.c → gsl_native/vector_double.c} +178 -183
- data/ext/{vector_int.c → gsl_native/vector_int.c} +27 -29
- data/ext/{vector_source.c → gsl_native/vector_source.h} +428 -443
- data/ext/{wavelet.c → gsl_native/wavelet.c} +224 -246
- data/gsl.gemspec +29 -0
- data/lib/gsl.rb +8 -3
- data/lib/gsl/gnuplot.rb +3 -3
- data/lib/gsl/oper.rb +35 -60
- data/lib/gsl/version.rb +3 -0
- data/lib/rbgsl.rb +1 -3
- data/rdoc/alf.rdoc +5 -5
- data/rdoc/blas.rdoc +9 -9
- data/rdoc/bspline.rdoc +17 -17
- data/rdoc/changes.rdoc +4 -9
- data/rdoc/cheb.rdoc +25 -25
- data/rdoc/cholesky_complex.rdoc +21 -21
- data/rdoc/combi.rdoc +37 -37
- data/rdoc/complex.rdoc +22 -22
- data/rdoc/const.rdoc +47 -47
- data/rdoc/dht.rdoc +49 -49
- data/rdoc/diff.rdoc +42 -42
- data/rdoc/ehandling.rdoc +6 -6
- data/rdoc/eigen.rdoc +153 -153
- data/rdoc/fft.rdoc +146 -146
- data/rdoc/fit.rdoc +109 -109
- data/rdoc/function.rdoc +11 -11
- data/rdoc/graph.rdoc +17 -17
- data/rdoc/hist.rdoc +103 -103
- data/rdoc/hist2d.rdoc +42 -42
- data/rdoc/hist3d.rdoc +9 -9
- data/rdoc/integration.rdoc +110 -110
- data/rdoc/interp.rdoc +71 -71
- data/rdoc/intro.rdoc +8 -8
- data/rdoc/linalg.rdoc +188 -188
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +58 -58
- data/rdoc/matrix.rdoc +275 -275
- data/rdoc/min.rdoc +57 -57
- data/rdoc/monte.rdoc +22 -22
- data/rdoc/multimin.rdoc +95 -95
- data/rdoc/multiroot.rdoc +80 -80
- data/rdoc/narray.rdoc +32 -32
- data/rdoc/ndlinear.rdoc +54 -54
- data/rdoc/nonlinearfit.rdoc +100 -100
- data/rdoc/ntuple.rdoc +31 -31
- data/rdoc/odeiv.rdoc +88 -88
- data/rdoc/perm.rdoc +90 -90
- data/rdoc/poly.rdoc +66 -66
- data/rdoc/qrng.rdoc +21 -21
- data/rdoc/randist.rdoc +82 -82
- data/rdoc/ref.rdoc +57 -57
- data/rdoc/rng.rdoc +85 -85
- data/rdoc/roots.rdoc +57 -57
- data/rdoc/sf.rdoc +428 -428
- data/rdoc/siman.rdoc +19 -19
- data/rdoc/sort.rdoc +30 -30
- data/rdoc/start.rdoc +8 -8
- data/rdoc/stats.rdoc +52 -52
- data/rdoc/sum.rdoc +12 -12
- data/rdoc/tensor.rdoc +31 -31
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +39 -39
- data/rdoc/vector.rdoc +188 -188
- data/rdoc/vector_complex.rdoc +24 -24
- data/rdoc/wavelet.rdoc +46 -46
- 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/index_test.rb +61 -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 +98 -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/oper_test.rb +98 -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
- data/uncrustify.cfg +1693 -0
- metadata +337 -378
- data/README +0 -32
- data/VERSION +0 -1
- data/ext/bspline.c +0 -130
- data/ext/const.c +0 -673
- data/ext/cqp.c +0 -283
- data/ext/extconf.rb +0 -295
- data/ext/fcmp.c +0 -66
- data/ext/fresnel.c +0 -312
- data/ext/jacobi.c +0 -739
- data/ext/ool.c +0 -879
- data/ext/oper_complex_source.c +0 -253
- data/ext/sf_mathieu.c +0 -238
- data/include/rb_gsl_config.h +0 -62
- data/include/rb_gsl_dirac.h +0 -13
- data/rdoc/index.rdoc +0 -62
- data/rdoc/rngextra.rdoc +0 -11
- data/rdoc/screenshot.rdoc +0 -40
- 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
data/rdoc/tensor.rdoc
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#
|
2
2
|
# = Tensor manipulations
|
3
|
-
# The tensor library is developed by J. Burguet and distributed
|
4
|
-
# as an add-on package of GSL. See {here}[
|
3
|
+
# The tensor library is developed by J. Burguet and distributed
|
4
|
+
# as an add-on package of GSL. See {here}[https://sourceware.org/ml/gsl-discuss/2004-q4/msg00053.html] and {here}[https://sourceware.org/ml/gsl-discuss/2004-q4/msg00055.html].
|
5
5
|
#
|
6
|
-
# ==
|
6
|
+
# == Class methods
|
7
7
|
# ---
|
8
8
|
# * GSL::Tensor.new(rank, dimention)
|
9
9
|
# * GSL::Tensor.alloc(rank, dimention)
|
@@ -16,7 +16,7 @@
|
|
16
16
|
#
|
17
17
|
# Creates a tensor of rank <tt>rank</tt> and dimension <tt>dimention</tt>,
|
18
18
|
# and initializes all the elements to zero.
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# ---
|
21
21
|
# * GSL::Tensor.copy(tensor)
|
22
22
|
#
|
@@ -33,8 +33,8 @@
|
|
33
33
|
#
|
34
34
|
# Exchanges the elements of the tensor <tt>a</tt> and <tt>b</tt>.
|
35
35
|
#
|
36
|
-
# ==
|
37
|
-
# ===
|
36
|
+
# == Instance methods
|
37
|
+
# === Accessing tensor elements
|
38
38
|
# ---
|
39
39
|
# * GSL::Tensor#set_zero
|
40
40
|
#
|
@@ -45,13 +45,13 @@
|
|
45
45
|
# Sets all the element of the tensor <tt>self</tt> to <tt>x</tt>.
|
46
46
|
# ---
|
47
47
|
# * GSL::Tensor#set(indices, x)
|
48
|
-
# * GSL::Tensor#[indices]=x
|
48
|
+
# * \GSL::Tensor#[indices]=x
|
49
49
|
#
|
50
50
|
# Sets the element of the given indices to <tt>x</tt>.
|
51
51
|
#
|
52
52
|
# ---
|
53
53
|
# * GSL::Tensor#get(indices)
|
54
|
-
# * GSL::Tensor#[indices]
|
54
|
+
# * \GSL::Tensor#[indices]
|
55
55
|
#
|
56
56
|
# Returns the tensor element. If the number of indices given is smaller than the
|
57
57
|
# rank of the tensor, the method GSL::Tensor#subtensor is called.
|
@@ -70,31 +70,31 @@
|
|
70
70
|
#
|
71
71
|
# ---
|
72
72
|
# * GSL::Tensor#subtensor(indices)
|
73
|
-
# * GSL::Tensor#[indices]
|
73
|
+
# * \GSL::Tensor#[indices]
|
74
74
|
#
|
75
75
|
# Return a subtensor.
|
76
|
-
#
|
76
|
+
#
|
77
77
|
# Ex:
|
78
78
|
# >> require("gsl")
|
79
79
|
# => true
|
80
80
|
# >> t = Vector[1..125].to_tensor(3, 5)
|
81
|
-
# => GSL::Tensor:
|
81
|
+
# => GSL::Tensor:
|
82
82
|
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 6.000e+00 7.000e+00 ... ]
|
83
83
|
# >> t[0]
|
84
|
-
# => GSL::Tensor::View:
|
85
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00
|
86
|
-
# 6.000e+00 7.000e+00 8.000e+00 9.000e+00 1.000e+01
|
87
|
-
# 1.100e+01 1.200e+01 1.300e+01 1.400e+01 1.500e+01
|
88
|
-
# 1.600e+01 1.700e+01 1.800e+01 1.900e+01 2.000e+01
|
84
|
+
# => GSL::Tensor::View:
|
85
|
+
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00
|
86
|
+
# 6.000e+00 7.000e+00 8.000e+00 9.000e+00 1.000e+01
|
87
|
+
# 1.100e+01 1.200e+01 1.300e+01 1.400e+01 1.500e+01
|
88
|
+
# 1.600e+01 1.700e+01 1.800e+01 1.900e+01 2.000e+01
|
89
89
|
# 2.100e+01 2.200e+01 2.300e+01 2.400e+01 2.500e+01 ]
|
90
90
|
# >> t[0,2]
|
91
|
-
# => GSL::Tensor::View:
|
91
|
+
# => GSL::Tensor::View:
|
92
92
|
# [ 1.100e+01 1.200e+01 1.300e+01 1.400e+01 1.500e+01 ]
|
93
93
|
# >> t[3,1]
|
94
|
-
# => GSL::Tensor::View:
|
94
|
+
# => GSL::Tensor::View:
|
95
95
|
# [ 8.100e+01 8.200e+01 8.300e+01 8.400e+01 8.500e+01 ]
|
96
96
|
# >> t[1][2]
|
97
|
-
# => GSL::Tensor::View:
|
97
|
+
# => GSL::Tensor::View:
|
98
98
|
# [ 3.600e+01 3.700e+01 3.800e+01 3.900e+01 4.000e+01 ]
|
99
99
|
#
|
100
100
|
# ---
|
@@ -115,8 +115,8 @@
|
|
115
115
|
# * GSL::Tensor#to_matrix
|
116
116
|
#
|
117
117
|
# Converts the tensor of rank 2 into a <tt>GSL::Matrix::View</tt> object.
|
118
|
-
#
|
119
|
-
# ===
|
118
|
+
#
|
119
|
+
# === IO
|
120
120
|
# ---
|
121
121
|
# * GSL::Tensor#fwrite(io)
|
122
122
|
# * GSL::Tensor#fwrite(filename)
|
@@ -128,7 +128,7 @@
|
|
128
128
|
# * GSL::Tensor#fscanf(filename)
|
129
129
|
#
|
130
130
|
#
|
131
|
-
# ===
|
131
|
+
# === Max, min
|
132
132
|
# ---
|
133
133
|
# * GSL::Tensor#max
|
134
134
|
# * GSL::Tensor#min
|
@@ -138,7 +138,7 @@
|
|
138
138
|
# * GSL::Tensor#minmax_index
|
139
139
|
#
|
140
140
|
#
|
141
|
-
# ===
|
141
|
+
# === Tensor operations
|
142
142
|
# ---
|
143
143
|
# * GSL::Tensor#add(b)
|
144
144
|
# * GSL::Tensor#+(b)
|
@@ -160,7 +160,7 @@
|
|
160
160
|
# ---
|
161
161
|
# * GSL::Tensor#mul_elements(b)
|
162
162
|
#
|
163
|
-
# This calculate element-by-element multiplication of <tt>self</tt> and <tt>b</tt>,
|
163
|
+
# This calculate element-by-element multiplication of <tt>self</tt> and <tt>b</tt>,
|
164
164
|
# and returns a new tensor.
|
165
165
|
# ---
|
166
166
|
# * GSL::Tensor#mul_elements!(b)
|
@@ -170,7 +170,7 @@
|
|
170
170
|
# * GSL::Tensor#div_elements(b)
|
171
171
|
# * GSL::Tensor#/(b)
|
172
172
|
#
|
173
|
-
# This calculate element-by-element division of <tt>self</tt> and <tt>b</tt>,
|
173
|
+
# This calculate element-by-element division of <tt>self</tt> and <tt>b</tt>,
|
174
174
|
# and returns a new tensor.
|
175
175
|
# Multiplies the elements of tensor <tt>b</tt> to the elements of <tt>self</tt> , <tt>in-place</tt>.
|
176
176
|
# ---
|
@@ -216,10 +216,10 @@
|
|
216
216
|
# * GSL::Tensor#==(b)
|
217
217
|
#
|
218
218
|
# Returns <tt>true</tt> if the tensors have same size and elements
|
219
|
-
# equal to absolute accurary <tt>eps</tt> for all the indices,
|
219
|
+
# equal to absolute accurary <tt>eps</tt> for all the indices,
|
220
220
|
# and <tt>false</tt> otherwise.
|
221
221
|
#
|
222
|
-
# ===
|
222
|
+
# === Tensor properties
|
223
223
|
# ---
|
224
224
|
# * GSL::Tensor#isnull
|
225
225
|
#
|
@@ -242,10 +242,10 @@
|
|
242
242
|
#
|
243
243
|
# Returns the size
|
244
244
|
#
|
245
|
-
# {prev}[link:
|
246
|
-
# {next}[link:
|
245
|
+
# {prev}[link:rdoc/rng_rdoc.html#label-Random+number+generator+initialization]
|
246
|
+
# {next}[link:rdoc/narray_rdoc.html]
|
247
247
|
#
|
248
|
-
# {Reference index}[link:
|
249
|
-
# {top}[link:
|
248
|
+
# {Reference index}[link:rdoc/ref_rdoc.html]
|
249
|
+
# {top}[link:index.html]
|
250
250
|
#
|
251
251
|
#
|
data/rdoc/tut.rdoc
CHANGED
data/rdoc/use.rdoc
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
#
|
2
2
|
# = Using Ruby/GSL
|
3
|
-
# ==
|
4
|
-
# See {here}[link:
|
3
|
+
# == Installation
|
4
|
+
# See {here}[link:index.html].
|
5
5
|
#
|
6
|
-
# ==
|
6
|
+
# == Load the library
|
7
7
|
# Put at the head of your scripts,
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# require 'rubygems' # if installed via RubyGems
|
10
10
|
# require 'gsl'
|
11
11
|
#
|
12
|
-
# ==
|
12
|
+
# == Naming conventions, C Structs and Ruby Classes
|
13
13
|
#
|
14
|
-
# Most of the GSL data types, functions or constants are named as <tt>gsl_xxx</tt> or <tt>GSL_XXX</tt>.
|
15
|
-
# In Ruby/GSL, the prefix <tt>gsl_</tt> is replaced by the module identifier <tt>GSL::</tt>,
|
14
|
+
# Most of the GSL data types, functions or constants are named as <tt>gsl_xxx</tt> or <tt>GSL_XXX</tt>.
|
15
|
+
# In Ruby/GSL, the prefix <tt>gsl_</tt> is replaced by the module identifier <tt>GSL::</tt>,
|
16
16
|
# where <tt>GSL</tt> is the top level module of Ruby/GSL,
|
17
17
|
# and the Ruby classes are defined for each of the GSL C structs under the <tt>GSL</tt> module.
|
18
18
|
# According to the Ruby manner, the name of each class begins with a capital. For example,
|
@@ -32,40 +32,40 @@
|
|
32
32
|
# * Singleton method <tt>GSL::Linalg::LU.decomp</tt>
|
33
33
|
# * Method <tt>GSL::Matrix#LU_decomp</tt>
|
34
34
|
#
|
35
|
-
# ==
|
35
|
+
# == Examples
|
36
36
|
# See the directories "examples/" and "tests/".
|
37
37
|
#
|
38
38
|
# Some of the examples use the <tt>graph</tt> utility to show the results. The <tt>graph</tt>
|
39
|
-
# utility is included in the {GNU plotutils}[
|
40
|
-
# related packages are available from
|
41
|
-
# {here}[http://
|
39
|
+
# utility is included in the {GNU plotutils}[https://gnu.org/software/plotutils/plotutils.html] package. Windows-cygwin binaries of <tt>GNU plotutils</tt> and
|
40
|
+
# related packages are available from
|
41
|
+
# {here}[http://gnuwin32.sourceforge.net/packages/plotutils.htm].
|
42
42
|
#
|
43
|
-
# ==
|
43
|
+
# == Modules and Classes
|
44
44
|
# The following is the list of Ruby/GSL modules and classes, <Name> (<Module or Class>)
|
45
45
|
#
|
46
|
-
# * GSL (Module)
|
47
|
-
# * Complex (Class)
|
48
|
-
# * Poly (Class)
|
46
|
+
# * GSL (Module)
|
47
|
+
# * Complex (Class)
|
48
|
+
# * Poly (Class)
|
49
49
|
# * Workspace (Class)
|
50
50
|
# * DividedDifferenceRepresentation (Class)
|
51
51
|
# * Taylor (Class)
|
52
|
-
# * Sf (Module)
|
52
|
+
# * Sf (Module)
|
53
53
|
# * Result (Class)
|
54
54
|
# * Block (Class)
|
55
55
|
# * Int (Class)
|
56
56
|
# * Byte (Class)
|
57
57
|
# * Index < Permutation
|
58
|
-
# * Vector (Class)
|
58
|
+
# * Vector (Class)
|
59
59
|
# * View < Vector
|
60
60
|
# * Complex (Class)
|
61
61
|
# * View < Vector::Complex
|
62
|
-
# * Matrix (Class)
|
62
|
+
# * Matrix (Class)
|
63
63
|
# * View < Matrix (Class)
|
64
64
|
# * Complex (Class)
|
65
65
|
# * View < Matrix::Complex
|
66
|
-
# * Permutation (Class)
|
67
|
-
# * Combination (Class)
|
68
|
-
# * Linalg (Module)
|
66
|
+
# * Permutation (Class)
|
67
|
+
# * Combination (Class)
|
68
|
+
# * Linalg (Module)
|
69
69
|
# * LU (Module)
|
70
70
|
# * QR (Module)
|
71
71
|
# * QRPT (Module)
|
@@ -90,12 +90,12 @@
|
|
90
90
|
# * Workspace (Class)
|
91
91
|
# * Hermv (Module)
|
92
92
|
# * Workspace (Class)
|
93
|
-
# * FFT (Module)
|
93
|
+
# * FFT (Module)
|
94
94
|
# * ComplexWavetable (Class)
|
95
95
|
# * ComplexWorkspace (Class)
|
96
96
|
# * HalfComplexWavetable (Class)
|
97
97
|
# * RealWavetable (Class)
|
98
|
-
# * RealWorkspace (Class)
|
98
|
+
# * RealWorkspace (Class)
|
99
99
|
# * Wavelet (Class)
|
100
100
|
# * Wavelet2d < Wavelet
|
101
101
|
# * Function (Class)
|
@@ -104,15 +104,15 @@
|
|
104
104
|
# * Workspace
|
105
105
|
# * QAWS_Table
|
106
106
|
# * QAWO_Table
|
107
|
-
# * Rng (Class)
|
107
|
+
# * Rng (Class)
|
108
108
|
# * QRng (Class)
|
109
109
|
# * Ran (Module)
|
110
|
-
# * Stats (Module)
|
111
|
-
# * Histogram (Class)
|
110
|
+
# * Stats (Module)
|
111
|
+
# * Histogram (Class)
|
112
112
|
# * Integral < Histogram
|
113
113
|
# * Pdf (Class)
|
114
114
|
# * Histogram2d (Class)
|
115
|
-
# * N-tuples
|
115
|
+
# * N-tuples
|
116
116
|
# * SelectFn (Class)
|
117
117
|
# * ValueFn (Class)
|
118
118
|
# * Monte (Module)
|
@@ -135,43 +135,43 @@
|
|
135
135
|
# * Interp (Class)
|
136
136
|
# * Accel (Class)
|
137
137
|
# * Spline (Class)
|
138
|
-
# * Diff (Module)
|
138
|
+
# * Diff (Module)
|
139
139
|
# * Deriv (Module)
|
140
|
-
# * Cheb (Class)
|
141
|
-
# * Sum (Module)
|
140
|
+
# * Cheb (Class)
|
141
|
+
# * Sum (Module)
|
142
142
|
# * Levin_u (Class)
|
143
143
|
# * Levin_utrunc (Class)
|
144
|
-
# * Dht (Class)
|
144
|
+
# * Dht (Class)
|
145
145
|
# * Root (Module)
|
146
146
|
# * Solver (Class)
|
147
147
|
# * FdfSolver (Class)
|
148
|
-
# * Min(Module)
|
148
|
+
# * Min(Module)
|
149
149
|
# * FMinimizer (Class)
|
150
150
|
# * MultiRoot (Module)
|
151
151
|
# * Function (Class)
|
152
152
|
# * FSolver (Class)
|
153
153
|
# * Function_fdf (Class)
|
154
154
|
# * FdfSolver (Class)
|
155
|
-
# * MultiMin (Module)
|
155
|
+
# * MultiMin (Module)
|
156
156
|
# * Function (Class)
|
157
157
|
# * FMinimizer (Class)
|
158
158
|
# * Function_fdf (Class)
|
159
159
|
# * FdfMinimizer (Class)
|
160
|
-
# * Fit (Module)
|
160
|
+
# * Fit (Module)
|
161
161
|
# * MultiFit (Module)
|
162
162
|
# * Workspace (Class)
|
163
163
|
# * Solver (Class)
|
164
164
|
# * Function_fdf (Class)
|
165
165
|
# * FdfSolver (Class)
|
166
|
-
# * CONST (Module)
|
166
|
+
# * CONST (Module)
|
167
167
|
# * MKSA (Module)
|
168
168
|
# * CGSM (Module)
|
169
169
|
# * NUM (Module)
|
170
170
|
#
|
171
|
-
# {prev}[link:
|
172
|
-
# {next}[link:
|
171
|
+
# {prev}[link:rdoc/intro_rdoc.html]
|
172
|
+
# {next}[link:rdoc/ehandling_rdoc.html]
|
173
173
|
#
|
174
|
-
# {Reference index}[link:
|
175
|
-
# {top}[link:
|
174
|
+
# {Reference index}[link:rdoc/ref_rdoc.html]
|
175
|
+
# {top}[link:index.html]
|
176
176
|
#
|
177
177
|
#
|
data/rdoc/vector.rdoc
CHANGED
@@ -2,37 +2,37 @@
|
|
2
2
|
# = GSL::Vector class
|
3
3
|
#
|
4
4
|
# Contents:
|
5
|
-
# 1. {Class methods}[link:
|
6
|
-
# 1. {Notes}[link:
|
7
|
-
# 1. {Methods}[link:
|
8
|
-
# 1. {Accessing vector elements}[link:
|
9
|
-
# 1. {Initializing vector elements}[link:
|
10
|
-
# 1. {Iterators}[link:
|
11
|
-
# 1. {IO}[link:
|
12
|
-
# 1. {Copying vectors}[link:
|
13
|
-
# 1. {Vector views}[link:
|
14
|
-
# 1. {Vector operations}[link:
|
15
|
-
# 1. {Vector operations with size changes}[link:
|
16
|
-
# 1. {Finding maximum and minimum elements of vectors}[link:
|
17
|
-
# 1. {Vector properties}[link:
|
18
|
-
# 1. {Element-wise vector comparison}[link:
|
19
|
-
# 1. {Histogram}[link:
|
20
|
-
# 1. {Sorting}[link:
|
21
|
-
# 1. {BLAS methods}[link:
|
22
|
-
# 1. {Data type conversions}[link:
|
23
|
-
# 1. {NArray}[link:
|
24
|
-
# 1. {GNU graph interface}[link:
|
25
|
-
#
|
26
|
-
# See also {GSL::Vector::Complex}[link:
|
27
|
-
#
|
28
|
-
# ==
|
29
|
-
#
|
30
|
-
# ---
|
31
|
-
# * GSL::Vector.alloc(ary)
|
32
|
-
# * GSL::Vector.alloc(ary)
|
33
|
-
# * GSL::Vector.alloc(range)
|
34
|
-
# * GSL::Vector.alloc(size)
|
35
|
-
# * GSL::Vector.alloc(elm0, elm1, ....)
|
5
|
+
# 1. {Class methods}[link:rdoc/vector_rdoc.html#label-Class+methods]
|
6
|
+
# 1. {Notes}[link:rdoc/vector_rdoc.html#label-NOTE%3A]
|
7
|
+
# 1. {Methods}[link:rdoc/vector_rdoc.html#label-Methods]
|
8
|
+
# 1. {Accessing vector elements}[link:rdoc/vector_rdoc.html#label-Accessing+vector+elements]
|
9
|
+
# 1. {Initializing vector elements}[link:rdoc/vector_rdoc.html#label-Initializing+vector+elements]
|
10
|
+
# 1. {Iterators}[link:rdoc/vector_rdoc.html#label-Iterators]
|
11
|
+
# 1. {IO}[link:rdoc/vector_rdoc.html#label-IO]
|
12
|
+
# 1. {Copying vectors}[link:rdoc/vector_rdoc.html#label-Copying+vectors]
|
13
|
+
# 1. {Vector views}[link:rdoc/vector_rdoc.html#label-Vector+views]
|
14
|
+
# 1. {Vector operations}[link:rdoc/vector_rdoc.html#label-Vector+operations]
|
15
|
+
# 1. {Vector operations with size changes}[link:rdoc/vector_rdoc.html#label-Vector+operations+with+size+changes]
|
16
|
+
# 1. {Finding maximum and minimum elements of vectors}[link:rdoc/vector_rdoc.html#label-Finding+maximum+and+minimum+elements+of+vectors]
|
17
|
+
# 1. {Vector properties}[link:rdoc/vector_rdoc.html#label-Vector+Properties]
|
18
|
+
# 1. {Element-wise vector comparison}[link:rdoc/vector_rdoc.html#label-Element-wise+vector+comparison]
|
19
|
+
# 1. {Histogram}[link:rdoc/vector_rdoc.html#label-Histogram]
|
20
|
+
# 1. {Sorting}[link:rdoc/vector_rdoc.html#label-Sorting]
|
21
|
+
# 1. {BLAS methods}[link:rdoc/vector_rdoc.html#label-BLAS+Methods]
|
22
|
+
# 1. {Data type conversions}[link:rdoc/vector_rdoc.html#label-Data+type+conversions]
|
23
|
+
# 1. {NArray}[link:rdoc/vector_rdoc.html#label-NArray+conversions]
|
24
|
+
# 1. {GNU graph interface}[link:rdoc/vector_rdoc.html#label-Graphics]
|
25
|
+
#
|
26
|
+
# See also {GSL::Vector::Complex}[link:rdoc/vector_complex_rdoc.html].
|
27
|
+
#
|
28
|
+
# == Class methods
|
29
|
+
#
|
30
|
+
# ---
|
31
|
+
# * GSL::Vector.alloc(ary)
|
32
|
+
# * GSL::Vector.alloc(ary)
|
33
|
+
# * GSL::Vector.alloc(range)
|
34
|
+
# * GSL::Vector.alloc(size)
|
35
|
+
# * GSL::Vector.alloc(elm0, elm1, ....)
|
36
36
|
# * GSL::Vector[elm0, elm1, ....]
|
37
37
|
#
|
38
38
|
# Constructors.
|
@@ -57,12 +57,12 @@
|
|
57
57
|
# ---
|
58
58
|
# * GSL::Vector.linspace(min, max, n = 10)
|
59
59
|
#
|
60
|
-
# Creates an <tt>GSL::Vector</tt> with <tt>n</tt> linearly spaced elements
|
61
|
-
# between <tt>min</tt> and <tt>max</tt>. If <tt>min</tt> is greater than <tt>max</tt>,
|
60
|
+
# Creates an <tt>GSL::Vector</tt> with <tt>n</tt> linearly spaced elements
|
61
|
+
# between <tt>min</tt> and <tt>max</tt>. If <tt>min</tt> is greater than <tt>max</tt>,
|
62
62
|
# the elements are stored in decreasing order. This mimics the <tt>linspace</tt>
|
63
|
-
# function of {GNU Octave}[
|
63
|
+
# function of {GNU Octave}[https://gnu.org/software/octave/].
|
64
64
|
#
|
65
|
-
# Ex:
|
65
|
+
# Ex:
|
66
66
|
# >> x = GSL::Vector.linspace(0, 10, 5)
|
67
67
|
# [ 0.000e+00 2.500e+00 5.000e+00 7.500e+00 1.000e+01 ]
|
68
68
|
# >> y = GSL::Vector.linspace(10, 0, 5)
|
@@ -71,7 +71,7 @@
|
|
71
71
|
# ---
|
72
72
|
# * GSL::Vector.logspace(min, max, n)
|
73
73
|
#
|
74
|
-
# Similar to <tt>GSL::Vector#linspace</tt> except that the values are
|
74
|
+
# Similar to <tt>GSL::Vector#linspace</tt> except that the values are
|
75
75
|
# logarithmically spaced from 10^<tt>min</tt> to 10^<tt>max</tt>.
|
76
76
|
#
|
77
77
|
# Ex:
|
@@ -83,7 +83,7 @@
|
|
83
83
|
# ---
|
84
84
|
# * GSL::Vector.logspace2(min, max, n)
|
85
85
|
#
|
86
|
-
# Similar to <tt>GSL::Vector#linspace</tt> except that the values are
|
86
|
+
# Similar to <tt>GSL::Vector#linspace</tt> except that the values are
|
87
87
|
# logarithmically spaced from <tt>min</tt> to <tt>max</tt>.
|
88
88
|
#
|
89
89
|
# Ex:
|
@@ -97,13 +97,13 @@
|
|
97
97
|
#
|
98
98
|
# This creates a vector of length <tt>n</tt> with elements from <tt>start</tt>
|
99
99
|
# with interval <tt>step</tt> (mimics NArray#indgen).
|
100
|
-
#
|
100
|
+
#
|
101
101
|
# Ex:
|
102
102
|
# >> v = GSL::Vector::Int.indgen(5)
|
103
|
-
# => GSL::Vector::Int:
|
103
|
+
# => GSL::Vector::Int:
|
104
104
|
# [ 0 1 2 3 4 ]
|
105
105
|
# >> v = GSL::Vector::Int.indgen(5, 3)
|
106
|
-
# => GSL::Vector::Int:
|
106
|
+
# => GSL::Vector::Int:
|
107
107
|
# [ 3 4 5 6 7 ]
|
108
108
|
# >> v = GSL::Vector.indgen(4, 1.2, 0.3)
|
109
109
|
# => GSL::Vector
|
@@ -123,39 +123,39 @@
|
|
123
123
|
# c = [6, 6, 7]
|
124
124
|
# d = [5, 7, 9]
|
125
125
|
#
|
126
|
-
# ===
|
126
|
+
# === NArray Extension
|
127
127
|
# If an <tt>NArray</tt> object is given, a newly allocated vector is created.
|
128
128
|
#
|
129
129
|
# Ex:
|
130
130
|
# na = NArray[1.0, 2, 3, 4, 5]
|
131
|
-
# p na <----- NArray.float(5):
|
131
|
+
# p na <----- NArray.float(5):
|
132
132
|
# [ 1.0, 2.0, 3.0, 4.0, 5.0]
|
133
|
-
# v = GSL::Vector.alloc(na)
|
133
|
+
# v = GSL::Vector.alloc(na)
|
134
134
|
# p v <----- [ 1 2 3 4 5 ]
|
135
135
|
#
|
136
136
|
#
|
137
|
-
# See also {here}[link:
|
137
|
+
# See also {here}[link:rdoc/vector_rdoc.html#label-NArray+conversions].
|
138
138
|
#
|
139
|
-
# ==
|
139
|
+
# == NOTE:
|
140
140
|
# In Ruby/GSL, vector length is limited within the range of Fixnum.
|
141
141
|
# For 32-bit CPU, the maximum of vector length is 2^30 ~ 1e9.
|
142
142
|
#
|
143
|
-
# ==
|
143
|
+
# == Methods
|
144
144
|
#
|
145
|
-
# ===
|
145
|
+
# === Accessing vector elements
|
146
146
|
# ---
|
147
147
|
# * GSL::Vector#get(args)
|
148
|
-
# * GSL::Vector#[args]
|
148
|
+
# * \GSL::Vector#[args]
|
149
149
|
#
|
150
150
|
# Returns elements(s) of the vector <tt>self</tt> if <tt>args</tt> is a single
|
151
151
|
# <tt>Fixnum</tt>, a single <tt>Array</tt> of <tt>Fixnums</tt>, or a single
|
152
152
|
# <tt>GSL::Permutation</tt> (or <tt>GSL::Index</tt>). For all other <tt>args</tt>,
|
153
153
|
# the arguments are treated as with <tt>Vector#subvector</tt> and a
|
154
|
-
# <tt>Vector::View</tt> is returned.
|
154
|
+
# <tt>Vector::View</tt> is returned.
|
155
155
|
#
|
156
156
|
# ---
|
157
157
|
# * GSL::Vector#set(args, val)
|
158
|
-
# * GSL::Vector#[args] = val
|
158
|
+
# * \GSL::Vector#[args] = val
|
159
159
|
#
|
160
160
|
# If <tt>args</tt> is empty, behaves as <tt>#set_all</tt> and <tt>val</tt> must be a
|
161
161
|
# <tt>Numeric</tt>.
|
@@ -211,7 +211,7 @@
|
|
211
211
|
# [ 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 1.230e+02 ]
|
212
212
|
#
|
213
213
|
#
|
214
|
-
# ===
|
214
|
+
# === Initializing vector elements
|
215
215
|
# ---
|
216
216
|
# * GSL::Vector#set_all(x)
|
217
217
|
#
|
@@ -226,19 +226,19 @@
|
|
226
226
|
# * GSL::Vector#set_basis!(i)
|
227
227
|
#
|
228
228
|
# This method makes a basis vector by setting all the elements of the vector
|
229
|
-
# to zero except for the <tt>i</tt>-th element, which is set to one.
|
229
|
+
# to zero except for the <tt>i</tt>-th element, which is set to one.
|
230
230
|
# For a vector <tt>v</tt> of size 10, the method
|
231
231
|
# v.set_basis!(4)
|
232
|
-
# sets the vector <tt>v</tt> to a basis vector <tt>[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]</tt>.
|
232
|
+
# sets the vector <tt>v</tt> to a basis vector <tt>[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]</tt>.
|
233
233
|
#
|
234
234
|
# ---
|
235
235
|
# * GSL::Vector#set_basis(i)
|
236
236
|
#
|
237
|
-
# This method returns a new basis vector by setting all the elements of the
|
238
|
-
# vector to zero except for the i-th element which is set to one.
|
237
|
+
# This method returns a new basis vector by setting all the elements of the
|
238
|
+
# vector to zero except for the i-th element which is set to one.
|
239
239
|
# For a vector <tt>v</tt> of size 10, the method
|
240
240
|
# vb = v.set_basis(4)
|
241
|
-
# creates a new vector <tt>vb</tt> with elements <tt>[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]</tt>.
|
241
|
+
# creates a new vector <tt>vb</tt> with elements <tt>[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]</tt>.
|
242
242
|
# The vector <tt>v</tt> is not changed.
|
243
243
|
#
|
244
244
|
# ---
|
@@ -247,7 +247,7 @@
|
|
247
247
|
#
|
248
248
|
# Mimics NArray#indgen!.
|
249
249
|
#
|
250
|
-
# ===
|
250
|
+
# === Iterators
|
251
251
|
# ---
|
252
252
|
# * GSL::Vector#each
|
253
253
|
# * GSL::Vector#reverse_each
|
@@ -262,7 +262,7 @@
|
|
262
262
|
# * GSL::Vector#each_index
|
263
263
|
# * GSL::Vector#reverse_each_index
|
264
264
|
#
|
265
|
-
# Iterators
|
265
|
+
# Iterators
|
266
266
|
#
|
267
267
|
# ---
|
268
268
|
# * GSL::Vector#collect { |item| .. }
|
@@ -297,7 +297,7 @@
|
|
297
297
|
# => GSL::Vector::Int
|
298
298
|
# [ 0 1 4 9 16 25 ]
|
299
299
|
#
|
300
|
-
# ===
|
300
|
+
# === IO
|
301
301
|
# ---
|
302
302
|
# * GSL::Vector#print
|
303
303
|
# * GSL::Vector#fprintf(io, format = "%e")
|
@@ -309,20 +309,20 @@
|
|
309
309
|
# * GSL::Vector#fread(io)
|
310
310
|
# * GSL::Vector#fread(filename)
|
311
311
|
#
|
312
|
-
# Methods for writing or reading the vector.
|
312
|
+
# Methods for writing or reading the vector.
|
313
313
|
# The first argument is an <tt>IO</tt> or a <tt>String</tt> object.
|
314
314
|
#
|
315
|
-
# ===
|
315
|
+
# === Copying vectors
|
316
316
|
# ---
|
317
317
|
# * GSL::Vector#clone
|
318
318
|
# * GSL::Vector#duplicate
|
319
319
|
#
|
320
320
|
# Create a new vector of the same elements.
|
321
321
|
#
|
322
|
-
# ===
|
322
|
+
# === Vector views
|
323
323
|
# The <tt>GSL::Vector::View</tt> class is defined to be used as "references" to
|
324
324
|
# vectors. Since the <tt>Vector::View</tt> class is a subclass of <tt>Vector</tt>,
|
325
|
-
# an instance of the <tt>View</tt> class created by slicing a <tt>Vector</tt> object
|
325
|
+
# an instance of the <tt>View</tt> class created by slicing a <tt>Vector</tt> object
|
326
326
|
# can be used same as the original vector. A
|
327
327
|
# <tt>View</tt> object shares the data with the original vector, i.e. any changes
|
328
328
|
# in the elements of the <tt>View</tt> object affect to the original vector.
|
@@ -371,30 +371,30 @@
|
|
371
371
|
# * GSL::Vector#matrix_view(n1, n2)
|
372
372
|
#
|
373
373
|
# This creates a <tt>Matrix::View</tt> object from the vector <tt>self</tt>.
|
374
|
-
# It enables to use the vector as a {Matrix}[link:
|
374
|
+
# It enables to use the vector as a {Matrix}[link:rdoc/matrix_rdoc.html] object.
|
375
375
|
#
|
376
376
|
# * Ex:
|
377
377
|
#
|
378
378
|
# >> v = GSL::Vector::Int.alloc(1..9)
|
379
|
-
# => GSL::Vector::Int:
|
379
|
+
# => GSL::Vector::Int:
|
380
380
|
# [ 1 2 3 4 5 6 7 8 9 ]
|
381
381
|
# >> m = v.matrix_view(3, 3)
|
382
|
-
# => GSL::Matrix::Int::View:
|
383
|
-
# [ 1 2 3
|
384
|
-
# 4 5 6
|
382
|
+
# => GSL::Matrix::Int::View:
|
383
|
+
# [ 1 2 3
|
384
|
+
# 4 5 6
|
385
385
|
# 7 8 9 ]
|
386
386
|
# >> m[1][2] = 99
|
387
387
|
# => 99
|
388
388
|
# >> v
|
389
|
-
# => GSL::Vector::Int:
|
389
|
+
# => GSL::Vector::Int:
|
390
390
|
# [ 1 2 3 4 5 99 7 8 9 ]
|
391
391
|
#
|
392
|
-
# ===
|
392
|
+
# === Vector operations
|
393
393
|
#
|
394
394
|
# ---
|
395
395
|
# * GSL::Vector#swap_elements(i, j)
|
396
396
|
#
|
397
|
-
# This method exchanges the i-th and j-th elements of the vector <tt>in-place</tt>.
|
397
|
+
# This method exchanges the i-th and j-th elements of the vector <tt>in-place</tt>.
|
398
398
|
#
|
399
399
|
# ---
|
400
400
|
# * GSL::Vector#reverse
|
@@ -402,10 +402,10 @@
|
|
402
402
|
# Reverses the order of the elements of the vector.
|
403
403
|
#
|
404
404
|
# >> v = GSL::Vector::Int[1..5]
|
405
|
-
# => GSL::Vector::Int:
|
405
|
+
# => GSL::Vector::Int:
|
406
406
|
# [ 1 2 3 4 5 ]
|
407
407
|
# >> v.reverse
|
408
|
-
# => GSL::Vector::Int:
|
408
|
+
# => GSL::Vector::Int:
|
409
409
|
# [ 5 4 3 2 1 ]
|
410
410
|
#
|
411
411
|
# ---
|
@@ -417,20 +417,20 @@
|
|
417
417
|
# Transpose the vector from a row vector into a column vector and vice versa.
|
418
418
|
#
|
419
419
|
# >> v = GSL::Vector::Int[1..5]
|
420
|
-
# => GSL::Vector::Int:
|
420
|
+
# => GSL::Vector::Int:
|
421
421
|
# [ 1 2 3 4 5 ]
|
422
422
|
# >> v.col
|
423
|
-
# => GSL::Vector::Int::Col:
|
424
|
-
# [ 1
|
425
|
-
# 2
|
426
|
-
# 3
|
427
|
-
# 4
|
423
|
+
# => GSL::Vector::Int::Col:
|
424
|
+
# [ 1
|
425
|
+
# 2
|
426
|
+
# 3
|
427
|
+
# 4
|
428
428
|
# 5 ]
|
429
429
|
#
|
430
430
|
# ---
|
431
431
|
# * GSL::Vector#add(b)
|
432
432
|
#
|
433
|
-
# Adds the elements of vector <tt>b</tt> to the elements
|
433
|
+
# Adds the elements of vector <tt>b</tt> to the elements
|
434
434
|
# of the vector <tt>self</tt>. A new vector is created, and the vector
|
435
435
|
# <tt>self</tt> is not changed.
|
436
436
|
#
|
@@ -453,7 +453,7 @@
|
|
453
453
|
# * GSL::Vector#scale(x)
|
454
454
|
# * GSL::Vector#scale!(x)
|
455
455
|
#
|
456
|
-
# This method multiplies the elements of vector <tt>self</tt> by
|
456
|
+
# This method multiplies the elements of vector <tt>self</tt> by
|
457
457
|
# the constant factor <tt>x</tt>.
|
458
458
|
#
|
459
459
|
# ---
|
@@ -490,34 +490,34 @@
|
|
490
490
|
# >> v = GSL::Vector[1, 2]
|
491
491
|
# [ 1 2 ]
|
492
492
|
# >> v*2
|
493
|
-
# [ 2 4 ]
|
493
|
+
# [ 2 4 ]
|
494
494
|
# 1. Element-by-element multiplication
|
495
495
|
# >> a = GSL::Vector[1, 2]; b = GSL::Vector[3, 4]
|
496
496
|
# [ 3 4 ]
|
497
497
|
# >> a*b
|
498
|
-
# [ 3 8 ]
|
498
|
+
# [ 3 8 ]
|
499
499
|
# 1. Inner product
|
500
500
|
# >> a = GSL::Vector[1, 2]; b = GSL::Vector[3, 4]
|
501
|
-
# [ 3
|
501
|
+
# [ 3
|
502
502
|
# 4 ]
|
503
503
|
# >> a*b.col
|
504
|
-
# => 11.0
|
504
|
+
# => 11.0
|
505
505
|
# 1. GSL::Vector::Col*Vector -> GSL::Matrix
|
506
506
|
# >> a = GSL::Vector::Col[1, 2]; b = GSL::Vector[3, 4]
|
507
507
|
# [ 3 4 ]
|
508
508
|
# >> a*b
|
509
|
-
# [ 3 4
|
509
|
+
# [ 3 4
|
510
510
|
# 6 8 ]
|
511
511
|
# 1. GSL::Matrix*Vector::Col -> GSL::Vector::Col
|
512
512
|
# >> a = GSL::Vector[1, 2]; m = GSL::Matrix[[2, 3], [4, 5]]
|
513
|
-
# [ 2 3
|
513
|
+
# [ 2 3
|
514
514
|
# 4 5 ]
|
515
515
|
# >> m*a <--- Error
|
516
516
|
# TypeError: Operation with GSL::Vector is not defined (GSL::Vector::Col expected)
|
517
517
|
# from (irb):30:in `*'
|
518
518
|
# from (irb):30
|
519
519
|
# >> m*a.col
|
520
|
-
# [ 8
|
520
|
+
# [ 8
|
521
521
|
# 14 ]
|
522
522
|
#
|
523
523
|
# ---
|
@@ -565,7 +565,7 @@
|
|
565
565
|
# * GSL::Vector#duplicate
|
566
566
|
#
|
567
567
|
# These create a copy of the vector <tt>self</tt>.
|
568
|
-
#
|
568
|
+
#
|
569
569
|
# ---
|
570
570
|
# * GSL::Vector.connect(v1, v2, v3, ...)
|
571
571
|
# * GSL::Vector#connect(v2, v3, ...)
|
@@ -573,13 +573,13 @@
|
|
573
573
|
# Creates a new vector by connecting all the elements of the given vectors.
|
574
574
|
#
|
575
575
|
# >> v1 = GSL::Vector::Int[1, 3]
|
576
|
-
# => GSL::Vector::Int:
|
576
|
+
# => GSL::Vector::Int:
|
577
577
|
# [ 1 3 ]
|
578
578
|
# >> v2 = GSL::Vector::Int[4, 3, 5]
|
579
|
-
# => GSL::Vector::Int:
|
579
|
+
# => GSL::Vector::Int:
|
580
580
|
# [ 4 3 5 ]
|
581
581
|
# >> v1.connect(v2)
|
582
|
-
# => GSL::Vector::Int:
|
582
|
+
# => GSL::Vector::Int:
|
583
583
|
# [ 1 3 4 3 5 ]
|
584
584
|
#
|
585
585
|
# ---
|
@@ -597,10 +597,10 @@
|
|
597
597
|
# Creates a new vector, with elements <tt>fabs(x_i)</tt>.
|
598
598
|
#
|
599
599
|
# >> v = GSL::Vector::Int[-3, 2, -5, 4]
|
600
|
-
# => GSL::Vector::Int:
|
600
|
+
# => GSL::Vector::Int:
|
601
601
|
# [ -3 2 -5 4 ]
|
602
602
|
# >> v.abs
|
603
|
-
# => GSL::Vector::Int:
|
603
|
+
# => GSL::Vector::Int:
|
604
604
|
# [ 3 2 5 4 ]
|
605
605
|
#
|
606
606
|
# ---
|
@@ -610,10 +610,10 @@
|
|
610
610
|
# Create a new vector, with elements <tt>x_i*x_i</tt>.
|
611
611
|
#
|
612
612
|
# >> v = GSL::Vector::Int[1..4]
|
613
|
-
# => GSL::Vector::Int:
|
613
|
+
# => GSL::Vector::Int:
|
614
614
|
# [ 1 2 3 4 ]
|
615
615
|
# >> v.square
|
616
|
-
# => GSL::Vector::Int:
|
616
|
+
# => GSL::Vector::Int:
|
617
617
|
# [ 1 4 9 16 ]
|
618
618
|
#
|
619
619
|
# ---
|
@@ -655,19 +655,19 @@
|
|
655
655
|
# >> require("gsl")
|
656
656
|
# => true
|
657
657
|
# >> a = GSL::Vector[-1, -2, -3, -4]
|
658
|
-
# => GSL::Vector:
|
658
|
+
# => GSL::Vector:
|
659
659
|
# [ -1.000e+00 -2.000e+00 -3.000e+00 -4.000e+00 ]
|
660
660
|
# >> b = a.abs
|
661
|
-
# => GSL::Vector:
|
661
|
+
# => GSL::Vector:
|
662
662
|
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 ]
|
663
663
|
# >> b.sqrt
|
664
|
-
# => GSL::Vector:
|
664
|
+
# => GSL::Vector:
|
665
665
|
# [ 1.000e+00 1.414e+00 1.732e+00 2.000e+00 ]
|
666
666
|
# >> b.square
|
667
|
-
# => GSL::Vector:
|
667
|
+
# => GSL::Vector:
|
668
668
|
# [ 1.000e+00 4.000e+00 9.000e+00 1.600e+01 ]
|
669
669
|
# >> c = b.normalize(2)
|
670
|
-
# => GSL::Vector:
|
670
|
+
# => GSL::Vector:
|
671
671
|
# [ 2.582e-01 5.164e-01 7.746e-01 1.033e+00 ]
|
672
672
|
# >> c.square.sum
|
673
673
|
# => 2.0
|
@@ -675,7 +675,7 @@
|
|
675
675
|
# ---
|
676
676
|
# * GSL::Vector#decimate(n)
|
677
677
|
#
|
678
|
-
# Creates a new vector by averaring every <tt>n</tt>
|
678
|
+
# Creates a new vector by averaring every <tt>n</tt>
|
679
679
|
# points of the vector <tt>self</tt> down to one point.
|
680
680
|
#
|
681
681
|
# ---
|
@@ -702,11 +702,11 @@
|
|
702
702
|
# >> a = GSL::Vector[4, 5, 6]
|
703
703
|
# >> b = GSL::Vector[7, 8, 9]
|
704
704
|
# >> GSL::Vector[1, 2, 3].zip(a, b)
|
705
|
-
# [[ 1.000e+00 4.000e+00 7.000e+00 ],
|
706
|
-
# [ 2.000e+00 5.000e+00 8.000e+00 ],
|
705
|
+
# [[ 1.000e+00 4.000e+00 7.000e+00 ],
|
706
|
+
# [ 2.000e+00 5.000e+00 8.000e+00 ],
|
707
707
|
# [ 3.000e+00 6.000e+00 9.000e+00 ]]
|
708
708
|
# >> GSL::Vector[1, 2].zip(a, b)
|
709
|
-
# [[ 1.000e+00 4.000e+00 7.000e+00 ],
|
709
|
+
# [[ 1.000e+00 4.000e+00 7.000e+00 ],
|
710
710
|
# [ 2.000e+00 5.000e+00 8.000e+00 ]]
|
711
711
|
# >> a.zip(GSL::Vector[1, 2], GSL::Vector[8.0])
|
712
712
|
# [[ 4.000e+00 1.000e+00 8.000e+00 ],
|
@@ -720,7 +720,7 @@
|
|
720
720
|
# <tt>x</tt>, which must be an <tt>Array</tt>, <tt>Fixnum</tt>, <tt>Bignum</tt>,
|
721
721
|
# <tt>Float</tt>, <tt>Range</tt>, or <tt>GSL::Vector</tt>.
|
722
722
|
#
|
723
|
-
# ===
|
723
|
+
# === Vector operations with size changes
|
724
724
|
# The methods below change vector length of <tt>self</tt>. A Vector's length may
|
725
725
|
# not extend past its original allocation. Use of these methods is discouraged.
|
726
726
|
# Existing Views may still refer to elements beyond the end of the shortened
|
@@ -734,7 +734,7 @@
|
|
734
734
|
# ---
|
735
735
|
# * GSL::Vector#delete_at(i)
|
736
736
|
#
|
737
|
-
# Deletes the element at the specified index <tt>i</tt>,
|
737
|
+
# Deletes the element at the specified index <tt>i</tt>,
|
738
738
|
# returning that element, or <tt>nil</tt> if the index is out of range.
|
739
739
|
# ---
|
740
740
|
# * GSL::Vector#delete_if { |x| ... }
|
@@ -742,7 +742,7 @@
|
|
742
742
|
# Deletes every element of <tt>self</tt> for which block evaluates to <tt>true</tt>
|
743
743
|
# and returns <tt>self</tt>.
|
744
744
|
#
|
745
|
-
# ===
|
745
|
+
# === Finding maximum and minimum elements of vectors
|
746
746
|
#
|
747
747
|
# ---
|
748
748
|
# * GSL::Vector#max
|
@@ -763,22 +763,22 @@
|
|
763
763
|
# ---
|
764
764
|
# * GSL::Vector#max_index
|
765
765
|
#
|
766
|
-
# This method returns the index of the maximum value in the vector. When there are
|
767
|
-
# several equal maximum elements then the lowest index is returned.
|
766
|
+
# This method returns the index of the maximum value in the vector. When there are
|
767
|
+
# several equal maximum elements then the lowest index is returned.
|
768
768
|
#
|
769
769
|
# ---
|
770
770
|
# * GSL::Vector#min_index
|
771
771
|
#
|
772
|
-
# This method returns the index of the minimum value in the vector. When there are
|
773
|
-
# several equal minimum elements then the lowest index is returned.
|
772
|
+
# This method returns the index of the minimum value in the vector. When there are
|
773
|
+
# several equal minimum elements then the lowest index is returned.
|
774
774
|
#
|
775
775
|
# ---
|
776
776
|
# * GSL::Vector#minmax_index
|
777
777
|
#
|
778
|
-
# This method returns an array of two elements which has the indices
|
778
|
+
# This method returns an array of two elements which has the indices
|
779
779
|
# of the minimum and the maximum values in the vector <tt>self</tt>.
|
780
780
|
#
|
781
|
-
# ===
|
781
|
+
# === Vector Properties
|
782
782
|
# ---
|
783
783
|
# * GSL::Vector#size
|
784
784
|
# * GSL::Vector#len
|
@@ -814,12 +814,12 @@
|
|
814
814
|
# ---
|
815
815
|
# * GSL::Vector#isnull
|
816
816
|
#
|
817
|
-
# Returns 1 if all the elements of the vector <tt>self</tt>
|
817
|
+
# Returns 1 if all the elements of the vector <tt>self</tt>
|
818
818
|
# are zero, and 0 otherwise.
|
819
819
|
# ---
|
820
820
|
# * GSL::Vector#isnull?
|
821
821
|
#
|
822
|
-
# Return <tt>true</tt> if all the elements of the vector <tt>self</tt>
|
822
|
+
# Return <tt>true</tt> if all the elements of the vector <tt>self</tt>
|
823
823
|
# are zero, and <tt>false</tt> otherwise.
|
824
824
|
# ---
|
825
825
|
# * GSL::Vector#ispos
|
@@ -833,24 +833,24 @@
|
|
833
833
|
# * GSL::Vector#isnonneg
|
834
834
|
# * GSL::Vector#isnonneg?
|
835
835
|
#
|
836
|
-
# (GSL-1.10 or later) Return 1 (true) if all the elements of the vector <tt>self</tt> are non-negative , and 0 (false) otherwise.
|
836
|
+
# (GSL-1.10 or later) Return 1 (true) if all the elements of the vector <tt>self</tt> are non-negative , and 0 (false) otherwise.
|
837
837
|
#
|
838
838
|
# ---
|
839
839
|
# * GSL::Vector#all?
|
840
840
|
#
|
841
|
-
# Returns <tt>true</tt> if all the vector elements are non-zero, and <tt>false</tt>
|
841
|
+
# Returns <tt>true</tt> if all the vector elements are non-zero, and <tt>false</tt>
|
842
842
|
# otherwise. If a block is given, the method returns <tt>true</tt> if the
|
843
843
|
# tests are true for all the elements.
|
844
844
|
# ---
|
845
845
|
# * GSL::Vector#any?
|
846
846
|
#
|
847
|
-
# Returns <tt>true</tt> if any the vector elements are non-zero, and <tt>false</tt>
|
847
|
+
# Returns <tt>true</tt> if any the vector elements are non-zero, and <tt>false</tt>
|
848
848
|
# otherwise. If a block is given, the method returns <tt>true</tt> if the
|
849
849
|
# tests are true for any of the elements.
|
850
850
|
# ---
|
851
851
|
# * GSL::Vector#none?
|
852
852
|
#
|
853
|
-
# Returns <tt>true</tt> if all the elements of the vector <tt>self</tt>
|
853
|
+
# Returns <tt>true</tt> if all the elements of the vector <tt>self</tt>
|
854
854
|
# are zero, and <tt>false</tt> otherwise (just as <tt>GSL::Vector#isnull?</tt>).
|
855
855
|
# If a block is given, the method returns <tt>true</tt> if the
|
856
856
|
# tests are false for all the elements.
|
@@ -884,10 +884,10 @@
|
|
884
884
|
# * GSL::Vector#==(other, eps = 1e-10)
|
885
885
|
#
|
886
886
|
# Returns <tt>true</tt> if the vectors have same size and elements
|
887
|
-
# equal to absolute accurary <tt>eps</tt> for all the indices,
|
887
|
+
# equal to absolute accurary <tt>eps</tt> for all the indices,
|
888
888
|
# and <tt>false</tt> otherwise.
|
889
889
|
#
|
890
|
-
# ===
|
890
|
+
# === Element-wise vector comparison
|
891
891
|
# ---
|
892
892
|
# * GSL::Vector#eq(other)
|
893
893
|
# * GSL::Vector#ne(other)
|
@@ -897,7 +897,7 @@
|
|
897
897
|
# * GSL::Vector#le(other)
|
898
898
|
#
|
899
899
|
# Return a <tt>Block::Byte</tt> object with elements 0/1 by comparing the two vectors
|
900
|
-
# <tt>self</tt> and <tt>other</tt>. Note that the values returned are 0/1,
|
900
|
+
# <tt>self</tt> and <tt>other</tt>. Note that the values returned are 0/1,
|
901
901
|
# not <tt>true/false</tt>, thus all of the elements are "true" in Ruby.
|
902
902
|
#
|
903
903
|
# Ex:
|
@@ -921,7 +921,7 @@
|
|
921
921
|
# ---
|
922
922
|
# * GSL::Vector#and(other)
|
923
923
|
# * GSL::Vector#or(other)
|
924
|
-
# * GSL::Vector#xor(other)
|
924
|
+
# * GSL::Vector#xor(other)
|
925
925
|
# * GSL::Vector#not
|
926
926
|
#
|
927
927
|
#
|
@@ -956,7 +956,7 @@
|
|
956
956
|
# >> a.where
|
957
957
|
# => nil
|
958
958
|
#
|
959
|
-
# ===
|
959
|
+
# === Histogram
|
960
960
|
# ---
|
961
961
|
# * GSL::Vector#histogram(n)
|
962
962
|
# * GSL::Vector#histogram(ranges)
|
@@ -980,7 +980,7 @@
|
|
980
980
|
# h = Histogram.alloc(50, [-4, 4])
|
981
981
|
# h.increment(v)
|
982
982
|
#
|
983
|
-
# ===
|
983
|
+
# === Sorting
|
984
984
|
#
|
985
985
|
# ---
|
986
986
|
# * GSL::Vector#sort
|
@@ -991,12 +991,12 @@
|
|
991
991
|
# ---
|
992
992
|
# * GSL::Vector#sort_index
|
993
993
|
#
|
994
|
-
# This method indirectly sorts the elements of the vector <tt>self</tt> into
|
995
|
-
# ascending order, and returns the resulting permutation.
|
996
|
-
# The elements of permutation give the index of the vector element which
|
997
|
-
# would have been stored in that position if the vector had been sorted in place.
|
994
|
+
# This method indirectly sorts the elements of the vector <tt>self</tt> into
|
995
|
+
# ascending order, and returns the resulting permutation.
|
996
|
+
# The elements of permutation give the index of the vector element which
|
997
|
+
# would have been stored in that position if the vector had been sorted in place.
|
998
998
|
# The first element of permutation gives the index of the least element in the
|
999
|
-
# vector, and the last element of permutation gives the index of the greatest
|
999
|
+
# vector, and the last element of permutation gives the index of the greatest
|
1000
1000
|
# vector element. The vector <tt>self</tt> is not changed.
|
1001
1001
|
#
|
1002
1002
|
# ---
|
@@ -1008,22 +1008,22 @@
|
|
1008
1008
|
#
|
1009
1009
|
# Ex:
|
1010
1010
|
# >> v = GSL::Vector::Int[8, 2, 3, 7, 9, 1, 4]
|
1011
|
-
# => GSL::Vector::Int:
|
1011
|
+
# => GSL::Vector::Int:
|
1012
1012
|
# [ 8 2 3 7 9 1 4 ]
|
1013
1013
|
# >> v.sort
|
1014
|
-
# => GSL::Vector::Int:
|
1014
|
+
# => GSL::Vector::Int:
|
1015
1015
|
# [ 1 2 3 4 7 8 9 ]
|
1016
1016
|
# >> v.sort_index
|
1017
|
-
# => GSL::Permutation:
|
1017
|
+
# => GSL::Permutation:
|
1018
1018
|
# [ 5 1 2 6 3 0 4 ]
|
1019
1019
|
# >> v.sort_largest(3)
|
1020
|
-
# => GSL::Vector::Int:
|
1020
|
+
# => GSL::Vector::Int:
|
1021
1021
|
# [ 9 8 7 ]
|
1022
1022
|
# >> v.sort_smallest(3)
|
1023
|
-
# => GSL::Vector::Int:
|
1023
|
+
# => GSL::Vector::Int:
|
1024
1024
|
# [ 1 2 3 ]
|
1025
1025
|
#
|
1026
|
-
# ===
|
1026
|
+
# === BLAS Methods
|
1027
1027
|
# ---
|
1028
1028
|
# * GSL::Vector#nrm2
|
1029
1029
|
# * GSL::Vector#dnrm2
|
@@ -1036,9 +1036,9 @@
|
|
1036
1036
|
#
|
1037
1037
|
# Compute the absolute sum \sum |x_i| of the elements of the vector.
|
1038
1038
|
#
|
1039
|
-
# ===
|
1039
|
+
# === Data type conversions
|
1040
1040
|
# ---
|
1041
|
-
# * GSL::Vector#to_a
|
1041
|
+
# * GSL::Vector#to_a
|
1042
1042
|
#
|
1043
1043
|
# This method converts the vector into a Ruby array. A Ruby array also can be
|
1044
1044
|
# converted into a GSL::Vector object with the <tt>to_gv</tt> method. For example,
|
@@ -1056,36 +1056,36 @@
|
|
1056
1056
|
# Creates a <tt>GSL::Matrix</tt> object of <tt>nrow</tt> rows and <tt>ncol</tt> columns.
|
1057
1057
|
#
|
1058
1058
|
# >> v = GSL::Vector::Int[1..5]
|
1059
|
-
# => GSL::Vector::Int:
|
1059
|
+
# => GSL::Vector::Int:
|
1060
1060
|
# [ 1 2 3 4 5 ]
|
1061
1061
|
# >> v.to_m(2, 3)
|
1062
|
-
# => GSL::Matrix::Int:
|
1063
|
-
# [ 1 2 3
|
1062
|
+
# => GSL::Matrix::Int:
|
1063
|
+
# [ 1 2 3
|
1064
1064
|
# 4 5 0 ]
|
1065
1065
|
# >> v.to_m(2, 2)
|
1066
|
-
# => GSL::Matrix::Int:
|
1067
|
-
# [ 1 2
|
1066
|
+
# => GSL::Matrix::Int:
|
1067
|
+
# [ 1 2
|
1068
1068
|
# 3 4 ]
|
1069
1069
|
# >> v.to_m(3, 2)
|
1070
|
-
# => GSL::Matrix::Int:
|
1071
|
-
# [ 1 2
|
1072
|
-
# 3 4
|
1070
|
+
# => GSL::Matrix::Int:
|
1071
|
+
# [ 1 2
|
1072
|
+
# 3 4
|
1073
1073
|
# 5 0 ]
|
1074
1074
|
#
|
1075
1075
|
# ---
|
1076
1076
|
# * GSL::Vector#to_m_diagonal
|
1077
1077
|
#
|
1078
|
-
# Converts the vector into a diagonal matrix.
|
1079
|
-
# See also {GSL::Matrix.diagonal(v)}[link:
|
1078
|
+
# Converts the vector into a diagonal matrix.
|
1079
|
+
# See also {GSL::Matrix.diagonal(v)}[link:rdoc/matrix_rdoc.html].
|
1080
1080
|
#
|
1081
1081
|
# >> v = GSL::Vector[1..4].to_i
|
1082
|
-
# => GSL::Vector::Int:
|
1082
|
+
# => GSL::Vector::Int:
|
1083
1083
|
# [ 1 2 3 4 ]
|
1084
1084
|
# >> v.to_m_diagonal
|
1085
|
-
# => GSL::Matrix::Int:
|
1086
|
-
# [ 1 0 0 0
|
1087
|
-
# 0 2 0 0
|
1088
|
-
# 0 0 3 0
|
1085
|
+
# => GSL::Matrix::Int:
|
1086
|
+
# [ 1 0 0 0
|
1087
|
+
# 0 2 0 0
|
1088
|
+
# 0 0 3 0
|
1089
1089
|
# 0 0 0 4 ]
|
1090
1090
|
#
|
1091
1091
|
# ---
|
@@ -1094,14 +1094,14 @@
|
|
1094
1094
|
# Creates a circulant matrix.
|
1095
1095
|
#
|
1096
1096
|
# >> v = GSL::Vector::Int[1..5]
|
1097
|
-
# => GSL::Vector::Int:
|
1097
|
+
# => GSL::Vector::Int:
|
1098
1098
|
# [ 1 2 3 4 5 ]
|
1099
1099
|
# >> v.to_m_circulant
|
1100
|
-
# => GSL::Matrix::Int:
|
1101
|
-
# [ 5 1 2 3 4
|
1102
|
-
# 4 5 1 2 3
|
1103
|
-
# 3 4 5 1 2
|
1104
|
-
# 2 3 4 5 1
|
1100
|
+
# => GSL::Matrix::Int:
|
1101
|
+
# [ 5 1 2 3 4
|
1102
|
+
# 4 5 1 2 3
|
1103
|
+
# 3 4 5 1 2
|
1104
|
+
# 2 3 4 5 1
|
1105
1105
|
# 1 2 3 4 5 ]
|
1106
1106
|
#
|
1107
1107
|
# ---
|
@@ -1124,12 +1124,12 @@
|
|
1124
1124
|
# * GSL::Vector#to_tensor(rank, dimension)
|
1125
1125
|
#
|
1126
1126
|
#
|
1127
|
-
# ===
|
1127
|
+
# === NArray conversions
|
1128
1128
|
#
|
1129
1129
|
# ---
|
1130
1130
|
# * GSL::Vector#to_na
|
1131
1131
|
#
|
1132
|
-
# Converts a vector <tt>self</tt> into an <tt>NArray</tt> object.
|
1132
|
+
# Converts a vector <tt>self</tt> into an <tt>NArray</tt> object.
|
1133
1133
|
# The data are copied to newly allocated memory.
|
1134
1134
|
#
|
1135
1135
|
# ---
|
@@ -1143,10 +1143,10 @@
|
|
1143
1143
|
# => GSL::Vector::Int
|
1144
1144
|
# [ 1 2 3 4 ]
|
1145
1145
|
# >> na = v.to_na
|
1146
|
-
# => NArray.int(4):
|
1146
|
+
# => NArray.int(4):
|
1147
1147
|
# [ 1, 2, 3, 4 ]
|
1148
1148
|
# >> na2 = v.to_na2
|
1149
|
-
# => NArray(ref).int(4):
|
1149
|
+
# => NArray(ref).int(4):
|
1150
1150
|
# [ 1, 2, 3, 4 ]
|
1151
1151
|
# >> na[1] = 99
|
1152
1152
|
# => 99
|
@@ -1170,53 +1170,53 @@
|
|
1170
1170
|
# * NArray#to_gv2
|
1171
1171
|
# * NArray#to_gslv_view
|
1172
1172
|
#
|
1173
|
-
# A <tt>GSL::Vector::View</tt> object is created from the NArray object <tt>self</tt>.
|
1174
|
-
# This method does not allocate memory for the data: the data of <tt>self</tt>
|
1175
|
-
# are not copied, but shared with the <tt>View</tt> object created, thus
|
1176
|
-
# any modifications to the <tt>View</tt> object affect on the original NArray
|
1177
|
-
# object. In other words, the <tt>View</tt> object can be used as a <tt>reference</tt>
|
1178
|
-
# to the NArray object.
|
1173
|
+
# A <tt>GSL::Vector::View</tt> object is created from the NArray object <tt>self</tt>.
|
1174
|
+
# This method does not allocate memory for the data: the data of <tt>self</tt>
|
1175
|
+
# are not copied, but shared with the <tt>View</tt> object created, thus
|
1176
|
+
# any modifications to the <tt>View</tt> object affect on the original NArray
|
1177
|
+
# object. In other words, the <tt>View</tt> object can be used as a <tt>reference</tt>
|
1178
|
+
# to the NArray object.
|
1179
1179
|
#
|
1180
1180
|
# Ex:
|
1181
1181
|
# tcsh> irb
|
1182
1182
|
# >> require("gsl")
|
1183
1183
|
# => true
|
1184
|
-
# >> na = NArray[1.0, 2, 3, 4, 5]
|
1185
|
-
# => NArray.float(5):
|
1184
|
+
# >> na = NArray[1.0, 2, 3, 4, 5]
|
1185
|
+
# => NArray.float(5):
|
1186
1186
|
# [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
|
1187
1187
|
# >> vv = na.to_gv_view # Create a view sharing the memory
|
1188
|
-
# => GSL::Vector::View
|
1188
|
+
# => GSL::Vector::View
|
1189
1189
|
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 ]
|
1190
1190
|
# >> vv[3] = 9
|
1191
1191
|
# => 9
|
1192
1192
|
# >> na
|
1193
|
-
# => NArray.float(5):
|
1193
|
+
# => NArray.float(5):
|
1194
1194
|
# [ 1.0, 2.0, 3.0, 9.0, 5.0 ] # The data are changed
|
1195
1195
|
# >> v = na.to_gv # A vector with newly allocated memory
|
1196
|
-
# => GSL::Vector
|
1196
|
+
# => GSL::Vector
|
1197
1197
|
# [ 1.000e+00 2.000e+00 3.000e+00 9.000e+00 5.000e+00 ]
|
1198
1198
|
# >> v[1] = 123
|
1199
1199
|
# => 123
|
1200
1200
|
# >> v
|
1201
|
-
# => GSL::Vector
|
1201
|
+
# => GSL::Vector
|
1202
1202
|
# [ 1.000e+00 1.230e+02 3.000e+00 9.000e+00 5.000e+00 ]
|
1203
|
-
# >> na
|
1204
|
-
# => NArray.float(5):
|
1205
|
-
# [ 1.0, 2.0, 3.0, 9.0, 5.0 ] # v and na are independent
|
1203
|
+
# >> na
|
1204
|
+
# => NArray.float(5):
|
1205
|
+
# [ 1.0, 2.0, 3.0, 9.0, 5.0 ] # v and na are independent
|
1206
1206
|
# >> na = NArray[1.0, 2, 3, 4, 5, 6]
|
1207
|
-
# => NArray.float(6):
|
1207
|
+
# => NArray.float(6):
|
1208
1208
|
# [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
1209
1209
|
# >> m = na.to_gv_view.matrix_view(2, 3)
|
1210
1210
|
# => GSL::Matrix::View
|
1211
|
-
# [ 1.000e+00 2.000e+00 3.000e+00
|
1211
|
+
# [ 1.000e+00 2.000e+00 3.000e+00
|
1212
1212
|
# 4.000e+00 5.000e+00 6.000e+00 ]
|
1213
1213
|
# >> m[1][2] = 9
|
1214
1214
|
# => 9
|
1215
1215
|
# >> na
|
1216
|
-
# => NArray.float(6):
|
1216
|
+
# => NArray.float(6):
|
1217
1217
|
# [ 1.0, 2.0, 3.0, 4.0, 5.0, 9.0 ]
|
1218
1218
|
#
|
1219
|
-
# ===
|
1219
|
+
# === Graphics
|
1220
1220
|
# ---
|
1221
1221
|
# * GSL::Vector.graph(y)
|
1222
1222
|
# * GSL::Vector.graph(y, options)
|
@@ -1234,10 +1234,10 @@
|
|
1234
1234
|
# >> s = GSL::Sf::sin(x)
|
1235
1235
|
# >> GSL::Vector.graph(x, c, s, "-T X -C -L 'cos(x), sin(x)'")
|
1236
1236
|
#
|
1237
|
-
# {prev}[link:
|
1238
|
-
# {next}[link:
|
1237
|
+
# {prev}[link:rdoc/sf_rdoc.html]
|
1238
|
+
# {next}[link:rdoc/matrix_rdoc.html]
|
1239
|
+
#
|
1240
|
+
# {Reference index}[link:rdoc/ref_rdoc.html]
|
1241
|
+
# {top}[link:index.html]
|
1239
1242
|
#
|
1240
|
-
# {Reference index}[link:files/rdoc/ref_rdoc.html]
|
1241
|
-
# {top}[link:files/rdoc/index_rdoc.html]
|
1242
|
-
#
|
1243
1243
|
#
|