Blitz logo

Blitz Support :

From: Simon Perreault (nomis80_at_[hidden])
Date: 2004-08-20 14:08:35


Hi,

I am having issues with the dataFirst() array method. Take a look at this test
code:

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

using namespace blitz;
using namespace std;

int main( int argc, char* argv[] )
{
    Array<int,1> a(7);
    a = 0, 1, 2, 3, 4, 5, 6;
    Array<int,1> b;
    b.reference( a( Range( 6, 0, -2 ) ) );
    cout << b << endl;
    cout << b.stride(0) << endl;
    cout << *b.data() << endl;
    cout << *b.dataFirst() << endl;
}
-----------

The output of this program is:

-----------
4
 [ 6 4 2 0 ]
-2
6
6
-----------

Shouldn't the element pointed by dataFirst() be 0 since it comes in memory
before 6?

Thanks

-- 
Simon Perreault <nomis80_at_[hidden]> -- http://nomis80.org