public class MutableInterval
extends java.lang.Object
Constructor and Description |
---|
MutableInterval()
Constructs a point interval [0,0].
|
MutableInterval(char[] b)
Constructs the interval from character array.
|
MutableInterval(double x)
Constructs a point interval [x,x].
|
MutableInterval(double inf,
double sup)
Constructs the interval [inf, sup].
|
MutableInterval(int x)
Constructs a point interval [x,x].
|
MutableInterval(int inf,
int sup)
Constructs the interval [inf, sup].
|
MutableInterval(long x)
Constructs sharpest interval containing x.
|
MutableInterval(long inf,
long sup)
Constructs the interval [inf, sup].
|
MutableInterval(MutableInterval x)
Constructs the interval same as x.
|
MutableInterval(java.lang.String s)
Constructs the interval from string.
|
Modifier and Type | Method and Description |
---|---|
MutableInterval |
abs()
Returns the interval of absolute values of this interval, i.e.
|
MutableInterval |
add(double y)
Adds double number y to this interval and returns the sum.
|
MutableInterval |
add(MutableInterval y)
Adds interval y to this interval and returns the sum.
|
static double |
addPosUp(double x,
double y) |
static double |
addUp(double x,
double y) |
MutableInterval |
assign(char[] b)
Assigns the interval from character array.
|
MutableInterval |
assign(double x)
Assigns a point interval.
|
MutableInterval |
assign(double inf,
double sup)
Assigns the interval [inf, sup].
|
MutableInterval |
assign(int x)
Assigns a point interval [x,x].
|
MutableInterval |
assign(int inf,
int sup)
Assigns the interval [inf, sup].
|
MutableInterval |
assign(long x)
Assigns sharpest interval containing x.
|
MutableInterval |
assign(long inf,
long sup)
Assigns the interval [inf, sup].
|
MutableInterval |
assign(MutableInterval x)
Assigns interval same as x.
|
MutableInterval |
assign(java.lang.String s)
Assigns the interval from string.
|
MutableInterval |
assignEmpty()
Assigns empty interval [-EMPTY ].
|
MutableInterval |
assignEntire()
Assigns entire interval [ -INF, +INF ].
|
boolean |
ceq(MutableInterval y)
Returns true iff this interval is certainly-equal to interval x.
|
boolean |
cge(MutableInterval y)
Returns true iff this interval is certainly-greater-or-equal to
interval x.
|
boolean |
cgt(MutableInterval y)
Returns true iff this interval is certainly-greater than interval x.
|
boolean |
cle(MutableInterval y)
Returns true iff this interval is certainly-less-or-equal to
interval x.
|
MutableInterval |
clon()
Creates and returns a copy of this MutableInterval.
|
boolean |
clt(MutableInterval y)
Returns true iff this interval is certainly-less than interval x.
|
boolean |
cne(MutableInterval y)
Returns true iff this interval is certainly-not-equal to interval x.
|
boolean |
disjoint(MutableInterval y)
Returns true iff this interval and interval x are disjoint., i.e.
|
MutableInterval |
div(MutableInterval y)
Divides this interval by interval y and returns the quotient.
|
boolean |
dj(MutableInterval y)
Same as x.disjoint(y)
|
MutableInterval |
exp()
Replaces this interval by an interval enclosure of its exponential.
|
boolean |
hasUlpAcc(int n)
Returns true iff this interval has an ulp accuracy of n.
|
MutableInterval |
ih(MutableInterval y)
Same as x.interval_hull(y)
|
boolean |
in_interior(MutableInterval y)
Returns true iff this interval is in interior of interval x.
|
boolean |
in(double y)
Returns true iff double number x is contained in this interval.
|
boolean |
in(long x)
Returns true iff double number x is contained in this interval.
|
double |
inf()
Returns the infimum of this interval.
|
boolean |
interior(MutableInterval y)
Same as x.interior(y)
|
MutableInterval |
intersect(MutableInterval y)
Returns the intersection of this interval and the interval x.
|
MutableInterval |
interval_hull(double x)
Returns the convex hull of this interval and the double x.
|
MutableInterval |
interval_hull(MutableInterval y)
Returns the convex hull of this interval and the interval x.
|
boolean |
isDegenerate()
Same as isPoint().
|
boolean |
isEmpty()
Returns true if this == [ EMPTY ].
|
boolean |
isEntire()
Returns true iff this interval is an entire interval [ -INF, +INF ].
|
static boolean |
isExtended()
Always returns true indicating that the extended system is currently used.
|
boolean |
isInfinite()
Return true if either x.inf() or x.sup() is infinite.
|
static boolean |
isNative()
Always returns false, indicating that this is not native implementation.
|
boolean |
isPoint()
Returns true iff this interval is a point interval.
|
MutableInterval |
ix(MutableInterval y)
Same as x.intersect(y)
|
MutableInterval |
log()
Replaces this interval by an interval enclosure of its natural logarithm.
|
double |
mag()
Returns the magnitude of this interval, i.e.
|
MutableInterval |
max(MutableInterval y)
Returns an enclosure for the range of maxima of this interval and the
interval x, i.e.
|
double |
mid()
Returns double number nearest to the midpoint of this interval, i.e.
|
double |
mig()
Returns the mignitude of this interval, i.e.
|
MutableInterval |
min(MutableInterval y)
Returns an enclosure for the range of minima of this interval and the
interval x, i.e.
|
MutableInterval |
mul(MutableInterval y)
Multiplies this interval by interval y and returns the product.
|
MutableInterval |
negate()
Unary operator -.
|
static double |
next(double x)
Returns next floating point double number.
|
boolean |
peq(MutableInterval y)
Returns true iff this interval is possibly-equal to interval x.
|
boolean |
pge(MutableInterval y)
Returns true iff this interval is possibly-greater-or-equal to
interval x.
|
boolean |
pgt(MutableInterval y)
Returns true iff this interval is possibly-greater than interval x.
|
boolean |
ple(MutableInterval y)
Returns true iff this interval is possibly-less-or-equal to
interval x.
|
boolean |
plt(MutableInterval y)
Returns true iff this interval is possibly-less than interval x.
|
boolean |
pne(MutableInterval y)
Returns true iff this interval is possibly-not-equal to interval x.
|
static double |
prev(double x)
Returns previous floating point double number.
|
boolean |
proper_subset(MutableInterval y)
Returns true iff this interval is a proper subset of interval x.
|
boolean |
proper_superset(MutableInterval y)
Returns true iff this interval is a proper superset of interval x.
|
double |
rad()
Returns an upper bound for the radius of this interval, i.e.
|
boolean |
seq(MutableInterval y)
Returns true iff this interval is set-equal to interval x.
|
boolean |
sge(MutableInterval y)
Returns true iff this interval is set-greater-or-equal to
interval x.
|
boolean |
sgt(MutableInterval y)
Returns true iff this interval is set-greater than interval x.
|
boolean |
sle(MutableInterval y)
Returns true iff this interval is set-less-or-equal to
interval x.
|
boolean |
slt(MutableInterval y)
Returns true iff this interval is set-less than interval x.
|
boolean |
sne(MutableInterval y)
Returns true iff this interval is set-not-equal to interval x.
|
MutableInterval |
sub(double y)
Subtracts double number y from this interval and returns the difference.
|
MutableInterval |
sub(MutableInterval y)
Subtracts interval y from this interval and returns the difference.
|
boolean |
subset(MutableInterval y)
Returns true iff this interval is a subset of interval x.
|
double |
sup()
Returns the supremum of this interval.
|
boolean |
superset(MutableInterval y)
Returns true iff this interval is a superset of interval x.
|
java.lang.String |
toString()
Return string representation.
|
static double |
ulp(double d)
Returns the size of an ulp of the argument.
|
double |
wid()
Returns an upper bound for the width (diameter) of this interval, i.e.
|
public MutableInterval()
public MutableInterval(int x)
public MutableInterval(long x)
public MutableInterval(double x)
public MutableInterval(int inf, int sup)
inf
- The infimum of the interval to be constructed.sup
- The supremum of the interval to be constructed.public MutableInterval(long inf, long sup)
inf
- The infimum of the interval to be constructed.sup
- The supremum of the interval to be constructed.public MutableInterval(double inf, double sup)
inf
- The infimum of the interval to be constructed.sup
- The supremum of the interval to be constructed.public MutableInterval(MutableInterval x)
public MutableInterval(java.lang.String s)
public MutableInterval(char[] b)
public MutableInterval assign(int x)
public MutableInterval assign(long x)
public MutableInterval assign(double x)
public MutableInterval assign(int inf, int sup)
inf
- The infimum of the interval to be constructed.sup
- The supremum of the interval to be constructed.public MutableInterval assign(long inf, long sup)
inf
- The infimum of the interval to be constructed.sup
- The supremum of the interval to be constructed.public MutableInterval assign(double inf, double sup)
inf
- The infimum of the interval to be constructed.sup
- The supremum of the interval to be constructed.public MutableInterval assign(MutableInterval x)
public MutableInterval assign(java.lang.String s)
public MutableInterval assign(char[] b)
public MutableInterval clon()
public MutableInterval assignEntire()
public MutableInterval assignEmpty()
public double inf()
public double sup()
public boolean isPoint()
public boolean isDegenerate()
public boolean isEmpty()
public boolean isInfinite()
public boolean hasUlpAcc(int n)
public boolean isEntire()
public static boolean isExtended()
public static boolean isNative()
public double mid()
public double wid()
public double rad()
public double mig()
public double mag()
public MutableInterval abs()
public MutableInterval min(MutableInterval y)
public MutableInterval max(MutableInterval y)
public MutableInterval intersect(MutableInterval y)
public MutableInterval ix(MutableInterval y)
public MutableInterval interval_hull(MutableInterval y)
public MutableInterval interval_hull(double x)
public MutableInterval ih(MutableInterval y)
public boolean disjoint(MutableInterval y)
public boolean dj(MutableInterval y)
public boolean in(long x)
public boolean in(double y)
public boolean in_interior(MutableInterval y)
public boolean interior(MutableInterval y)
public boolean proper_subset(MutableInterval y)
public boolean subset(MutableInterval y)
public boolean proper_superset(MutableInterval y)
public boolean superset(MutableInterval y)
public boolean seq(MutableInterval y)
public boolean sne(MutableInterval y)
public boolean sge(MutableInterval y)
public boolean sgt(MutableInterval y)
public boolean sle(MutableInterval y)
public boolean slt(MutableInterval y)
public boolean ceq(MutableInterval y)
public boolean cne(MutableInterval y)
public boolean cge(MutableInterval y)
public boolean cgt(MutableInterval y)
public boolean cle(MutableInterval y)
public boolean clt(MutableInterval y)
public boolean peq(MutableInterval y)
public boolean pne(MutableInterval y)
public boolean pge(MutableInterval y)
public boolean pgt(MutableInterval y)
public boolean ple(MutableInterval y)
public boolean plt(MutableInterval y)
public MutableInterval negate()
public MutableInterval add(MutableInterval y)
public MutableInterval add(double y)
public MutableInterval sub(MutableInterval y)
public MutableInterval sub(double y)
public MutableInterval mul(MutableInterval y)
public MutableInterval div(MutableInterval y)
public MutableInterval exp()
public MutableInterval log()
public java.lang.String toString()
toString
in class java.lang.Object
public static double ulp(double d)
double
value is the positive distance between this
floating-point value and the double
value next
larger in magnitude. Note that for non-NaN x,
ulp(-x) == ulp(x)
.
Special Cases:
Double.MIN_VALUE
.
Double.MAX_VALUE
, then
the result is equal to 2971.
d
- the floating-point value whose ulp is to be returnedpublic static double prev(double x)
public static double next(double x)
public static double addUp(double x, double y)
public static double addPosUp(double x, double y)