Hello,

I'm trying to use the stencil object from Blitz++ User Guide

#include <blitz/array.h>
using namespace blitz;

BZ_DECLARE_STENCIL4(test,P1,P2,P3,c)
    P3 = 2 * P2 + c * Laplacian3D(P2) - P1;
BZ_END_STENCIL

applyStencil(test(), P1, P2, P3, c);
but after compilation I have this error

test_blitz.cpp: In static member function static void test::apply(T1&, T2&, T3&, T4&, T5, T6, T7, T8, T9, T10, T11) [with T1 = blitz::FastArrayIterator<long double, 3>, T2 = blitz::FastArrayIterator<long double, 3>, T3 = blitz::FastArrayIterator<long double, 3>, T4 = blitz::FastArrayIterator<long double, 3>, T5 = blitz::dummy<double>, T6 = blitz::dummy<double>, T7 = blitz::dummy<double>, T8 = blitz::dummy<double>, T9 = blitz::dummy<double>, T10 = blitz::dummy<double>, T11 = blitz::dummy<double>]’:
/usr/include/blitz/array/stencils.cc:288:13:   instantiated from void blitz::applyStencil_imp(const T_stencil&, blitz::Array<T_numtype1, 3>&, T_array2&, T_array3&, T_array4&, T_array5&, T_array6&, T_array7&, T_array8&, T_array9&, T_array10&, T_array11&) [with T_stencil = test, T_numtype1 = long double, T_array2 = blitz::Array<long double, 3>, T_array3 = blitz::Array<long double, 3>, T_array4 = blitz::Array<long double, 3>, T_array5 = blitz::dummyArray, T_array6 = blitz::dummyArray, T_array7 = blitz::dummyArray, T_array8 = blitz::dummyArray, T_array9 = blitz::dummyArray, T_array10 = blitz::dummyArray, T_array11 = blitz::dummyArray]’
/usr/include/blitz/array/stencils.cc:535:5:   instantiated from void blitz::applyStencil(const T_stencil&, blitz::Array<T_numtype1, N_rank>&, T_array2&, T_array3&, T_array4&) [with T_stencil = test, T_numtype1 = long double, int N_rank = 3, T_array2 = blitz::Array<long double, 3>, T_array3 = blitz::Array<long double, 3>, T_array4 = blitz::Array<long double, 3>]’
test_blitz.cpp:35:36:   instantiated from here
test_blitz.cpp:9:5: error: Laplacian3D was not declared in this scope
It looks like I'm missed the header blitz/array/stencil-et.h (which is in example stencil2.cpp), but there is another error.

test_blitz.cpp: In static member function static void test::apply(T1&, T2&, T3, T4, T5, T6, T7, T8, T9, T10, T11) [with T1 = blitz::FastArrayIterator<long double, 3>, T2 = blitz::FastArrayIterator<long double, 3>, T3 = blitz::dummy<double>, T4 = blitz::dummy<double>, T5 = blitz::dummy<double>, T6 = blitz::dummy<double>, T7 = blitz::dummy<double>, T8 = blitz::dummy<double>, T9 = blitz::dummy<double>, T10 = blitz::dummy<double>, T11 = blitz::dummy<double>]’:
/usr/include/blitz/array/stencils.cc:288:13:   instantiated from void blitz::applyStencil_imp(const T_stencil&, blitz::Array<T_numtype1, 3>&, T_array2&, T_array3&, T_array4&, T_array5&, T_array6&, T_array7&, T_array8&, T_array9&, T_array10&, T_array11&) [with T_stencil = test, T_numtype1 = long double, T_array2 = blitz::Array<long double, 3>, T_array3 = blitz::dummyArray, T_array4 = blitz::dummyArray, T_array5 = blitz::dummyArray, T_array6 = blitz::dummyArray, T_array7 = blitz::dummyArray, T_array8 = blitz::dummyArray, T_array9 = blitz::dummyArray, T_array10 = blitz::dummyArray, T_array11 = blitz::dummyArray]’
/usr/include/blitz/array/stencils.cc:515:5:   instantiated from void blitz::applyStencil(const T_stencil&, blitz::Array<T_numtype1, N_rank>&, T_array2&) [with T_stencil = test, T_numtype1 = long double, int N_rank = 3, T_array2 = blitz::Array<long double, 3>]’
test_blitz.cpp:38:30:   instantiated from here
test_blitz.cpp:12:5: error: no matching function for call to Laplacian3D(blitz::FastArrayIterator<long double, 3>&)’
test_blitz.cpp:12:5: note: candidates are:
Other array operations (multiplication, where and etc.) are working. Can anybody explain what am I doing wrong?