Module: GSL::Oper

### Home Classes Methods

### In Files

- lib/gsl/oper.rb

### Methods

- ::included
- #*
- #/

### 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.

# GSL::Oper

### Public Class Methods

included(base) click to toggle source

    # File lib/gsl/oper.rb, line 3
    def self.included(base)
      base.class_eval {
        alias_method :_gsl_oper_original_mul, :*
        alias_method :_gsl_oper_original_div, :/

        def *(other)
          case other
            when Numeric
              _gsl_oper_original_mul(other)
            when GSL::Matrix,          GSL::Vector,
                 GSL::Matrix::Int,     GSL::Vector::Int,
                 GSL::Vector::Complex, GSL::Matrix::Complex,
                 *GSL.have_tensor? ? [GSL::Tensor, GSL::Tensor::Int] : []
              other.scale(self)
            else
              _gsl_oper_original_mul(other)
          end
        end

        def /(other)
          case other
            when Numeric
              _gsl_oper_original_div(other)
            when GSL::Poly, GSL::Poly::Int
              a = GSL::Poly[1]; a[0] = self
              GSL::Rational.new(a, other)
            when GSL::Vector::Col
              other.scale(self / GSL.pow_2(other.dnrm2))
            when GSL::Vector::Int::Col
              v = other.to_f
              v.scale(self / GSL.pow_2(v.dnrm2))
            else
              _gsl_oper_original_div(other)
          end
        end
      }
    end

### Public Instance Methods

*(other) click to toggle source

    # File lib/gsl/oper.rb, line 8
    def *(other)
      case other
        when Numeric
          _gsl_oper_original_mul(other)
        when GSL::Matrix,          GSL::Vector,
             GSL::Matrix::Int,     GSL::Vector::Int,
             GSL::Vector::Complex, GSL::Matrix::Complex,
             *GSL.have_tensor? ? [GSL::Tensor, GSL::Tensor::Int] : []
          other.scale(self)
        else
          _gsl_oper_original_mul(other)
      end
    end

/(other) click to toggle source

    # File lib/gsl/oper.rb, line 22
    def /(other)
      case other
        when Numeric
          _gsl_oper_original_div(other)
        when GSL::Poly, GSL::Poly::Int
          a = GSL::Poly[1]; a[0] = self
          GSL::Rational.new(a, other)
        when GSL::Vector::Col
          other.scale(self / GSL.pow_2(other.dnrm2))
        when GSL::Vector::Int::Col
          v = other.to_f
          v.scale(self / GSL.pow_2(v.dnrm2))
        else
          _gsl_oper_original_div(other)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.