[RFH] ExpressionEngine _not_ zero-based?

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Mon Aug 23 21:15:06 UTC 2004


Despite it says so

template<int Dim, class T, class Expr>
class Engine<Dim, T, ExpressionTag<Expr> >
{
public:
...
   /// Expression-engines are zero-based.

   enum { zeroBased = true };

it is _not_ zero-based - at least not in all cases.  Example:

   Array<1, int> a(8, GuardLayers<1>(1)), b(8, GuardLayers<1>(1));
   std::cout << (a+b).domain() << std::endl;

prints [-1:8:1] while it should have printed [0:9:1]!

or not?  The same wrapped into a dummy stencil with zero extent

   std::cout << Stencil<Dummy>()(a+b).domain() << std::endl;

yields the expected.  StencilEngines seem to be really zero-based
(well, yes - they do it the strange way - not taking a view of the 
expression, but keeping an offset).

While I suspect StencilEngine and ExpressionEngine need to be very 
similar in principle I don't know how to best fix this deficiency.

Any ideas?

Richard.



More information about the pooma-dev mailing list