Blitz logo

Blitz Support :

From: Todd Veldhuizen (tveldhui_at_[hidden])
Date: 2003-09-03 10:09:54


You want this notation:

Array<double,1> xi_6(6) = 0.816847572980459, 0.091576213509771,
             0.091576213509771, 0.108103018168070, 0.445948490915965,
             0.445948490915965;

When you write Array<T,N> xi_6(n1,n2,...), the n1, n2 parameters
are interpreted as dimension sizes.

Cheers,
Todd

-- 
Todd Veldhuizen  /  tveldhui_at_[hidden]  /  Indiana University Computer Science
On Wed, 3 Sep 2003, van den Bosch wrote:
> Hi,
>
> I'm declaring Array constants in a file named "GK_triangle. h" as follows:
>
> /////////////////////////////////////////////// GK_triangle.h ///////
> const Array<double,1> xi_6 (0.816847572980459, 0.091576213509771,
> 0.091576213509771, 0.108103018168070, 0.445948490915965, 0.445948490915965);
> const Array<double,1> eta_6 (0.091576213509771, 0.816847572980459,
> 0.091576213509771, 0.445948490915965, 0.108103018168070, 0.445948490915965);
> const Array<double,1> weigths_6 (0.109951743655322, 0.109951743655322,
> 0.109951743655322, 0.223381589678011, 0.223381589678011, 0.223381589678011);
> const double sum_weigths_6 = sum(weigths_6);
>
> const Array<double,1> xi_9 (0.124949503233232, 0.437525248383384,
> 0.437525248383384, 0.797112651860071, 0.797112651860071, 0.165409927389841,
> 0.165409927389841, 0.037477420750088, 0.037477420750088);
> const Array<double,1> eta_9 (0.437525248383384, 0.124949503233232,
> 0.437525248383384, 0.165409927389841, 0.037477420750088, 0.797112651860071,
> 0.037477420750088, 0.797112651860071, 0.165409927389841);
> const Array<double,1> weigths_9 (0.205950504760887, 0.205950504760887,
> 0.205950504760887, 0.063691414286223, 0.063691414286223, 0.063691414286223,
> 0.063691414286223, 0.063691414286223, 0.063691414286223);
> const double sum_weigths_9 = sum(weigths_9);
>
> and using it in another file called "triangle_int.cpp" as follows
> ///////////////////////////////// triangle_int.cpp ////////////
> #include <iostream>
> #include <complex>
> #include <blitz/array.h>
> #include <blitz/tinyvec-et.h>
>
> using namespace blitz;
>
> const complex<double> I (0.0, 1.0);
> const double mu_0 = 4*M_PI*1e-7;
> const double eps_0 = 8.85418782e-12;
> const double c = 2.99792458e8;
>
> #include "KA_grid.h"
> #include "interp_KA_mm.h"
> #include "GK_triangle.h"
>
> complex<double> triangle_int (etc.)
>
> But when I compile, the error message is:
>
> [denbosch_at_lorentz devel]$ make Zmain_mn
> g++ -c -O3 -I../../blitz++/include triangle_int.cpp
> GK_triangle.h: In function `void
> __static_initialization_and_destruction_0(int,
>    int)':
> GK_triangle.h:1: warning: passing `double' for argument 1 of `blitz::Array<T,
>    N>::Array(int, int, int, int, int, int, blitz::GeneralArrayStorage<N_rank>)
>    [with P_numtype = double, int N_rank = 1]'
> GK_triangle.h:1: warning: passing `double' for argument 2 of `blitz::Array<T,
>    N>::Array(int, int, int, int, int, int, blitz::GeneralArrayStorage<N_rank>)
>    [with P_numtype = double, int N_rank = 1]'
> GK_triangle.h:1: warning: passing `double' for argument 3 of `blitz::Array<T,
>    N>::Array(int, int, int, int, int, int, blitz::GeneralArrayStorage<N_rank>)
>    [with P_numtype = double, int N_rank = 1]'
> GK_triangle.h:1: warning: passing `double' for argument 4 of `blitz::Array<T,
>    N>::Array(int, int, int, int, int, int, blitz::GeneralArrayStorage<N_rank>)
>    [with P_numtype = double, int N_rank = 1]'
> ...
>
> As one can see, there is one error message per Array argument, saying that it
> is a "double" when it should be an "int". But in the declaration, all arrays
> are declared Array<double>. Anyone understands what's going on? Thanks,
>
> Ides
>
> --
> Ir Idesbald van den Bosch
> PhD Student
> 3, Place du Levant - Bātiment Maxwell
> 1348		Louvain-la-Neuve
> tel.: +32 (0)10 47 81 06
> fax : +32 (0)10 47 87 05
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>