choco.real.exp
Class RealIntervalConstant

java.lang.Object
  extended by choco.real.exp.RealIntervalConstant
All Implemented Interfaces:
RealExp, RealInterval
Direct Known Subclasses:
PalmRealIntervalConstant

public class RealIntervalConstant
extends java.lang.Object
implements RealExp

A constant real interval.


Field Summary
protected  double inf
           
protected  double sup
           
 
Constructor Summary
RealIntervalConstant(double inf, double sup)
           
RealIntervalConstant(RealInterval interval)
           
 
Method Summary
 java.util.Set collectVars(java.util.Set s)
          Collects recursively all the variable this expression depends on.
 double getInf()
           
 double getSup()
           
 void intersect(RealInterval interval)
          Modifies the bounds for intersecting with the specified interval.
 void intersect(RealInterval interval, int index)
          Modifies the bounds for intersecting with the specified interval.
 boolean isolate(RealVar var, java.util.List wx, java.util.List wox)
          Isolates sub terms depending or not on a variable x.
 java.lang.String pretty()
           
 void project()
          Projects computed bounds to the sub expressions.
 java.util.List subExps(java.util.List l)
          Computes recursively the sub expressions (avoids to tighten and project recursively).
 void tighten()
          Computes the narrowest bounds with respect to sub terms.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inf

protected final double inf

sup

protected final double sup
Constructor Detail

RealIntervalConstant

public RealIntervalConstant(RealInterval interval)

RealIntervalConstant

public RealIntervalConstant(double inf,
                            double sup)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getInf

public double getInf()
Specified by:
getInf in interface RealInterval
Returns:
the lower bound.

getSup

public double getSup()
Specified by:
getSup in interface RealInterval
Returns:
the upper bound.

intersect

public void intersect(RealInterval interval)
               throws ContradictionException
Description copied from interface: RealInterval
Modifies the bounds for intersecting with the specified interval.

Specified by:
intersect in interface RealInterval
Throws:
ContradictionException

intersect

public void intersect(RealInterval interval,
                      int index)
               throws ContradictionException
Description copied from interface: RealInterval
Modifies the bounds for intersecting with the specified interval.

Specified by:
intersect in interface RealInterval
index - of the constraint responsible to this withdraw
Throws:
ContradictionException

tighten

public void tighten()
Description copied from interface: RealExp
Computes the narrowest bounds with respect to sub terms.

Specified by:
tighten in interface RealExp

project

public void project()
Description copied from interface: RealExp
Projects computed bounds to the sub expressions.

Specified by:
project in interface RealExp

pretty

public java.lang.String pretty()

subExps

public java.util.List subExps(java.util.List l)
Description copied from interface: RealExp
Computes recursively the sub expressions (avoids to tighten and project recursively).

Specified by:
subExps in interface RealExp
Returns:
the flattened list of subexpressions

collectVars

public java.util.Set collectVars(java.util.Set s)
Description copied from interface: RealExp
Collects recursively all the variable this expression depends on.

Specified by:
collectVars in interface RealExp
Returns:
the collected set

isolate

public boolean isolate(RealVar var,
                       java.util.List wx,
                       java.util.List wox)
Description copied from interface: RealExp
Isolates sub terms depending or not on a variable x.

Specified by:
isolate in interface RealExp
Returns:
TODO