FreePOOMA
2.4.1
|
SliceDomain is a base class for all sliced domain objects. More...
#include "Domain/DomainBase.h"
#include "Domain/DomainTraits.h"
#include "Utilities/NoInit.h"
#include "Utilities/PAssert.h"
#include <iosfwd>
Classes | |
class | SliceDomain< DT > |
SliceDomainprovides the bulk of the public interface for all sliced domain objects. More... | |
Defines | |
#define | POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION, OP, RETTYPE, LHSTYPE) |
#define | POOMA_SLICEDOMAIN_ARITH(OPFUNCTION, OP, RETTYPE) |
Functions | |
template<class DT > | |
std::ostream & | operator<< (std::ostream &o, const SliceDomain< DT > &dbase) |
print a SliceDomain to a stream, in the format "[" first:last:stride, first:last:stride, ... |
SliceDomain is a base class for all sliced domain objects.
A sliced domain stores two pieces of information:
SliceDomain stores both domains, and provides accessors to get references to them. It does not have the full interface as regular domains, you must get a reference to the relevant domain (total or slice) and then use that as normal. Unlike the regular Domain class, SliceDomain does not have or need any 1D specializations, or any base class. SliceDomain is templated on the DomainTraits<> class providing the traits for the SliceDomain derived class. It does not have a Dim template parameter as Domain does.
#define POOMA_SLICEDOMAIN_ARITH_SINGLE | ( | OPFUNCTION, | |
OP, | |||
RETTYPE, | |||
LHSTYPE | |||
) |
template <class T> \ inline typename T::RETTYPE \ OPFUNCTION(const SliceDomain<T> &d1, LHSTYPE d2) { \ typename T::RETTYPE ret(d1.unwrap()); \ ret.totalDomain() OP##= d2; \ ret.setSliceFromTotal(); \ return ret; \ } \ template <class T> \ inline typename T::RETTYPE \ OPFUNCTION(LHSTYPE d1, const SliceDomain<T> &d2) { \ typename T::RETTYPE ret(d2.unwrap()); \ ret.totalDomain() = d2 OP ret.totalDomain(); \ ret.setSliceFromTotal(); \ return ret; \ }
#define POOMA_SLICEDOMAIN_ARITH | ( | OPFUNCTION, | |
OP, | |||
RETTYPE | |||
) |
template <class T1, class T2> \ inline typename T1::RETTYPE \ OPFUNCTION(const SliceDomain<T1> &d1, const DomainBase<T2> &d2) { \ typename T1::RETTYPE ret(d1.unwrap()); \ ret.totalDomain() OP##= d2.unwrap(); \ ret.setSliceFromTotal(); \ return ret; \ } \ template <class T1, class T2> \ inline typename T1::RETTYPE \ OPFUNCTION(const SliceDomain<T1> &d1, const SliceDomain<T2> &d2) { \ typename T1::RETTYPE ret(d1.unwrap()); \ ret.totalDomain() OP##= d2.unwrap().totalDomain(); \ ret.setSliceFromTotal(); \ return ret; \ } \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, char) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, unsigned char) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, short) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, unsigned short) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, int) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, unsigned int) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, long) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, unsigned long) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, float) \ POOMA_SLICEDOMAIN_ARITH_SINGLE(OPFUNCTION,OP, RETTYPE, double)
std::ostream& operator<< | ( | std::ostream & | o, |
const SliceDomain< DT > & | dbase | ||
) |
print a SliceDomain to a stream, in the format "[" first:last:stride, first:last:stride, ...
first:last:stride "]" "==>" (same for slice dimensions)