subset [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:intervals,math Component type:function
Prototype
template <class Tnum>
bool subset(const interval<interval<Tnum> >& x, const interval<interval<Tnum> >& y) ;
Description
Tests if the extreme bounds of an interval of intervals x are within the bounds of another interval of intervals y. Invoked in the same manner as a normal subset. Returns true if the lower bound of the lower bound of x is greater or equal to than the lower bound of the lower bound of y and the upper bound of the upper bound of x is less than or equal to the upper bound of the upper bound of y.
Definition
interval.cct
Preconditions
Complexity
Example
In subset.cc:
  dint A(-2,2,true);
  dint B(-1,1);
  cout << "A in B? " << subset(A,B) <<endl;
  cout << "B in A? " << subset(B,A) <<endl;
  cout << "0 in A? " << subset(double(0),A) << endl;
  cout << "3 in A? " << subset(double(3),A) << endl;

  cout << "B Proper subset of A? " << proper_subset(B,A) << endl;
  cout << "B Proper subset of B? " << proper_subset(B,B) << endl;

Notes
See also

[MTL Home] Copyright © 1998,1999 University of Notre Dame. All Rights Reserved.