Struct honestintervals::Interval [] [src]

pub struct Interval<BOUND: PartialOrd> {
    pub lo: BOUND,
    pub hi: BOUND,
}

Interval struct.

Represents a set where each element x satisfies lo <= x && x <= hi.

Fields

Inclusive lower bound.

Inclusive upper bound.

Methods

impl<BOUND: Float> Interval<BOUND>
[src]

Constructs a new interval from given bounds.

Lower bound must be less than or equal to upper bound. Only exception is when they are both NaNs, in which case a NaN (empty) interval is created.

Cases where both bounds are negative infinity or positive infinity are not allowed as these are empty sets. If you want to represent an empty set, use Interval::nan().

Constructs the minimal interval that covers all of the given intervals.

Constructs a singleton interval (an interval with only one element).

Constructs an interval that contains only zero.

Constructs an interval that contains only one.

Constructs a NaN (empty) interval.

Constructs an interval that contains all numbers.

Constructs an interval from a float with given precision.

Constructs an interval by parsing a string.

Accepts INTERVAL according to the rule below.

INTERVAL = FLOAT | '<' FLOAT ',' FLOAT '>'

Returns the sign class of self.

Returns the precision of self.

Returns the difference between the upper bound and the lower bound of self.

As the result is not always exactly representable as BOUND, an interval is returned instead.

Whether self is a singleton interval (an interval containing only one element).

Whether self contains only zero.

Whether self is NaN (empty).

Whether self contains all numbers.

Whether self contains zero.

Cuts self into two at val and returns the left and right pieces as a pair.

If self lies on only one side of val, the non-existent side will be a NaN interval.

impl<BOUND: Float> Interval<BOUND>
[src]

Divides self by rhs and returns a vector of intervals minimally covering the result.

impl<BOUND: Float> Interval<BOUND>
[src]

Computes self raised to the power rhs and returns a vector of intervals minimally covering the result.

Trait Implementations

impl<BOUND: Clone + PartialOrd> Clone for Interval<BOUND>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<BOUND: Debug + PartialOrd> Debug for Interval<BOUND>
[src]

Formats the value using the given formatter.

impl<BOUND: Float> From<f64> for Interval<BOUND>
[src]

Performs the conversion.

impl<BOUND: Float> FromStr for Interval<BOUND>
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl<BOUND: Float> Display for Interval<BOUND>
[src]

Formats the value using the given formatter. Read more

impl<BOUND: Float> Into<(BOUND, BOUND)> for Interval<BOUND>
[src]

Performs the conversion.

impl<BOUND: Float> PartialEq for Interval<BOUND>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<BOUND: Float> Neg for Interval<BOUND>
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<BOUND: Float> Add<Self> for Interval<BOUND>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<BOUND: Float> Sub<Self> for Interval<BOUND>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<BOUND: Float> Mul<Self> for Interval<BOUND>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<BOUND: Float> Div<Self> for Interval<BOUND>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<BOUND: Float> Transc for Interval<BOUND>
[src]

Output type.

Computes the natural logarithm of self.

Computes the natural exponential of self.

Computes self raised to the power rhs.