Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Interval.h File Reference


Detailed Description

Interval class definition.

Author:
Bart Stander, John C. Hart
Adapted by Hart from Stander's original 1997 ism code.

Todo:
Remove global functions like IExp().

Definition in file Interval.h.

#include <math.h>
#include <stdio.h>
#include "Infinite.h"
#include "libgm/gm.h"
#include "tnt/vec.h"

Include dependency graph for Interval.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

class  Interval
 An interval arithmetic class. More...


Defines

#define I_NOT(x)   (((x) == I_TRUE) ? I_FALSE : ((x) == I_FALSE)?I_TRUE:I_MAYBE)
 Complement of an I_TRISTATE variable.


Typedefs

typedef Interval< double > Intervald
 Convenience typedef so we don't always have to type Interval<double>.


Enumerations

enum  I_TRISTATE { I_TRUE = 0, I_FALSE = -1, I_MAYBE = 1 }
 Tristate logic for interval conditions. More...

enum  IDIF_TYPES { INORMAL = 0, ISPLIT, IDIV_BY_ZERO }
 Used to indicate result of division by zero
  • INORMAL - Division resulted in a single interval - normally
  • ISPLIT - Division resulted in two separate intervals
  • IDIV_BY_ZERO - Error since denominator was zero.
More...


Functions

template<class Type> IDIF_TYPES IDinf (Interval< Type > &v, Interval< Type > &v2, const Interval< Type > &x, const Interval< Type > &y)
 Full Interval division In this extended version, divide by zero is allowed.

template<class Type> std::ostream & operator<< (std::ostream &os, const Interval< Type > &x)
 Basic output stream operator for printing out the value of the Interval.

template<class Type> Interval< Type > operator+ (const Interval< Type > &a, const Interval< Type > &b)
 Sum of two Intervals.

template<class Type> Interval< Type > operator+ (const Interval< Type > &a, const Type &b)
 Sum of an Interval and a base Type.

template<class Type> Interval< Type > operator+ (const Type &a, const Interval< Type > &b)
 Sum of a base Type and an Interval.

template<class Type> Interval< Type > operator- (const Interval< Type > &a, const Interval< Type > &b)
 Difference of two Intervals.

template<class Type> Interval< Type > operator- (const Interval< Type > &a, const Type &b)
 Difference of an Interval and a base Type.

template<class Type> Interval< Type > operator- (const Type &a, const Interval< Type > &b)
 Difference of a base Type and an Interval.

template<class Type> Interval< Type > operator * (const Interval< Type > &a, const Interval< Type > &b)
 Product of two Intervals.

template<class Type> Interval< Type > operator * (const Interval< Type > &a, const Type &b)
 Product of an Interval and a base Type.

template<class Type> Interval< Type > operator * (const Type &a, const Interval< Type > &b)
 Product of a base Type and an Interval.

template<class Type> Interval< Type > operator/ (const Interval< Type > &a, const Interval< Type > &b)
 Quotient of two Intervals.

template<class Type> Interval< Type > operator/ (const Interval< Type > &a, const Type &b)
 Quotient of an Interval and a base Type.

template<class Type> Interval< Type > operator/ (const Type &a, const Interval< Type > &b)
 Quotient of a base Type and an Interval.

template<class Type> I_TRISTATE operator< (const Interval< Type > &a, const Interval< Type > &b)
 Less-than for two Intervals.

template<class Type> I_TRISTATE operator< (const Interval< Type > &a, const Type &b)
 Less than for an Interval and a base Type.

template<class Type> I_TRISTATE operator< (const Type &a, const Interval< Type > &b)
 Less than for a base Type and an Interval.

template<class Type> I_TRISTATE operator> (const Interval< Type > &a, const Interval< Type > &b)
 Greater-than for two Intervals.

template<class Type> I_TRISTATE operator> (const Interval< Type > &a, const Type &b)
 Greater-than for an Interval and a base Type.

template<class Type> I_TRISTATE operator> (const Type &a, const Interval< Type > &b)
 Greater-than for a base Type and an Interval.

template<class Type> I_TRISTATE operator<= (const Interval< Type > &a, const Interval< Type > &b)
 Less-than-or-equal-to for two Intervals.

template<class Type> I_TRISTATE operator<= (const Interval< Type > &a, const Type &b)
 Less-than-or-equal-to for an Interval and a base Type.

template<class Type> I_TRISTATE operator<= (const Type &a, const Interval< Type > &b)
 Less-than-or-equal-to for a base Type and an Interval.

template<class Type> I_TRISTATE operator>= (const Interval< Type > &a, const Interval< Type > &b)
 Greater-than-or-equal-to for two Intervals.

template<class Type> I_TRISTATE operator>= (const Interval< Type > &a, const Type &b)
 Greater-than-or-equal-to for an Interval and a base Type.

template<class Type> I_TRISTATE operator>= (const Type &a, const Interval< Type > &b)
 Greater-than-or-equal-to for a base Type and an Interval.

template<class Type> I_TRISTATE operator== (const Interval< Type > &a, const Interval< Type > &b)
 Equivalence for two Intervals.

template<class Type> I_TRISTATE operator== (const Interval< Type > &a, const Type &b)
 Equivalence for an Interval and a base Type.

template<class Type> I_TRISTATE operator== (const Type &a, const Interval< Type > &b)
 Equivalence for a base Type and an Interval.

template<class Type> I_TRISTATE operator!= (const Interval< Type > &a, const Interval< Type > &b)
 Non-Equivalence for two Intervals.

template<class Type> I_TRISTATE operator!= (const Interval< Type > &a, const Type &b)
 Non-equivalence for an Interval and a base Type.

template<class Type> I_TRISTATE operator!= (const Type &a, const Interval< Type > &b)
 Non-equivalence for a base Type and an Interval.


Define Documentation

#define I_NOT  )     (((x) == I_TRUE) ? I_FALSE : ((x) == I_FALSE)?I_TRUE:I_MAYBE)
 

Complement of an I_TRISTATE variable.

  • I_TRUE->I_FALSE
  • I_FALSE->I_TRUE
  • I_MAYBE->I_MAYBE

Definition at line 37 of file Interval.h.

Referenced by operator!=().


Typedef Documentation

typedef Interval<double> Intervald
 

Convenience typedef so we don't always have to type Interval<double>.

Definition at line 156 of file Interval.h.

Referenced by Wyvill::d2kernel(), Blinn::d2kernel(), Wyvill::dkernel(), Blinn::dkernel(), Implicit::Fx(), Implicit::Fxx(), Implicit::Fxy(), Implicit::Fxz(), Implicit::Fy(), Implicit::Fyx(), Implicit::Fyy(), Implicit::Fyz(), Implicit::Fz(), Implicit::Fzx(), Implicit::Fzy(), Implicit::Fzz(), Sphere::grad(), Segment::grad(), RBF::grad(), Blob::grad(), Blend::grad(), Algebraic::grad(), RBF::gradphi(), Implicit::gradq(), Algebraic::gradq(), Implicit::gradt(), RFunction::h(), AUnion::h(), ASubtraction::h(), AIntersection::h(), Sphere::hess(), RBF::hess(), Blob::hess(), Blend::hess(), Algebraic::hess(), RBF::hessphi(), RFunction::hf(), Blend::hf(), AUnion::hf(), ASubtraction::hf(), AIntersection::hf(), RFunction::hff(), Blend::hff(), AUnion::hff(), ASubtraction::hff(), AIntersection::hff(), RFunction::hfg(), Blend::hfg(), AUnion::hfg(), ASubtraction::hfg(), AIntersection::hfg(), RFunction::hg(), Blend::hg(), AUnion::hg(), ASubtraction::hg(), AIntersection::hg(), RFunction::hgg(), Blend::hgg(), AUnion::hgg(), ASubtraction::hgg(), AIntersection::hgg(), Blend::hr1(), Blend::hr2(), AUnion::indomain(), Wyvill::kernel(), Blinn::kernel(), Segment::m_alrp(), Algebraic::m_alrp(), Segment::m_blrp(), Plane::m_dlrp(), Plane::m_nlrp(), Mover::m_olrp(), Sphere::m_rlrp(), Offset::m_rlrp(), Sphere::m_xlrp(), NewtonDegenerate::NewtonSubdivisionBreak(), Implicit::operator()(), RBFPoint::phi(), RBF::phi(), UnaryOp::proc(), Sum::proc(), Subtraction::proc(), Sphere::proc(), Segment::proc(), RBF::proc(), Plane::proc(), Offset::proc(), Mover::proc(), ImpList::proc(), Implicit::proc(), Difference::proc(), Complement::proc(), Blob::proc(), Blend::proc(), Algebraic::proc(), ADF::proc(), Implicit::procq(), Algebraic::procq(), Sphere::proct(), Segment::proct(), Plane::proct(), Offset::proct(), Mover::proct(), Implicit::proct(), and SearchDegenerate::search().


Enumeration Type Documentation

enum I_TRISTATE
 

Tristate logic for interval conditions.

  • I_TRUE - True for all possible members.
  • I_FALSE - False for all possible members.
  • I_MAYBE - True for some, false for others.
Enumeration values:
I_TRUE 
I_FALSE 
I_MAYBE 

Definition at line 23 of file Interval.h.

Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

enum IDIF_TYPES
 

Used to indicate result of division by zero

  • INORMAL - Division resulted in a single interval - normally
  • ISPLIT - Division resulted in two separate intervals
  • IDIV_BY_ZERO - Error since denominator was zero.

Enumeration values:
INORMAL 
ISPLIT 
IDIV_BY_ZERO 

Definition at line 30 of file Interval.h.

Referenced by IDinf().


Function Documentation

template<class Type>
IDIF_TYPES IDinf Interval< Type > &  v,
Interval< Type > &  v2,
const Interval< Type > &  x,
const Interval< Type > &  y
 

Full Interval division In this extended version, divide by zero is allowed.

When this happens two semi-infinite intervals result.

Parameters:
x Numerator.
y Denominator.
v Quotient.
v2 Second part of quotient if a split occurs.
Returns:
  • ISPLIT if a split occurs.
  • ()IDIV_BY_0, if that occurs.
  • INORMAL (nothing bad happened).
IDinf, interval divide by infinity, was taken from John M. Snyder's Thesis, California Institute of Technology, 1991

Definition at line 174 of file Interval.h.

References Interval< Type >::check(), Interval< Type >::contains(), Interval< Type >::high(), IDIF_TYPES, IDIV_BY_ZERO, INORMAL, Interval< Type >::isMixed(), Interval< Type >::isNegative(), ISPLIT, Interval< Type >::isPositive(), and Interval< Type >::low().

Referenced by Newton::GaussSeidelRow().

template<class Type>
Interval<Type> operator * const Type &  a,
const Interval< Type > &  b
 

Product of a base Type and an Interval.

Definition at line 312 of file Interval.h.

template<class Type>
Interval<Type> operator * const Interval< Type > &  a,
const Type &  b
 

Product of an Interval and a base Type.

Definition at line 304 of file Interval.h.

template<class Type>
Interval<Type> operator * const Interval< Type > &  a,
const Interval< Type > &  b
 

Product of two Intervals.

Definition at line 296 of file Interval.h.

template<class Type>
I_TRISTATE operator!= const Type &  a,
const Interval< Type > &  b
 

Non-equivalence for a base Type and an Interval.

Definition at line 498 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator!= const Interval< Type > &  a,
const Type &  b
 

Non-equivalence for an Interval and a base Type.

Definition at line 491 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator!= const Interval< Type > &  a,
const Interval< Type > &  b
 

Non-Equivalence for two Intervals.

Returns:
  • I_FALSE only if intervals equal with width zero.
  • I_MAYBE only if intervals overlap.
  • I_TRUE otherwise.

Definition at line 484 of file Interval.h.

References I_NOT, and I_TRISTATE.

template<class Type>
Interval<Type> operator+ const Type &  a,
const Interval< Type > &  b
 

Sum of a base Type and an Interval.

Definition at line 264 of file Interval.h.

template<class Type>
Interval<Type> operator+ const Interval< Type > &  a,
const Type &  b
 

Sum of an Interval and a base Type.

Definition at line 256 of file Interval.h.

template<class Type>
Interval<Type> operator+ const Interval< Type > &  a,
const Interval< Type > &  b
 

Sum of two Intervals.

Definition at line 248 of file Interval.h.

template<class Type>
Interval<Type> operator- const Type &  a,
const Interval< Type > &  b
 

Difference of a base Type and an Interval.

Definition at line 288 of file Interval.h.

template<class Type>
Interval<Type> operator- const Interval< Type > &  a,
const Type &  b
 

Difference of an Interval and a base Type.

Definition at line 280 of file Interval.h.

template<class Type>
Interval<Type> operator- const Interval< Type > &  a,
const Interval< Type > &  b
 

Difference of two Intervals.

Definition at line 272 of file Interval.h.

template<class Type>
Interval<Type> operator/ const Type &  a,
const Interval< Type > &  b
 

Quotient of a base Type and an Interval.

Definition at line 336 of file Interval.h.

template<class Type>
Interval<Type> operator/ const Interval< Type > &  a,
const Type &  b
 

Quotient of an Interval and a base Type.

Definition at line 328 of file Interval.h.

template<class Type>
Interval<Type> operator/ const Interval< Type > &  a,
const Interval< Type > &  b
 

Quotient of two Intervals.

Definition at line 320 of file Interval.h.

template<class Type>
I_TRISTATE operator< const Type &  a,
const Interval< Type > &  b
 

Less than for a base Type and an Interval.

Definition at line 364 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator< const Interval< Type > &  a,
const Type &  b
 

Less than for an Interval and a base Type.

Definition at line 357 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator< const Interval< Type > &  a,
const Interval< Type > &  b
 

Less-than for two Intervals.

Returns:
  • I_TRUE only if all of me less than any of a.
  • I_FALSE only if none of me is less than any of a.
  • I_MAYBE otherwise.

Definition at line 349 of file Interval.h.

References I_FALSE, I_MAYBE, I_TRISTATE, and I_TRUE.

template<class Type>
std::ostream& operator<< std::ostream &  os,
const Interval< Type > &  x
 

Basic output stream operator for printing out the value of the Interval.

Definition at line 241 of file Interval.h.

template<class Type>
I_TRISTATE operator<= const Type &  a,
const Interval< Type > &  b
 

Less-than-or-equal-to for a base Type and an Interval.

Definition at line 418 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator<= const Interval< Type > &  a,
const Type &  b
 

Less-than-or-equal-to for an Interval and a base Type.

Definition at line 411 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator<= const Interval< Type > &  a,
const Interval< Type > &  b
 

Less-than-or-equal-to for two Intervals.

Returns:
  • I_TRUE only if all of me less than or equal to any of a.
  • I_FALSE only if none of me is less than or equal to any of a.
  • I_MAYBE otherwise.

Definition at line 403 of file Interval.h.

References I_FALSE, I_MAYBE, I_TRISTATE, and I_TRUE.

template<class Type>
I_TRISTATE operator== const Type &  a,
const Interval< Type > &  b
 

Equivalence for a base Type and an Interval.

Definition at line 472 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator== const Interval< Type > &  a,
const Type &  b
 

Equivalence for an Interval and a base Type.

Definition at line 465 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator== const Interval< Type > &  a,
const Interval< Type > &  b
 

Equivalence for two Intervals.

Returns:
  • I_TRUE only if intervals equal with width zero.
  • I_MAYBE only if intervals overlap.
  • I_FALSE otherwise.

Definition at line 457 of file Interval.h.

References I_FALSE, I_MAYBE, I_TRISTATE, I_TRUE, Interval< Type >::low(), Interval< Type >::overlaps(), and Interval< Type >::thin().

template<class Type>
I_TRISTATE operator> const Type &  a,
const Interval< Type > &  b
 

Greater-than for a base Type and an Interval.

Definition at line 391 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator> const Interval< Type > &  a,
const Type &  b
 

Greater-than for an Interval and a base Type.

Definition at line 384 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator> const Interval< Type > &  a,
const Interval< Type > &  b
 

Greater-than for two Intervals.

Returns:
  • I_TRUE only if all of me greater than any of a.
  • I_FALSE only if none of me is greater than any of a.
  • I_MAYBE otherwise.

Definition at line 376 of file Interval.h.

References Interval< Type >::high(), I_FALSE, I_MAYBE, I_TRISTATE, I_TRUE, and Interval< Type >::low().

template<class Type>
I_TRISTATE operator>= const Type &  a,
const Interval< Type > &  b
 

Greater-than-or-equal-to for a base Type and an Interval.

Definition at line 445 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator>= const Interval< Type > &  a,
const Type &  b
 

Greater-than-or-equal-to for an Interval and a base Type.

Definition at line 438 of file Interval.h.

References I_TRISTATE.

template<class Type>
I_TRISTATE operator>= const Interval< Type > &  a,
const Interval< Type > &  b
 

Greater-than-or-equal-to for two Intervals.

Returns:
  • I_TRUE only if all of me greater than or equal to any of a.
  • I_FALSE only if none of me is greater than or equal to any of a.
  • I_MAYBE otherwise.

Definition at line 430 of file Interval.h.

References Interval< Type >::high(), I_FALSE, I_MAYBE, I_TRISTATE, I_TRUE, and Interval< Type >::low().


Generated on Mon Jun 28 14:59:26 2004 for Advanced Surface Library by doxygen 1.3.4