rb-gsl 1.16.0.5 → 1.16.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/rb-gsl.gemspec +5 -10
- metadata +10 -713
- data/.gitignore +0 -12
- data/.travis.yml +0 -24
- data/AUTHORS +0 -12
- data/COPYING +0 -341
- data/ChangeLog +0 -621
- data/Gemfile +0 -4
- data/README.md +0 -77
- data/Rakefile +0 -20
- data/THANKS +0 -17
- data/examples/alf/alf.gp +0 -15
- data/examples/alf/alf.rb +0 -32
- data/examples/blas/blas.rb +0 -13
- data/examples/blas/dnrm2.rb +0 -16
- data/examples/blas/level1.rb +0 -81
- data/examples/blas/level2.rb +0 -11
- data/examples/blas/level3.rb +0 -12
- data/examples/bspline.rb +0 -57
- data/examples/cdf.rb +0 -16
- data/examples/cheb.rb +0 -21
- data/examples/combination.rb +0 -23
- data/examples/complex/RC-lpf.rb +0 -47
- data/examples/complex/add.rb +0 -36
- data/examples/complex/coerce.rb +0 -14
- data/examples/complex/complex.rb +0 -25
- data/examples/complex/fpmi.rb +0 -70
- data/examples/complex/functions.rb +0 -77
- data/examples/complex/michelson.rb +0 -36
- data/examples/complex/mul.rb +0 -28
- data/examples/complex/oscillator.rb +0 -17
- data/examples/complex/set.rb +0 -37
- data/examples/const/physconst.rb +0 -151
- data/examples/const/travel.rb +0 -45
- data/examples/deriv/demo.rb +0 -13
- data/examples/deriv/deriv.rb +0 -36
- data/examples/deriv/diff.rb +0 -35
- data/examples/dht.rb +0 -42
- data/examples/dirac.rb +0 -56
- data/examples/eigen/eigen.rb +0 -34
- data/examples/eigen/herm.rb +0 -22
- data/examples/eigen/narray.rb +0 -9
- data/examples/eigen/nonsymm.rb +0 -37
- data/examples/eigen/nonsymmv.rb +0 -43
- data/examples/eigen/qhoscillator.gp +0 -35
- data/examples/eigen/qhoscillator.rb +0 -90
- data/examples/eigen/vander.rb +0 -41
- data/examples/fft/fft.rb +0 -17
- data/examples/fft/fft2.rb +0 -17
- data/examples/fft/forward.rb +0 -25
- data/examples/fft/forward2.rb +0 -26
- data/examples/fft/radix2.rb +0 -18
- data/examples/fft/real-halfcomplex.rb +0 -33
- data/examples/fft/real-halfcomplex2.rb +0 -30
- data/examples/fft/realradix2.rb +0 -19
- data/examples/fft/sunspot.dat +0 -256
- data/examples/fft/sunspot.rb +0 -16
- data/examples/fit/expdata.dat +0 -20
- data/examples/fit/expfit.rb +0 -31
- data/examples/fit/gaussfit.rb +0 -29
- data/examples/fit/gaussian_2peaks.rb +0 -34
- data/examples/fit/hillfit.rb +0 -40
- data/examples/fit/lognormal.rb +0 -26
- data/examples/fit/lorentzfit.rb +0 -22
- data/examples/fit/multifit.rb +0 -72
- data/examples/fit/ndlinear.rb +0 -133
- data/examples/fit/nonlinearfit.rb +0 -89
- data/examples/fit/plot.gp +0 -36
- data/examples/fit/polyfit.rb +0 -9
- data/examples/fit/powerfit.rb +0 -21
- data/examples/fit/sigmoidfit.rb +0 -40
- data/examples/fit/sinfit.rb +0 -22
- data/examples/fit/wlinear.rb +0 -46
- data/examples/fresnel.rb +0 -11
- data/examples/function/function.rb +0 -36
- data/examples/function/log.rb +0 -7
- data/examples/function/min.rb +0 -33
- data/examples/function/sin.rb +0 -10
- data/examples/function/synchrotron.rb +0 -18
- data/examples/gallery/butterfly.rb +0 -7
- data/examples/gallery/cayley.rb +0 -12
- data/examples/gallery/cornu.rb +0 -23
- data/examples/gallery/eight.rb +0 -11
- data/examples/gallery/koch.rb +0 -40
- data/examples/gallery/lemniscate.rb +0 -11
- data/examples/gallery/polar.rb +0 -11
- data/examples/gallery/rgplot/cossin.rb +0 -35
- data/examples/gallery/rgplot/rgplot.replaced +0 -0
- data/examples/gallery/rgplot/roesller.rb +0 -55
- data/examples/gallery/roesller.rb +0 -39
- data/examples/gallery/scarabaeus.rb +0 -14
- data/examples/histogram/cauchy.rb +0 -27
- data/examples/histogram/cauchy.sh +0 -2
- data/examples/histogram/exponential.rb +0 -19
- data/examples/histogram/gauss.rb +0 -16
- data/examples/histogram/gsl-histogram.rb +0 -40
- data/examples/histogram/histo2d.rb +0 -31
- data/examples/histogram/histo3d.rb +0 -34
- data/examples/histogram/histogram-pdf.rb +0 -27
- data/examples/histogram/histogram.rb +0 -26
- data/examples/histogram/integral.rb +0 -28
- data/examples/histogram/poisson.rb +0 -27
- data/examples/histogram/power.rb +0 -25
- data/examples/histogram/rebin.rb +0 -17
- data/examples/histogram/smp.dat +0 -5
- data/examples/histogram/xexp.rb +0 -21
- data/examples/integration/ahmed.rb +0 -21
- data/examples/integration/cosmology.rb +0 -75
- data/examples/integration/friedmann.gp +0 -16
- data/examples/integration/friedmann.rb +0 -35
- data/examples/integration/gamma-zeta.rb +0 -35
- data/examples/integration/integration.rb +0 -22
- data/examples/integration/qag.rb +0 -8
- data/examples/integration/qag2.rb +0 -14
- data/examples/integration/qag3.rb +0 -8
- data/examples/integration/qagi.rb +0 -28
- data/examples/integration/qagi2.rb +0 -49
- data/examples/integration/qagiu.rb +0 -29
- data/examples/integration/qagp.rb +0 -20
- data/examples/integration/qags.rb +0 -14
- data/examples/integration/qawc.rb +0 -18
- data/examples/integration/qawf.rb +0 -41
- data/examples/integration/qawo.rb +0 -29
- data/examples/integration/qaws.rb +0 -30
- data/examples/integration/qng.rb +0 -17
- data/examples/interp/demo.gp +0 -20
- data/examples/interp/demo.rb +0 -45
- data/examples/interp/interp.rb +0 -37
- data/examples/interp/points +0 -10
- data/examples/interp/spline.rb +0 -20
- data/examples/jacobi/deriv.rb +0 -40
- data/examples/jacobi/integrate.rb +0 -34
- data/examples/jacobi/interp.rb +0 -43
- data/examples/jacobi/jacobi.rb +0 -11
- data/examples/linalg/HH.rb +0 -15
- data/examples/linalg/HH_narray.rb +0 -13
- data/examples/linalg/LQ_solve.rb +0 -73
- data/examples/linalg/LU.rb +0 -84
- data/examples/linalg/LU2.rb +0 -31
- data/examples/linalg/LU_narray.rb +0 -24
- data/examples/linalg/PTLQ.rb +0 -47
- data/examples/linalg/QR.rb +0 -18
- data/examples/linalg/QRPT.rb +0 -47
- data/examples/linalg/QR_solve.rb +0 -78
- data/examples/linalg/QR_solve_narray.rb +0 -13
- data/examples/linalg/SV.rb +0 -16
- data/examples/linalg/SV_narray.rb +0 -12
- data/examples/linalg/SV_solve.rb +0 -49
- data/examples/linalg/chol.rb +0 -29
- data/examples/linalg/chol_narray.rb +0 -15
- data/examples/linalg/complex.rb +0 -57
- data/examples/linalg/invert_narray.rb +0 -10
- data/examples/math/const.rb +0 -67
- data/examples/math/elementary.rb +0 -35
- data/examples/math/functions.rb +0 -41
- data/examples/math/inf_nan.rb +0 -34
- data/examples/math/minmax.rb +0 -22
- data/examples/math/power.rb +0 -18
- data/examples/math/test.rb +0 -31
- data/examples/matrix/a.dat +0 -0
- data/examples/matrix/add.rb +0 -45
- data/examples/matrix/b.dat +0 -4
- data/examples/matrix/cat.rb +0 -31
- data/examples/matrix/colvectors.rb +0 -24
- data/examples/matrix/complex.rb +0 -41
- data/examples/matrix/det.rb +0 -29
- data/examples/matrix/diagonal.rb +0 -23
- data/examples/matrix/get_all.rb +0 -159
- data/examples/matrix/hilbert.rb +0 -31
- data/examples/matrix/iterator.rb +0 -19
- data/examples/matrix/matrix.rb +0 -57
- data/examples/matrix/minmax.rb +0 -53
- data/examples/matrix/mul.rb +0 -39
- data/examples/matrix/rand.rb +0 -20
- data/examples/matrix/read.rb +0 -29
- data/examples/matrix/rowcol.rb +0 -47
- data/examples/matrix/set.rb +0 -41
- data/examples/matrix/set_all.rb +0 -100
- data/examples/matrix/view.rb +0 -32
- data/examples/matrix/view_all.rb +0 -148
- data/examples/matrix/write.rb +0 -23
- data/examples/min.rb +0 -29
- data/examples/monte/miser.rb +0 -47
- data/examples/monte/monte.rb +0 -47
- data/examples/monte/plain.rb +0 -47
- data/examples/monte/vegas.rb +0 -46
- data/examples/multimin/bundle.rb +0 -66
- data/examples/multimin/cqp.rb +0 -109
- data/examples/multimin/fdfminimizer.rb +0 -40
- data/examples/multimin/fminimizer.rb +0 -41
- data/examples/multiroot/demo.rb +0 -36
- data/examples/multiroot/fdfsolver.rb +0 -50
- data/examples/multiroot/fsolver.rb +0 -33
- data/examples/multiroot/fsolver2.rb +0 -32
- data/examples/multiroot/fsolver3.rb +0 -26
- data/examples/narray/histogram.rb +0 -14
- data/examples/narray/mandel.rb +0 -27
- data/examples/narray/narray.rb +0 -28
- data/examples/narray/narray2.rb +0 -44
- data/examples/narray/sf.rb +0 -26
- data/examples/ntuple/create.rb +0 -17
- data/examples/ntuple/project.rb +0 -31
- data/examples/odeiv/binarysystem.gp +0 -23
- data/examples/odeiv/binarysystem.rb +0 -104
- data/examples/odeiv/demo.gp +0 -24
- data/examples/odeiv/demo.rb +0 -69
- data/examples/odeiv/demo2.gp +0 -26
- data/examples/odeiv/duffing.rb +0 -45
- data/examples/odeiv/frei1.rb +0 -109
- data/examples/odeiv/frei2.rb +0 -76
- data/examples/odeiv/legendre.rb +0 -52
- data/examples/odeiv/odeiv.rb +0 -32
- data/examples/odeiv/odeiv2.rb +0 -45
- data/examples/odeiv/oscillator.rb +0 -42
- data/examples/odeiv/sedov.rb +0 -97
- data/examples/odeiv/whitedwarf.gp +0 -40
- data/examples/odeiv/whitedwarf.rb +0 -158
- data/examples/ool/conmin.rb +0 -100
- data/examples/ool/gencan.rb +0 -99
- data/examples/ool/pgrad.rb +0 -100
- data/examples/ool/spg.rb +0 -100
- data/examples/pdf/bernoulli.rb +0 -5
- data/examples/pdf/beta.rb +0 -7
- data/examples/pdf/binomiral.rb +0 -10
- data/examples/pdf/cauchy.rb +0 -6
- data/examples/pdf/chisq.rb +0 -8
- data/examples/pdf/exponential.rb +0 -7
- data/examples/pdf/exppow.rb +0 -6
- data/examples/pdf/fdist.rb +0 -7
- data/examples/pdf/flat.rb +0 -7
- data/examples/pdf/gamma.rb +0 -8
- data/examples/pdf/gauss-tail.rb +0 -5
- data/examples/pdf/gauss.rb +0 -6
- data/examples/pdf/geometric.rb +0 -5
- data/examples/pdf/gumbel.rb +0 -6
- data/examples/pdf/hypergeometric.rb +0 -11
- data/examples/pdf/landau.rb +0 -5
- data/examples/pdf/laplace.rb +0 -7
- data/examples/pdf/logarithmic.rb +0 -5
- data/examples/pdf/logistic.rb +0 -6
- data/examples/pdf/lognormal.rb +0 -6
- data/examples/pdf/neg-binomiral.rb +0 -10
- data/examples/pdf/pareto.rb +0 -7
- data/examples/pdf/pascal.rb +0 -10
- data/examples/pdf/poisson.rb +0 -5
- data/examples/pdf/rayleigh-tail.rb +0 -6
- data/examples/pdf/rayleigh.rb +0 -6
- data/examples/pdf/tdist.rb +0 -6
- data/examples/pdf/weibull.rb +0 -8
- data/examples/permutation/ex1.rb +0 -22
- data/examples/permutation/permutation.rb +0 -16
- data/examples/poly/bell.rb +0 -6
- data/examples/poly/bessel.rb +0 -6
- data/examples/poly/cheb.rb +0 -6
- data/examples/poly/cheb_II.rb +0 -6
- data/examples/poly/cubic.rb +0 -9
- data/examples/poly/demo.rb +0 -20
- data/examples/poly/eval.rb +0 -28
- data/examples/poly/eval_derivs.rb +0 -14
- data/examples/poly/fit.rb +0 -21
- data/examples/poly/hermite.rb +0 -6
- data/examples/poly/poly.rb +0 -13
- data/examples/poly/quadratic.rb +0 -25
- data/examples/random/diffusion.rb +0 -34
- data/examples/random/gaussian.rb +0 -9
- data/examples/random/generator.rb +0 -27
- data/examples/random/hdsobol.rb +0 -21
- data/examples/random/poisson.rb +0 -9
- data/examples/random/qrng.rb +0 -19
- data/examples/random/randomwalk.rb +0 -37
- data/examples/random/randomwalk2d.rb +0 -19
- data/examples/random/rayleigh.rb +0 -36
- data/examples/random/rng.rb +0 -33
- data/examples/random/rngextra.rb +0 -14
- data/examples/roots/bisection.rb +0 -25
- data/examples/roots/brent.rb +0 -43
- data/examples/roots/demo.rb +0 -30
- data/examples/roots/newton.rb +0 -46
- data/examples/roots/recombination.gp +0 -11
- data/examples/roots/recombination.rb +0 -61
- data/examples/roots/steffenson.rb +0 -48
- data/examples/sf/ShiChi.rb +0 -6
- data/examples/sf/SiCi.rb +0 -6
- data/examples/sf/airy_Ai.rb +0 -8
- data/examples/sf/airy_Bi.rb +0 -8
- data/examples/sf/bessel_IK.rb +0 -12
- data/examples/sf/bessel_JY.rb +0 -13
- data/examples/sf/beta_inc.rb +0 -9
- data/examples/sf/clausen.rb +0 -6
- data/examples/sf/dawson.rb +0 -5
- data/examples/sf/debye.rb +0 -9
- data/examples/sf/dilog.rb +0 -6
- data/examples/sf/ellint.rb +0 -6
- data/examples/sf/expint.rb +0 -8
- data/examples/sf/fermi.rb +0 -10
- data/examples/sf/gamma_inc_P.rb +0 -9
- data/examples/sf/gegenbauer.rb +0 -8
- data/examples/sf/hyperg.rb +0 -7
- data/examples/sf/laguerre.rb +0 -19
- data/examples/sf/lambertW.rb +0 -5
- data/examples/sf/legendre_P.rb +0 -10
- data/examples/sf/lngamma.rb +0 -5
- data/examples/sf/psi.rb +0 -54
- data/examples/sf/sphbessel.gp +0 -27
- data/examples/sf/sphbessel.rb +0 -30
- data/examples/sf/synchrotron.rb +0 -5
- data/examples/sf/transport.rb +0 -10
- data/examples/sf/zetam1.rb +0 -5
- data/examples/siman.rb +0 -44
- data/examples/sort/heapsort.rb +0 -23
- data/examples/sort/heapsort_vector_complex.rb +0 -21
- data/examples/sort/sort.rb +0 -23
- data/examples/sort/sort2.rb +0 -16
- data/examples/stats/mean.rb +0 -17
- data/examples/stats/statistics.rb +0 -18
- data/examples/stats/test.rb +0 -9
- data/examples/sum.rb +0 -34
- data/examples/tamu_anova.rb +0 -18
- data/examples/vector/a.dat +0 -0
- data/examples/vector/add.rb +0 -56
- data/examples/vector/b.dat +0 -4
- data/examples/vector/c.dat +0 -3
- data/examples/vector/collect.rb +0 -26
- data/examples/vector/compare.rb +0 -28
- data/examples/vector/complex.rb +0 -51
- data/examples/vector/complex_get_all.rb +0 -85
- data/examples/vector/complex_set_all.rb +0 -131
- data/examples/vector/complex_view_all.rb +0 -77
- data/examples/vector/connect.rb +0 -22
- data/examples/vector/decimate.rb +0 -38
- data/examples/vector/diff.rb +0 -31
- data/examples/vector/filescan.rb +0 -17
- data/examples/vector/floor.rb +0 -23
- data/examples/vector/get_all.rb +0 -82
- data/examples/vector/gnuplot.rb +0 -38
- data/examples/vector/graph.rb +0 -28
- data/examples/vector/histogram.rb +0 -22
- data/examples/vector/linspace.rb +0 -24
- data/examples/vector/log.rb +0 -17
- data/examples/vector/logic.rb +0 -33
- data/examples/vector/logspace.rb +0 -25
- data/examples/vector/minmax.rb +0 -47
- data/examples/vector/mul.rb +0 -49
- data/examples/vector/narray.rb +0 -46
- data/examples/vector/read.rb +0 -29
- data/examples/vector/set.rb +0 -35
- data/examples/vector/set_all.rb +0 -121
- data/examples/vector/smpv.dat +0 -15
- data/examples/vector/test.rb +0 -43
- data/examples/vector/test_gslblock.rb +0 -58
- data/examples/vector/vector.rb +0 -110
- data/examples/vector/view.rb +0 -35
- data/examples/vector/view_all.rb +0 -73
- data/examples/vector/where.rb +0 -29
- data/examples/vector/write.rb +0 -24
- data/examples/vector/zip.rb +0 -34
- data/examples/wavelet/ecg.dat +0 -256
- data/examples/wavelet/wavelet1.rb +0 -50
- data/ext/gsl_native/alf.c +0 -206
- data/ext/gsl_native/array.c +0 -553
- data/ext/gsl_native/array_complex.c +0 -245
- data/ext/gsl_native/blas.c +0 -28
- data/ext/gsl_native/blas1.c +0 -733
- data/ext/gsl_native/blas2.c +0 -1088
- data/ext/gsl_native/blas3.c +0 -880
- data/ext/gsl_native/block.c +0 -40
- data/ext/gsl_native/block_source.h +0 -885
- data/ext/gsl_native/bspline.c +0 -122
- data/ext/gsl_native/bundle.c +0 -3
- data/ext/gsl_native/cdf.c +0 -740
- data/ext/gsl_native/cheb.c +0 -531
- data/ext/gsl_native/combination.c +0 -275
- data/ext/gsl_native/common.c +0 -293
- data/ext/gsl_native/complex.c +0 -1002
- data/ext/gsl_native/const.c +0 -331
- data/ext/gsl_native/const_additional.c +0 -99
- data/ext/gsl_native/cqp.c +0 -283
- data/ext/gsl_native/deriv.c +0 -187
- data/ext/gsl_native/dht.c +0 -353
- data/ext/gsl_native/diff.c +0 -164
- data/ext/gsl_native/dirac.c +0 -388
- data/ext/gsl_native/eigen.c +0 -2322
- data/ext/gsl_native/error.c +0 -193
- data/ext/gsl_native/extconf.rb +0 -118
- data/ext/gsl_native/fft.c +0 -1095
- data/ext/gsl_native/fit.c +0 -204
- data/ext/gsl_native/fresnel.c +0 -312
- data/ext/gsl_native/function.c +0 -518
- data/ext/gsl_native/geometry.c +0 -139
- data/ext/gsl_native/graph.c +0 -1590
- data/ext/gsl_native/gsl.c +0 -259
- data/ext/gsl_native/gsl_narray.c +0 -794
- data/ext/gsl_native/histogram.c +0 -1964
- data/ext/gsl_native/histogram2d.c +0 -1042
- data/ext/gsl_native/histogram3d.c +0 -884
- data/ext/gsl_native/histogram3d_source.c +0 -749
- data/ext/gsl_native/histogram_find.c +0 -99
- data/ext/gsl_native/histogram_oper.c +0 -150
- data/ext/gsl_native/ieee.c +0 -88
- data/ext/gsl_native/include/rb_gsl.h +0 -136
- data/ext/gsl_native/include/rb_gsl_array.h +0 -214
- data/ext/gsl_native/include/rb_gsl_cheb.h +0 -19
- data/ext/gsl_native/include/rb_gsl_common.h +0 -348
- data/ext/gsl_native/include/rb_gsl_complex.h +0 -25
- data/ext/gsl_native/include/rb_gsl_const.h +0 -23
- data/ext/gsl_native/include/rb_gsl_dirac.h +0 -6
- data/ext/gsl_native/include/rb_gsl_eigen.h +0 -17
- data/ext/gsl_native/include/rb_gsl_fft.h +0 -49
- data/ext/gsl_native/include/rb_gsl_fit.h +0 -23
- data/ext/gsl_native/include/rb_gsl_function.h +0 -23
- data/ext/gsl_native/include/rb_gsl_graph.h +0 -68
- data/ext/gsl_native/include/rb_gsl_histogram.h +0 -63
- data/ext/gsl_native/include/rb_gsl_histogram3d.h +0 -97
- data/ext/gsl_native/include/rb_gsl_integration.h +0 -17
- data/ext/gsl_native/include/rb_gsl_interp.h +0 -41
- data/ext/gsl_native/include/rb_gsl_linalg.h +0 -21
- data/ext/gsl_native/include/rb_gsl_math.h +0 -20
- data/ext/gsl_native/include/rb_gsl_odeiv.h +0 -18
- data/ext/gsl_native/include/rb_gsl_poly.h +0 -67
- data/ext/gsl_native/include/rb_gsl_rational.h +0 -30
- data/ext/gsl_native/include/rb_gsl_rng.h +0 -20
- data/ext/gsl_native/include/rb_gsl_root.h +0 -22
- data/ext/gsl_native/include/rb_gsl_sf.h +0 -110
- data/ext/gsl_native/include/rb_gsl_statistics.h +0 -17
- data/ext/gsl_native/include/rb_gsl_tensor.h +0 -43
- data/ext/gsl_native/include/rb_gsl_with_narray.h +0 -31
- data/ext/gsl_native/include/templates_off.h +0 -87
- data/ext/gsl_native/include/templates_on.h +0 -241
- data/ext/gsl_native/integration.c +0 -1154
- data/ext/gsl_native/interp.c +0 -499
- data/ext/gsl_native/jacobi.c +0 -733
- data/ext/gsl_native/linalg.c +0 -3915
- data/ext/gsl_native/linalg_complex.c +0 -726
- data/ext/gsl_native/math.c +0 -706
- data/ext/gsl_native/matrix.c +0 -36
- data/ext/gsl_native/matrix_complex.c +0 -1733
- data/ext/gsl_native/matrix_double.c +0 -557
- data/ext/gsl_native/matrix_int.c +0 -255
- data/ext/gsl_native/matrix_source.h +0 -2708
- data/ext/gsl_native/min.c +0 -219
- data/ext/gsl_native/monte.c +0 -978
- data/ext/gsl_native/multifit.c +0 -1862
- data/ext/gsl_native/multimin.c +0 -778
- data/ext/gsl_native/multimin_fsdf.c +0 -156
- data/ext/gsl_native/multiroots.c +0 -952
- data/ext/gsl_native/multiset.c +0 -210
- data/ext/gsl_native/ndlinear.c +0 -320
- data/ext/gsl_native/nmf.c +0 -171
- data/ext/gsl_native/nmf_wrap.c +0 -75
- data/ext/gsl_native/ntuple.c +0 -469
- data/ext/gsl_native/odeiv.c +0 -947
- data/ext/gsl_native/ool.c +0 -879
- data/ext/gsl_native/permutation.c +0 -598
- data/ext/gsl_native/poly.c +0 -39
- data/ext/gsl_native/poly2.c +0 -265
- data/ext/gsl_native/poly_source.h +0 -1871
- data/ext/gsl_native/qrng.c +0 -160
- data/ext/gsl_native/randist.c +0 -1848
- data/ext/gsl_native/rational.c +0 -480
- data/ext/gsl_native/rng.c +0 -595
- data/ext/gsl_native/root.c +0 -407
- data/ext/gsl_native/sf.c +0 -1446
- data/ext/gsl_native/sf_airy.c +0 -200
- data/ext/gsl_native/sf_bessel.c +0 -871
- data/ext/gsl_native/sf_clausen.c +0 -28
- data/ext/gsl_native/sf_coulomb.c +0 -206
- data/ext/gsl_native/sf_coupling.c +0 -121
- data/ext/gsl_native/sf_dawson.c +0 -29
- data/ext/gsl_native/sf_debye.c +0 -148
- data/ext/gsl_native/sf_dilog.c +0 -43
- data/ext/gsl_native/sf_elementary.c +0 -46
- data/ext/gsl_native/sf_ellint.c +0 -206
- data/ext/gsl_native/sf_elljac.c +0 -30
- data/ext/gsl_native/sf_erfc.c +0 -89
- data/ext/gsl_native/sf_exp.c +0 -169
- data/ext/gsl_native/sf_expint.c +0 -201
- data/ext/gsl_native/sf_fermi_dirac.c +0 -148
- data/ext/gsl_native/sf_gamma.c +0 -343
- data/ext/gsl_native/sf_gegenbauer.c +0 -97
- data/ext/gsl_native/sf_hyperg.c +0 -203
- data/ext/gsl_native/sf_laguerre.c +0 -113
- data/ext/gsl_native/sf_lambert.c +0 -47
- data/ext/gsl_native/sf_legendre.c +0 -368
- data/ext/gsl_native/sf_log.c +0 -105
- data/ext/gsl_native/sf_mathieu.c +0 -235
- data/ext/gsl_native/sf_power.c +0 -47
- data/ext/gsl_native/sf_psi.c +0 -89
- data/ext/gsl_native/sf_synchrotron.c +0 -48
- data/ext/gsl_native/sf_transport.c +0 -76
- data/ext/gsl_native/sf_trigonometric.c +0 -210
- data/ext/gsl_native/sf_zeta.c +0 -115
- data/ext/gsl_native/signal.c +0 -303
- data/ext/gsl_native/siman.c +0 -713
- data/ext/gsl_native/sort.c +0 -207
- data/ext/gsl_native/spline.c +0 -377
- data/ext/gsl_native/stats.c +0 -787
- data/ext/gsl_native/sum.c +0 -168
- data/ext/gsl_native/tamu_anova.c +0 -56
- data/ext/gsl_native/tensor.c +0 -35
- data/ext/gsl_native/tensor_source.h +0 -1122
- data/ext/gsl_native/vector.c +0 -35
- data/ext/gsl_native/vector_complex.c +0 -2241
- data/ext/gsl_native/vector_double.c +0 -1433
- data/ext/gsl_native/vector_int.c +0 -202
- data/ext/gsl_native/vector_source.h +0 -3321
- data/ext/gsl_native/wavelet.c +0 -923
- data/lib/gsl.rb +0 -8
- data/lib/gsl/gnuplot.rb +0 -41
- data/lib/gsl/oper.rb +0 -43
- data/lib/gsl/version.rb +0 -3
- data/lib/ool.rb +0 -22
- data/lib/ool/conmin.rb +0 -30
- data/lib/rbgsl.rb +0 -1
- data/rdoc/alf.rdoc +0 -77
- data/rdoc/blas.rdoc +0 -269
- data/rdoc/bspline.rdoc +0 -42
- data/rdoc/changes.rdoc +0 -159
- data/rdoc/cheb.rdoc +0 -99
- data/rdoc/cholesky_complex.rdoc +0 -46
- data/rdoc/combi.rdoc +0 -125
- data/rdoc/complex.rdoc +0 -210
- data/rdoc/const.rdoc +0 -546
- data/rdoc/dht.rdoc +0 -122
- data/rdoc/diff.rdoc +0 -133
- data/rdoc/ehandling.rdoc +0 -50
- data/rdoc/eigen.rdoc +0 -401
- data/rdoc/fft.rdoc +0 -535
- data/rdoc/fit.rdoc +0 -284
- data/rdoc/function.rdoc +0 -94
- data/rdoc/graph.rdoc +0 -137
- data/rdoc/hist.rdoc +0 -409
- data/rdoc/hist2d.rdoc +0 -279
- data/rdoc/hist3d.rdoc +0 -112
- data/rdoc/integration.rdoc +0 -398
- data/rdoc/interp.rdoc +0 -231
- data/rdoc/intro.rdoc +0 -27
- data/rdoc/linalg.rdoc +0 -681
- data/rdoc/linalg_complex.rdoc +0 -88
- data/rdoc/math.rdoc +0 -276
- data/rdoc/matrix.rdoc +0 -1093
- data/rdoc/min.rdoc +0 -189
- data/rdoc/monte.rdoc +0 -234
- data/rdoc/multimin.rdoc +0 -312
- data/rdoc/multiroot.rdoc +0 -293
- data/rdoc/narray.rdoc +0 -177
- data/rdoc/ndlinear.rdoc +0 -250
- data/rdoc/nonlinearfit.rdoc +0 -348
- data/rdoc/ntuple.rdoc +0 -88
- data/rdoc/odeiv.rdoc +0 -378
- data/rdoc/perm.rdoc +0 -221
- data/rdoc/poly.rdoc +0 -335
- data/rdoc/qrng.rdoc +0 -90
- data/rdoc/randist.rdoc +0 -233
- data/rdoc/ref.rdoc +0 -93
- data/rdoc/rng.rdoc +0 -203
- data/rdoc/roots.rdoc +0 -305
- data/rdoc/sf.rdoc +0 -1622
- data/rdoc/siman.rdoc +0 -89
- data/rdoc/sort.rdoc +0 -94
- data/rdoc/start.rdoc +0 -16
- data/rdoc/stats.rdoc +0 -219
- data/rdoc/sum.rdoc +0 -65
- data/rdoc/tensor.rdoc +0 -251
- data/rdoc/tut.rdoc +0 -5
- data/rdoc/use.rdoc +0 -177
- data/rdoc/vector.rdoc +0 -1243
- data/rdoc/vector_complex.rdoc +0 -347
- data/rdoc/wavelet.rdoc +0 -218
- data/test/gsl/blas_test.rb +0 -79
- data/test/gsl/bspline_test.rb +0 -63
- data/test/gsl/cdf_test.rb +0 -1512
- data/test/gsl/cheb_test.rb +0 -80
- data/test/gsl/combination_test.rb +0 -100
- data/test/gsl/complex_test.rb +0 -20
- data/test/gsl/const_test.rb +0 -29
- data/test/gsl/deriv_test.rb +0 -62
- data/test/gsl/dht_test.rb +0 -79
- data/test/gsl/diff_test.rb +0 -53
- data/test/gsl/eigen_test.rb +0 -563
- data/test/gsl/err_test.rb +0 -23
- data/test/gsl/fit_test.rb +0 -101
- data/test/gsl/histo_test.rb +0 -14
- data/test/gsl/index_test.rb +0 -61
- data/test/gsl/integration_test.rb +0 -274
- data/test/gsl/interp_test.rb +0 -27
- data/test/gsl/linalg_test.rb +0 -463
- data/test/gsl/matrix_nmf_test.rb +0 -37
- data/test/gsl/matrix_test.rb +0 -98
- data/test/gsl/min_test.rb +0 -89
- data/test/gsl/monte_test.rb +0 -77
- data/test/gsl/multifit_test.rb +0 -753
- data/test/gsl/multimin_test.rb +0 -157
- data/test/gsl/multiroot_test.rb +0 -135
- data/test/gsl/multiset_test.rb +0 -52
- data/test/gsl/odeiv_test.rb +0 -275
- data/test/gsl/oper_test.rb +0 -98
- data/test/gsl/poly_test.rb +0 -338
- data/test/gsl/qrng_test.rb +0 -94
- data/test/gsl/quartic_test.rb +0 -28
- data/test/gsl/randist_test.rb +0 -122
- data/test/gsl/rng_test.rb +0 -303
- data/test/gsl/roots_test.rb +0 -78
- data/test/gsl/sf_test.rb +0 -2079
- data/test/gsl/stats_test.rb +0 -122
- data/test/gsl/sum_test.rb +0 -69
- data/test/gsl/tensor_test.rb +0 -396
- data/test/gsl/vector_test.rb +0 -223
- data/test/gsl/wavelet_test.rb +0 -130
- data/test/gsl_test.rb +0 -321
- data/test/test_helper.rb +0 -42
- data/uncrustify.cfg +0 -1693
data/rdoc/tensor.rdoc
DELETED
@@ -1,251 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# = Tensor manipulations
|
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
|
-
#
|
6
|
-
# == Class methods
|
7
|
-
# ---
|
8
|
-
# * GSL::Tensor.new(rank, dimention)
|
9
|
-
# * GSL::Tensor.alloc(rank, dimention)
|
10
|
-
# * GSL::Tensor[rank, dimention]
|
11
|
-
#
|
12
|
-
# Create a tensor of rank <tt>rank</tt> and dimension <tt>dimention</tt>.
|
13
|
-
#
|
14
|
-
# ---
|
15
|
-
# * GSL::Tensor.calloc(rank, dimention)
|
16
|
-
#
|
17
|
-
# Creates a tensor of rank <tt>rank</tt> and dimension <tt>dimention</tt>,
|
18
|
-
# and initializes all the elements to zero.
|
19
|
-
#
|
20
|
-
# ---
|
21
|
-
# * GSL::Tensor.copy(tensor)
|
22
|
-
#
|
23
|
-
# Create a tensor copying the existing tensor <tt>tensor</tt>.
|
24
|
-
#
|
25
|
-
# ---
|
26
|
-
# * GSL::Tensor.memcpy(dest, src)
|
27
|
-
#
|
28
|
-
# Copies the tensor <tt>src</tt> to another <tt>dest</tt>. The two
|
29
|
-
# tensors must have the same shape.
|
30
|
-
#
|
31
|
-
# ---
|
32
|
-
# * GSL::Tensor.swap(a, b)
|
33
|
-
#
|
34
|
-
# Exchanges the elements of the tensor <tt>a</tt> and <tt>b</tt>.
|
35
|
-
#
|
36
|
-
# == Instance methods
|
37
|
-
# === Accessing tensor elements
|
38
|
-
# ---
|
39
|
-
# * GSL::Tensor#set_zero
|
40
|
-
#
|
41
|
-
# Sets all the element of the tensor <tt>self</tt> to zero.
|
42
|
-
# ---
|
43
|
-
# * GSL::Tensor#set_all(x)
|
44
|
-
#
|
45
|
-
# Sets all the element of the tensor <tt>self</tt> to <tt>x</tt>.
|
46
|
-
# ---
|
47
|
-
# * GSL::Tensor#set(indices, x)
|
48
|
-
# * \GSL::Tensor#[indices]=x
|
49
|
-
#
|
50
|
-
# Sets the element of the given indices to <tt>x</tt>.
|
51
|
-
#
|
52
|
-
# ---
|
53
|
-
# * GSL::Tensor#get(indices)
|
54
|
-
# * \GSL::Tensor#[indices]
|
55
|
-
#
|
56
|
-
# Returns the tensor element. If the number of indices given is smaller than the
|
57
|
-
# rank of the tensor, the method GSL::Tensor#subtensor is called.
|
58
|
-
#
|
59
|
-
# Ex:
|
60
|
-
# >> t = Tensor.new(2, 3)
|
61
|
-
# => #<GSL::Tensor:0x762ae8>
|
62
|
-
# >> t.set(1, 2, 2, 123)
|
63
|
-
# => #<GSL::Tensor:0x762ae8>
|
64
|
-
# >> t.get(1, 2, 2)
|
65
|
-
# => 123.0
|
66
|
-
# >> t[0, 0, 2] = 456
|
67
|
-
# => 456
|
68
|
-
# >> t[0, 0, 2]
|
69
|
-
# => 456.0
|
70
|
-
#
|
71
|
-
# ---
|
72
|
-
# * GSL::Tensor#subtensor(indices)
|
73
|
-
# * \GSL::Tensor#[indices]
|
74
|
-
#
|
75
|
-
# Return a subtensor.
|
76
|
-
#
|
77
|
-
# Ex:
|
78
|
-
# >> require("gsl")
|
79
|
-
# => true
|
80
|
-
# >> t = Vector[1..125].to_tensor(3, 5)
|
81
|
-
# => GSL::Tensor:
|
82
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 6.000e+00 7.000e+00 ... ]
|
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
|
89
|
-
# 2.100e+01 2.200e+01 2.300e+01 2.400e+01 2.500e+01 ]
|
90
|
-
# >> t[0,2]
|
91
|
-
# => GSL::Tensor::View:
|
92
|
-
# [ 1.100e+01 1.200e+01 1.300e+01 1.400e+01 1.500e+01 ]
|
93
|
-
# >> t[3,1]
|
94
|
-
# => GSL::Tensor::View:
|
95
|
-
# [ 8.100e+01 8.200e+01 8.300e+01 8.400e+01 8.500e+01 ]
|
96
|
-
# >> t[1][2]
|
97
|
-
# => GSL::Tensor::View:
|
98
|
-
# [ 3.600e+01 3.700e+01 3.800e+01 3.900e+01 4.000e+01 ]
|
99
|
-
#
|
100
|
-
# ---
|
101
|
-
# * GSL::Tensor#swap_indices(i, j)
|
102
|
-
# * GSL::Tensor#data
|
103
|
-
#
|
104
|
-
# Returns the data as <tt>GSL::Vector::View</tt>.
|
105
|
-
# ---
|
106
|
-
# * GSL::Tensor#to_v
|
107
|
-
#
|
108
|
-
# Creates a new vector from the tensor.
|
109
|
-
#
|
110
|
-
# ---
|
111
|
-
# * GSL::Tensor#to_vector
|
112
|
-
#
|
113
|
-
# Converts the tensor of rank 1 into a <tt>GSL::Vector::View</tt> object.
|
114
|
-
# ---
|
115
|
-
# * GSL::Tensor#to_matrix
|
116
|
-
#
|
117
|
-
# Converts the tensor of rank 2 into a <tt>GSL::Matrix::View</tt> object.
|
118
|
-
#
|
119
|
-
# === IO
|
120
|
-
# ---
|
121
|
-
# * GSL::Tensor#fwrite(io)
|
122
|
-
# * GSL::Tensor#fwrite(filename)
|
123
|
-
# * GSL::Tensor#fread(io)
|
124
|
-
# * GSL::Tensor#fread(filename)
|
125
|
-
# * GSL::Tensor#fprintf(io, format="%g")
|
126
|
-
# * GSL::Tensor#fprintf(filename, format="%g")
|
127
|
-
# * GSL::Tensor#fscanf(io)
|
128
|
-
# * GSL::Tensor#fscanf(filename)
|
129
|
-
#
|
130
|
-
#
|
131
|
-
# === Max, min
|
132
|
-
# ---
|
133
|
-
# * GSL::Tensor#max
|
134
|
-
# * GSL::Tensor#min
|
135
|
-
# * GSL::Tensor#minmax
|
136
|
-
# * GSL::Tensor#max_index
|
137
|
-
# * GSL::Tensor#min_index
|
138
|
-
# * GSL::Tensor#minmax_index
|
139
|
-
#
|
140
|
-
#
|
141
|
-
# === Tensor operations
|
142
|
-
# ---
|
143
|
-
# * GSL::Tensor#add(b)
|
144
|
-
# * GSL::Tensor#+(b)
|
145
|
-
#
|
146
|
-
# Creates a new tensor adding two tensors <tt>self</tt> and <tt>b</tt>.
|
147
|
-
# ---
|
148
|
-
# * GSL::Tensor#add!(b)
|
149
|
-
#
|
150
|
-
# Adds the element of tensor <tt>b</tt> to the elements of <tt>self</tt> , <tt>in-place</tt>.
|
151
|
-
# ---
|
152
|
-
# * GSL::Tensor#sub(b)
|
153
|
-
# * GSL::Tensor#+(b)
|
154
|
-
#
|
155
|
-
# Creates a new tensor subtracting the tensors <tt>b</tt> from <tt>self</tt>.
|
156
|
-
# ---
|
157
|
-
# * GSL::Tensor#sub!(b)
|
158
|
-
#
|
159
|
-
# Subtracts the element of tensor <tt>b</tt> from the elements of <tt>self</tt> , <tt>in-place</tt>.
|
160
|
-
# ---
|
161
|
-
# * GSL::Tensor#mul_elements(b)
|
162
|
-
#
|
163
|
-
# This calculate element-by-element multiplication of <tt>self</tt> and <tt>b</tt>,
|
164
|
-
# and returns a new tensor.
|
165
|
-
# ---
|
166
|
-
# * GSL::Tensor#mul_elements!(b)
|
167
|
-
#
|
168
|
-
# Multiplies the elements of tensor <tt>self</tt> to the elements of <tt>b</tt> , <tt>in-place</tt>.
|
169
|
-
# ---
|
170
|
-
# * GSL::Tensor#div_elements(b)
|
171
|
-
# * GSL::Tensor#/(b)
|
172
|
-
#
|
173
|
-
# This calculate element-by-element division of <tt>self</tt> and <tt>b</tt>,
|
174
|
-
# and returns a new tensor.
|
175
|
-
# Multiplies the elements of tensor <tt>b</tt> to the elements of <tt>self</tt> , <tt>in-place</tt>.
|
176
|
-
# ---
|
177
|
-
# * GSL::Tensor#div_elements!(b)
|
178
|
-
#
|
179
|
-
# Divides the elements of tensor <tt>self</tt> to the elements of <tt>b</tt> , <tt>in-place</tt>.
|
180
|
-
# ---
|
181
|
-
# * GSL::Tensor#add_constant(x)
|
182
|
-
#
|
183
|
-
# Creates a new tensor adding the constant <tt>x</tt> to the tensor <tt>self</tt>.
|
184
|
-
# ---
|
185
|
-
# * GSL::Tensor#add_constant!(x)
|
186
|
-
#
|
187
|
-
# Adds the constant <tt>x</tt> to the elements of tensor <tt>self</tt> , <tt>in-place</tt>.
|
188
|
-
# ---
|
189
|
-
# * GSL::Tensor#scale(x)
|
190
|
-
#
|
191
|
-
# Creates a new tensor scaling the tensor <tt>self</tt> by the constant <tt>x</tt>.
|
192
|
-
# ---
|
193
|
-
# * GSL::Tensor#scale!(x)
|
194
|
-
#
|
195
|
-
# Multiplies the constant <tt>x</tt> to the elements of tensor <tt>self</tt> , <tt>in-place</tt>.
|
196
|
-
# ---
|
197
|
-
# * GSL::Tensor#add_diagonal(x)
|
198
|
-
#
|
199
|
-
# Creates a new tensor adding the constant <tt>x</tt> to the diagonal elements
|
200
|
-
# of the tensor <tt>self</tt>.
|
201
|
-
# ---
|
202
|
-
# * GSL::Tensor#add_diagonal!(x)
|
203
|
-
#
|
204
|
-
# Adds the constant <tt>x</tt> to the diagonal elements of tensor <tt>self</tt> , <tt>in-place</tt>.
|
205
|
-
# ---
|
206
|
-
# * GSL::Tensor#product(b)
|
207
|
-
# * GSL::Tensor#*(b)
|
208
|
-
#
|
209
|
-
# Calculate tensorian product of <tt>self</tt> and <tt>b</tt>.
|
210
|
-
# ---
|
211
|
-
# * GSL::Tensor#contract(i, j)
|
212
|
-
#
|
213
|
-
#
|
214
|
-
# ---
|
215
|
-
# * GSL::Tensor#equal?(b, eps = 1e-10)
|
216
|
-
# * GSL::Tensor#==(b)
|
217
|
-
#
|
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,
|
220
|
-
# and <tt>false</tt> otherwise.
|
221
|
-
#
|
222
|
-
# === Tensor properties
|
223
|
-
# ---
|
224
|
-
# * GSL::Tensor#isnull
|
225
|
-
#
|
226
|
-
# Returns 1 if all the elements of the tensor are zero, and 0 otherwise.
|
227
|
-
# ---
|
228
|
-
# * GSL::Tensor#isnull?
|
229
|
-
#
|
230
|
-
# Returns <tt>true</tt> if all the elements of the tensor are zero, and <tt>false</tt> otherwise.
|
231
|
-
#
|
232
|
-
# ---
|
233
|
-
# * GSL::Tensor#rank
|
234
|
-
#
|
235
|
-
# Returns the rank
|
236
|
-
# ---
|
237
|
-
# * GSL::Tensor#dimension
|
238
|
-
#
|
239
|
-
# Returns the dimension
|
240
|
-
# ---
|
241
|
-
# * GSL::Tensor#size
|
242
|
-
#
|
243
|
-
# Returns the size
|
244
|
-
#
|
245
|
-
# {prev}[link:rdoc/rng_rdoc.html#label-Random+number+generator+initialization]
|
246
|
-
# {next}[link:rdoc/narray_rdoc.html]
|
247
|
-
#
|
248
|
-
# {Reference index}[link:rdoc/ref_rdoc.html]
|
249
|
-
# {top}[link:index.html]
|
250
|
-
#
|
251
|
-
#
|
data/rdoc/tut.rdoc
DELETED
data/rdoc/use.rdoc
DELETED
@@ -1,177 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# = Using Ruby/GSL
|
3
|
-
# == Installation
|
4
|
-
# See {here}[link:index.html].
|
5
|
-
#
|
6
|
-
# == Load the library
|
7
|
-
# Put at the head of your scripts,
|
8
|
-
#
|
9
|
-
# require 'rubygems' # if installed via RubyGems
|
10
|
-
# require 'gsl'
|
11
|
-
#
|
12
|
-
# == Naming conventions, C Structs and Ruby Classes
|
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>,
|
16
|
-
# where <tt>GSL</tt> is the top level module of Ruby/GSL,
|
17
|
-
# and the Ruby classes are defined for each of the GSL C structs under the <tt>GSL</tt> module.
|
18
|
-
# According to the Ruby manner, the name of each class begins with a capital. For example,
|
19
|
-
#
|
20
|
-
# * Struct <tt>gsl_vector</tt> ---> Ruby class <tt>GSL::Vector</tt>
|
21
|
-
# * Function call as <tt>v = gsl_vector_alloc(5);</tt> ---> Class method <tt>v = GSL::Vector.alloc(5)</tt>
|
22
|
-
# * Function call as <tt>gsl_vector_set(v, i, 1.5);</tt> ---> Method <tt>v.set(i, 1.5)</tt> or <tt>v[i] = 1.5</tt>
|
23
|
-
# * Constant <tt>GSL_SUCCESS</tt> ---> Ruby module constant <tt>GSL::SUCCESS</tt>
|
24
|
-
# * Function <tt>gsl_sf_bessel_J0(x)</tt> --->
|
25
|
-
# * Submodule <tt>GSL::Sf</tt>
|
26
|
-
# * Module function <tt>GSL::Sf::bessel_J0(x)</tt>
|
27
|
-
# * <tt>GSL::Sf::Bessel::J0(x)</tt> is also OK, where <tt>J0(x)</tt> is a module function of the sub-sub-module <tt>GSL::Sf::Bessel</tt>.
|
28
|
-
# * Function <tt>gsl_linalg_LU_decomp</tt> --->
|
29
|
-
# * Module <tt>GSL::Linalg::LU</tt>
|
30
|
-
# * Singleton method <tt>GSL::Linalg::LU_decomp</tt>
|
31
|
-
# * Submodule <tt>GSL::Linalg::LU</tt>
|
32
|
-
# * Singleton method <tt>GSL::Linalg::LU.decomp</tt>
|
33
|
-
# * Method <tt>GSL::Matrix#LU_decomp</tt>
|
34
|
-
#
|
35
|
-
# == Examples
|
36
|
-
# See the directories "examples/" and "tests/".
|
37
|
-
#
|
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}[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
|
-
#
|
43
|
-
# == Modules and Classes
|
44
|
-
# The following is the list of Ruby/GSL modules and classes, <Name> (<Module or Class>)
|
45
|
-
#
|
46
|
-
# * GSL (Module)
|
47
|
-
# * Complex (Class)
|
48
|
-
# * Poly (Class)
|
49
|
-
# * Workspace (Class)
|
50
|
-
# * DividedDifferenceRepresentation (Class)
|
51
|
-
# * Taylor (Class)
|
52
|
-
# * Sf (Module)
|
53
|
-
# * Result (Class)
|
54
|
-
# * Block (Class)
|
55
|
-
# * Int (Class)
|
56
|
-
# * Byte (Class)
|
57
|
-
# * Index < Permutation
|
58
|
-
# * Vector (Class)
|
59
|
-
# * View < Vector
|
60
|
-
# * Complex (Class)
|
61
|
-
# * View < Vector::Complex
|
62
|
-
# * Matrix (Class)
|
63
|
-
# * View < Matrix (Class)
|
64
|
-
# * Complex (Class)
|
65
|
-
# * View < Matrix::Complex
|
66
|
-
# * Permutation (Class)
|
67
|
-
# * Combination (Class)
|
68
|
-
# * Linalg (Module)
|
69
|
-
# * LU (Module)
|
70
|
-
# * QR (Module)
|
71
|
-
# * QRPT (Module)
|
72
|
-
# * LQ (Module)
|
73
|
-
# * LQPT (Module)
|
74
|
-
# * SV (Module)
|
75
|
-
# * Cholesky (Module)
|
76
|
-
# * Symmtd (Module)
|
77
|
-
# * HH (Module)
|
78
|
-
# * Eigen (Module)
|
79
|
-
# * EigenValues < Vector
|
80
|
-
# * EigenVectors < Matrix
|
81
|
-
# * Symm (Module)
|
82
|
-
# * Workspace (Class)
|
83
|
-
# * Symmv (Module)
|
84
|
-
# * Workspace (Class)
|
85
|
-
# * Unsymm (Module)
|
86
|
-
# * Workspace (Class)
|
87
|
-
# * Unsymmv (Module)
|
88
|
-
# * Workspace (Class)
|
89
|
-
# * Herm (Module)
|
90
|
-
# * Workspace (Class)
|
91
|
-
# * Hermv (Module)
|
92
|
-
# * Workspace (Class)
|
93
|
-
# * FFT (Module)
|
94
|
-
# * ComplexWavetable (Class)
|
95
|
-
# * ComplexWorkspace (Class)
|
96
|
-
# * HalfComplexWavetable (Class)
|
97
|
-
# * RealWavetable (Class)
|
98
|
-
# * RealWorkspace (Class)
|
99
|
-
# * Wavelet (Class)
|
100
|
-
# * Wavelet2d < Wavelet
|
101
|
-
# * Function (Class)
|
102
|
-
# * Function_fdf (Class)
|
103
|
-
# * Integration (Module)
|
104
|
-
# * Workspace
|
105
|
-
# * QAWS_Table
|
106
|
-
# * QAWO_Table
|
107
|
-
# * Rng (Class)
|
108
|
-
# * QRng (Class)
|
109
|
-
# * Ran (Module)
|
110
|
-
# * Stats (Module)
|
111
|
-
# * Histogram (Class)
|
112
|
-
# * Integral < Histogram
|
113
|
-
# * Pdf (Class)
|
114
|
-
# * Histogram2d (Class)
|
115
|
-
# * N-tuples
|
116
|
-
# * SelectFn (Class)
|
117
|
-
# * ValueFn (Class)
|
118
|
-
# * Monte (Module)
|
119
|
-
# * Function (Class)
|
120
|
-
# * Plain (Class)
|
121
|
-
# * Miser (Class)
|
122
|
-
# * Vegas (Class)
|
123
|
-
# * Siman (Module)
|
124
|
-
# * Efunc (Class)
|
125
|
-
# * Step (Class)
|
126
|
-
# * Metric (Class)
|
127
|
-
# * Print (Class)
|
128
|
-
# * Params (Class)
|
129
|
-
# * Solver (Class)
|
130
|
-
# * Odeiv (Module)
|
131
|
-
# * Control (Class)
|
132
|
-
# * Evolve (Class)
|
133
|
-
# * System (Class)
|
134
|
-
# * Solver (Class)
|
135
|
-
# * Interp (Class)
|
136
|
-
# * Accel (Class)
|
137
|
-
# * Spline (Class)
|
138
|
-
# * Diff (Module)
|
139
|
-
# * Deriv (Module)
|
140
|
-
# * Cheb (Class)
|
141
|
-
# * Sum (Module)
|
142
|
-
# * Levin_u (Class)
|
143
|
-
# * Levin_utrunc (Class)
|
144
|
-
# * Dht (Class)
|
145
|
-
# * Root (Module)
|
146
|
-
# * Solver (Class)
|
147
|
-
# * FdfSolver (Class)
|
148
|
-
# * Min(Module)
|
149
|
-
# * FMinimizer (Class)
|
150
|
-
# * MultiRoot (Module)
|
151
|
-
# * Function (Class)
|
152
|
-
# * FSolver (Class)
|
153
|
-
# * Function_fdf (Class)
|
154
|
-
# * FdfSolver (Class)
|
155
|
-
# * MultiMin (Module)
|
156
|
-
# * Function (Class)
|
157
|
-
# * FMinimizer (Class)
|
158
|
-
# * Function_fdf (Class)
|
159
|
-
# * FdfMinimizer (Class)
|
160
|
-
# * Fit (Module)
|
161
|
-
# * MultiFit (Module)
|
162
|
-
# * Workspace (Class)
|
163
|
-
# * Solver (Class)
|
164
|
-
# * Function_fdf (Class)
|
165
|
-
# * FdfSolver (Class)
|
166
|
-
# * CONST (Module)
|
167
|
-
# * MKSA (Module)
|
168
|
-
# * CGSM (Module)
|
169
|
-
# * NUM (Module)
|
170
|
-
#
|
171
|
-
# {prev}[link:rdoc/intro_rdoc.html]
|
172
|
-
# {next}[link:rdoc/ehandling_rdoc.html]
|
173
|
-
#
|
174
|
-
# {Reference index}[link:rdoc/ref_rdoc.html]
|
175
|
-
# {top}[link:index.html]
|
176
|
-
#
|
177
|
-
#
|
data/rdoc/vector.rdoc
DELETED
@@ -1,1243 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# = GSL::Vector class
|
3
|
-
#
|
4
|
-
# Contents:
|
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
|
-
# * GSL::Vector[elm0, elm1, ....]
|
37
|
-
#
|
38
|
-
# Constructors.
|
39
|
-
#
|
40
|
-
# Ex:
|
41
|
-
# >> v1 = GSL::Vector.alloc(5)
|
42
|
-
# => GSL::Vector: [ 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 ]
|
43
|
-
# >> v2 = GSL::Vector.alloc(1, 3, 5, 2)
|
44
|
-
# => GSL::Vector: [ 1.000e+00 3.000e+00 5.000e+00 2.000e+00 ]
|
45
|
-
# >> v3 = GSL::Vector[1, 3, 5, 2]
|
46
|
-
# => GSL::Vector: [ 1.000e+00 3.000e+00 5.000e+00 2.000e+00 ]
|
47
|
-
# >> v4 = GSL::Vector.alloc([1, 3, 5, 2])
|
48
|
-
# => GSL::Vector: [ 1.000e+00 3.000e+00 5.000e+00 2.000e+00 ]
|
49
|
-
# >> v5 = GSL::Vector[1..6]
|
50
|
-
# => GSL::Vector: [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 6.000e+00 ]
|
51
|
-
#
|
52
|
-
# ---
|
53
|
-
# * GSL::Vector.calloc(size)
|
54
|
-
#
|
55
|
-
# This method creates a vector object, and initializes all the elements to zero.
|
56
|
-
#
|
57
|
-
# ---
|
58
|
-
# * GSL::Vector.linspace(min, max, n = 10)
|
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>,
|
62
|
-
# the elements are stored in decreasing order. This mimics the <tt>linspace</tt>
|
63
|
-
# function of {GNU Octave}[https://gnu.org/software/octave/].
|
64
|
-
#
|
65
|
-
# Ex:
|
66
|
-
# >> x = GSL::Vector.linspace(0, 10, 5)
|
67
|
-
# [ 0.000e+00 2.500e+00 5.000e+00 7.500e+00 1.000e+01 ]
|
68
|
-
# >> y = GSL::Vector.linspace(10, 0, 5)
|
69
|
-
# [ 1.000e+01 7.500e+00 5.000e+00 2.500e+00 0.000e+00 ]
|
70
|
-
#
|
71
|
-
# ---
|
72
|
-
# * GSL::Vector.logspace(min, max, n)
|
73
|
-
#
|
74
|
-
# Similar to <tt>GSL::Vector#linspace</tt> except that the values are
|
75
|
-
# logarithmically spaced from 10^<tt>min</tt> to 10^<tt>max</tt>.
|
76
|
-
#
|
77
|
-
# Ex:
|
78
|
-
# >> x = GSL::Vector.logspace(1, 3, 5)
|
79
|
-
# [ 1.000e+01 3.162e+01 1.000e+02 3.162e+02 1.000e+03 ]
|
80
|
-
# >> x = GSL::Vector.logspace(3, 1, 5)
|
81
|
-
# [ 1.000e+03 3.162e+02 1.000e+02 3.162e+01 1.000e+01 ]
|
82
|
-
#
|
83
|
-
# ---
|
84
|
-
# * GSL::Vector.logspace2(min, max, n)
|
85
|
-
#
|
86
|
-
# Similar to <tt>GSL::Vector#linspace</tt> except that the values are
|
87
|
-
# logarithmically spaced from <tt>min</tt> to <tt>max</tt>.
|
88
|
-
#
|
89
|
-
# Ex:
|
90
|
-
# >> x = GSL::Vector.logspace2(10, 1000, 5)
|
91
|
-
# [ 1.000e+01 3.162e+01 1.000e+02 3.162e+02 1.000e+03 ]
|
92
|
-
# >> x = GSL::Vector.logspace2(1000, 10, 5)
|
93
|
-
# [ 1.000e+03 3.162e+02 1.000e+02 3.162e+01 1.000e+01 ]
|
94
|
-
#
|
95
|
-
# ---
|
96
|
-
# * GSL::Vector.indgen(n, start=0, step=1)
|
97
|
-
#
|
98
|
-
# This creates a vector of length <tt>n</tt> with elements from <tt>start</tt>
|
99
|
-
# with interval <tt>step</tt> (mimics NArray#indgen).
|
100
|
-
#
|
101
|
-
# Ex:
|
102
|
-
# >> v = GSL::Vector::Int.indgen(5)
|
103
|
-
# => GSL::Vector::Int:
|
104
|
-
# [ 0 1 2 3 4 ]
|
105
|
-
# >> v = GSL::Vector::Int.indgen(5, 3)
|
106
|
-
# => GSL::Vector::Int:
|
107
|
-
# [ 3 4 5 6 7 ]
|
108
|
-
# >> v = GSL::Vector.indgen(4, 1.2, 0.3)
|
109
|
-
# => GSL::Vector
|
110
|
-
# [ 1.200e+00 1.500e+00 1.800e+00 2.100e+00 ]
|
111
|
-
#
|
112
|
-
# ---
|
113
|
-
# * GSL::Vector.filescan(filename)
|
114
|
-
#
|
115
|
-
# Reads a formatted ascii file and returns an array of vectors.
|
116
|
-
# For a data file <tt>a.dat</tt> as
|
117
|
-
# 1 5 6 5
|
118
|
-
# 3 5 6 7
|
119
|
-
# 5 6 7 9
|
120
|
-
# then <tt>a, b, c, d = Vetor.filescan("a.dat")</tt> yields
|
121
|
-
# a = [1, 3, 5]
|
122
|
-
# b = [5, 5, 6]
|
123
|
-
# c = [6, 6, 7]
|
124
|
-
# d = [5, 7, 9]
|
125
|
-
#
|
126
|
-
# === NArray Extension
|
127
|
-
# If an <tt>NArray</tt> object is given, a newly allocated vector is created.
|
128
|
-
#
|
129
|
-
# Ex:
|
130
|
-
# na = NArray[1.0, 2, 3, 4, 5]
|
131
|
-
# p na <----- NArray.float(5):
|
132
|
-
# [ 1.0, 2.0, 3.0, 4.0, 5.0]
|
133
|
-
# v = GSL::Vector.alloc(na)
|
134
|
-
# p v <----- [ 1 2 3 4 5 ]
|
135
|
-
#
|
136
|
-
#
|
137
|
-
# See also {here}[link:rdoc/vector_rdoc.html#label-NArray+conversions].
|
138
|
-
#
|
139
|
-
# == NOTE:
|
140
|
-
# In Ruby/GSL, vector length is limited within the range of Fixnum.
|
141
|
-
# For 32-bit CPU, the maximum of vector length is 2^30 ~ 1e9.
|
142
|
-
#
|
143
|
-
# == Methods
|
144
|
-
#
|
145
|
-
# === Accessing vector elements
|
146
|
-
# ---
|
147
|
-
# * GSL::Vector#get(args)
|
148
|
-
# * \GSL::Vector#[args]
|
149
|
-
#
|
150
|
-
# Returns elements(s) of the vector <tt>self</tt> if <tt>args</tt> is a single
|
151
|
-
# <tt>Fixnum</tt>, a single <tt>Array</tt> of <tt>Fixnums</tt>, or a single
|
152
|
-
# <tt>GSL::Permutation</tt> (or <tt>GSL::Index</tt>). For all other <tt>args</tt>,
|
153
|
-
# the arguments are treated as with <tt>Vector#subvector</tt> and a
|
154
|
-
# <tt>Vector::View</tt> is returned.
|
155
|
-
#
|
156
|
-
# ---
|
157
|
-
# * GSL::Vector#set(args, val)
|
158
|
-
# * \GSL::Vector#[args] = val
|
159
|
-
#
|
160
|
-
# If <tt>args</tt> is empty, behaves as <tt>#set_all</tt> and <tt>val</tt> must be a
|
161
|
-
# <tt>Numeric</tt>.
|
162
|
-
#
|
163
|
-
# If <tt>args</tt> is a single <tt>Fixnum</tt>, <tt>i</tt>, sets the <tt>i</tt>-th
|
164
|
-
# element of the vector <tt>self</tt> to <tt>val</tt>, which must be a
|
165
|
-
# <tt>Numeric</tt>.
|
166
|
-
#
|
167
|
-
# All other <tt>args</tt> specify a subvector (as with <tt>#subvector</tt>) whose
|
168
|
-
# elements are assigned from <tt>val</tt>. In this case, <tt>val</tt> can be an
|
169
|
-
# <tt>Array</tt>, <tt>Range</tt>, <tt>GSL::Vector</tt>, or <tt>Numeric</tt>.
|
170
|
-
#
|
171
|
-
# NOTE: GSL does not provide a vector copy function that properly copies data
|
172
|
-
# across overlapping memory regions, so watch out if assigning to part of a
|
173
|
-
# Vector from another part of itself (see example below).
|
174
|
-
#
|
175
|
-
# Ex:
|
176
|
-
# >> require 'gsl'
|
177
|
-
# => true
|
178
|
-
# >> v = GSL::Vector[0..5]
|
179
|
-
# => GSL::Vector
|
180
|
-
# [ 0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 ]
|
181
|
-
# >> v[2]
|
182
|
-
# => 2.0
|
183
|
-
# >> v[1,2,3]
|
184
|
-
# => GSL::Vector::View
|
185
|
-
# [ 1.000e+00 3.000e+00 5.000e+00 ]
|
186
|
-
# >> v[[1,2,3]]
|
187
|
-
# => GSL::Vector
|
188
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 ]
|
189
|
-
# >> v[3] = 9
|
190
|
-
# => 9
|
191
|
-
# >> v[-1] = 123
|
192
|
-
# => 123
|
193
|
-
# >> v
|
194
|
-
# => GSL::Vector
|
195
|
-
# [ 0.000e+00 1.000e+00 2.000e+00 9.000e+00 4.000e+00 1.230e+02 ]
|
196
|
-
# >> v[2,3] = 0
|
197
|
-
# => 0
|
198
|
-
# >> v
|
199
|
-
# => GSL::Vector
|
200
|
-
# [ 0.000e+00 1.000e+00 0.000e+00 0.000e+00 0.000e+00 1.230e+02 ]
|
201
|
-
# >> v[2,3] = [4,5,6]
|
202
|
-
# => [4, 5, 6]
|
203
|
-
# >> v
|
204
|
-
# => GSL::Vector
|
205
|
-
# [ 0.000e+00 1.000e+00 4.000e+00 5.000e+00 6.000e+00 1.230e+02 ]
|
206
|
-
# >> v[1,4] = v[0,4] # !!! Overlapping !!!
|
207
|
-
# => GSL::Vector::View
|
208
|
-
# [ 0.000e+00 0.000e+00 0.000e+00 0.000e+00 ]
|
209
|
-
# >> v
|
210
|
-
# => GSL::Vector
|
211
|
-
# [ 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 1.230e+02 ]
|
212
|
-
#
|
213
|
-
#
|
214
|
-
# === Initializing vector elements
|
215
|
-
# ---
|
216
|
-
# * GSL::Vector#set_all(x)
|
217
|
-
#
|
218
|
-
# This method sets all the elements of the vector to the value <tt>x</tt>.
|
219
|
-
#
|
220
|
-
# ---
|
221
|
-
# * GSL::Vector#set_zero
|
222
|
-
#
|
223
|
-
# This method sets all the elements of the vector to zero.
|
224
|
-
#
|
225
|
-
# ---
|
226
|
-
# * GSL::Vector#set_basis!(i)
|
227
|
-
#
|
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.
|
230
|
-
# For a vector <tt>v</tt> of size 10, the method
|
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>.
|
233
|
-
#
|
234
|
-
# ---
|
235
|
-
# * GSL::Vector#set_basis(i)
|
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.
|
239
|
-
# For a vector <tt>v</tt> of size 10, the method
|
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>.
|
242
|
-
# The vector <tt>v</tt> is not changed.
|
243
|
-
#
|
244
|
-
# ---
|
245
|
-
# * GSL::Vector#indgen!(start=0, step=1)
|
246
|
-
# * GSL::Vector#indgen(start=0, step=1)
|
247
|
-
#
|
248
|
-
# Mimics NArray#indgen!.
|
249
|
-
#
|
250
|
-
# === Iterators
|
251
|
-
# ---
|
252
|
-
# * GSL::Vector#each
|
253
|
-
# * GSL::Vector#reverse_each
|
254
|
-
#
|
255
|
-
# An iterator for each of the vector elements, used as
|
256
|
-
#
|
257
|
-
# v.each do |x| # Show all the elements
|
258
|
-
# p x
|
259
|
-
# end
|
260
|
-
#
|
261
|
-
# ---
|
262
|
-
# * GSL::Vector#each_index
|
263
|
-
# * GSL::Vector#reverse_each_index
|
264
|
-
#
|
265
|
-
# Iterators
|
266
|
-
#
|
267
|
-
# ---
|
268
|
-
# * GSL::Vector#collect { |item| .. }
|
269
|
-
# * GSL::Vector#map { |item| .. }
|
270
|
-
#
|
271
|
-
# Creates a new vector by collecting the vector elements modified with some
|
272
|
-
# operations.
|
273
|
-
#
|
274
|
-
# Ex:
|
275
|
-
# >> a = GSL::Vector::Int[0..5]
|
276
|
-
# => GSL::Vector::Int
|
277
|
-
# [ 0 1 2 3 4 5 ]
|
278
|
-
# >> b = a.collect {|v| v*v}
|
279
|
-
# => GSL::Vector::Int
|
280
|
-
# [ 0 1 4 9 16 25 ]
|
281
|
-
# >> a
|
282
|
-
# => GSL::Vector::Int
|
283
|
-
# [ 0 1 2 3 4 5 ]
|
284
|
-
#
|
285
|
-
# ---
|
286
|
-
# * GSL::Vector#collect! { |item| .. }
|
287
|
-
# * GSL::Vector#map! { |item| .. }
|
288
|
-
#
|
289
|
-
# Ex:
|
290
|
-
# >> a = GSL::Vector::Int[0..5]
|
291
|
-
# => GSL::Vector::Int
|
292
|
-
# [ 0 1 2 3 4 5 ]
|
293
|
-
# >> a.collect! {|v| v*v}
|
294
|
-
# => GSL::Vector::Int
|
295
|
-
# [ 0 1 4 9 16 25 ]
|
296
|
-
# >> a
|
297
|
-
# => GSL::Vector::Int
|
298
|
-
# [ 0 1 4 9 16 25 ]
|
299
|
-
#
|
300
|
-
# === IO
|
301
|
-
# ---
|
302
|
-
# * GSL::Vector#print
|
303
|
-
# * GSL::Vector#fprintf(io, format = "%e")
|
304
|
-
# * GSL::Vector#fprintf(filename, format = "%e")
|
305
|
-
# * GSL::Vector#fscanf(io)
|
306
|
-
# * GSL::Vector#fscanf(filename)
|
307
|
-
# * GSL::Vector#fwrite(io)
|
308
|
-
# * GSL::Vector#fwrite(filename)
|
309
|
-
# * GSL::Vector#fread(io)
|
310
|
-
# * GSL::Vector#fread(filename)
|
311
|
-
#
|
312
|
-
# Methods for writing or reading the vector.
|
313
|
-
# The first argument is an <tt>IO</tt> or a <tt>String</tt> object.
|
314
|
-
#
|
315
|
-
# === Copying vectors
|
316
|
-
# ---
|
317
|
-
# * GSL::Vector#clone
|
318
|
-
# * GSL::Vector#duplicate
|
319
|
-
#
|
320
|
-
# Create a new vector of the same elements.
|
321
|
-
#
|
322
|
-
# === Vector views
|
323
|
-
# The <tt>GSL::Vector::View</tt> class is defined to be used as "references" to
|
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
|
326
|
-
# can be used same as the original vector. A
|
327
|
-
# <tt>View</tt> object shares the data with the original vector, i.e. any changes
|
328
|
-
# in the elements of the <tt>View</tt> object affect to the original vector.
|
329
|
-
#
|
330
|
-
# ---
|
331
|
-
# * GSL::Vector#subvector
|
332
|
-
# * GSL::Vector#subvector(n)
|
333
|
-
# * GSL::Vector#subvector(offset, n)
|
334
|
-
# * GSL::Vector#subvector(offset, stride, n)
|
335
|
-
# * GSL::Vector#subvector(range, stride=1)
|
336
|
-
#
|
337
|
-
# Create a <tt>Vector::View</tt> object slicing <tt>n</tt> elements
|
338
|
-
# of the vector <tt>self</tt> from the offset <tt>offset</tt>. If called with one
|
339
|
-
# argument <tt>n</tt>, <tt>offset</tt> is set to 0. With no arguments, a view is
|
340
|
-
# created with the same length of the original vector. If called with a
|
341
|
-
# <tt>range</tt> parameter (and optional <tt>stride</tt>), a view is created for
|
342
|
-
# that range (and stride). Note the <tt>n</tt>, if given, is the length of the
|
343
|
-
# returned View.
|
344
|
-
#
|
345
|
-
# * Example:
|
346
|
-
# #!/usr/bin/env ruby
|
347
|
-
# require("gsl")
|
348
|
-
#
|
349
|
-
# v = GSL::Vector[1, 2, 3, 4, 5, 6]
|
350
|
-
# view = v.subvector(1, 4)
|
351
|
-
# p view.class <----- GSL::Vector::View
|
352
|
-
# view.print <----- [ 2 3 4 5 ]
|
353
|
-
#
|
354
|
-
# view[2] = 99
|
355
|
-
# view.print <----- [ 2 3 99 5 ]
|
356
|
-
# v.print <----- [ 1 2 3 99 5 6 ]
|
357
|
-
#
|
358
|
-
# ---
|
359
|
-
# * GSL::Vector#subvector_with_stride(stride)
|
360
|
-
# * GSL::Vector#subvector_with_stride(offset, stride)
|
361
|
-
# * GSL::Vector#subvector_with_stride(offset, stride, n)
|
362
|
-
#
|
363
|
-
# Return a <tt>Vector::View</tt> object of a subvector of another vector
|
364
|
-
# <tt>self</tt> with an additional stride argument. The subvector is formed in
|
365
|
-
# the same way as for <tt>Vector#subvector</tt> but the new vector view has
|
366
|
-
# <tt>n</tt> elements with a step-size of <tt>stride</tt> from one element to the
|
367
|
-
# next in the original vector. Note that <tt>n</tt>, if given, is the length of
|
368
|
-
# the returned View.
|
369
|
-
#
|
370
|
-
# ---
|
371
|
-
# * GSL::Vector#matrix_view(n1, n2)
|
372
|
-
#
|
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:rdoc/matrix_rdoc.html] object.
|
375
|
-
#
|
376
|
-
# * Ex:
|
377
|
-
#
|
378
|
-
# >> v = GSL::Vector::Int.alloc(1..9)
|
379
|
-
# => GSL::Vector::Int:
|
380
|
-
# [ 1 2 3 4 5 6 7 8 9 ]
|
381
|
-
# >> m = v.matrix_view(3, 3)
|
382
|
-
# => GSL::Matrix::Int::View:
|
383
|
-
# [ 1 2 3
|
384
|
-
# 4 5 6
|
385
|
-
# 7 8 9 ]
|
386
|
-
# >> m[1][2] = 99
|
387
|
-
# => 99
|
388
|
-
# >> v
|
389
|
-
# => GSL::Vector::Int:
|
390
|
-
# [ 1 2 3 4 5 99 7 8 9 ]
|
391
|
-
#
|
392
|
-
# === Vector operations
|
393
|
-
#
|
394
|
-
# ---
|
395
|
-
# * GSL::Vector#swap_elements(i, j)
|
396
|
-
#
|
397
|
-
# This method exchanges the i-th and j-th elements of the vector <tt>in-place</tt>.
|
398
|
-
#
|
399
|
-
# ---
|
400
|
-
# * GSL::Vector#reverse
|
401
|
-
#
|
402
|
-
# Reverses the order of the elements of the vector.
|
403
|
-
#
|
404
|
-
# >> v = GSL::Vector::Int[1..5]
|
405
|
-
# => GSL::Vector::Int:
|
406
|
-
# [ 1 2 3 4 5 ]
|
407
|
-
# >> v.reverse
|
408
|
-
# => GSL::Vector::Int:
|
409
|
-
# [ 5 4 3 2 1 ]
|
410
|
-
#
|
411
|
-
# ---
|
412
|
-
# * GSL::Vector#trans
|
413
|
-
# * GSL::Vector#transpose
|
414
|
-
# * GSL::Vector#col
|
415
|
-
# * GSL::Vector#row
|
416
|
-
#
|
417
|
-
# Transpose the vector from a row vector into a column vector and vice versa.
|
418
|
-
#
|
419
|
-
# >> v = GSL::Vector::Int[1..5]
|
420
|
-
# => GSL::Vector::Int:
|
421
|
-
# [ 1 2 3 4 5 ]
|
422
|
-
# >> v.col
|
423
|
-
# => GSL::Vector::Int::Col:
|
424
|
-
# [ 1
|
425
|
-
# 2
|
426
|
-
# 3
|
427
|
-
# 4
|
428
|
-
# 5 ]
|
429
|
-
#
|
430
|
-
# ---
|
431
|
-
# * GSL::Vector#add(b)
|
432
|
-
#
|
433
|
-
# Adds the elements of vector <tt>b</tt> to the elements
|
434
|
-
# of the vector <tt>self</tt>. A new vector is created, and the vector
|
435
|
-
# <tt>self</tt> is not changed.
|
436
|
-
#
|
437
|
-
# ---
|
438
|
-
# * GSL::Vector#sub(b)
|
439
|
-
#
|
440
|
-
# Subtracts the element of vector <tt>b</tt> from the elements of <tt>self</tt>.
|
441
|
-
# A new vector is created, and the vector <tt>self</tt> is not changed.
|
442
|
-
#
|
443
|
-
# ---
|
444
|
-
# * GSL::Vector#mul(b)
|
445
|
-
#
|
446
|
-
# Multiplies the elements of vector <tt>self</tt> by the elements of vector <tt>b</tt>.
|
447
|
-
# ---
|
448
|
-
# * GSL::Vector#div(b)
|
449
|
-
#
|
450
|
-
# Divides the elements of vector <tt>self</tt> by the elements of vector <tt>b</tt>.
|
451
|
-
#
|
452
|
-
# ---
|
453
|
-
# * GSL::Vector#scale(x)
|
454
|
-
# * GSL::Vector#scale!(x)
|
455
|
-
#
|
456
|
-
# This method multiplies the elements of vector <tt>self</tt> by
|
457
|
-
# the constant factor <tt>x</tt>.
|
458
|
-
#
|
459
|
-
# ---
|
460
|
-
# * GSL::Vector#add_constant(x)
|
461
|
-
# * GSL::Vector#add_constant!(x)
|
462
|
-
#
|
463
|
-
# Adds the constant value <tt>x</tt> to the elements of the vector <tt>self</tt>.
|
464
|
-
#
|
465
|
-
# ---
|
466
|
-
# * GSL::Vector#+(b)
|
467
|
-
#
|
468
|
-
# For <tt>b</tt>,
|
469
|
-
# * a Number: ---> <tt>self.add_constanb(b)</tt>
|
470
|
-
# * a Vector: ---> <tt>self.add(b)</tt>
|
471
|
-
# ---
|
472
|
-
# * GSL::Vector#-(b)
|
473
|
-
#
|
474
|
-
# For <tt>b</tt>,
|
475
|
-
# * a Number: ---> <tt>self.add_constanb(-b)</tt>
|
476
|
-
# * a Vector: ---> <tt>self.sub(b)</tt>
|
477
|
-
# ---
|
478
|
-
# * GSL::Vector#/(b)
|
479
|
-
#
|
480
|
-
# For <tt>b</tt>,
|
481
|
-
# * a Number: ---> <tt>self.scale(1/b)</tt>
|
482
|
-
# * a Vector: ---> <tt>self.div(b)</tt>
|
483
|
-
#
|
484
|
-
# ---
|
485
|
-
# * GSL::Vector#*(b)
|
486
|
-
#
|
487
|
-
# Vector multiplication.
|
488
|
-
#
|
489
|
-
# 1. Scale
|
490
|
-
# >> v = GSL::Vector[1, 2]
|
491
|
-
# [ 1 2 ]
|
492
|
-
# >> v*2
|
493
|
-
# [ 2 4 ]
|
494
|
-
# 1. Element-by-element multiplication
|
495
|
-
# >> a = GSL::Vector[1, 2]; b = GSL::Vector[3, 4]
|
496
|
-
# [ 3 4 ]
|
497
|
-
# >> a*b
|
498
|
-
# [ 3 8 ]
|
499
|
-
# 1. Inner product
|
500
|
-
# >> a = GSL::Vector[1, 2]; b = GSL::Vector[3, 4]
|
501
|
-
# [ 3
|
502
|
-
# 4 ]
|
503
|
-
# >> a*b.col
|
504
|
-
# => 11.0
|
505
|
-
# 1. GSL::Vector::Col*Vector -> GSL::Matrix
|
506
|
-
# >> a = GSL::Vector::Col[1, 2]; b = GSL::Vector[3, 4]
|
507
|
-
# [ 3 4 ]
|
508
|
-
# >> a*b
|
509
|
-
# [ 3 4
|
510
|
-
# 6 8 ]
|
511
|
-
# 1. GSL::Matrix*Vector::Col -> GSL::Vector::Col
|
512
|
-
# >> a = GSL::Vector[1, 2]; m = GSL::Matrix[[2, 3], [4, 5]]
|
513
|
-
# [ 2 3
|
514
|
-
# 4 5 ]
|
515
|
-
# >> m*a <--- Error
|
516
|
-
# TypeError: Operation with GSL::Vector is not defined (GSL::Vector::Col expected)
|
517
|
-
# from (irb):30:in `*'
|
518
|
-
# from (irb):30
|
519
|
-
# >> m*a.col
|
520
|
-
# [ 8
|
521
|
-
# 14 ]
|
522
|
-
#
|
523
|
-
# ---
|
524
|
-
# * GSL::Vector#add!(b)
|
525
|
-
# * GSL::Vector#sub!(b)
|
526
|
-
# * GSL::Vector#mul!(b)
|
527
|
-
# * GSL::Vector#div!(b)
|
528
|
-
#
|
529
|
-
# In-place operations with a vector <tt>b</tt>.
|
530
|
-
#
|
531
|
-
# ---
|
532
|
-
# * GSL::Vector#pow(p)
|
533
|
-
# * GSL::Vector#**(p)
|
534
|
-
# * GSL::Vector#pow!(p)
|
535
|
-
#
|
536
|
-
# Element-wise calculation of power p.
|
537
|
-
#
|
538
|
-
# Ex)
|
539
|
-
# >> require("gsl")
|
540
|
-
# >> v = GSL::Vector[1, 2, 3]
|
541
|
-
# => GSL::Vector
|
542
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 ]
|
543
|
-
# >> v.pow(2)
|
544
|
-
# => GSL::Vector
|
545
|
-
# [ 1.000e+00 4.000e+00 9.000e+00 ]
|
546
|
-
# >> v**2
|
547
|
-
# => GSL::Vector
|
548
|
-
# [ 1.000e+00 4.000e+00 9.000e+00 ]
|
549
|
-
# >> v
|
550
|
-
# => GSL::Vector
|
551
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 ]
|
552
|
-
# >> v.pow!(2)
|
553
|
-
# => GSL::Vector
|
554
|
-
# [ 1.000e+00 4.000e+00 9.000e+00 ]
|
555
|
-
# >> v
|
556
|
-
# => GSL::Vector
|
557
|
-
# [ 1.000e+00 4.000e+00 9.000e+00 ]
|
558
|
-
#
|
559
|
-
# ---
|
560
|
-
# * GSL::Vector#swap_elements(i, j)
|
561
|
-
#
|
562
|
-
# This exchanges the <tt>i</tt>-th and <tt>j</tt>-th elements of the vector <tt>self</tt> in-place.
|
563
|
-
# ---
|
564
|
-
# * GSL::Vector#clone
|
565
|
-
# * GSL::Vector#duplicate
|
566
|
-
#
|
567
|
-
# These create a copy of the vector <tt>self</tt>.
|
568
|
-
#
|
569
|
-
# ---
|
570
|
-
# * GSL::Vector.connect(v1, v2, v3, ...)
|
571
|
-
# * GSL::Vector#connect(v2, v3, ...)
|
572
|
-
#
|
573
|
-
# Creates a new vector by connecting all the elements of the given vectors.
|
574
|
-
#
|
575
|
-
# >> v1 = GSL::Vector::Int[1, 3]
|
576
|
-
# => GSL::Vector::Int:
|
577
|
-
# [ 1 3 ]
|
578
|
-
# >> v2 = GSL::Vector::Int[4, 3, 5]
|
579
|
-
# => GSL::Vector::Int:
|
580
|
-
# [ 4 3 5 ]
|
581
|
-
# >> v1.connect(v2)
|
582
|
-
# => GSL::Vector::Int:
|
583
|
-
# [ 1 3 4 3 5 ]
|
584
|
-
#
|
585
|
-
# ---
|
586
|
-
# * GSL::Vector#sgn
|
587
|
-
# * GSL::Vector#signum
|
588
|
-
#
|
589
|
-
# Creates a new vector, with elements +1 if <tt>x_i</tt> > 0, -1 if <tt>x_i</tt> <
|
590
|
-
# 0, otherwise 0. Note that this definition gives the signum of NaN as 0
|
591
|
-
# rather than NaN.
|
592
|
-
#
|
593
|
-
# ---
|
594
|
-
# * GSL::Vector#abs
|
595
|
-
# * GSL::Vector#fabs
|
596
|
-
#
|
597
|
-
# Creates a new vector, with elements <tt>fabs(x_i)</tt>.
|
598
|
-
#
|
599
|
-
# >> v = GSL::Vector::Int[-3, 2, -5, 4]
|
600
|
-
# => GSL::Vector::Int:
|
601
|
-
# [ -3 2 -5 4 ]
|
602
|
-
# >> v.abs
|
603
|
-
# => GSL::Vector::Int:
|
604
|
-
# [ 3 2 5 4 ]
|
605
|
-
#
|
606
|
-
# ---
|
607
|
-
# * GSL::Vector#square
|
608
|
-
# * GSL::Vector#abs2
|
609
|
-
#
|
610
|
-
# Create a new vector, with elements <tt>x_i*x_i</tt>.
|
611
|
-
#
|
612
|
-
# >> v = GSL::Vector::Int[1..4]
|
613
|
-
# => GSL::Vector::Int:
|
614
|
-
# [ 1 2 3 4 ]
|
615
|
-
# >> v.square
|
616
|
-
# => GSL::Vector::Int:
|
617
|
-
# [ 1 4 9 16 ]
|
618
|
-
#
|
619
|
-
# ---
|
620
|
-
# * GSL::Vector#sqrt
|
621
|
-
#
|
622
|
-
# Creates a new vector, with elements <tt>sqrt</tt>(<tt>x_i</tt>).
|
623
|
-
#
|
624
|
-
# ---
|
625
|
-
# * GSL::Vector#floor
|
626
|
-
# * GSL::Vector#ceil
|
627
|
-
# * GSL::Vector#round
|
628
|
-
#
|
629
|
-
#
|
630
|
-
# Ex:
|
631
|
-
# >> v = GSL::Vector[1.1, 2.7, 3.5, 4.3]
|
632
|
-
# => GSL::Vector
|
633
|
-
# [ 1.100e+00 2.700e+00 3.500e+00 4.300e+00 ]
|
634
|
-
# >> v.floor
|
635
|
-
# => GSL::Vector::Int
|
636
|
-
# [ 1 2 3 4 ]
|
637
|
-
# >> v.ceil
|
638
|
-
# => GSL::Vector::Int
|
639
|
-
# [ 2 3 4 5 ]
|
640
|
-
# >> v.round
|
641
|
-
# => GSL::Vector::Int
|
642
|
-
# [ 1 3 4 4 ]
|
643
|
-
#
|
644
|
-
# ---
|
645
|
-
# * GSL::Vector#normalize(nrm = 1.0)
|
646
|
-
#
|
647
|
-
# Creates a new vector of norm <tt>nrm</tt>, by scaling the vector <tt>self</tt>.
|
648
|
-
# ---
|
649
|
-
# * GSL::Vector#normalize!(nrm = 1.0)
|
650
|
-
#
|
651
|
-
# This normalizes the vector <tt>self</tt> in-place.
|
652
|
-
#
|
653
|
-
# Ex:
|
654
|
-
# tcsh> irb
|
655
|
-
# >> require("gsl")
|
656
|
-
# => true
|
657
|
-
# >> a = GSL::Vector[-1, -2, -3, -4]
|
658
|
-
# => GSL::Vector:
|
659
|
-
# [ -1.000e+00 -2.000e+00 -3.000e+00 -4.000e+00 ]
|
660
|
-
# >> b = a.abs
|
661
|
-
# => GSL::Vector:
|
662
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 ]
|
663
|
-
# >> b.sqrt
|
664
|
-
# => GSL::Vector:
|
665
|
-
# [ 1.000e+00 1.414e+00 1.732e+00 2.000e+00 ]
|
666
|
-
# >> b.square
|
667
|
-
# => GSL::Vector:
|
668
|
-
# [ 1.000e+00 4.000e+00 9.000e+00 1.600e+01 ]
|
669
|
-
# >> c = b.normalize(2)
|
670
|
-
# => GSL::Vector:
|
671
|
-
# [ 2.582e-01 5.164e-01 7.746e-01 1.033e+00 ]
|
672
|
-
# >> c.square.sum
|
673
|
-
# => 2.0
|
674
|
-
#
|
675
|
-
# ---
|
676
|
-
# * GSL::Vector#decimate(n)
|
677
|
-
#
|
678
|
-
# Creates a new vector by averaring every <tt>n</tt>
|
679
|
-
# points of the vector <tt>self</tt> down to one point.
|
680
|
-
#
|
681
|
-
# ---
|
682
|
-
# * GSL::Vector#diff(k = 1)
|
683
|
-
#
|
684
|
-
# Calculate <tt>k</tt>-th differences of a vector <tt>self</tt>.
|
685
|
-
#
|
686
|
-
#
|
687
|
-
# ---
|
688
|
-
# * GSL::Vector#join(sep = " ")
|
689
|
-
#
|
690
|
-
# Converts the vector to a <tt>String</tt> by joining all the elements with a
|
691
|
-
# separator <tt>sep</tt>.
|
692
|
-
#
|
693
|
-
# ---
|
694
|
-
# * GSL::Vector#zip(vec, ...)
|
695
|
-
# * GSL::Vector.zip(vec, ...)
|
696
|
-
#
|
697
|
-
# Create an <tt>Array</tt> of vectors by merging the elements of <tt>self</tt>
|
698
|
-
# with corresponding elements from each arguments.
|
699
|
-
#
|
700
|
-
# Ex:
|
701
|
-
# >> require("gsl")
|
702
|
-
# >> a = GSL::Vector[4, 5, 6]
|
703
|
-
# >> b = GSL::Vector[7, 8, 9]
|
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 ],
|
707
|
-
# [ 3.000e+00 6.000e+00 9.000e+00 ]]
|
708
|
-
# >> GSL::Vector[1, 2].zip(a, b)
|
709
|
-
# [[ 1.000e+00 4.000e+00 7.000e+00 ],
|
710
|
-
# [ 2.000e+00 5.000e+00 8.000e+00 ]]
|
711
|
-
# >> a.zip(GSL::Vector[1, 2], GSL::Vector[8.0])
|
712
|
-
# [[ 4.000e+00 1.000e+00 8.000e+00 ],
|
713
|
-
# [ 5.000e+00 2.000e+00 0.000e+00 ],
|
714
|
-
# [ 6.000e+00 0.000e+00 0.000e+00 ]]
|
715
|
-
#
|
716
|
-
# ---
|
717
|
-
# * GSL::Vector#concat(x)
|
718
|
-
#
|
719
|
-
# Returns a new Vector that contains the concatenation <tt>self</tt> and
|
720
|
-
# <tt>x</tt>, which must be an <tt>Array</tt>, <tt>Fixnum</tt>, <tt>Bignum</tt>,
|
721
|
-
# <tt>Float</tt>, <tt>Range</tt>, or <tt>GSL::Vector</tt>.
|
722
|
-
#
|
723
|
-
# === Vector operations with size changes
|
724
|
-
# The methods below change vector length of <tt>self</tt>. A Vector's length may
|
725
|
-
# not extend past its original allocation. Use of these methods is discouraged.
|
726
|
-
# Existing Views may still refer to elements beyond the end of the shortened
|
727
|
-
# Vector. These elements remain allocated, but are effectvely unmanaged.
|
728
|
-
#
|
729
|
-
# ---
|
730
|
-
# * GSL::Vector#delete(x)
|
731
|
-
#
|
732
|
-
# Deletes items from <tt>self</tt> that are equal to <tt>x</tt>. If the item is
|
733
|
-
# not found, returns <tt>nil</tt>, otherwise returns <tt>x</tt>.
|
734
|
-
# ---
|
735
|
-
# * GSL::Vector#delete_at(i)
|
736
|
-
#
|
737
|
-
# Deletes the element at the specified index <tt>i</tt>,
|
738
|
-
# returning that element, or <tt>nil</tt> if the index is out of range.
|
739
|
-
# ---
|
740
|
-
# * GSL::Vector#delete_if { |x| ... }
|
741
|
-
#
|
742
|
-
# Deletes every element of <tt>self</tt> for which block evaluates to <tt>true</tt>
|
743
|
-
# and returns <tt>self</tt>.
|
744
|
-
#
|
745
|
-
# === Finding maximum and minimum elements of vectors
|
746
|
-
#
|
747
|
-
# ---
|
748
|
-
# * GSL::Vector#max
|
749
|
-
#
|
750
|
-
# This method returns the maximum value in the vector.
|
751
|
-
#
|
752
|
-
# ---
|
753
|
-
# * GSL::Vector#min
|
754
|
-
#
|
755
|
-
# This method returns the minimum value in the vector.
|
756
|
-
#
|
757
|
-
# ---
|
758
|
-
# * GSL::Vector#minmax
|
759
|
-
#
|
760
|
-
# This method returns an array of two elements, the minimum and the maximum values
|
761
|
-
# in the vector <tt>self</tt>.
|
762
|
-
#
|
763
|
-
# ---
|
764
|
-
# * GSL::Vector#max_index
|
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.
|
768
|
-
#
|
769
|
-
# ---
|
770
|
-
# * GSL::Vector#min_index
|
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.
|
774
|
-
#
|
775
|
-
# ---
|
776
|
-
# * GSL::Vector#minmax_index
|
777
|
-
#
|
778
|
-
# This method returns an array of two elements which has the indices
|
779
|
-
# of the minimum and the maximum values in the vector <tt>self</tt>.
|
780
|
-
#
|
781
|
-
# === Vector Properties
|
782
|
-
# ---
|
783
|
-
# * GSL::Vector#size
|
784
|
-
# * GSL::Vector#len
|
785
|
-
# * GSL::Vector#length
|
786
|
-
#
|
787
|
-
# Return the vector length.
|
788
|
-
#
|
789
|
-
# ---
|
790
|
-
# * GSL::Vector#stride
|
791
|
-
#
|
792
|
-
# Return the vector stride.
|
793
|
-
#
|
794
|
-
# ---
|
795
|
-
# * GSL::Vector#sum
|
796
|
-
#
|
797
|
-
# Returns the sum of the vector elements.
|
798
|
-
#
|
799
|
-
# ---
|
800
|
-
# * GSL::Vector#prod
|
801
|
-
#
|
802
|
-
# Returns the product of the vector elements.
|
803
|
-
#
|
804
|
-
# ---
|
805
|
-
# * GSL::Vector#cumsum
|
806
|
-
#
|
807
|
-
# Calculate the cumulative sum of elements of <tt>self</tt> and returns as a new vector.
|
808
|
-
#
|
809
|
-
# ---
|
810
|
-
# * GSL::Vector#cumprod
|
811
|
-
#
|
812
|
-
# Calculate the cumulative product of elements of <tt>self</tt> and returns as a new vector.
|
813
|
-
#
|
814
|
-
# ---
|
815
|
-
# * GSL::Vector#isnull
|
816
|
-
#
|
817
|
-
# Returns 1 if all the elements of the vector <tt>self</tt>
|
818
|
-
# are zero, and 0 otherwise.
|
819
|
-
# ---
|
820
|
-
# * GSL::Vector#isnull?
|
821
|
-
#
|
822
|
-
# Return <tt>true</tt> if all the elements of the vector <tt>self</tt>
|
823
|
-
# are zero, and <tt>false</tt> otherwise.
|
824
|
-
# ---
|
825
|
-
# * GSL::Vector#ispos
|
826
|
-
# * GSL::Vector#ispos?
|
827
|
-
# * GSL::Vector#isneg
|
828
|
-
# * GSL::Vector#isneg?
|
829
|
-
#
|
830
|
-
# (GSL-1.9 or later) Return 1 (true) if all the elements of the vector <tt>self</tt> are zero, strictly positive, strictly negative respectively, and 0 (false) otherwise.
|
831
|
-
#
|
832
|
-
# ---
|
833
|
-
# * GSL::Vector#isnonneg
|
834
|
-
# * GSL::Vector#isnonneg?
|
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.
|
837
|
-
#
|
838
|
-
# ---
|
839
|
-
# * GSL::Vector#all?
|
840
|
-
#
|
841
|
-
# Returns <tt>true</tt> if all the vector elements are non-zero, and <tt>false</tt>
|
842
|
-
# otherwise. If a block is given, the method returns <tt>true</tt> if the
|
843
|
-
# tests are true for all the elements.
|
844
|
-
# ---
|
845
|
-
# * GSL::Vector#any?
|
846
|
-
#
|
847
|
-
# Returns <tt>true</tt> if any the vector elements are non-zero, and <tt>false</tt>
|
848
|
-
# otherwise. If a block is given, the method returns <tt>true</tt> if the
|
849
|
-
# tests are true for any of the elements.
|
850
|
-
# ---
|
851
|
-
# * GSL::Vector#none?
|
852
|
-
#
|
853
|
-
# Returns <tt>true</tt> if all the elements of the vector <tt>self</tt>
|
854
|
-
# are zero, and <tt>false</tt> otherwise (just as <tt>GSL::Vector#isnull?</tt>).
|
855
|
-
# If a block is given, the method returns <tt>true</tt> if the
|
856
|
-
# tests are false for all the elements.
|
857
|
-
#
|
858
|
-
# Ex:
|
859
|
-
# >> a = GSL::Vector[1, 2, 3]
|
860
|
-
# >> b = GSL::Vector[1, 2, 0]
|
861
|
-
# >> c = GSL::Vector[0, 0, 0]
|
862
|
-
# >> a.all?
|
863
|
-
# => true
|
864
|
-
# >> b.all?
|
865
|
-
# => false
|
866
|
-
# >> b.any?
|
867
|
-
# => true
|
868
|
-
# >> c.any?
|
869
|
-
# => false
|
870
|
-
# >> a.none?
|
871
|
-
# => false
|
872
|
-
# >> c.none?
|
873
|
-
# => true
|
874
|
-
#
|
875
|
-
# ---
|
876
|
-
# * GSL::Vector#all
|
877
|
-
# * GSL::Vector#any
|
878
|
-
# * GSL::Vector#none
|
879
|
-
#
|
880
|
-
# Returns 1 or 0.
|
881
|
-
#
|
882
|
-
# ---
|
883
|
-
# * GSL::Vector#equal?(other, eps = 1e-10)
|
884
|
-
# * GSL::Vector#==(other, eps = 1e-10)
|
885
|
-
#
|
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,
|
888
|
-
# and <tt>false</tt> otherwise.
|
889
|
-
#
|
890
|
-
# === Element-wise vector comparison
|
891
|
-
# ---
|
892
|
-
# * GSL::Vector#eq(other)
|
893
|
-
# * GSL::Vector#ne(other)
|
894
|
-
# * GSL::Vector#gt(other)
|
895
|
-
# * GSL::Vector#ge(other)
|
896
|
-
# * GSL::Vector#lt(other)
|
897
|
-
# * GSL::Vector#le(other)
|
898
|
-
#
|
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,
|
901
|
-
# not <tt>true/false</tt>, thus all of the elements are "true" in Ruby.
|
902
|
-
#
|
903
|
-
# Ex:
|
904
|
-
# >> a = GSL::Vector[1, 2, 3]
|
905
|
-
# >> b = GSL::Vector[1, 2, 5]
|
906
|
-
# >> a.eq(b)
|
907
|
-
# [ 1 1 0 ]
|
908
|
-
# >> a.ne(b)
|
909
|
-
# [ 0 0 1 ]
|
910
|
-
# >> a.gt(b)
|
911
|
-
# [ 0 0 0 ]
|
912
|
-
# >> a.ge(b)
|
913
|
-
# [ 1 1 0 ]
|
914
|
-
# >> a.eq(3)
|
915
|
-
# [ 0 0 1 ]
|
916
|
-
# >> a.ne(2)
|
917
|
-
# [ 1 0 1 ]
|
918
|
-
# >> a.ge(2)
|
919
|
-
# [ 0 1 1 ]
|
920
|
-
#
|
921
|
-
# ---
|
922
|
-
# * GSL::Vector#and(other)
|
923
|
-
# * GSL::Vector#or(other)
|
924
|
-
# * GSL::Vector#xor(other)
|
925
|
-
# * GSL::Vector#not
|
926
|
-
#
|
927
|
-
#
|
928
|
-
# Ex:
|
929
|
-
# >> a = GSL::Vector[1, 0, 3, 0]
|
930
|
-
# >> b = GSL::Vector[3, 4, 0, 0]
|
931
|
-
# >> a.and(b)
|
932
|
-
# [ 1 0 0 0 ]
|
933
|
-
# >> a.or(b)
|
934
|
-
# [ 1 1 1 0 ]
|
935
|
-
# >> a.xor(b)
|
936
|
-
# [ 0 1 1 0 ]
|
937
|
-
# >> a.not
|
938
|
-
# [ 0 1 0 1 ]
|
939
|
-
# >> b.not
|
940
|
-
# [ 0 0 1 1 ]
|
941
|
-
#
|
942
|
-
# ---
|
943
|
-
# * GSL::Vector#where
|
944
|
-
# * GSL::Vector#where { |elm| ... }
|
945
|
-
#
|
946
|
-
# Returns the vector indices where the tests are true. If all the test failed
|
947
|
-
# <tt>nil</tt> is returned.
|
948
|
-
#
|
949
|
-
# Ex:
|
950
|
-
# >> v = GSL::Vector::Int[0, 3, 0, -2, 3, 5, 0, 3]
|
951
|
-
# >> v.where
|
952
|
-
# [ 1 3 4 5 7 ] # where elements are non-zero
|
953
|
-
# >> v.where { |elm| elm == -2 }
|
954
|
-
# [ 3 ]
|
955
|
-
# >> a = GSL::Vector[0, 0, 0]
|
956
|
-
# >> a.where
|
957
|
-
# => nil
|
958
|
-
#
|
959
|
-
# === Histogram
|
960
|
-
# ---
|
961
|
-
# * GSL::Vector#histogram(n)
|
962
|
-
# * GSL::Vector#histogram(ranges)
|
963
|
-
# * GSL::Vector#histogram(n, min, max)
|
964
|
-
# * GSL::Vector#histogram(n, [min, max])
|
965
|
-
#
|
966
|
-
# Creates a histogram filling the vector <tt>self</tt>.
|
967
|
-
#
|
968
|
-
# Example:
|
969
|
-
# >> r = GSL::Rng.alloc # Random number generator
|
970
|
-
# => #<GSL::Rng:0x6d8594>
|
971
|
-
# >> v = r.gaussian(1, 1000) # Generate 1000 Gaussian random numbers
|
972
|
-
# => GSL::Vector
|
973
|
-
# [ 1.339e-01 -8.810e-02 1.674e+00 7.336e-01 9.975e-01 -1.278e+00 -2.397e+00 ... ]
|
974
|
-
# >> h = v.histogram(50, [-4, 4]) # Creates a histogram of size 50, range [-4, 4)
|
975
|
-
# => #<GSL::Histogram:0x6d28b0>
|
976
|
-
# >> h.graph("-T X -C -g 3") # Show the histogram
|
977
|
-
# => true
|
978
|
-
#
|
979
|
-
# This is equivalent to
|
980
|
-
# h = Histogram.alloc(50, [-4, 4])
|
981
|
-
# h.increment(v)
|
982
|
-
#
|
983
|
-
# === Sorting
|
984
|
-
#
|
985
|
-
# ---
|
986
|
-
# * GSL::Vector#sort
|
987
|
-
# * GSL::Vector#sort!
|
988
|
-
#
|
989
|
-
# These methods sort the vector <tt>self</tt> in ascending numerical order.
|
990
|
-
#
|
991
|
-
# ---
|
992
|
-
# * GSL::Vector#sort_index
|
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.
|
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
|
1000
|
-
# vector element. The vector <tt>self</tt> is not changed.
|
1001
|
-
#
|
1002
|
-
# ---
|
1003
|
-
# * GSL::Vector#sort_smallest(n)
|
1004
|
-
# * GSL::Vector#sort_largest(n)
|
1005
|
-
# * GSL::Vector#sort_smallest_index(n)
|
1006
|
-
# * GSL::Vector#sort_largest_index(n)
|
1007
|
-
#
|
1008
|
-
#
|
1009
|
-
# Ex:
|
1010
|
-
# >> v = GSL::Vector::Int[8, 2, 3, 7, 9, 1, 4]
|
1011
|
-
# => GSL::Vector::Int:
|
1012
|
-
# [ 8 2 3 7 9 1 4 ]
|
1013
|
-
# >> v.sort
|
1014
|
-
# => GSL::Vector::Int:
|
1015
|
-
# [ 1 2 3 4 7 8 9 ]
|
1016
|
-
# >> v.sort_index
|
1017
|
-
# => GSL::Permutation:
|
1018
|
-
# [ 5 1 2 6 3 0 4 ]
|
1019
|
-
# >> v.sort_largest(3)
|
1020
|
-
# => GSL::Vector::Int:
|
1021
|
-
# [ 9 8 7 ]
|
1022
|
-
# >> v.sort_smallest(3)
|
1023
|
-
# => GSL::Vector::Int:
|
1024
|
-
# [ 1 2 3 ]
|
1025
|
-
#
|
1026
|
-
# === BLAS Methods
|
1027
|
-
# ---
|
1028
|
-
# * GSL::Vector#nrm2
|
1029
|
-
# * GSL::Vector#dnrm2
|
1030
|
-
#
|
1031
|
-
# Compute the Euclidean norm ||x||_2 = sqrt {sum x_i^2} of the vector.
|
1032
|
-
#
|
1033
|
-
# ---
|
1034
|
-
# * GSL::Vector#asum
|
1035
|
-
# * GSL::Vector#dasum
|
1036
|
-
#
|
1037
|
-
# Compute the absolute sum \sum |x_i| of the elements of the vector.
|
1038
|
-
#
|
1039
|
-
# === Data type conversions
|
1040
|
-
# ---
|
1041
|
-
# * GSL::Vector#to_a
|
1042
|
-
#
|
1043
|
-
# This method converts the vector into a Ruby array. A Ruby array also can be
|
1044
|
-
# converted into a GSL::Vector object with the <tt>to_gv</tt> method. For example,
|
1045
|
-
#
|
1046
|
-
# v = GSL::Vector.alloc([1, 2, 3, 4, 5])
|
1047
|
-
# a = v.to_a -> GSL::Vector to an array
|
1048
|
-
# p a -> [1.0, 2.0, 3.0, 4.0, 5.0]
|
1049
|
-
# a[2] = 12.0
|
1050
|
-
# v2 = a.to_gv -> a new GSL::Vector object
|
1051
|
-
# v2.print -> 1.0000e+00 2.0000e+00 1.2000e+01 4.0000e+00 5.0000e+00
|
1052
|
-
#
|
1053
|
-
# ---
|
1054
|
-
# * GSL::Vector#to_m(nrow, ncol)
|
1055
|
-
#
|
1056
|
-
# Creates a <tt>GSL::Matrix</tt> object of <tt>nrow</tt> rows and <tt>ncol</tt> columns.
|
1057
|
-
#
|
1058
|
-
# >> v = GSL::Vector::Int[1..5]
|
1059
|
-
# => GSL::Vector::Int:
|
1060
|
-
# [ 1 2 3 4 5 ]
|
1061
|
-
# >> v.to_m(2, 3)
|
1062
|
-
# => GSL::Matrix::Int:
|
1063
|
-
# [ 1 2 3
|
1064
|
-
# 4 5 0 ]
|
1065
|
-
# >> v.to_m(2, 2)
|
1066
|
-
# => GSL::Matrix::Int:
|
1067
|
-
# [ 1 2
|
1068
|
-
# 3 4 ]
|
1069
|
-
# >> v.to_m(3, 2)
|
1070
|
-
# => GSL::Matrix::Int:
|
1071
|
-
# [ 1 2
|
1072
|
-
# 3 4
|
1073
|
-
# 5 0 ]
|
1074
|
-
#
|
1075
|
-
# ---
|
1076
|
-
# * GSL::Vector#to_m_diagonal
|
1077
|
-
#
|
1078
|
-
# Converts the vector into a diagonal matrix.
|
1079
|
-
# See also {GSL::Matrix.diagonal(v)}[link:rdoc/matrix_rdoc.html].
|
1080
|
-
#
|
1081
|
-
# >> v = GSL::Vector[1..4].to_i
|
1082
|
-
# => GSL::Vector::Int:
|
1083
|
-
# [ 1 2 3 4 ]
|
1084
|
-
# >> v.to_m_diagonal
|
1085
|
-
# => GSL::Matrix::Int:
|
1086
|
-
# [ 1 0 0 0
|
1087
|
-
# 0 2 0 0
|
1088
|
-
# 0 0 3 0
|
1089
|
-
# 0 0 0 4 ]
|
1090
|
-
#
|
1091
|
-
# ---
|
1092
|
-
# * GSL::Vector#to_m_circulant
|
1093
|
-
#
|
1094
|
-
# Creates a circulant matrix.
|
1095
|
-
#
|
1096
|
-
# >> v = GSL::Vector::Int[1..5]
|
1097
|
-
# => GSL::Vector::Int:
|
1098
|
-
# [ 1 2 3 4 5 ]
|
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
|
1105
|
-
# 1 2 3 4 5 ]
|
1106
|
-
#
|
1107
|
-
# ---
|
1108
|
-
# * GSL::Vector#to_complex
|
1109
|
-
# * GSL::Vector#to_complex2
|
1110
|
-
#
|
1111
|
-
# Example:
|
1112
|
-
#
|
1113
|
-
# >> v = GSL::Vector[1..4]
|
1114
|
-
# => GSL::Vector
|
1115
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 ]
|
1116
|
-
# >> v.to_complex
|
1117
|
-
# [ [1.000e+00 0.000e+00] [2.000e+00 0.000e+00] [3.000e+00 0.000e+00] [4.000e+00 0.000e+00] ]
|
1118
|
-
# => #<GSL::Vector::Complex:0x6d7d24>
|
1119
|
-
# >> v.to_complex2
|
1120
|
-
# [ [1.000e+00 2.000e+00] [3.000e+00 4.000e+00] ]
|
1121
|
-
# => #<GSL::Vector::Complex:0x6d6424>
|
1122
|
-
#
|
1123
|
-
# ---
|
1124
|
-
# * GSL::Vector#to_tensor(rank, dimension)
|
1125
|
-
#
|
1126
|
-
#
|
1127
|
-
# === NArray conversions
|
1128
|
-
#
|
1129
|
-
# ---
|
1130
|
-
# * GSL::Vector#to_na
|
1131
|
-
#
|
1132
|
-
# Converts a vector <tt>self</tt> into an <tt>NArray</tt> object.
|
1133
|
-
# The data are copied to newly allocated memory.
|
1134
|
-
#
|
1135
|
-
# ---
|
1136
|
-
# * GSL::Vector#to_na2
|
1137
|
-
# * GSL::Vector#to_na_ref
|
1138
|
-
#
|
1139
|
-
# Create an <tt>NArray</tt> reference of the vector <tt>self</tt>.
|
1140
|
-
#
|
1141
|
-
# Example:
|
1142
|
-
# >> v = GSL::Vector::Int[1, 2, 3, 4]
|
1143
|
-
# => GSL::Vector::Int
|
1144
|
-
# [ 1 2 3 4 ]
|
1145
|
-
# >> na = v.to_na
|
1146
|
-
# => NArray.int(4):
|
1147
|
-
# [ 1, 2, 3, 4 ]
|
1148
|
-
# >> na2 = v.to_na2
|
1149
|
-
# => NArray(ref).int(4):
|
1150
|
-
# [ 1, 2, 3, 4 ]
|
1151
|
-
# >> na[1] = 99
|
1152
|
-
# => 99
|
1153
|
-
# >> v # na and v are independent
|
1154
|
-
# => GSL::Vector::Int
|
1155
|
-
# [ 1 2 3 4 ]
|
1156
|
-
# >> na2[1] = 99 # na2 points to the data of v
|
1157
|
-
# => 99
|
1158
|
-
# >> v
|
1159
|
-
# => GSL::Vector::Int
|
1160
|
-
# [ 1 99 3 4 ]
|
1161
|
-
#
|
1162
|
-
# ---
|
1163
|
-
# * NArray#to_gv
|
1164
|
-
# * NArray#to_gslv
|
1165
|
-
#
|
1166
|
-
# Create <tt>GSL::Vector</tt> object from the <tt>NArray</tt> object <tt>self</tt>.
|
1167
|
-
#
|
1168
|
-
# ---
|
1169
|
-
# * NArray#to_gv_view
|
1170
|
-
# * NArray#to_gv2
|
1171
|
-
# * NArray#to_gslv_view
|
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.
|
1179
|
-
#
|
1180
|
-
# Ex:
|
1181
|
-
# tcsh> irb
|
1182
|
-
# >> require("gsl")
|
1183
|
-
# => true
|
1184
|
-
# >> na = NArray[1.0, 2, 3, 4, 5]
|
1185
|
-
# => NArray.float(5):
|
1186
|
-
# [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
|
1187
|
-
# >> vv = na.to_gv_view # Create a view sharing the memory
|
1188
|
-
# => GSL::Vector::View
|
1189
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 ]
|
1190
|
-
# >> vv[3] = 9
|
1191
|
-
# => 9
|
1192
|
-
# >> na
|
1193
|
-
# => NArray.float(5):
|
1194
|
-
# [ 1.0, 2.0, 3.0, 9.0, 5.0 ] # The data are changed
|
1195
|
-
# >> v = na.to_gv # A vector with newly allocated memory
|
1196
|
-
# => GSL::Vector
|
1197
|
-
# [ 1.000e+00 2.000e+00 3.000e+00 9.000e+00 5.000e+00 ]
|
1198
|
-
# >> v[1] = 123
|
1199
|
-
# => 123
|
1200
|
-
# >> v
|
1201
|
-
# => GSL::Vector
|
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
|
1206
|
-
# >> na = NArray[1.0, 2, 3, 4, 5, 6]
|
1207
|
-
# => NArray.float(6):
|
1208
|
-
# [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
1209
|
-
# >> m = na.to_gv_view.matrix_view(2, 3)
|
1210
|
-
# => GSL::Matrix::View
|
1211
|
-
# [ 1.000e+00 2.000e+00 3.000e+00
|
1212
|
-
# 4.000e+00 5.000e+00 6.000e+00 ]
|
1213
|
-
# >> m[1][2] = 9
|
1214
|
-
# => 9
|
1215
|
-
# >> na
|
1216
|
-
# => NArray.float(6):
|
1217
|
-
# [ 1.0, 2.0, 3.0, 4.0, 5.0, 9.0 ]
|
1218
|
-
#
|
1219
|
-
# === Graphics
|
1220
|
-
# ---
|
1221
|
-
# * GSL::Vector.graph(y)
|
1222
|
-
# * GSL::Vector.graph(y, options)
|
1223
|
-
# * GSL::Vector.graph(x, y)
|
1224
|
-
# * GSL::Vector.graph(x, y, options)
|
1225
|
-
# * GSL::Vector#graph(options)
|
1226
|
-
# * GSL::Vector#graph(x, options)
|
1227
|
-
#
|
1228
|
-
# These methods use the GNU plotutils <tt>graph</tt> application to plot
|
1229
|
-
# a vector <tt>self</tt>. The options of <tt>graph</tt> as "-T X -C" can be given by a String.
|
1230
|
-
#
|
1231
|
-
# Example:
|
1232
|
-
# >> x = GSL::Vector.linspace(0, 2.0*M_PI, 20)
|
1233
|
-
# >> c = GSL::Sf::cos(x)
|
1234
|
-
# >> s = GSL::Sf::sin(x)
|
1235
|
-
# >> GSL::Vector.graph(x, c, s, "-T X -C -L 'cos(x), sin(x)'")
|
1236
|
-
#
|
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]
|
1242
|
-
#
|
1243
|
-
#
|