public class LinearSum
extends java.lang.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.
|
int |
coefGCD() |
boolean |
containsPbPart() |
void |
divide(int c) |
boolean |
equals(LinearSum linearLe)
Returns true when the linear expression is equal to the given linear expression.
|
boolean |
equals(java.lang.Object obj)
Returns true when the linear expression is equal to the given object.
|
int |
factor() |
void |
factorize() |
java.lang.Integer |
getA(IntegerVariable v) |
int |
getB() |
java.util.SortedMap<IntegerVariable,java.lang.Integer> |
getCoef() |
IntegerDomain |
getDomain() |
IntegerDomain |
getDomainExcept(IntegerVariable v) |
IntegerVariable |
getLargestDomainVariable() |
int |
getValue()
Returns the value of the linear expression.
|
java.util.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 |
isModified() |
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) |
LinearSum[] |
splitPbPart() |
void |
subtract(LinearSum linearLe)
Subtracts the given linear expression.
|
Expression |
toExpression() |
java.lang.String |
toString() |
java.lang.String |
toString0()
Returns the string representation of the linear expression.
|
public static LinearSum ONE
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 java.util.SortedMap<IntegerVariable,java.lang.Integer> getCoef()
public java.util.Set<IntegerVariable> getVariables()
public boolean isIntegerVariable()
public boolean isSimple()
public java.lang.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 boolean isModified()
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 int coefGCD()
public IntegerDomain getDomain() throws SugarException
SugarException
public IntegerDomain getDomainExcept(IntegerVariable v) throws SugarException
SugarException
public LinearSum[] split(int m)
public boolean containsPbPart()
public LinearSum[] splitPbPart()
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(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be comparedpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString0()
public java.lang.String toString()
toString
in class java.lang.Object