Blitz logo

Blitz Support :

From: Julian Cummings (cummings_at_[hidden])
Date: 2005-04-25 13:08:17


Hi Chris,

You had a subscripting error in your code. That is what lead to the core
dump. If you compile your code with -DBZ_DEBUG, it will turn on run-time
subscript checking, and then you will see the assertion failure indicating
the bug in your code. You have been coding in Fortran 77 a little too long!
;-)

Regards, Julian C.

Dr. Julian C. Cummings
Staff Scientist, CACR/Caltech
(626) 395-2543
cummings_at_[hidden]
 

> #include <blitz/array.h>
>
> using namespace blitz;
>
> typedef TinyVector<double, 2> vector2d;
> typedef Array<vector2d, 2> vectorField;
> typedef Array<double, 2> scalarField;
>
> int main()
> {
> firstIndex i;
> secondIndex j;
>
> vectorField v,v2;
>
> allocateArrays(shape(8,8), v, v2);
>
> v = 1;
> v2 = 0;
>
> v[1] = i;
> v[2] = j; <----- Array component subscripting begins with zero!!
>
> cout << v << endl;
>
> }