public class LinearSum extends Object
CSP
,
LinearLeLiteral
Constructor and Description |
---|
LinearSum(int b) |
LinearSum(IntegerVariable v0) |
LinearSum(int a0,
IntegerVariable v0,
int b) |
LinearSum(LinearSum e) |
Modifier and Type | Method and Description |
---|---|
void |
add(LinearSum linearLe)
Adds the given linear expression.
|
void |
divide(int c) |
boolean |
equals(LinearSum linearLe)
Returns true when the linear expression is equal to the given linear expression.
|
boolean |
equals(Object obj)
Returns true when the linear expression is equal to the given object.
|
int |
factor() |
void |
factorize() |
Integer |
getA(IntegerVariable v) |
int |
getB() |
SortedMap<IntegerVariable,Integer> |
getCoef() |
IntegerDomain |
getDomain() |
IntegerDomain |
getDomainExcept(IntegerVariable v) |
IntegerVariable |
getLargestDomainVariable() |
int |
getValue()
Returns the value of the linear expression.
|
Set<IntegerVariable> |
getVariables() |
IntegerVariable[] |
getVariablesSorted() |
int |
hashCode()
Returns the hash code of the linear expression.
|
boolean |
isDomainLargerThan(long limit) |
boolean |
isDomainLargerThanExcept(long limit) |
boolean |
isDomainLargerThanExcept(long limit,
IntegerVariable v) |
boolean |
isIntegerVariable() |
boolean |
isSimple()
Returns true when the linear expression is simple.
|
void |
multiply(int c)
Multiplies the given constant.
|
boolean |
satSizeLE(long limit) |
void |
setA(int a,
IntegerVariable v) |
void |
setB(int b) |
int |
size()
Returns the size of the linear expression.
|
LinearSum[] |
split(int m) |
void |
subtract(LinearSum linearLe)
Subtracts the given linear expression.
|
Expression |
toExpression() |
String |
toString() |
String |
toString0()
Returns the string representation of the linear expression.
|
public LinearSum(int b)
public LinearSum(int a0, IntegerVariable v0, int b)
public LinearSum(IntegerVariable v0)
public LinearSum(LinearSum e)
public int size()
public int getB()
public void setB(int b)
public SortedMap<IntegerVariable,Integer> getCoef()
public Set<IntegerVariable> getVariables()
public boolean isIntegerVariable()
public boolean isSimple()
public Integer getA(IntegerVariable v)
public void setA(int a, IntegerVariable v)
public boolean isDomainLargerThan(long limit)
public boolean isDomainLargerThanExcept(long limit, IntegerVariable v)
public boolean isDomainLargerThanExcept(long limit)
public void add(LinearSum linearLe)
linearLe
- the linear expression to be added.public void subtract(LinearSum linearLe)
linearLe
- the linear expression to be subtracted.public void multiply(int c)
c
- the constant to be multiplied bypublic void divide(int c)
public int factor()
public void factorize()
public IntegerDomain getDomain() throws SugarException
SugarException
public IntegerDomain getDomainExcept(IntegerVariable v) throws SugarException
SugarException
public LinearSum[] split(int m)
public IntegerVariable getLargestDomainVariable()
public IntegerVariable[] getVariablesSorted()
public boolean satSizeLE(long limit) throws SugarException
SugarException
public Expression toExpression()
public int getValue()
public boolean equals(LinearSum linearLe)
linearLe
- the linear expression to be comparedpublic boolean equals(Object obj)
public int hashCode()
public String toString0()