email@example.com (Loren Shure) wrote in message news:<MPG.firstname.lastname@example.org>...
> In article <email@example.com>,
> firstname.lastname@example.org says...
> > While browsing the web I came upon this little beauty:
> > >> A' * x;
> > may instead be written as
> > >> (x' * A)';
> > which avoids computing A' and so saves time & memory! Bargain.
> > Reference: http://www.imm.dtu.dk/~mj/show.php?content=matlab.php
> Are you using R13 or above? If you put code in an M-file and have the results
> of A'*b or the other returned in a variable (e.g., c = A'*b), then we have some
> magic inside MATLAB to transform the code into another, more efficient pattern
> that doesn't require the literal transpose, but instead calls the BLAS with an
> appropriate flag. When we time it here, under the conditions I mention,
> y = A'*b
> takes the same amount of time as
> y = (b'*A)'
> Soooooo, we encourage you to not change to less obvious code in R13 and above.
Thanks Loren! (I've also replied by email from a different account). I
forgot to say that I only tested it on sparse matrices, where there
does seem to be a benefit. On full matrices, there is no benefit as