Blitz logo

Blitz Support :

From: Shunji Satoh (shun_at_[hidden])
Date: 2003-11-20 01:42:41


Dear all,

I am now engaged in image processing using Blitz++
and wrote a simple code:

----
#include <blitz/tinyvec.h>
#include <blitz/array.h>
using namespace std;
using namespace blitz;
int main()
{
  // a gray-scale 64x64 image	
  Array<float,2> image(64,64); 
  // a vector image initialzed by the 64x64 image.
  TinyVector< Array<float,2> ,2 > vectorImage(image, image);
  cout << vector[0].size() << endl; // it would be equal to 64*64 = 4096
  cout << vector[1].size() << endl; // it would be equal to 64*64 = 4096
}
----
I hope the code outputs "4096" and "4096",
but the actual outputs were "0" and "0".
As shown in the section 5.1.1 of the manual, another representation of a vector image
   Array<TinyVector<float,3>,2> vectorImage(64,64);
works well.
What is wrong of my code?
# the version of g++ is 3.0.4,
# OS is Debian GNU/Linux
Shunji Satoh