The Matrix object is a property of the parent Model object and contains all the information stored about the LP matrix for the model.
Returns the Constraints collection for the matrix. (Object Property)
Returns the Variables collection for the matrix. (Object Property)
The number of constraints in the matrix. (Integer Property - Read Only)
The number of equal constraints in the matrix. (Integer Property - Read Only)
The number of greater than constraints in the matrix. (Integer Property - Read Only)
The number of less than constraints in the matrix. (Integer Property - Read Only)
The number of constraints which contain nonlinear terms. (Integer Property - Read Only)
The number of nonzero RHS values in the matrix. (Integer Property - Read Only)
The number of ranged constraints in the matrix. (Integer Property - Read Only)
The number of constraints with defined stochastic stages. (Integer Property - Read Only)
The number of constraints that have at least one variable. (Integer Property - Read Only)
The density of the matrix. (Double Property - Read Only)
Specifies if the objective function is maximized. (Boolean Property - Read/Write)
Specifies if the matrix is stored by columns. (Boolean Property - Read/Write)
Specifies if the variables and the constraints for the matrix have been synchronized. (Boolean Property - Read/Write)
The name of the objective function. (String Property - Read/Write)
The number of nonzero values in the matrix. (Integer Property - Read Only)
The number of quadratic terms in the objective function. (Integer Property - Read Only)
Model name that is given with the TITLE statement in MPL. (String Property - Read/Write)
The nonzero value for the given constraint and variable in the matrix. (Double Property - Read/Write)
The number of binary variables. (Integer Property - Read Only)
The number of variables in the matrix. (Integer Property - Read Only)
The number of free variables. (Integer Property - Read Only)
The number of variables with nonzero lower bound. (Integer Property - Read Only)
The number of variables that appear in nonlinear terms. (Integer Property - Read Only)
The number of variables with nonzero initial value. (Integer Property - Read Only)
The number of general integer variables. (Integer Property - Read Only)
The number of variables with objective value. (Integer Property - Read Only)
The number of variables with defined priority values. (Integer Property - Read Only)
The number of variables that are semi-continuous. (Integer Property - Read Only)
The number of variables that are members of SOS sets. (Integer Property - Read Only)
The number of variables with defined stochastic stages. (Integer Property - Read Only)
The number of variables with defined upper bound. (Integer Property - Read Only)
The number of variables that appear in at least one constraint or the objective. (Integer Property - Read Only)
Visual Basic Example:
Dim MPL As OptiMax
Dim cpxSolver As Solver
Dim planModel As Model
Dim planMatrix As Matrix
Dim con As Constraint
Dim var As Variable
Set MPL = New OptiMax
Set cpxSolver = MPL.Solvers.Add("CPLEX")
Set planModel = MPL.Models.Add("planning")
MPL.WorkingDirectory = "c:\mplwin4"
planModel.ReadModel ("planning.mpl")
Set planMatrix = planModel.Matrix
Debug.Print "Model Title = " & planMatrix.Title
Debug.Print "Objective Name = " & planMatrix.ObjectName
Debug.Print "Variable Count = " & planMatrix.VarCount
Debug.Print "Binary Count = " & planMatrix.VarBinaryCount
Debug.Print "Integer Count = " & planMatrix.VarIntegerCount
Debug.Print "Constraint Count = " & planMatrix.ConCount
Debug.Print "RHS Count = " & planMatrix.ConRHSCount
Debug.Print "Equal Count = " & planMatrix.ConEqualCount
Debug.Print "Less Than Count = " & planMatrix.ConLessThanCount
Debug.Print "Greater Than Count = " & planMatrix.ConGreaterThanCount
Debug.Print "Nonzero Count = " & planMatrix.NonZeroCount
Debug.Print "Density of Matrix = " & planMatrix.Density
For Each con In planMatrix.Constraints
For Each var In planMatrix.Variables
If planMatrix(con, var) <> 0 Then
Debug.Print "[" & con & "," & var & "]=" & planMatrix.Value(con, var)
End If
Next var
Next con
Returns a string representing the Matrix object. (Method)