29template <
class T,
unsigned Dim >
class NDRegion;
30template <
class T,
unsigned Dim>
32template <
class T,
unsigned Dim>
34template <
class T,
unsigned Dim>
36template <
class T,
unsigned Dim>
38template <
class T,
unsigned Dim>
40template <
class T,
unsigned Dim>
42template <
class T,
unsigned Dim>
44template <
class T,
unsigned Dim>
46template <
class T,
unsigned Dim>
48template <
class T,
unsigned Dim>
50template <
class T,
unsigned Dim>
52template <
class T,
unsigned Dim >
55template <
class T,
unsigned Dim >
64 for (
unsigned int i=0; i <
Dim; i++)
70 PInsist(
Dim==1,
"Number of arguments does not match NDRegion dimension!!");
74 PInsist(
Dim==2,
"Number of arguments does not match NDRegion dimension!!");
79 PInsist(
Dim==3,
"Number of arguments does not match NDRegion dimension!!");
86 PInsist(
Dim==4,
"Number of arguments does not match NDRegion dimension!!");
94 PInsist(
Dim==5,
"Number of arguments does not match NDRegion dimension!!");
103 PInsist(
Dim==6,
"Number of arguments does not match NDRegion dimension!!");
114 for (
unsigned int i=0; i <
Dim; i++)
120 for (
unsigned int i=0; i <
Dim; i++)
132 for (
unsigned int i=1; i <
Dim; i++)
139 for (
unsigned int i=0; i <
Dim; i++)
144 for (
unsigned int i=0; i <
Dim; i++)
149 for (
unsigned int i=0; i <
Dim; i++)
155 for (
unsigned int i=0; i <
Dim; i++)
p[i] /= t;
161 for (
unsigned int i=0; i <
Dim; i++)
170 for (
unsigned int i=0; i <
Dim; i++)
171 retval.
p[i] =
p[i].intersect(
nr.p[i]);
176 for (
unsigned int i=0; i <
Dim; i++)
183 for (
unsigned int i=0; i <
Dim; i++)
192 for (
unsigned int i=0; i <
Dim; i++) {
194 p[i].split(l.
p[i], r.
p[i]);
207 T maxlen =
p[0].length();
208 for (
unsigned i=1; i <
Dim; i++) {
209 if (
p[i].length() > maxlen) {
210 maxlen =
p[i].length();
215 return split(l, r, d);
220 for (
unsigned d = 0 ; d <
Dim ; ++d )
227 for (
unsigned d = 0 ; d <
Dim ; ++d )
239template <
class T,
unsigned Dim>
246template <
class T,
unsigned Dim>
251template <
class T,
unsigned Dim>
256template <
class T,
unsigned Dim>
263template <
class T,
unsigned Dim>
267 for (
unsigned int i=0; i <
Dim; i++)
271template <
class T,
unsigned Dim>
278template <
class T,
unsigned Dim>
283template <
class T,
unsigned Dim>
286 return (t != 0 ? (
nr * (1/t)) :
nr);
291template <
class T,
unsigned Dim>
294 for (
unsigned int i=0; i <
Dim; i++)
295 if ( !(A[i] < B[i]) )
return false;
298template <
class T,
unsigned Dim>
301 for (
unsigned int i=0; i <
Dim; i++)
302 if ( !(A[i] == B[i]) )
return false;
305template <
class T,
unsigned Dim>
312template <
class T,
unsigned Dim>
316 for (
unsigned d = 0; d <
Dim; ++d)
317 out << idx[d] << ((d==
Dim-1) ?
'}' :
',');
325template <
class T,
unsigned Dim >
335template <
class T,
unsigned Dim >
341 return a.contains(b);
345template <
class T,
unsigned Dim >
NDRegion< T, Dim > operator-(const NDRegion< T, Dim > &, T)
bool operator<(const NDRegion< T, Dim > &, const NDRegion< T, Dim > &)
bool operator!=(const NDRegion< T, Dim > &, const NDRegion< T, Dim > &)
std::ostream & operator<<(std::ostream &, const NDRegion< T, Dim > &)
bool operator==(const NDRegion< T, Dim > &, const NDRegion< T, Dim > &)
NDRegion< T, Dim > operator/(const NDRegion< T, Dim > &, T)
NDRegion< T, Dim > operator+(const NDRegion< T, Dim > &, T)
NDRegion< T, Dim > operator*(const NDRegion< T, Dim > &, T)
Message & getMessage(Message &m)
NDRegion< T, Dim > & operator=(const NDRegion< T, Dim > &nr)
NDRegion(const PRegion< T > &r1, const PRegion< T > &r2, const PRegion< T > &r3)
NDRegion< T, Dim > & operator/=(const T t)
NDRegion(const PRegion< T > &r1)
NDRegion(const NDRegion< T, Dim > &nr)
NDRegion(const PRegion< T > &r1, const PRegion< T > &r2, const PRegion< T > &r3, const PRegion< T > &r4, const PRegion< T > &r5)
NDRegion(PRegion< T > *idx)
bool touches(const NDRegion< T, Dim > &nr) const
NDRegion< T, Dim > & operator*=(const T t)
NDRegion(const PRegion< T > &r1, const PRegion< T > &r2, const PRegion< T > &r3, const PRegion< T > &r4)
PRegion< T > & operator[](unsigned d)
NDRegion< T, Dim > & operator+=(const T t)
bool contains(const NDRegion< T, Dim > &nr) const
bool split(NDRegion< T, Dim > &l, NDRegion< T, Dim > &r, unsigned d) const
NDRegion< T, Dim > intersect(const NDRegion< T, Dim > &nr) const
Message & putMessage(Message &m)
NDRegion(const PRegion< T > &r1, const PRegion< T > &r2)
const PRegion< T > & operator[](unsigned d) const
bool split(NDRegion< T, Dim > &l, NDRegion< T, Dim > &r) const
NDRegion(const PRegion< T > &r1, const PRegion< T > &r2, const PRegion< T > &r3, const PRegion< T > &r4, const PRegion< T > &r5, const PRegion< T > &r6)
NDRegion< T, Dim > & operator-=(const T t)
static bool test(const NDRegion< T, Dim > &a, const NDRegion< T, Dim > &b)
static bool test(const NDRegion< T, Dim > &a, const NDRegion< T, Dim > &b)
static bool test(NDRegion< T, Dim > &l, NDRegion< T, Dim > &r, const NDRegion< T, Dim > &a)