Hi Yixin,

On your first question, previous I have the same concern as yours until trying to read the source code. My understanding is the assignment operator is no longer the conventional operator. In order to optimize the expression like a=b+c+d, the blitz library uses the trick called expression template which expand the expression into something like:
for (iter=begin();iter!=end();iter++)

On Thu, Apr 19, 2012 at 5:34 AM, 刘一新 <liuyxpp@gmail.com> wrote:
Hi, guys

I am ultilizing blitz++ as my internal data structure in a C++ application polyorder. Blitz++ is great, I really love using it. However, I also encounter some inconvenient cases.

1. the assignment operator of blitz::Array
Say, I have a class A which has a member _data. The synthesized copy constructor works fine. But the synthesized assignment operator will fail, since the assignment operator does not work as expected. The following code

blitz::Array<double,3> A(3,3,3);
A = 1.0;
blitz::Array<double,3> B(A); // this is fine
blitz::Array<double,3> C;
C = A; // Bang! This fails. C is empty!

In any rate, the last line should assign C with A whatever the size C is. If C's shape is different than A, then blitz should reshape C internally and then adopt the data from A.

2. blitz::product should work for blitz::TinyVector * blitz::TinyMatrix
Currently, only

blitz::product(blitz::TinyMatrix, blitz::TinyVector) 

is implemented. However, it is equally common to compute the product

blitz::product(blitz::TinyVector, blitz::TinyMatrix)

Now blitz::TinyVector should be considered as a row vector rather than a column vector. 


Yi-Xin Liu, PHD
Department of Macromolecular Science
Fudan University
Room 415, Yuejing Building 
Handan Rd. 220, Shanghai, China

For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
Blitz-devel mailing list