|
Ublas : |
From: Sorkin Dima (dsorkin_at_[hidden])
Date: 2006-10-11 14:20:01
On Sun, 8 Oct 2006, James N. Knight wrote:
> I'm trying to implement a concatenation feature as an extension to
> ublas. I think this will be generally useful so I wanted to try and get
> some input.
I will try to reply, since I see that you talk about concatenation
since a long time ago.
> ??? concat (...)
That's exactly the question - what is the type of the matrix 'concat'
is returning. Maybe "concat(A,B,direction,C)" ? - this is not
expression template ( = ET) based.
(I like it more then the ET based, because it is more definite.
But user's code will be more ugly, on the other hand)
> Anyway, what I'm really thinking is that a better way to do this would
> be to create a concat matrix expression that I can lazily evaluate when
> needed. The expression would need to join the iterators of the two
>
> Does this seem feasible?
I don't know ... :) . But it seems to be integrated better into uBLAS
methodology (ETs)
> Is there any interest in something like this?
Actually once I thought that I am in a big need to have
concat operation in my code (I work mainly on FEM and BEM codes).
But then I saw that people use block matrices instead of concatination
(see for example
http://www.dealii.org/developer/doxygen/deal.II/classBlockMatrixBase.html
)
and that's work fine.
Anyway, it would be nice to see what gain can be obtained from use
of (effectively implemented) concatenation.
Additionally I see another problem: If you have a concatination
ET (a sparse one), how do you effectively construct a sparse matrix
from that expression ? What kind of sparsity pattern does the
concatinated ET have (CSR or CSC or "sorted list of triples"),
given that it's arguments differ in their sparsity patterns.
Regards, hope this helps,
Dima.