Re: A question about efficiency
Andrew Lumsdaine <[email protected]> Fri, 23 Jul 2004 04:47:51 -0500
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi -- I think this type of operation only makes sense for triangular matrices. I.e., if you think about matrix-vector multiplication: y_i = sum_j A_ij * x_j you need all of the values of x to compute each of the values of y. If you change any of the values of x during the computation, you won't get the right answer for y -- that is, if you try to update y in-place ala an operation like y = A*y. The only exception is if A is triangular -- then as the operation proceeds you no longer need values x_j for j < i (or j > i depending on whether you have an upper or lower triangular matrix). Best Regards, Andrew Lumsdaine On Jul 23, 2004, at 2:06 AM, Tim wrote: > Hey guys, > A simple question here. > > How do I apply a matrix transformation 'A' to a vector 'x', without > storing the result into another vector? > > The only way I can think of doing it now is to do: > "mult(A,x,y); > copy(y,x)" > > I ask this because I want to be able to transform all the elements in > a container of vectors, without getting bogged down by unnecassary > calls to copy. > > Thanks in advance, > Timothy Ling > _______________________________________________ > This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/ _______________________________________________ This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/