Touches.h File Reference

bool touches(domain,domain) is a global function which determines if two domains d1 and d2 overlap in any way. More...

#include "Domain/DomainTraits.h"
#include "Domain/DomainCalculus.h"
#include "Utilities/PAssert.h"
#include "Utilities/WrappedInt.h"

Include dependency graph for Touches.h:

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


Classes

struct  TouchesDomainSingle< T1, T2, strided >
 TouchesDomainSingle<T1,T2,bool strided>::touches(a,b) compares two domains a and b of type T1 and T2, and returns true if they touch. More...
struct  TouchesDomainSingle< T1, T2, true >
 The non-unit-stride version of TouchesDomainSingle, which does extra work for the case where a and b do not have unit stride. More...
struct  TouchesDomain< T1, T2, Dim >
 TouchesDomain implements a basic template meta-program to compare each dimension separately of the multidimensional domains for whether they touch. More...
struct  TouchesDomain< T1, T2, 1 >

Functions

template<class T1 , class T2 , int Dim1, int Dim2>
bool touches2 (const T1 &, const T2 &, const WrappedInt< Dim1 > &, const WrappedInt< Dim2 > &)
template<class T1 , class T2 , int Dim>
bool touches2 (const T1 &a, const T2 &b, const WrappedInt< Dim > &, const WrappedInt< Dim > &)
template<class T1 , class T2 >
bool touches (const T1 &a, const T2 &b)
 bool touches(domain1, domain2) is one of the domain calculus routines used to analyze domains to determine their relative characteristics.

Detailed Description

bool touches(domain,domain) is a global function which determines if two domains d1 and d2 overlap in any way.

'Overlap' means that there is at least one point which resides in both domains. If this is the case, it returns true, otherwise false.

touches uses a partially-specialized struct 'TouchesDomain' to do the work; TouchesDomain implements a template metaprogram to check that each dimension touches and and's the results together. TouchesDomain, in turn, uses TouchesDomainSingle to perform the touches calculation for two 1D domains, with specialization for the case where one or both of the domains have unit stride, and for the case where neither have unit stride (which is a much more complicated computation).


Function Documentation

template<class T1 , class T2 , int Dim1, int Dim2>
bool touches2 ( const T1 &  ,
const T2 &  ,
const WrappedInt< Dim1 > &  ,
const WrappedInt< Dim2 > &   
) [inline]

Referenced by touches().

template<class T1 , class T2 , int Dim>
bool touches2 ( const T1 &  a,
const T2 &  b,
const WrappedInt< Dim > &  ,
const WrappedInt< Dim > &   
) [inline]

template<class T1 , class T2 >
bool touches ( const T1 &  a,
const T2 &  b 
) [inline]

bool touches(domain1, domain2) is one of the domain calculus routines used to analyze domains to determine their relative characteristics.

It returns true if there is at least one point in domain1 which is also in domain2. Otherwise, if they are completely disjoint, it returns false. domain1 and domain2 must have the same number of dimensions; if they don't, it results in an assertion failure. The comparison is done for each dimension; if any dimension fails to have overlapping domains for the two domain objects, then the whole domains do not touch.

The implementation of touches is deferred to the TouchesDomain struct, which performs the touches comparison for each dimension and and's the results together.

References touches2().

Referenced by DomainRemoveOverlap(), DomainMapNode< Dom, T >::findLeftTouchNode(), DomainMapNode< Dom, T >::nextRightTouchNode(), DomainMapTouchIterator< Dom, T >::operator++(), and DomainMap< Interval< 1 >, AxisIndex_t >::touch().


Generated on Wed Mar 16 06:19:18 2011 for FreePOOMA by  doxygen 1.5.9