![]() |
Blitz Bugs : |
From: Todd Veldhuizen (tveldhui_at_[hidden])
Date: 2002-10-03 12:16:08
Hi Sebastian, not a bug.
In your example, consider B(0,0,1). This has i=0, j=0, k=1.
So the assignment "B=A(k,i,j)" sets "B(0,0,1)=A(1,0,0)".
But A has no element (1,0,0) because the valid index ranges
for A are ([0..0],[0..1],[0..2]).
If you compile with -DBZ_DEBUG (usually a good way of finding
these errors), you'll get:
Array index out of range: (1, 0, 0)
Lower bounds: 3 [ 0 0 0 ]
Length: 3 [ 1 2 3 ]
Unexpected assert failure!
/home/tveldhui/blitz/blitz/array-impl.h:1392
Sebastian-Dransfeld-1: /home/tveldhui/blitz/blitz/bzdebug.h:116: void blitz::checkAssert (bool, const char *, int): Assertion `0' failed.
Hope that helps
Todd
Sebastian Dransfeld wrote:
>
> Using this code:
>
> #include <blitz/array.h>
> #include <iostream>
> using namespace std;
> using namespace blitz;
> using namespace blitz::tensor;
> int
> main()
> {
> Array<int, 3 > A(1, 2, 3);
> A = 1, 2, 3, 4, 5, 6;
> cout << A << endl;
>
> Array<int, 3 > B(3, 1, 2);
> B = A(k, i, j);
> cout << B << endl;
> return 0;
> }
>
> result:
> 1 x 2 x 3
> [ 1 2 3 4 5 6 ]
>
> 3 x 1 x 2
> [ 1 0 4 134544544 0 6 ]
>
> This seems to happen if _all_ rank's switch places. Is there a reason why
> this doesn't work? Using B = A.transpose() works for all permutations of
> the ranks.
>
> From config.h:
> #define BZ_COMPILER_NAME "g++"
> #define BZ_COMPILER_OPTIONS "-ftemplate-depth-30"
> #define BZ_OS_NAME "Linux 2.4.18-21mdk"
> #define BZ_BZCONFIG_DATE "Wed Jul 17 09:37:15 CEST 2002"
> #define BZ_PLATFORM "i686-pc-linux-gnu"
>
> gcc (GCC) 3.1.1 (Mandrake Linux 8.3 3.1.1-0.7mdk)
> libstdc++.so.4.0.1
>
> Sebastian
>
> _______________________________________________
> Blitz-bugs mailing list
> Blitz-bugs_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-bugs
>
-- Todd Veldhuizen / tveldhui_at_[hidden] / Indiana University Computer Science _______________________________________________ Blitz-bugs mailing list Blitz-bugs_at_[hidden] http://www.oonumerics.org/mailman/listinfo.cgi/blitz-bugs