The OpenD Programming Language

optimizeLeastSquares

High level nothtow D API for Levenberg-Marquardt Algorithm.

Computes the argmin over x of sum_i(f(x_i)^2) using the Least-Squares algorithm, and an estimate of the Jacobian of f at x.

The function f should take an input vector of length n, and fill an output vector of length m.

The function g is the Jacobian of f, and should fill a row-major m x n matrix.

  1. LeastSquaresResult!T optimizeLeastSquares(LeastSquaresSettings!T settings, size_t m, Slice!(T*) x, Slice!(const(T)*) l, Slice!(const(T)*) u)
    optimizeLeastSquares
    (
    alias g = null
    alias tm = null
    T
    )
    (
    scope const ref LeastSquaresSettings!T settings
    ,
    size_t m
    ,
    Slice!(T*) x
    ,
    Slice!(const(T)*) l
    ,
    Slice!(const(T)*) u
    )
  2. alias optimizeLeastSquares(T : double) = optimizeLeastSquaresD
  3. alias optimizeLeastSquares(T : float) = optimizeLeastSquaresS

Parameters

f

n -> m function

g

m × n Jacobian (optional)

tm

thread manager for finite difference jacobian approximation in case of g is null (optional)

settings LeastSquaresSettings!T

Levenberg-Marquardt data structure

m size_t

length (dimension) of y = f(x)

x Slice!(T*)

initial (in) and final (out) X value

l Slice!(const(T)*)

lower X bound

u Slice!(const(T)*)

upper X bound

Return Value

Type: LeastSquaresResult!T

optimization status.

See Also

Meta