Blitz logo

Blitz Bugs :

From: Derrick Bass (derrick_at_[hidden])
Date: 2003-01-23 16:19:08


I just submitted a bug report on the sourceforge repository, but I just
discovered that the bug is more serious than I thought. So here's
another bug report, submitted to another place...

It appears that an array with a reverse'd dimension does not work
properly in many contexts. Try the attached code.

Derrick Bass

#include <blitz/array.h>
#include <iostream>

using namespace std;
using namespace blitz;

int main() {
   Array<double, 1> x(10);
   x = 0,1,2,3,4,5,6,7,8,9;

   Array<double, 1> y(x.reverse(firstDim));
   Array<double, 1> z(y.copy());

   cout << x << endl;
   cout << y << endl; // okay
   cout << z << endl; // not okay

   Array<double, 1> sx(sin(x));
   Array<double, 1> sy(sin(y));

   cout << sx << endl;
   cout << sy << endl; // not okay
}