public class Interval extends Coeff implements java.lang.Cloneable, java.io.Serializable
Scalar
bound.
Intervals are a specialisation of the more general Coeff
class.
Intervals may be unbounded (one or both bound(s) can be infinite). An interval can also be empty (the canonical empty interval is [1, -1]).
Modifier and Type | Field and Description |
---|---|
Scalar |
inf
(Mutable) lower bound.
|
Scalar |
sup
(Mutable) upper bound.
|
Constructor and Description |
---|
Interval()
Creates a new interval set to [0, 0], with double bounds.
|
Interval(java.math.BigInteger i,
java.math.BigInteger s)
Creates an interval [i, s] with Mpq bounds.
|
Interval(java.math.BigInteger inum,
java.math.BigInteger iden,
java.math.BigInteger snum,
java.math.BigInteger sden)
Creates an interval [inum/iden, snum/sden] with Mpq bounds.
|
Interval(double i,
double s)
Creates an interval [i, s] with double bounds.
|
Interval(Interval i)
Creates a copy of the interval i.
|
Interval(int i,
int s)
Creates an interval [i, s] with Mpq bounds.
|
Interval(int inum,
int iden,
int snum,
int sden)
Creates an interval [inum/iden, snum/sden] with Mpq bounds.
|
Interval(Mpfr i,
Mpfr s)
Creates an interval [i, s] with Mpfr bounds (copied).
|
Interval(Mpq i,
Mpq s)
Creates an interval [i, s] with Mpq bounds (copied).
|
Interval(Mpz i,
Mpz s)
Creates an interval [i, s] with Mpq bounds.
|
Interval(Mpz inum,
Mpz iden,
Mpz snum,
Mpz sden)
Creates an interval [inum/iden, snum/sden] with Mpq bounds.
|
Interval(Scalar i,
Scalar s)
Creates a new interval [i, s].
|
Modifier and Type | Method and Description |
---|---|
Interval |
clone()
Returns a copy of this.
|
int |
cmp(Coeff x)
Compares this and x for inclusion.
|
int |
cmp(Interval x)
Compares this and x for inclusion.
|
Interval |
copy()
Creates a copy of the coefficient, of the same kind.
|
int |
hashCode()
Returns a hash made from both bounds.
|
Scalar |
inf()
Returns a reference to the lower bound of this.
|
boolean |
isBottom()
Whether this represents an empty interval.
|
boolean |
isEqual(Coeff x)
Whether this equals x.
|
boolean |
isEqual(int i)
Whether this equals the singleton i.
|
boolean |
isEqual(Interval x)
Whether this and x are equal.
|
boolean |
isLeq(Interval x)
Whether this is included in x.
|
boolean |
isScalar()
Whether this represents a singleton.
|
boolean |
isTop()
Whether this represents [-oo, +oo].
|
boolean |
isZero()
Whether this represents the singleton [0, 0].
|
void |
neg()
Negates x.
|
void |
setBottom()
Sets the interval to [1, -1], without changing the bound types.
|
void |
setInf(Scalar s)
Sets the lower bound.
|
void |
setSup(Scalar s)
Sets the upper bound.
|
void |
setTop()
Sets the interval to [-oo, +oo], without changing the bound types.
|
Scalar |
sup()
Returns a reference to the upper bound of this.
|
java.lang.String |
toString()
Returns a string representation of the interval.
|
public Scalar inf
public Scalar sup
public Interval()
public Interval(Scalar i, Scalar s)
The bounds are not copied, but only referenced.
public Interval(Interval i)
Both scalar bounds are copied.
public Interval(int i, int s)
public Interval(int inum, int iden, int snum, int sden)
public Interval(java.math.BigInteger i, java.math.BigInteger s)
public Interval(java.math.BigInteger inum, java.math.BigInteger iden, java.math.BigInteger snum, java.math.BigInteger sden)
public Interval(Mpz inum, Mpz iden, Mpz snum, Mpz sden)
public Interval(double i, double s)
public Interval copy()
Coeff
public void setInf(Scalar s)
public void setSup(Scalar s)
public void setTop()
public void setBottom()
public boolean isTop()
public boolean isBottom()
public boolean isZero()
public boolean isLeq(Interval x)
public int cmp(Interval x)
public boolean isEqual(Interval x)
public boolean isEqual(int i)
public boolean isScalar()
public int cmp(Coeff x)
cmp
in class Coeff
cmp(Interval)
public Scalar inf()
public Scalar sup()
public java.lang.String toString()
public int hashCode()
public Interval clone()
clone
in class java.lang.Object