|
From: | Umut Tabak |
Subject: | Re: [Getfem-users] submatrix addressing and assignment of this to a csr matrix |
Date: | Wed, 04 May 2011 11:59:21 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 |
On 05/04/2011 11:42 AM, Andriy Andreykiv wrote:
Hi Umut, Regarding the assignment, probably the easiest way is: if A and B are your matrices and you want to place a part of A into a part of B (or the whole A into part of B, or any combinations) do: gmm::copy( gmm::sub_matrix(A, gmm::sub_interval(startAX, sizeAX), gmm::sub_interval(startAY, sizeAY)), gmm::sub_matrix(B, gmm::sub_interval(startBX, sizeBX), gmm::sub_interval(startBY, sizeBY)) ) of course the sizes should match: sizeAXY=sizeBXY etc. .
Hi Andriy,I could not really understand the internals of the library but there is a general rule-of-thumb, I suppose. If you are doing a write related operation than that should be done with copy and if you would like to do some kind of matrix-vector multiplication then you should use csr or csc formats where you should copy your gmm::row_matrix< gmm::wsvector<double> > K for instance into a csr matrix. Am I right on this?
As an experienced user, could you please comment on this? Thanks for the above tip, by the way. Umut
[Prev in Thread] | Current Thread | [Next in Thread] |