|
Sugar version 1.13 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.ac.kobe_u.cs.sugar.csp.LinearSum
public class LinearSum
A class for linear expressions.
A linear expression represents the following formula:
a0*x0+a1*x1+...+an*xn+b
where ai's and b are integer constants and xi's are integer variables
of CSP.
CSP
,
LinearLiteral
Constructor Summary | |
---|---|
LinearSum(int b)
|
|
LinearSum(IntegerVariable v0)
|
|
LinearSum(int a0,
IntegerVariable v0,
int b)
|
|
LinearSum(LinearSum e)
|
Method Summary | |
---|---|
void |
add(LinearSum linearSum)
Adds the given linear expression. |
void |
divide(int c)
|
boolean |
equals(LinearSum linearSum)
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)
|
int |
getValue()
Returns the value of the linear expression. |
Set<IntegerVariable> |
getVariables()
|
IntegerVariable[] |
getVariablesByCoef()
|
int |
hashCode()
Returns the hash code of the linear expression. |
boolean |
isDomainLargerThan(long limit)
|
boolean |
isIntegerVariable()
|
boolean |
isSimple()
Returns true when the linear expression is simple. |
void |
multiply(int c)
Multiplies the given constant. |
void |
setA(int a,
IntegerVariable v)
|
int |
size()
Returns the size of the linear expression. |
LinearSum[] |
split()
|
void |
subtract(LinearSum linearSum)
Subtracts the given linear expression. |
Expression |
toExpression()
|
String |
toString()
|
String |
toString0()
Returns the string representation of the linear expression. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinearSum(int b)
public LinearSum(int a0, IntegerVariable v0, int b)
public LinearSum(IntegerVariable v0)
public LinearSum(LinearSum e)
Method Detail |
---|
public int size()
public int getB()
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 void add(LinearSum linearSum)
linearSum
- the linear expression to be added.public void subtract(LinearSum linearSum)
linearSum
- 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()
public IntegerVariable[] getVariablesByCoef()
public Expression toExpression()
public int getValue()
public boolean equals(LinearSum linearSum)
linearSum
- the linear expression to be compared
public boolean equals(Object obj)
equals
in class Object
obj
- the object to be compared
public int hashCode()
hashCode
in class Object
public String toString0()
public String toString()
toString
in class Object
|
Sugar version 1.13 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |