public class LpVariable implements LpExpressionLike
Variable in linear programming problem. Has a unique name. By default, variables are limited not to be negative. If needed, one can set canBeNegative to allow negative values by adding another internal variable responsible for negative values.
Implements interface LpExpressionLike interface so it can be used as a standalone linear expression.
interface LpExpressionLike| Constructor and Description |
|---|
LpVariable(java.lang.String name,
boolean canBeNegative)
Variable in linear programming problem. Has a unique name. By default, variables are limited not to be negative.
If needed, one can set canBeNegative to allow negative values by adding another internal variable responsible
for negative values.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
component1()
Variable name.
|
boolean |
component2()
Can this variable assume negative values,
|
LpVariable |
copy(java.lang.String name,
boolean canBeNegative)
Variable in linear programming problem. Has a unique name. By default, variables are limited not to be negative.
If needed, one can set canBeNegative to allow negative values by adding another internal variable responsible
for negative values.
|
boolean |
equals(java.lang.Object p) |
boolean |
getCanBeNegative()
Can this variable assume negative values,
|
double |
getFree()
Freestanding term.
|
java.lang.String |
getName()
Variable name.
|
java.util.Map<net.ldvsoft.simplex_lp_solver.LpVariable,java.lang.Double> |
getTerms()
Terms of linear expression: mapping from variables to their coefficients.
|
int |
hashCode() |
java.lang.String |
toString() |
getFree, getTermspublic LpVariable(java.lang.String name,
boolean canBeNegative)
Variable in linear programming problem. Has a unique name. By default, variables are limited not to be negative. If needed, one can set canBeNegative to allow negative values by adding another internal variable responsible for negative values.
Implements interface LpExpressionLike interface so it can be used as a standalone linear expression.
name - Variable name.canBeNegative - Can this variable assume negative values, defaults to false.name - Variable name.canBeNegative - Can this variable assume negative values, defaults to false.interface LpExpressionLikepublic java.util.Map<net.ldvsoft.simplex_lp_solver.LpVariable,java.lang.Double> getTerms()
Terms of linear expression: mapping from variables to their coefficients.
public double getFree()
Freestanding term.
public java.lang.String getName()
Variable name.
public boolean getCanBeNegative()
Can this variable assume negative values,
defaults to false.
public java.lang.String component1()
Variable name.
public boolean component2()
Can this variable assume negative values,
defaults to false.
public LpVariable copy(java.lang.String name, boolean canBeNegative)
Variable in linear programming problem. Has a unique name. By default, variables are limited not to be negative. If needed, one can set canBeNegative to allow negative values by adding another internal variable responsible for negative values.
Implements interface LpExpressionLike interface so it can be used as a standalone linear expression.
name - Variable name.canBeNegative - Can this variable assume negative values, defaults to false.interface LpExpressionLikepublic java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)