Blitz logo

Blitz Support :

From: Andrius Kurtinaitis (andrius.kurtinaitis_at_[hidden])
Date: 2003-12-11 04:29:13


Hello, Julian,

> You might consider using a preprocessor macro to represent your very
> long expression, if you are just worried about cut-and-paste coding
> errors. Unfortunately, there is no nice way to capture a subexpression
> as a handy object in blitz. This was a feature we added in Pooma by
> allowing an expression to be represented as an Array containing an
> "expression engine" that could evaluate the expression as needed to
> return array element values. It was a slick idea, but there is a
> significant cost in terms of internal code complexity and added pain and
> torture for the C++ compiler.

Thank you. I just wanted to know if there is some kind of expression
objects.

> blitz::Array<double,1> Aeven = A(even);
> blitz::Array<double,1> Aodd = A(odd);
>
> Aeven = central12(Aeven);
> Aodd = central12(Aodd);

I did not know that you can directly use difference operators on the
arrays (not only in stencil declarations). And in fact - i tried to
compile this example and i failed. Or was this just a pseudocode?

The example program and error log are attached.
I tried to compile under unstable debian, blitz++ v.0.7,
gcc version 3.3.3 20031206 (prerelease) (Debian)

Furthermore, I think that Aeven = central12(Aeven) is not the same as
A(even) = 0.5 * (A(even+1) - A(even-1)), because Aeven already has only
even points and so has no chance to access odd points which are in
A(even+1) and A(even-1). Probably you even did not mean that :-)

Andrius

cd /home/andrius/download/ternary/
g++ -o testTernary testTernary.cpp /usr/lib/libblitz.a
/usr/include/blitz/array/stencilops.h: In function `typename T::T_numtype
   blitz::central12(T&, int) [with T = blitz::Array<double, 1>]':
testTernary.cpp:17: instantiated from here
/usr/include/blitz/array/stencilops.h:125: error: `shift' undeclared (first use
   this function)
/usr/include/blitz/array/stencilops.h:125: error: (Each undeclared identifier
   is reported only once for each function it appears in.)

Compilation exited abnormally with code 1 at Thu Dec 11 10:04:16