Blitz logo

Blitz Support :

From: Julian Cummings (cummings_at_[hidden])
Date: 2004-12-22 13:44:36


Hi,

This is correct. The result Array C must be properly allocated before
you can assign a result to it. I believe that the first example would
give an error if you compile in debug mode with -DBZ_DEBUG. Shape
checking is done during assignment only in debug mode.

Regards, Julian C.

Faheem Mitha wrote:

>
> Ok. I think that
>
> 2.4.6: A note about assignment
>
> explains why this is not working. Namely,
>
> **************************************************************************
>
> Very important: whenever you have an assignment operator (=, +=, -=,
> etc.) the lhs must have the same shape as the rhs. If you want the
> array on the left hand side to be resized to the proper shape, you
> must do so by calling the resize method, for example:
>
> A.resize(B.shape()); // Make A the same size as B
> A = B;
> ****************************************************************************
>
>
> I am not sure why the first example does not give an error as well,
> though.
>
> Faheem.
>

-- 
Dr. Julian C. Cummings                       E-mail: cummings_at_[hidden]
California Institute of Technology           Phone:  626-395-2543
1200 E. California Blvd., Mail Code 158-79   Fax:    626-584-5917
Pasadena, CA 91125                           Office: 125 Powell-Booth