Package org.projog.clp.math
Class Multiply
java.lang.Object
org.projog.clp.math.Multiply
- All Implemented Interfaces:
Expression
The product of two
Expressions.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static longdivideRoundDown(long dividend, long divisor) private static longdivideWhole(long dividend, long divisor) longlongReturns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.setMax(ConstraintStore s, long max) private static ExpressionResultsetMax(ConstraintStore s, Expression left, long max, long leftMax, long rightMin, long rightMax, BiFunction<Long, Long, Long> f) setMin(ConstraintStore s, long min) private static ExpressionResultsetMin(ConstraintStore s, Expression left, long min, long leftMin, long rightMin, long rightMax, BiFunction<Long, Long, Long> f) toString()voidwalk(Consumer<Expression> r) Traverse this expression.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.projog.clp.Expression
setNot
-
Field Details
-
left
-
right
-
-
Constructor Details
-
Multiply
-
-
Method Details
-
getMin
- Specified by:
getMinin interfaceExpression
-
getMax
- Specified by:
getMaxin interfaceExpression
-
setMin
- Specified by:
setMinin interfaceExpression
-
setMax
- Specified by:
setMaxin interfaceExpression
-
setMax
private static ExpressionResult setMax(ConstraintStore s, Expression left, long max, long leftMax, long rightMin, long rightMax, BiFunction<Long, Long, Long> f) -
setMin
private static ExpressionResult setMin(ConstraintStore s, Expression left, long min, long leftMin, long rightMin, long rightMax, BiFunction<Long, Long, Long> f) -
divideRoundDown
private static long divideRoundDown(long dividend, long divisor) -
divideWhole
private static long divideWhole(long dividend, long divisor) -
walk
Description copied from interface:ExpressionTraverse this expression.If this expression is a composite then all its sub-expressions will be traversed.
- Specified by:
walkin interfaceExpression- Parameters:
r- will be called for eachExpressioncontained within thisExpression.
-
replace
Description copied from interface:ExpressionReturns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.- Specified by:
replacein interfaceExpression- Parameters:
r- returns theLeafExpressionto use as a replacement for theLeafExpressionit is called with, ornullif the originalLeafExpressionshould continue to be used.- Returns:
- a new
ExpressionwithLeafExpressions in thisExpressionreplaced with versions returned fromfunction.
-
toString
-