Class Lqn_export_nlp
Twin of python's line_solver.api.lqn.lqn_export_nlp. Python EMITS the
program as a standalone script; that part is python-only by design, and this
class builds the SAME PROGRAM in memory instead: the same variable layout
(Xe, Xa, Xc, W, S, R, Q, Qt, BC, BR, GH, GT, SA, in that order), the same rows of
AEQ and AUB in the same order, the same residuals in the same order, and the
same refusals, so the solution vector is comparable component by component.
The laws, the counting argument and the AND-fork closure are documented in the
python module docstring and in _kb/03-api-layer.md.
The rate functions are differentiated by COMPLEX STEP over
LqnNlpComplex, as python differentiates them, and a declared
queue-dependent multiplier is an expression in n of the shared grammar
of LqnLld.
ONE DOCUMENTED DIVERGENCE: when the Newton ladder finds no root, python falls
back to scipy's trust-constr; this port, like the MATLAB and C++ ones,
falls back to a projected Levenberg-Marquardt descent on the same merit
(Lqn_export_nlp.Program.lmFallback(double[], int)), then polishes. No model the ladder solves
reaches either.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWhatLqn_export_nlp.Program.lmFallback(double[], int)returns: the iterate and the merit it passed through.static final classThe program, built in memory.static interfaceA station's rate as a function of the jobs present, over complex.static final classWhatLqn_export_nlp.Program.solve(int, int)returns. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Lqn_export_nlp.Programbuild(LayeredNetwork model) The program of a model with no declared rate multiplier, alpha 20, forks refused.static Lqn_export_nlp.Programbuild(LayeredNetwork model, Map<String, ?> lld, double alpha, String fork) Asbuild(LayeredNetworkStruct, Map, double, String), from the model.static Lqn_export_nlp.ProgramThe program of a model with no declared rate multiplier, alpha 20, forks refused.static Lqn_export_nlp.Programbuild(LayeredNetworkStruct lqn, Map<String, ?> lld, double alpha, String fork) Build the nonlinear program of a layered model.static doubledrate(Lqn_export_nlp.Rate f, double n) Derivative of a rate function by complex step, python'sdrate.static doublefjMaxExp(double[] m) E[max] of K independent EXPONENTIAL branch completion times of means m, python'sfj_max_exp: the inclusion-exclusion sum with the reciprocals cleared.static double[]mgrad(double[] u) Gradient offjMaxExp(double[])by complex step per coordinate, python'smgrad.static StringpyTypeName(Object o) Python'stype(x).__name__for the values a config can carry.static LqnNlpComplexsoftmin(LqnNlpComplex a, LqnNlpComplex b, double alpha) Python'ssoftmin, over complex so the rate functions differentiate by complex step.
-
Field Details
-
FORK_MODES
Whatforkaccepts.
-
-
Method Details
-
build
The program of a model with no declared rate multiplier, alpha 20, forks refused. -
build
The program of a model with no declared rate multiplier, alpha 20, forks refused. -
build
public static Lqn_export_nlp.Program build(LayeredNetwork model, Map<String, ?> lld, double alpha, String fork) Asbuild(LayeredNetworkStruct, Map, double, String), from the model. -
build
public static Lqn_export_nlp.Program build(LayeredNetworkStruct lqn, Map<String, ?> lld, double alpha, String fork) Build the nonlinear program of a layered model.- Parameters:
lqn- the layered structlld- queue-dependent rate multipliers, {station name: expression in n}, or nullalpha- sharpness of the softmin standing in for min(n, m)fork- "refuse" or "exp", how to treat an AND-fork/join block- Returns:
- the program
- Throws:
LqnNlpExportException- when the model uses a feature the form cannot express
-
softmin
Python'ssoftmin, over complex so the rate functions differentiate by complex step. -
pyTypeName
Python'stype(x).__name__for the values a config can carry. -
drate
Derivative of a rate function by complex step, python'sdrate. -
fjMaxExp
public static double fjMaxExp(double[] m) E[max] of K independent EXPONENTIAL branch completion times of means m, python'sfj_max_exp: the inclusion-exclusion sum with the reciprocals cleared. -
mgrad
public static double[] mgrad(double[] u) Gradient offjMaxExp(double[])by complex step per coordinate, python'smgrad.
-