Returns the selected Variable object from the collection. (Object Property)
Adds a new Variable object to the matrix. (Method)
Locates a specific variable name, returns the variable number. (Method)
The number of binary variables. (Integer Property - Read Only)
The number of variables in the collection. (Integer Property - Read Only)
The number of free variables. (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 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 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.
CSharp Example:
OptiMax MPL; Model planModel; Variables planVars; cpxSolver = MPL.Solvers.Add("CPLEX"); planModel = MPL.Models.Add("Planning"); string WorkingDirectory = "c:\\mplwin4"; string modFilePath = WorkingDirectory + "\\" + "Planning.mpl"; result = planModel.ReadModel(modFilePath); planVars = planModel.Matrix.Variables; Console.WriteLine("Variable Count = {0}", planVars.Count); Console.WriteLine("Binary Count = {0}", planVars.BinaryCount); Console.WriteLine("Integer Count = {0}", planVars.IntegerCount); Console.WriteLine("Free Count = {0}", planVars.FreeCount); Console.WriteLine("Nonlinear Count = {0}", planVars.NonlinearCount);