Class LinearExpression
java.lang.Object
dev.yushen.wrapperapi.gurobi.expression.LinearExpression
- All Implemented Interfaces:
Expression
- Direct Known Subclasses:
QuadraticExpression
public class LinearExpression extends java.lang.Object implements Expression
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<java.lang.Double>coefficientsprotected doubleconstantprotected java.util.ArrayList<Variable>variables -
Constructor Summary
Constructors Constructor Description LinearExpression()LinearExpression(double constant)LinearExpression(Variable variable)LinearExpression(java.lang.Double coefficient, Variable variable) -
Method Summary
Modifier and Type Method Description LinearExpressionadd(double constant)LinearExpressionadd(LinearExpression lx)QuadraticExpressionadd(QuadraticExpression qx)LinearExpressionadd(Variable variable)java.util.ArrayList<java.lang.Double>getCoefficients()doublegetConstant()java.util.ArrayList<Variable>getVariables()LinearExpressionmul(double coefficient)QuadraticExpressionmul(Variable variable)LinearExpressionsub(double constant)LinearExpressionsub(LinearExpression lx)QuadraticExpressionsub(QuadraticExpression qx)LinearExpressionsub(Variable variable)gurobi.GRBLinExprtoGRBLinExpr()java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
variables
-
coefficients
protected java.util.ArrayList<java.lang.Double> coefficients -
constant
protected double constant
-
-
Constructor Details
-
LinearExpression
public LinearExpression() -
LinearExpression
-
LinearExpression
public LinearExpression(double constant) -
LinearExpression
-
-
Method Details
-
add
-
add
-
add
-
add
-
sub
-
sub
-
sub
-
sub
-
mul
-
mul
-
toGRBLinExpr
public gurobi.GRBLinExpr toGRBLinExpr() -
getVariables
- Specified by:
getVariablesin interfaceExpression
-
getCoefficients
public java.util.ArrayList<java.lang.Double> getCoefficients()- Specified by:
getCoefficientsin interfaceExpression
-
getConstant
public double getConstant()- Specified by:
getConstantin interfaceExpression
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-