module GSL::MultiRoot

Defined in:

gsl/maths/optimization/multiroot.cr

Class Method Summary

Class Method Detail

def self.find_root(f : GSL::MultiRootFunction, initial : GSL::Vector, eps_x : Float64 = 1e-6, eps_f : Float64 = 1e-9, *, algorithm : GSL::Roots::AlgorithmF = GSL::MultiRoot::AlgorithmF::HybridScaled, max_iter = 10000) #

High-level interface to root finder.

  • f - function to minimize
  • initial - initial guess
  • eps_x - tolerance by x. Iterations terminates when all components of dx are <= eps_x
  • eps_f - tolerance by f. Iterations terminates when all components of f are <= eps_x
  • algorithm - root finding algorithm to be used
  • max_iter - maximum number of iterations

returns {result, x_root}

  • result (type GSL::Result) represents result of minimization
  • x_root - value of root on last iteration

[View source]
def self.find_root(initial : GSL::Vector, eps_x : Float64 = 1e-6, eps_f : Float64 = 1e-9, *, algorithm : GSL::Roots::AlgorithmFDF = GSL::MultiRoot::AlgorithmF::HybridScaled, max_iter = 10000, &f : GSL::MultiRootFunctionFDF) #

[View source]
def self.find_root(f : GSL::MultiRootFunctionFDF, initial : GSL::Vector, eps_x : Float64 = 1e-6, eps_f : Float64 = 1e-9, *, algorithm : GSL::Roots::AlgorithmFDF = GSL::MultiRoot::AlgorithmF::HybridJScaled, max_iter = 10000) #

High-level interface to root finder.

  • f - function to minimize
  • initial - initial guess
  • eps_x - tolerance by x. Iterations terminates when all components of dx are <= eps_x
  • eps_f - tolerance by f. Iterations terminates when all components of f are <= eps_x
  • algorithm - root finding algorithm to be used
  • max_iter - maximum number of iterations

returns {result, x_root}

  • result (type GSL::Result) represents result of minimization
  • x_root - value of root on last iteration

[View source]