From: Dominique O. <dom...@gm...> - 2009-11-17 18:09:37
|
On Tue, Nov 17, 2009 at 6:42 AM, Fergus Gallagher <fe...@go...>wrote: > > The find/put method is surely the fastest in general. The more > > fundamental question is do you really need the explicit transpose? > > Often, algorithms that need the transpose operate directly on the > > original matrix. If what you need is matrix-vector products of the form > > A.T*x, you can always use the matvec_transp() method. If you're using > > the higher-level PysparseMatrix objects, you can do A*x and x*A. The > > latter actually computes A.T*x. > > > > I hope this helps. > > > > Hi, > > thanks for all the replies. > > What we want to do is generate the "outer product" A*B^T (actually A*A^T > in our case). > If you really need A*A^T explicitly, I suggest building A^T and then using dot(). Often you don't need this matrix explicitly though (e.g., it is easy to build matrix-vector products with A*A^T without assembling this matrix). Similarly, if you need to factorize it to solve A*A^T x = b, you can solve the equivalent system [ I A^T ] [x] [ 0] [ A 0 ] [y] = [-b] This last system is also much sparser, and it is symmetric. It is indefinite though. -- Dominique |