public class TMtxLP : TMtxComponent
Interfaces Linear Programming algorithms.
The component can be used to solve several linear programming problems.
How to use TMtxLP component?
- Drop a TMtxLP component on the form.
- Set the Dew.Math.TMtxLP.Minimize property to minimize or maximize objective function f(x).
- By setting Dew.Math.TMtxLP.Algorithm select which algorithm will be used to solve LP problem.
- Define Dew.Math.TMtxLP.A, Dew.Math.TMtxLP.b, Dew.Math.TMtxLP.c and optionaly Dew.Math.TMtxLP.Relations , keeping in mind correct size of matrix, vectors and string.
- Call the Dew.Math.TMtxLP.Recalculate method to solve LP problem.
The results of solving LP are returned as:
- Final tableaux Dew.Math.TMtxLP.AFinal,
- Legitimate variables, stored in vector Dew.Math.TMtxLP.x,
- Indexes of legitimate variables, stored in vector Dew.Math.TMtxLP.Indexes IValues,
- Solution type, stored in Dew.Math.TMtxLP.SolutionType,
- Objective function Dew.Math.TMtxLP.z, evaluated at minimum or maximum.
Properties
| Name | Type | Description |
|---|---|---|
| A | TMtx | Defines A in A*x <= b equation. |
| AFinal | TMtx | Final tableaux. |
| Algorithm | TLPAlgorithm | Defines LP solving algorithm. |
| b | TVec | Defines b in A*x <= b equation. |
| BlockAssign | Boolean | Block streaming of specific properties when storing only a "template". |
| c | TVec | Defines c in f=c(T)*x equation. |
| Dirty | Boolean | Becomes true, after any property has changed. |
| EditorActive | Boolean | Returns True, if the component editor is displayed. |
| Indexes | TVecInt | Returns indices (stored in IValues) of basic variables in final tableaux. |
| Minimize | Boolean | Find minimum or maximum of objective function. |
| Reference | TReferenceList | Stores a list of components that have to be notified, when this component is destroyed. |
| Relations | String | Defines relations for two phase algorithm. |
| SolutionType | TLPSolution | LP solution type. |
| Verbose | TStrings | Log optimization algorithm calculation. |
| x | TVec | Values of the legitimate variables. |
| z | Double | Value of the objective function. |
Methods
| Name | Description |
|---|---|
| AllowStreaming | Returns the negatated value of BlockAssign. |
| Assign | Assign values of all published properties from Source. |
| AssignTemplate | Assign values of "template-like" published properties from Source. |
| CheckDimensions | Checks A,b,c and relations dimensions. |
| EditorClass | To be overriden in descendanr classses. |
| LoadFromStream | Load the component from Src stream. |
| LoadTemplateFromFile | Load a template from file. |
| LoadTemplateFromStream | Load a template from stream. |
| Recalculate | Triggers TMtxLP recalculation. |
| Reset | Reset is called after loading the data from stream or file. |
| SaveTemplateToFile | Save template to file. |
| SaveTemplateToStream | Save template to stream. |
| SaveToStream | Save the component to Dst stream. |