Using Ruby/GSL

# Title: Using Ruby/GSL

## 1 Installation

See here.

## 2 Load the library

Put at the head of your scripts,

    require("gsl")

## 3 Naming convention

- Most of GSL data types, functions or constants are named as `gsl_xxx` or `GSL_XXX`. In Ruby/GSL, the prefix `gsl_` is replaced by the module identifier `GSL::`, and Ruby classes are defined for each of the GSL structs.

According to the Ruby manner, the name of each class begins with capital. For example,

- Struct `gsl_vector` ---> Class `GSL::Vector`
- Constant `GSL_SUCCESS` ---> Constant `GSL::SUCCESS`
- Function `gsl_sf_bessel_J0` --->
  - Submodule `GSL::Sf`
  - Module function `GSL::Sf::bessel_J0`
- Function `gsl_linalg_LU_decomp` --->
  - Submodule `GSL::Linalg::LU`
  - Singleton method `GSL::Linalg::LU.decomp`

## 4 Modules and Classes

The following is the list of Ruby/GSL modules and classes, <Name> (<Module or Class>)

- GSL (Module)
  - Complex (Class)
  - Poly (Class)
    - Workspace (Class)
    - DividedDifferenceRepresentation (Class)
    - Taylor (Class)
  - Sf (Module)
    - Result (Class)
  - Vector (Class)
    - View < Vector
    - Complex (Class)
      - View < Vector::Complex
  - Matrix (Class)
    - View < Matrix (Class)
    - Complex (Class)
      - View < Matrix::Complex
  - Permutation (Class)
  - Combination (Class)
  - Linalg (Module)
    - LU (Module)
      - LUMatrix < Matrix
    - QR (Module)
      - QRMatrix < Matrix
      - TauVector < Vector
      - QMatrix < Matrix
      - RMatrix < Matrix
    - QRPT (Module)
      - QRMatrix < Matrix
      - TauVector < Vector
      - QMatrix < Matrix
      - RMatrix < Matrix
    - SV (Module)
      - SVMatrix < Matrix
      - UMatrix < Matrix
      - VMatrix < Matrix
      - SVector < Matrix
    - Cholesky (Module)
      - CholeskyMatrix < Matrix
    - Symmtd (Module)
      - QMatrix < Matrix
      - TauVector < Vector
    - HH (Module)
  - Eigen (Module)
    - Values < Vecto
    - Vectors < Matrix
    - Symm (Module)
      - Workspace (Class)
    - Symmv (Module)
      - Workspace (Class)
    - Herm (Module)
      - Workspace (Class)
    - Hermv (Module)
      - Workspace (Class)
  - FFT (Module)
    - Complex (Module)
      - PackedArray (Class)
      - Wavetable (Class)
      - Workspace (Class)
    - Real (Module)
      - Wavetable (Class)
      - Workspace (Class)
    - HalfComplex (Module)
      - Wavetable (Class)
    - Wavetable (Class)
    - WavetableFactor (Class)
    - Workspace (Class)
  - Function (Class)
  - Function_fdf (Class)
  - Integration (Module)
    - Workspace
    - QAWS_Table
    - QAWO_Table
  - Rng (Class)
  - QRng (Class)
  - Ran (Module)
  - Stats (Module)
  - Histogram (Class)
    - Pdf (Class)
  - Histogram2d (Class)
  - N-tuples
    - SelectFn (Class)
    - ValueFn (Class)
  - Monte (Module)
    - Function (Class)
    - Plain (Class)
    - Miser (Class)
    - Vegas (Class)
  - Siman (Module)
    - Efunc (Class)
    - Step (Class)
    - Metric (Class)
    - Print (Class)
    - Params (Class)
    - Solver (Class)
  - Odeiv (Module)
    - Control (Class)
    - Evolve (Class)
    - System (Class)
    - Solver (Class)
  - Interp (Class)
    - Accel (Class)
  - Spline (Class)
  - Diff (Module)
  - Deriv (Module)
  - Cheb (Class)
  - Sum (Module)
    - Levin_u (Class)
    - Levin_utrunc (Class)
  - Dht (Class)
  - Root (Module)
    - Solver (Class)
    - FdfSolver (Class)
  - Min(Module)
    - FMinimizer (Class)
  - MultiRoot (Module)
    - Function (Class)
    - FSolver (Class)
    - Function_fdf (Class)
    - FdfSolver (Class)
  - MultiMin (Module)
    - Function (Class)
    - FMinimizer (Class)
    - Function_fdf (Class)
    - FdfMinimizer (Class)
  - Fit (Module)
  - MultiFit (Module)
    - Workspace (Class)
    - Solver (Class)
    - Function_fdf (Class)
    - FdfSolver (Class)
  - CONST (Module)
    - MKSA (Module)
    - CGSM (Module)
    - NUM (Module)

## 5 Examples

See sample codes in the "samples/" or "tests" directory.

back