public abstract class FloatDomain extends Domain
Modifier and Type | Field and Description |
---|---|
static int |
ANY
It specifies the constant for ANY event.
|
static int |
BOUND
It specifies the constant for BOUND event.
|
static double |
E |
static FloatDomain |
emptyFloatDomain
It specifies an empty integer domain.
|
static int |
FloatIntervalDomainID
Unique identifier for an interval domain type.
|
static int |
GROUND
It specifies the constant for GROUND event.
|
static int |
IntervalDomainID
Unique identifier for an interval domain type.
|
static double |
MaxFloat |
static double |
MinFloat |
static double |
minimizationStep |
static double |
PI |
FloatDomain |
previousDomain
It specifies the previous domain which was used by this domain.
|
failException, modelConstraints, modelConstraintsToEvaluate, NOINFO, NONE, searchConstraints, searchConstraintsCloned, searchConstraintsToEvaluate, stamp
Constructor and Description |
---|
FloatDomain() |
Modifier and Type | Method and Description |
---|---|
static FloatIntervalDomain |
addBounds(double a,
double b,
double c,
double d) |
void |
addDom(FloatDomain domain)
It adds values as specified by the parameter to the domain.
|
abstract FloatDomain |
clone()
It clones the domain object.
|
abstract FloatDomain |
cloneLight()
It clones the domain object, only data responsible for encoding domain
values is cloned.
|
abstract FloatDomain |
complement()
It creates a complement of a domain.
|
abstract boolean |
contains(double value) |
abstract boolean |
contains(double min,
double max)
It checks if an interval min..max belongs to the domain.
|
boolean |
contains(FloatDomain domain)
It specifies if the current domain contains the domain given as a
parameter.
|
boolean |
contains(int value)
It checks if value belongs to the domain.
|
static FloatIntervalDomain |
divBounds(double a,
double b,
double c,
double d) |
static double |
down(double d) |
static double |
epsilon(double f) |
boolean |
eq(FloatDomain domain)
It specifies if the other int domain is equal to this one.
|
abstract FloatIntervalEnumeration |
floatIntervalEnumeration()
It returns interval enumeration of the domain values.
|
static double |
format() |
int[] |
getEventsInclusion(int pruningEvent)
It helps to specify what events should be executed if a given event occurs.
|
abstract FloatInterval |
getInterval(int position)
It returns required interval.
|
abstract int |
getSize()
It returns the size of the domain.
|
void |
in(int level,
Var var,
Domain domain)
It enforces that this domain is included within the specified domain.
|
abstract void |
in(int storeLevel,
Var var,
double min,
double max)
It updates the domain to have values only within the interval min..max.
|
void |
in(int storeLevel,
Var var,
FloatDomain domain)
It updates the domain to have values only within the domain.
|
void |
inComplement(int storeLevel,
Var var,
double complement)
It updates the domain to not contain the value complement.
|
abstract void |
inComplement(int storeLevel,
Var var,
double min,
double max)
It updates the domain so it does not contain the supplied interval.
|
void |
inMax(int storeLevel,
Var var,
double max)
It updates the domain according to the maximum value and stamp value.
|
void |
inMin(int storeLevel,
Var var,
double min)
It updates the domain according to the minimum value and stamp value.
|
abstract void |
inShift(int storeLevel,
Var var,
FloatDomain domain,
double shift)
It updates the domain to contain the elements as specifed by the domain,
which is shifted.
|
abstract FloatDomain |
intersect(double min,
double max)
In intersects current domain with the interval min..max.
|
abstract FloatDomain |
intersect(FloatDomain dom)
It intersects current domain with the one given as a parameter.
|
abstract int |
intersectAdapt(FloatDomain intersect)
It computes an intersection with a given domain and stores it in this domain.
|
abstract int |
intersectAdapt(int min,
int max)
It computes an intersection of this domain with an interval [min..max].
|
abstract IntervalEnumeration |
intervalEnumeration()
It returns interval enumeration of the domain values.
|
static void |
intervalPrint(boolean p) |
void |
inValue(int level,
Var var,
double value)
It reduces domain to a single value.
|
abstract boolean |
isIntersecting(double min,
double max)
It checks if interval min..max intersects with current domain.
|
boolean |
isIntersecting(FloatDomain domain)
Checks if two domains intersect.
|
double |
leftElement(int intervalNo)
It returns the left most element of the given interval.
|
int |
lex(FloatDomain domain) |
abstract double |
max()
It returns the maximum value in a domain.
|
static double |
maxULP(FloatVar f) |
abstract double |
min()
It returns the minimum value in a domain.
|
static double |
minULP(FloatVar f) |
static FloatIntervalDomain |
mulBounds(double a,
double b,
double c,
double d) |
static double |
next(double d) |
int |
noConstraints()
It returns the number of constraints
|
abstract int |
noIntervals()
It returns number of intervals required to represent this domain.
|
static double |
precision() |
static double |
previous(double d) |
abstract FloatDomain |
previousDomain()
It returns domain at earlier level at which the change has occurred.
|
static double |
previousForMinimization(double d) |
void |
putModelConstraint(int storeLevel,
Var var,
Constraint C,
int pruningEvent)
It adds a constraint to a domain, it should only be called by
putConstraint function of Variable object.
|
abstract FloatDomain |
recentDomainPruning(int currentStoreLevel)
It returns the values which have been removed at current store level.
|
void |
removeModelConstraint(int storeLevel,
Var var,
Constraint C)
It removes a constraint from a domain, it should only be called by
removeConstraint function of Variable object.
|
double |
rightElement(int intervalNo)
It returns the right most element of the given interval.
|
abstract void |
setDomain(double min,
double max)
It sets this domain to contain exactly all values between min and max.
|
abstract void |
setDomain(FloatDomain domain)
It sets the domain to the specified domain.
|
static void |
setFormat(double f) |
static void |
setOutward(boolean out) |
static void |
setPrecision(double p) |
static void |
setStep(double s) |
boolean |
singleton(Domain value)
It returns true if given domain has only one element.
|
boolean |
singleton(double c)
It returns true if given domain has only one element equal c.
|
int |
sizeOfIntersection(FloatDomain domain)
It computes the size of the intersection between this domain and the domain
supplied as a parameter.
|
static FloatIntervalDomain |
subBounds(double a,
double b,
double c,
double d) |
FloatDomain |
subtract(double value)
It intersects with the domain which is a complement of value.
|
abstract FloatDomain |
subtract(double min,
double max)
It subtracts interval min..max.
|
FloatDomain |
subtract(FloatDomain domain)
It subtracts domain from current domain and returns the result.
|
abstract void |
subtractAdapt(double value)
It removes value from the domain.
|
abstract void |
subtractAdapt(double min,
double max)
It removes all values between min and max to the domain.
|
int[] |
toIntArray()
It constructs and int array containing all elements in the domain.
|
static double |
ulp(double f) |
FloatDomain |
union(double value)
It computes union of this domain and value.
|
FloatDomain |
union(double min,
double max)
It computes union of this domain and the interval.
|
FloatDomain |
union(FloatDomain domain)
It computes union of the supplied domain with this domain.
|
void |
unionAdapt(double value)
It adds a values to the domain.
|
abstract void |
unionAdapt(double min,
double max)
It adds all values between min and max to the domain.
|
int |
unionAdapt(FloatDomain union)
It computes a union between this domain and the domain provided as a parameter.
|
void |
unionAdapt(FloatInterval i)
It adds interval of values to the domain.
|
static double |
up(double d) |
double |
value()
It returns the value to which this domain is grounded.
|
abstract ValueEnumeration |
valueEnumeration()
It returns value enumeration of the domain values.
|
checkInvariants, clear, constraints, domainID, isEmpty, isNumeric, isSparseRepresentation, noSearchConstraints, putSearchConstraint, removeLevel, removeSearchConstraint, searchConstraints, setStamp, singleton, sizeConstraints, sizeConstraintsOriginal, stamp, toString, toStringConstraints, toStringFull
public static final double MinFloat
public static final double MaxFloat
public static double minimizationStep
public static final double PI
public static final double E
public FloatDomain previousDomain
public static final int GROUND
public static final int BOUND
public static final int ANY
public static final int FloatIntervalDomainID
public static final int IntervalDomainID
public static final FloatDomain emptyFloatDomain
public static void setOutward(boolean out)
public static void intervalPrint(boolean p)
public static double format()
public static void setFormat(double f)
public static double precision()
public static void setPrecision(double p)
public static double epsilon(double f)
public static double ulp(double f)
public static double minULP(FloatVar f)
public static double maxULP(FloatVar f)
public static double down(double d)
public static double up(double d)
public static double previous(double d)
public static void setStep(double s)
public static double previousForMinimization(double d)
public static double next(double d)
public int[] getEventsInclusion(int pruningEvent)
getEventsInclusion
in class Domain
pruningEvent
- the pruning event for which we want to know what events it encompasses.public void unionAdapt(FloatInterval i)
i
- Interval which needs to be added to the domain.public void addDom(FloatDomain domain)
domain
- Domain which needs to be added to the domain.public abstract void unionAdapt(double min, double max)
min
- the left bound of the interval being added.max
- the right bound of the interval being added.public void unionAdapt(double value)
value
- value being added to the domain.public boolean isIntersecting(FloatDomain domain)
domain
- the domain for which intersection is checked.public abstract boolean isIntersecting(double min, double max)
min
- the left bound of the interval.max
- the right bound of the interval.public boolean contains(FloatDomain domain)
domain
- for which we check if it is contained in the current domain.public abstract boolean contains(double min, double max)
min
- the minimum value of the interval being checkedmax
- the maximum value of the interval being checkedpublic abstract FloatDomain complement()
public boolean contains(int value)
value
- which is checked if it exists in the domain.public abstract boolean contains(double value)
public abstract ValueEnumeration valueEnumeration()
valueEnumeration
in class Domain
public abstract IntervalEnumeration intervalEnumeration()
public abstract FloatIntervalEnumeration floatIntervalEnumeration()
public abstract int getSize()
public abstract FloatDomain intersect(FloatDomain dom)
dom
- domain with which the intersection needs to be computed.public abstract FloatDomain intersect(double min, double max)
min
- the left bound of the interval (inclusive)max
- the right bound of the interval (inclusive)public FloatDomain subtract(double value)
value
- the value for which the complement is computedpublic abstract void subtractAdapt(double value)
value
- the value for which the complement is computedpublic abstract void subtractAdapt(double min, double max)
min
- the left bound of the interval being removed.max
- the right bound of the interval being removed.public abstract double max()
public abstract double min()
public abstract void setDomain(FloatDomain domain)
domain
- the domain from which this domain takes all elements.public abstract void setDomain(double min, double max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public boolean singleton(double c)
c
- the value to which the only element should be equal to.public FloatDomain subtract(FloatDomain domain)
domain
- the domain which is subtracted from this domain.public abstract FloatDomain subtract(double min, double max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public FloatDomain union(FloatDomain domain)
domain
- the domain for which the union is computed.public FloatDomain union(double min, double max)
min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public FloatDomain union(double value)
value
- it specifies the value which is being added.public void inMin(int storeLevel, Var var, double min)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.min
- the minimum value to which the domain is updated.public void inMax(int storeLevel, Var var, double max)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.max
- the maximum value to which the domain is updated.public abstract void in(int storeLevel, Var var, double min, double max)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.min
- the minimum value to which the domain is updated.max
- the maximum value to which the domain is updated.public void inValue(int level, Var var, double value)
level
- level of the store at which the update occurs.var
- variable for which this domain is used.value
- the value according to which the domain is updated.public void in(int storeLevel, Var var, FloatDomain domain)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.domain
- the domain according to which the domain is updated.public void inComplement(int storeLevel, Var var, double complement)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.complement
- value which is removed from the domain if it belonged to the domain.public abstract void inComplement(int storeLevel, Var var, double min, double max)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.min
- the left bound of the interval (inclusive).max
- the right bound of the interval (inclusive).public abstract int noIntervals()
public abstract FloatInterval getInterval(int position)
position
- the position of the interval.public abstract void inShift(int storeLevel, Var var, FloatDomain domain, double shift)
storeLevel
- level of the store at which the update occurs.var
- variable for which this domain is used.domain
- the domain according to which the domain is updated.shift
- the shift which is used to shift the domain supplied as argument.public double leftElement(int intervalNo)
intervalNo
- the interval number.public double rightElement(int intervalNo)
intervalNo
- the interval number.public abstract FloatDomain recentDomainPruning(int currentStoreLevel)
currentStoreLevel
- the current store level.public abstract FloatDomain previousDomain()
public boolean eq(FloatDomain domain)
domain
- the domain which is compared to this domain.public void in(int level, Var var, Domain domain)
Domain
public boolean singleton(Domain value)
Domain
public int noConstraints()
Domain
noConstraints
in class Domain
public abstract FloatDomain clone()
Domain
public abstract FloatDomain cloneLight()
Domain
cloneLight
in class Domain
public int lex(FloatDomain domain)
public abstract int intersectAdapt(FloatDomain intersect)
intersect
- domain with which the intersection is being computed.public int unionAdapt(FloatDomain union)
union
- the domain with is used for the union operation with this domain.public abstract int intersectAdapt(int min, int max)
min
- the minimum value of the interval used in the intersection computation.max
- the maximum value of the interval used in the intersection computation.public int sizeOfIntersection(FloatDomain domain)
domain
- the domain with which the intersection is computed.public void putModelConstraint(int storeLevel, Var var, Constraint C, int pruningEvent)
putModelConstraint
in class Domain
storeLevel
- the level at which the model constraint is to be added.var
- variable to which the constraint is attached to.C
- the constraint which is being attached to a variable.pruningEvent
- the type of the prunning event required to check the consistency of the attached constraint.public void removeModelConstraint(int storeLevel, Var var, Constraint C)
Domain
removeModelConstraint
in class Domain
storeLevel
- specifies the current level of the store, from which it should be removed.var
- specifies variable for which the constraint is being removed.C
- the constraint which is being removed.public int[] toIntArray()
public double value()
public static final FloatIntervalDomain addBounds(double a, double b, double c, double d)
public static final FloatIntervalDomain subBounds(double a, double b, double c, double d)
public static final FloatIntervalDomain mulBounds(double a, double b, double c, double d)
public static final FloatIntervalDomain divBounds(double a, double b, double c, double d)
Copyright © 2022. All rights reserved.