Class: Array

### Home Classes Methods

### In Files

- lib/gsl/gnuplot.rb

### Parent

Object

### Methods

- #to_gplot
- #to_gsplot

### Files

- alf.rdoc
- blas.rdoc
- bspline.rdoc
- changes.rdoc
- cheb.rdoc
- cholesky_complex.rdoc
- combi.rdoc
- complex.rdoc
- const.rdoc
- dht.rdoc
- diff.rdoc
- ehandling.rdoc
- eigen.rdoc
- fft.rdoc
- fit.rdoc
- function.rdoc
- graph.rdoc
- hist.rdoc
- hist2d.rdoc
- hist3d.rdoc
- index.rdoc
- integration.rdoc
- interp.rdoc
- intro.rdoc
- linalg.rdoc
- linalg_complex.rdoc
- math.rdoc
- matrix.rdoc
- min.rdoc
- monte.rdoc
- multimin.rdoc
- multiroot.rdoc
- narray.rdoc
- ndlinear.rdoc
- nonlinearfit.rdoc
- ntuple.rdoc
- odeiv.rdoc
- perm.rdoc
- poly.rdoc
- qrng.rdoc
- randist.rdoc
- ref.rdoc
- rng.rdoc
- roots.rdoc
- sf.rdoc
- siman.rdoc
- sort.rdoc
- start.rdoc
- stats.rdoc
- sum.rdoc
- tensor.rdoc
- tut.rdoc
- use.rdoc
- vector.rdoc
- vector_complex.rdoc
- wavelet.rdoc

### Class/Module Index

Quicksearch

- OOL
- OOL::Conmin
- OOL::Conmin::Gencan_parameters
- OOL::Conmin::Minimizer
- OOL::Conmin::Minimizer::Gencan
- OOL::Conmin::Minimizer::Gencan::Parameters
- OOL::Conmin::Minimizer::Pgrad
- OOL::Conmin::Minimizer::Pgrad::Parameters
- OOL::Conmin::Minimizer::Spg
- OOL::Conmin::Minimizer::Spg::Parameters
- OOL::Conmin::Pgrad_parameters
- OOL::Conmin::Spg_parameters
- GSL
- GSL::Oper
- Array

No matching classes.

# Array

### Public Instance Methods

to_gplot() click to toggle source

    # File lib/gsl/gnuplot.rb, line 4
    def to_gplot
      if ( self[0].kind_of? Array ) then
        tmp = self[0].zip( *self[1..-1] )
        tmp.collect { |a| a.join(" ") }.join("\n") + "\ne"
      elsif ( self[0].kind_of? Numeric ) then
        s = ""
        self.length.times { |i| s << "#{self[i]}\n" }
        s
      elsif ( self[0].kind_of? GSL::Vector ) then
        tmp = self[0].zip( *self[1..-1] )
        tmp.collect { |a| a.join(" ") }.join("\n") + "\ne"
      else
        self[0].zip( *self[1..-1] ).to_gplot
      end
    end

to_gsplot() click to toggle source

    # File lib/gsl/gnuplot.rb, line 19
    def to_gsplot
      f = ""

      if ( self[0].kind_of? Array ) then
        x = self[0]
        y = self[1]
        d = self[2]

        x.each_with_index do |xv, i|
          y.each_with_index do |yv, j|
            f << [ xv, yv, d[i][j] ].join(" ") << "\n"
          end
          # f << "\n"
        end
      elsif ( self[0].kind_of? Numeric ) then
        self.length.times do |i| f << "#{self[i]}\n" end
      else
        self[0].zip( *self[1..-1] ).to_gsplot
      end

      f
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.