hmatrix-gsl-0.19.0.1: Numerical computation

Copyright | (c) Alberto Ruiz 2009
License | GPL
Maintainer | Alberto Ruiz
Stability | provisional
Safe Haskell | None
Language | Haskell2010

Numeric.GSL.Root

Description

Multidimensional root finding.

http://www.gnu.org/software/gsl/manual/html_node/Multidimensional-Root_002dFinding.html

The example in the GSL manual:

    >>> let rosenbrock a b [x,y] = [ a*(1-x), b*(y-x^2) ]
    >>> let (sol,path) = root Hybrids 1E-7 30 (rosenbrock 1 10) [-10,-5]
    >>> sol
    [1.0,1.0]
    >>> disp 3 path
    11x5
     1.000  -10.000  -5.000  11.000  -1050.000
     2.000   -3.976  24.827   4.976     90.203
     3.000   -3.976  24.827   4.976     90.203
     4.000   -3.976  24.827   4.976     90.203
     5.000   -1.274  -5.680   2.274    -73.018
     6.000   -1.274  -5.680   2.274    -73.018
     7.000    0.249   0.298   0.751      2.359
     8.000    0.249   0.298   0.751      2.359
     9.000    1.000   0.878  -0.000     -1.218
    10.000    1.000   0.989  -0.000     -0.108
    11.000    1.000   1.000   0.000      0.000

Synopsis

- uniRoot :: UniRootMethod -> Double -> Int -> (Double -> Double) -> Double -> Double -> (Double, Matrix Double)
- data UniRootMethod
  - = Bisection
  - | FalsePos
  - | Brent
- uniRootJ :: UniRootMethodJ -> Double -> Int -> (Double -> Double) -> (Double -> Double) -> Double -> (Double, Matrix Double)
- data UniRootMethodJ
  - = UNewton
  - | Secant
  - | Steffenson
- root :: RootMethod -> Double -> Int -> ([Double] -> [Double]) -> [Double] -> ([Double], Matrix Double)
- data RootMethod
  - = Hybrids
  - | Hybrid
  - | DNewton
  - | Broyden
- rootJ :: RootMethodJ -> Double -> Int -> ([Double] -> [Double]) -> ([Double] -> [[Double]]) -> [Double] -> ([Double], Matrix Double)
- data RootMethodJ
  - = HybridsJ
  - | HybridJ
  - | Newton
  - | GNewton

# Documentation

uniRoot :: UniRootMethod -> Double -> Int -> (Double -> Double) -> Double -> Double -> (Double, Matrix Double) Source #

data UniRootMethod Source #

Constructors

Bisection |
FalsePos |
Brent |

#### Instances

Instances details

Bounded UniRootMethod Source # |
Instance details Defined in Numeric.GSL.Root Methods minBound :: UniRootMethod Source # maxBound :: UniRootMethod Source #
Enum UniRootMethod Source # |

Instance details

Defined in Numeric.GSL.Root

Methods

succ :: UniRootMethod -> UniRootMethod Source #

pred :: UniRootMethod -> UniRootMethod Source #

toEnum :: Int -> UniRootMethod Source #

fromEnum :: UniRootMethod -> Int Source #

enumFrom :: UniRootMethod -> [UniRootMethod] Source #

enumFromThen :: UniRootMethod -> UniRootMethod -> [UniRootMethod] Source #

enumFromTo :: UniRootMethod -> UniRootMethod -> [UniRootMethod] Source #

enumFromThenTo :: UniRootMethod -> UniRootMethod -> UniRootMethod -> [UniRootMethod] Source #

Show UniRootMethod Source # |
Instance details Defined in Numeric.GSL.Root Methods showsPrec :: Int -> UniRootMethod -> ShowS Source # show :: UniRootMethod -> String Source # showList :: [UniRootMethod] -> ShowS Source #
Eq UniRootMethod Source # |
Instance details Defined in Numeric.GSL.Root Methods (==) :: UniRootMethod -> UniRootMethod -> Bool Source # (/=) :: UniRootMethod -> UniRootMethod -> Bool Source #

uniRootJ :: UniRootMethodJ -> Double -> Int -> (Double -> Double) -> (Double -> Double) -> Double -> (Double, Matrix Double) Source #

data UniRootMethodJ Source #

Constructors

UNewton |
Secant |
Steffenson |

#### Instances

Instances details

Bounded UniRootMethodJ Source # |
Instance details Defined in Numeric.GSL.Root Methods minBound :: UniRootMethodJ Source # maxBound :: UniRootMethodJ Source #
Enum UniRootMethodJ Source # |

Instance details

Defined in Numeric.GSL.Root

Methods

succ :: UniRootMethodJ -> UniRootMethodJ Source #

pred :: UniRootMethodJ -> UniRootMethodJ Source #

toEnum :: Int -> UniRootMethodJ Source #

fromEnum :: UniRootMethodJ -> Int Source #

enumFrom :: UniRootMethodJ -> [UniRootMethodJ] Source #

enumFromThen :: UniRootMethodJ -> UniRootMethodJ -> [UniRootMethodJ] Source #

enumFromTo :: UniRootMethodJ -> UniRootMethodJ -> [UniRootMethodJ] Source #

enumFromThenTo :: UniRootMethodJ -> UniRootMethodJ -> UniRootMethodJ -> [UniRootMethodJ] Source #

Show UniRootMethodJ Source # |
Instance details Defined in Numeric.GSL.Root Methods showsPrec :: Int -> UniRootMethodJ -> ShowS Source # show :: UniRootMethodJ -> String Source # showList :: [UniRootMethodJ] -> ShowS Source #
Eq UniRootMethodJ Source # |
Instance details Defined in Numeric.GSL.Root Methods (==) :: UniRootMethodJ -> UniRootMethodJ -> Bool Source # (/=) :: UniRootMethodJ -> UniRootMethodJ -> Bool Source #

root Source #

Arguments

:: RootMethod |
-> Double | maximum residual
-> Int | maximum number of iterations allowed
-> ([Double] -> [Double]) | function to minimize
-> [Double] | starting point
-> ([Double], Matrix Double) | solution vector and optimization path

Nonlinear multidimensional root finding using algorithms that do not require any derivative information to be supplied by the user. Any derivatives needed are approximated by finite differences.

data RootMethod Source #

Constructors

Hybrids |
Hybrid |
DNewton |
Broyden |

#### Instances

Instances details

Bounded RootMethod Source # |
Instance details Defined in Numeric.GSL.Root Methods minBound :: RootMethod Source # maxBound :: RootMethod Source #
Enum RootMethod Source # |

Instance details

Defined in Numeric.GSL.Root

Methods

succ :: RootMethod -> RootMethod Source #

pred :: RootMethod -> RootMethod Source #

toEnum :: Int -> RootMethod Source #

fromEnum :: RootMethod -> Int Source #

enumFrom :: RootMethod -> [RootMethod] Source #

enumFromThen :: RootMethod -> RootMethod -> [RootMethod] Source #

enumFromTo :: RootMethod -> RootMethod -> [RootMethod] Source #

enumFromThenTo :: RootMethod -> RootMethod -> RootMethod -> [RootMethod] Source #

Show RootMethod Source # |
Instance details Defined in Numeric.GSL.Root Methods showsPrec :: Int -> RootMethod -> ShowS Source # show :: RootMethod -> String Source # showList :: [RootMethod] -> ShowS Source #
Eq RootMethod Source # |
Instance details Defined in Numeric.GSL.Root Methods (==) :: RootMethod -> RootMethod -> Bool Source # (/=) :: RootMethod -> RootMethod -> Bool Source #

rootJ Source #

Arguments

:: RootMethodJ |
-> Double | maximum residual
-> Int | maximum number of iterations allowed
-> ([Double] -> [Double]) | function to minimize
-> ([Double] -> [[Double]]) | Jacobian
-> [Double] | starting point
-> ([Double], Matrix Double) | solution vector and optimization path

Nonlinear multidimensional root finding using both the function and its derivatives.

data RootMethodJ Source #

Constructors

HybridsJ |
HybridJ |
Newton |
GNewton |

#### Instances

Instances details

Bounded RootMethodJ Source # |
Instance details Defined in Numeric.GSL.Root Methods minBound :: RootMethodJ Source # maxBound :: RootMethodJ Source #
Enum RootMethodJ Source # |

Instance details

Defined in Numeric.GSL.Root

Methods

succ :: RootMethodJ -> RootMethodJ Source #

pred :: RootMethodJ -> RootMethodJ Source #

toEnum :: Int -> RootMethodJ Source #

fromEnum :: RootMethodJ -> Int Source #

enumFrom :: RootMethodJ -> [RootMethodJ] Source #

enumFromThen :: RootMethodJ -> RootMethodJ -> [RootMethodJ] Source #

enumFromTo :: RootMethodJ -> RootMethodJ -> [RootMethodJ] Source #

enumFromThenTo :: RootMethodJ -> RootMethodJ -> RootMethodJ -> [RootMethodJ] Source #

Show RootMethodJ Source # |
Instance details Defined in Numeric.GSL.Root Methods showsPrec :: Int -> RootMethodJ -> ShowS Source # show :: RootMethodJ -> String Source # showList :: [RootMethodJ] -> ShowS Source #
Eq RootMethodJ Source # |
Instance details Defined in Numeric.GSL.Root Methods (==) :: RootMethodJ -> RootMethodJ -> Bool Source # (/=) :: RootMethodJ -> RootMethodJ -> Bool Source #