mir.optim.least_squares

Nonlinear Least Squares Solver

Public Imports

std.typecons
public import std.typecons : Flag, Yes, No;

Members

Aliases

LeastSquaresTask
alias LeastSquaresTask = void function(void* context, size_t totalThreads, size_t treadId, size_t i) @safe nothrow @nogc pure
LeastSquaresThreadManagerDelegate
alias LeastSquaresThreadManagerDelegate = void delegate(size_t count, void* taskContext, scope LeastSquaresTask task) @safe nothrow @nogc pure

Thread manager delegate type for low level extern(D) API.

LeastSquaresThreadManagerFunction
alias LeastSquaresThreadManagerFunction = void function(void* context, size_t count, void* taskContext, scope LeastSquaresTask task) @system nothrow @nogc pure

Thread manager function type for low level extern(C) API.

mir_least_squares_lm_init_params
alias mir_least_squares_lm_init_params(T : double) = mir_least_squares_lm_init_params_d
alias mir_least_squares_lm_init_params(T : float) = mir_least_squares_lm_init_params_s

Initialize LM data structure with default params for iteration.

mir_least_squares_lm_optimize
alias mir_least_squares_lm_optimize(T : double) = mir_least_squares_lm_optimize_d
alias mir_least_squares_lm_optimize(T : float) = mir_least_squares_lm_optimize_s

Low level extern(C) wrapper instatiation.

mir_least_squares_lm_reset
alias mir_least_squares_lm_reset(T : double) = mir_least_squares_lm_reset_d
alias mir_least_squares_lm_reset(T : float) = mir_least_squares_lm_reset_s

Resets all counters and flags, fills x, y, upper, lower, vecors with default values.

mir_least_squares_lm_stdc_alloc
alias mir_least_squares_lm_stdc_alloc(T : double) = mir_least_squares_lm_stdc_alloc_d
alias mir_least_squares_lm_stdc_alloc(T : float) = mir_least_squares_lm_stdc_alloc_s

Allocates data.

mir_least_squares_lm_stdc_free
alias mir_least_squares_lm_stdc_free(T : float) = mir_least_squares_lm_stdc_free_s
alias mir_least_squares_lm_stdc_free(T : double) = mir_least_squares_lm_stdc_free_d

Frees vectors including x, y, upper, lower.

optimizeLeastSquaresLM
alias optimizeLeastSquaresLM(T : double) = optimizeLeastSquaresLMD
alias optimizeLeastSquaresLM(T : float) = optimizeLeastSquaresLMS

Low level extern(D) instatiation.

Enums

LMStatus
enum LMStatus

Functions

lmStatusString
string lmStatusString(LMStatus st)

Status string for low (extern) and middle (nothrow) levels D API.

mir_least_squares_lm_init_params_d
void mir_least_squares_lm_init_params_d(ref LeastSquaresLM!double lm)
mir_least_squares_lm_init_params_s
void mir_least_squares_lm_init_params_s(ref LeastSquaresLM!float lm)

Initialize LM data structure with default params for iteration.

mir_least_squares_lm_optimize_d
LMStatus mir_least_squares_lm_optimize_d(scope ref LeastSquaresLM!double lm, scope void* fContext, scope LeastSquaresLM!double.FunctionFunction f, scope void* gContext = null, scope LeastSquaresLM!double.JacobianFunction g = null, scope void* tmContext = null, scope LeastSquaresThreadManagerFunction tm = null)
mir_least_squares_lm_optimize_s
LMStatus mir_least_squares_lm_optimize_s(scope ref LeastSquaresLM!float lm, scope void* fContext, scope LeastSquaresLM!float.FunctionFunction f, scope void* gContext = null, scope LeastSquaresLM!float.JacobianFunction g = null, scope void* tmContext = null, scope LeastSquaresThreadManagerFunction tm = null)

Low level extern(C) wrapper instatiation.

mir_least_squares_lm_reset_d
void mir_least_squares_lm_reset_d(ref LeastSquaresLM!double lm)
mir_least_squares_lm_reset_s
void mir_least_squares_lm_reset_s(ref LeastSquaresLM!float lm)

Resets all counters and flags, fills x, y, upper, lower, vecors with default values.

mir_least_squares_lm_status_string
immutable(char)* mir_least_squares_lm_status_string(LMStatus st)

Status string for extern(C) API.

mir_least_squares_lm_stdc_alloc_d
void mir_least_squares_lm_stdc_alloc_d(ref LeastSquaresLM!double lm, size_t m, size_t n, bool lowerBounds, bool upperBounds)
mir_least_squares_lm_stdc_alloc_s
void mir_least_squares_lm_stdc_alloc_s(ref LeastSquaresLM!float lm, size_t m, size_t n, bool lowerBounds, bool upperBounds)

Allocates data.

mir_least_squares_lm_stdc_free_d
void mir_least_squares_lm_stdc_free_d(ref LeastSquaresLM!double lm)
mir_least_squares_lm_stdc_free_s
void mir_least_squares_lm_stdc_free_s(ref LeastSquaresLM!float lm)

Frees vectors including x, y, upper, lower.

optimize
void optimize(scope ref LeastSquaresLM!T lm)
void optimize(scope ref LeastSquaresLM!T lm, TaskPool taskPool)

High level D API for Levenberg-Marquardt Algorithm.

optimizeImpl
LMStatus optimizeImpl(scope ref LeastSquaresLM!T lm)

High level nothtow D API for Levenberg-Marquardt Algorithm.

optimizeLeastSquaresLMD
LMStatus optimizeLeastSquaresLMD(scope ref LeastSquaresLM!double lm, scope LeastSquaresLM!double.FunctionDelegate f, scope LeastSquaresLM!double.JacobianDelegate g = null, scope LeastSquaresThreadManagerDelegate tm = null)
optimizeLeastSquaresLMS
LMStatus optimizeLeastSquaresLMS(scope ref LeastSquaresLM!float lm, scope LeastSquaresLM!float.FunctionDelegate f, scope LeastSquaresLM!float.JacobianDelegate g = null, scope LeastSquaresThreadManagerDelegate tm = null)

Low level extern(D) instatiation.

Structs

LeastSquaresLM
struct LeastSquaresLM(T)

Modified Levenberg-Marquardt parameters, data, and state.

Meta

Authors

Ilya Yaroshenko