Blitz logo

Blitz Support :

From: Martin Davis (martindavis_at_[hidden])
Date: 2004-06-03 03:05:05


Hi,

Sorry for the interruption.

I've been trying to work out why the below code will not compile.
(note: The test suite builds and works okay).
Perhaps I am missing something?
Any assistance for fixing this would be greatly appreciated.

On a different note, usually I avoid "using" a namespace (I would prefer to use "blitz::").
However, I suspect that the following define:
array/stencils.h: #define BZ_END_STENCIL_WITH_SHAPE(MINS,MAXS) }
would not work without the line "BZ_USING_NAMESPACE(blitz)". (As TinyVector is not qualified with blitz::).

Thanks,

Martin

>> cat UnitMain.cpp
//-(This is line 1)---------------------------------------------------------------
#include <blitz/array.h>
#include <blitz/array/stencil-et.h>
#include <iostream>
                                                                                                                             
BZ_USING_NAMESPACE(blitz)
                                                                                                                             
BZ_DECLARE_STENCIL2(update_e_3D_stencil,E,H)
        E = curl(H);
BZ_END_STENCIL_WITH_SHAPE(blitz::shape(-1,-1,-1),blitz::shape(+1,+1,+1))
                                                                                                                             
int main(int argc, char * argv[], char * env[])
{
        Array<TinyVector<double,3>, 3> H(25,25,25);
        Array<TinyVector<double,3>, 3> E(25,25,25);
                                                                                                                             
        H = 0;
                                                                                                                             
        applyStencil(update_e_3D_stencil(), E, H);
                                                                                                                             
        std::cout << H;
                                                                                                                             
        return(0);
}

>> make
gcc -O2 -Wall -c UnitMain.cpp
In file included from /usr/include/blitz/array/stencils.cc:9:
/usr/include/blitz/array/stencilops.h: In function `T::T_numtype
   blitz::curl(T&) [with T = blitz::FastArrayIterator<blitz::TinyVector<double,
   3>, 3>]':

/usr/include/blitz/array/fastiter.h:241: instantiated from `void blitz::FastArrayIterator<T_numtype, N_rank>::operator=(P_numtype) [with P_numtype = blitz::TinyVector<double, 3>, int N_rank = 3]'

/usr/include/blitz/array/stencils.cc:9: instantiated from `static void update_e_3D_stencil::apply(T1&, T2&, T3, T4, T5, T6, T7, T8, T9, T10, T11) [with T1 = blitz::FastArrayIterator<blitz::TinyVector<double, 3>, 3>, T2 = blitz::FastArrayIterator<blitz::TinyVector<double, 3>, 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:281: 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 = update_e_3D_stencil, T_numtype1 = blitz::TinyVector<double, 3>, T_array2 = blitz::Array<blitz::TinyVector<double, 3>, 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:508: instantiated from `void blitz::applyStencil(const T_stencil&, blitz::Array<T_numtype1, N_rank>&, T_array2&) [with T_stencil = update_e_3D_stencil, T_numtype1 = blitz::TinyVector<double, 3>, int N_rank = 3,
T_array2 = blitz::Array<blitz::TinyVector<double, 3>, 3>]'
UnitMain.cpp:19: instantiated from here

/usr/include/blitz/array/stencilops.h:821: invalid use of member `
   blitz::FastArrayIterator<blitz::TinyVector<double, 3>, 3>::T_numtype'

make: *** [UnitMain.o] Error 1

>> gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.

_____________________________________________________________
Free, simple, fast, memorable email
Become you_at_[hidden] at http://www.emailaccount.com/