The library documents itself · Numeric & optimization
stzOptimModel
38 own methods · 5 forms written with extensions, listed under their method
the source: base/optim/stzOptimModel.ring(opens in a new tab) · All classes · The area reference: Numeric & optimization
Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean
Examples: 5 methods carry one, from the library's tests; 33 have none yet.
Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
[ :x = [0, 40], :y = [0, :integer] ] -- a spec is [lb], [lb, ub], [lb, :integer] or [lb, ub, :integer]. An omitted upper bound means UNBOUNDED ABOVE, which the engine models exactly rather than by a large number standing in for infinity. 3 examples run
oF = new stzOptimModel()
oF.Vars([ :x = [ 0, 10 ] ])
oF.Maximize("x")
oF.SubjectTo([ "x >= 20" ])
oF.Solve()
? oF.StatusWord()
#--> infeasiblelibrary testQCSXTZZZIBWUAddVar
(no comment in the source: the name reads as a sentence) add varno extension
HasVar
(no comment in the source: the name reads as a sentence) has varno extension
NumberOfVars
(no comment in the source: the name reads as a sentence) number of varsno extension
VarNames
(no comment in the source: the name reads as a sentence) var namesno extension
BoundsOf
(no comment in the source: the name reads as a sentence) bounds ofno extension
2. THE OBJECTIVE 3 examples run
oF = new stzOptimModel()
oF.Vars([ :x = [ 0, 10 ] ])
oF.Maximize("x")
oF.SubjectTo([ "x >= 20" ])
oF.Solve()
? oF.StatusWord()
#--> infeasiblelibrary testQCSXTZZZIBWUMinimize
(no comment in the source: the name reads as a sentence) minimizeQCSXTZZZIBWU
Sense
(no comment in the source: the name reads as a sentence) senseno extension
ObjectiveCoefficients
(no comment in the source: the name reads as a sentence) objective coefficientsno extension
3. THE CONSTRAINTS 3 examples run
oF = new stzOptimModel()
oF.Vars([ :x = [ 0, 10 ] ])
oF.Maximize("x")
oF.SubjectTo([ "x >= 20" ])
oF.Solve()
? oF.StatusWord()
#--> infeasiblelibrary testQCSXTZZZIBWUAddConstraint
(no comment in the source: the name reads as a sentence) add constraintno extension
AddNamedConstraint
(no comment in the source: the name reads as a sentence) add named constraintno extension
NumberOfConstraints
(no comment in the source: the name reads as a sentence) number of constraintsno extension
ConstraintAt
(no comment in the source: the name reads as a sentence) constraint atno extension
AST
The comparable form. Two surfaces agree when THIS is equal -- never when their answers are, because two different wrong models can produce the same number and one guard would pass both.no extension
ASTCore
the same, with the constraint NAMES dropped -- for comparing two surfaces that agree on the mathematics and label it differentlyno extension
ASTSignature
THE AST AS ONE CANONICAL STRING, and it exists because Haro's `=` does not compare two nested lists structurally -- two ASTs whose every field printed identically still answered "not equal", so a guard written the obvious way would have failed while the surfaces agreed. A signature compares exactly, and when it differs it can be PRINTED side by side, which a list comparison never could.no extension
Describe
the model as it reads, for a human and for a narrationno extension
Show
(no comment in the source: the name reads as a sentence) showno extension
4. SOLVING ------------------------------------------------------ :auto picks the tier; :floor forces the Zig simplex+B&B; :highs is the upgrade tier and is REFUSED while it is not vendored, because answering with the floor would make the two-tier claim untrue. 1 examples runQCSXTZZZIBWU
Same as SolveWith: 4. SOLVING ------------------------------------------------------ :auto picks the tier; :floor forces the Zig simplex+B&B; :highs is the upgrade tier and is REFUSED while it is not vendored, because answering with the floor would make the two-tier claim untrue. 2 examples run
oF = new stzOptimModel()
oF.Vars([ :x = [ 0, 10 ] ])
oF.Maximize("x")
oF.SubjectTo([ "x >= 20" ])
oF.Solve()
? oF.StatusWord()
#--> infeasiblelibrary testno extensionIsSolved
5. READING THE ANSWERno extension
Status
(no comment in the source: the name reads as a sentence) statusno extension
(no comment in the source: the name reads as a sentence) status word 2 examples run
oF = new stzOptimModel()
oF.Vars([ :x = [ 0, 10 ] ])
oF.Maximize("x")
oF.SubjectTo([ "x >= 20" ])
oF.Solve()
? oF.StatusWord()
#--> infeasiblelibrary testno extensionIsOptimal
(no comment in the source: the name reads as a sentence) is optimalno extension
ValueOf
(no comment in the source: the name reads as a sentence) value ofno extension
Nodes
(no comment in the source: the name reads as a sentence) nodesno extension
Iterations
(no comment in the source: the name reads as a sentence) iterationsno extension
Engine
(no comment in the source: the name reads as a sentence) engineno extension
Why
LAW 3: the verdict explains itself, and NAMES THE TIER THAT RANno extension
ShowWhy
(no comment in the source: the name reads as a sentence) show whyno extension
Violations
Does the reported point actually satisfy the model? A solver that returns a confident wrong answer is the failure this catches, and it costs one pass over the rows.no extension
IsFeasibleAnswer
(no comment in the source: the name reads as a sentence) is feasible answerno extension

